/* OB・選手・父母の声ページ専用
 * 通常の指定 → 条件別の調整の順序を保っています。
 * タブ切り替え・ページ送り（10件ごと）・詳細ポップアップは
 * js/main.js の「11. 声ページ」で制御しています。
 */

.voices-section {
  --voices-gold: #d6bd8f;
  --voices-paper: #f6f3ee;
  padding-block: clamp(40px, 5vw, 72px) clamp(56px, 6vw, 88px);
  background: var(--voices-paper);
}

.voices-container {
  max-width: 1120px;
}

/* 導入 */

.voices-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  margin-bottom: clamp(36px, 4.4vw, 56px);
}

.voices-intro-label {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding-right: clamp(24px, 4vw, 64px);
  border-right: 1px solid #d9cfc4;
  color: var(--ink);
  font: italic 900 clamp(34px, 4.6vw, 62px)/0.95 Georgia,
    serif;
  letter-spacing: -0.01em;
}

.voices-intro-label span:first-child {
  color: var(--red);
  font-size: 0.5em;
  letter-spacing: 0.14em;
}

.voices-intro-title {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(21px, 2.4vw, 30px);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.voices-intro-title span {
  display: inline-block;
}

.voices-intro-text {
  max-width: 680px;
  margin: 0;
  color: #443d36;
  font-size: 15px;
  font-weight: 600;
  line-height: 2;
}

/* タブ（下線で切り替えを示すシンプルなタブ。ボックス型にしない） */

.voices-tabs {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 3vw, 48px);
  margin-bottom: clamp(18px, 2vw, 26px);
  border-bottom: 1px solid #d9cfc4;
}

.voices-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: clamp(96px, 14vw, 180px);
  margin-bottom: -1px;
  padding: 10px 8px 18px;
  border: 0;
  background: none;
  color: #8f8780;
  font: inherit;
  cursor: pointer;
  transition: color 0.3s;
}

.voices-tab small {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
  transition: color 0.3s;
}

.voices-tab strong {
  font-size: clamp(16px, 1.7vw, 21px);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.voices-tab:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.voices-tab:hover {
  color: var(--ink);
}

.voices-tab:hover:after {
  transform: scaleX(0.3);
}

.voices-tab[aria-selected="true"] {
  color: var(--ink);
}

.voices-tab[aria-selected="true"] small {
  color: var(--red);
}

.voices-tab[aria-selected="true"]:after {
  transform: scaleX(1);
}

.voices-tab:focus-visible {
  outline: 3px solid var(--voices-gold);
  outline-offset: 2px;
}

/* パネル */

.voices-panel {
  scroll-margin-top: 120px;
}

.voices-panel:focus-visible {
  outline: 3px solid var(--voices-gold);
  outline-offset: 8px;
}

.voices-panel[hidden] {
  display: none;
}

.voices-panel-lead {
  margin: 0 0 clamp(22px, 2.6vw, 32px);
  color: #6c625a;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/* 声のボックス（2列。クリックで詳細ポップアップ） */

.voices-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 22px);
}

.voice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(24px, 2.8vw, 36px) clamp(22px, 2.6vw, 34px) clamp(20px, 2.4vw, 28px);
  overflow: hidden;
  background: #fff;
  border-top: 3px solid var(--red);
  box-shadow: 0 1px 0 #e4dbd1;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s;
}

.voice-card[hidden] {
  display: none;
}

/* 背景の大きな引用符 */
.voice-card:before {
  content: "“";
  position: absolute;
  right: 14px;
  top: -18px;
  color: #f2ece5;
  font: italic 900 150px/1 Georgia,
    serif;
  pointer-events: none;
  transition: color 0.35s,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.voice-card:is(:hover, .is-hover),
.voice-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 20px 42px rgba(26, 17, 12, 0.1);
}

.voice-card:is(:hover, .is-hover):before,
.voice-card:focus-visible:before {
  color: #f6e4e4;
  transform: translateY(4px);
}

.voice-card:focus-visible {
  outline: 3px solid var(--voices-gold);
  outline-offset: 3px;
}

.voice-card-cat {
  position: relative;
  margin: 0 0 12px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.voice-card-title {
  position: relative;
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(17px, 1.65vw, 20px);
  font-weight: 900;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.voice-card-title:before {
  content: "『";
}

.voice-card-title:after {
  content: "』";
}

/* 氏名（OBの声など、氏名を掲載する場合のみ .voice-card-name を記載） */
.voice-card-name,
.voice-dialog-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  color: #8e0000;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.voice-card-name:before,
.voice-dialog-name:before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.voice-dialog-name[hidden] {
  display: none;
}

/* 本文は冒頭のみ3行で表示（全文はポップアップ） */
.voice-card-body {
  position: relative;
  margin-bottom: 20px;
}

.voice-card-body p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #5b524b;
  font-size: 14px;
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.voice-card-body p + p {
  display: none;
}

.voice-card-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  margin-top: auto;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: color 0.3s,
    border-color 0.3s;
}

.voice-card-more b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  transition: transform 0.35s;
}

.voice-card:is(:hover, .is-hover) .voice-card-more {
  color: var(--red);
  border-color: var(--red);
}

.voice-card:is(:hover, .is-hover) .voice-card-more b {
  transform: rotate(90deg);
}

.voices-panel.is-entering .voice-card {
  animation: voice-card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.voices-panel.is-entering .voice-card:nth-child(2) {
  animation-delay: 0.05s;
}
.voices-panel.is-entering .voice-card:nth-child(3) {
  animation-delay: 0.1s;
}
.voices-panel.is-entering .voice-card:nth-child(4) {
  animation-delay: 0.15s;
}
.voices-panel.is-entering .voice-card:nth-child(n + 5) {
  animation-delay: 0.2s;
}

@keyframes voice-card-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ページ送り（11件以上で表示） */

.voices-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: clamp(28px, 3.4vw, 44px);
}

.voices-pager[hidden] {
  display: none;
}

.voices-pager button {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #d6ccc1;
  background: #fff;
  color: var(--ink);
  font: italic 700 16px/1 Georgia,
    serif;
  cursor: pointer;
  transition: background 0.25s,
    color 0.25s,
    border-color 0.25s;
}

.voices-pager button:hover:not(:disabled) {
  border-color: var(--red);
  color: var(--red);
}

.voices-pager button:focus-visible {
  outline: 3px solid var(--voices-gold);
  outline-offset: 2px;
}

.voices-pager button[aria-current="page"] {
  border-color: #171413;
  background: #171413;
  color: #fff;
}

.voices-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.voices-pager .voices-pager-step {
  font: 800 12px/1 "Helvetica Neue",
    "Noto Sans JP",
    sans-serif;
  letter-spacing: 0.08em;
}

.voices-pager-status {
  width: 100%;
  margin: 6px 0 0;
  color: #6c625a;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* 詳細ポップアップ */

.voice-dialog {
  width: min(760px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overscroll-behavior: contain;
}

.voice-dialog::backdrop {
  background: rgba(14, 10, 9, 0.82);
  backdrop-filter: blur(3px);
}

.voice-dialog[open] {
  animation: voice-dialog-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes voice-dialog-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.voice-dialog-inner {
  position: relative;
  padding: clamp(40px, 5vw, 60px) clamp(22px, 5.6vw, 64px) clamp(28px, 3.6vw, 44px);
  overflow: hidden;
  border-top: 5px solid var(--red);
}

.voice-dialog-quote {
  position: absolute;
  right: clamp(20px, 4vw, 48px);
  top: -14px;
  color: #f2ece5;
  font: italic 900 clamp(150px, 20vw, 230px)/1 Georgia,
    serif;
  pointer-events: none;
}

.voice-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #ddd3c8;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s,
    color 0.25s,
    transform 0.3s,
    border-color 0.25s;
}

.voice-dialog-close:hover,
.voice-dialog-close:focus-visible {
  border-color: #171413;
  background: #171413;
  color: #fff;
  transform: rotate(90deg);
}

.voice-dialog-cat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.voice-dialog-cat:after {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
}

.voice-dialog-title {
  position: relative;
  margin: 0 0 clamp(20px, 2.4vw, 28px);
  padding-bottom: clamp(18px, 2.2vw, 26px);
  border-bottom: 1px solid #ece5dd;
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 900;
  line-height: 1.6;
}

.voice-dialog-title:before {
  content: "『";
}

.voice-dialog-title:after {
  content: "』";
}

.voice-dialog-body {
  position: relative;
  display: grid;
  gap: 1.1em;
}

.voice-dialog-body p {
  margin: 0;
  color: #2f2926;
  font-size: 15px;
  line-height: 2.1;
}

.voice-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(26px, 3vw, 36px);
  padding-top: 18px;
  border-top: 1px solid #ece5dd;
}

.voice-dialog-foot span {
  color: #8f8780;
  font: italic 700 12px/1 Georgia,
    serif;
  letter-spacing: 0.14em;
}

.voice-dialog-back {
  min-width: 140px;
  padding: 12px 20px;
  border: 1px solid #171413;
  background: #171413;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.25s,
    border-color 0.25s;
}

.voice-dialog-back:hover,
.voice-dialog-back:focus-visible {
  border-color: var(--red);
  background: var(--red);
}

body.voice-dialog-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .voices-intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .voices-intro-label {
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
    padding: 0 0 16px;
    border-right: 0;
    border-bottom: 1px solid #d9cfc4;
  }
}

@media (max-width: 650px) {
  .voices-intro-text {
    font-size: 14px;
  }

  .voices-tabs {
    justify-content: space-between;
    gap: 0;
  }

  .voices-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 2px 14px;
  }

  .voices-tab small {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .voices-tab strong {
    font-size: 15px;
  }

  .voices-panel-lead {
    font-size: 13px;
    text-align: left;
  }

  .voices-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .voice-card {
    padding: 22px 18px 20px;
  }

  .voice-card:before {
    font-size: 120px;
  }

  .voice-card-title {
    font-size: 17px;
  }

  .voice-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .voice-dialog-inner {
    padding: 52px 20px 24px;
  }

  .voice-dialog-body p {
    font-size: 14px;
    line-height: 2;
  }

  .voice-dialog-back {
    min-width: 0;
    padding: 11px 16px;
  }

  .voices-pager button {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voices-panel.is-entering .voice-card,
  .voice-dialog[open] {
    animation: none;
  }
  .voice-card,
  .voices-tab:after {
    transition: none;
  }
}

/* 一覧の説明文（JSで本文冒頭65文字を生成）。生成後は本文ブロックを一覧では非表示 */
.voice-card-excerpt {
  position: relative;
  margin: 0 0 20px;
  color: #5b524b;
  font-size: 14px;
  line-height: 1.9;
}

.voice-card.has-excerpt .voice-card-body {
  display: none;
}
