/* ===== トップページ専用スタイル ===== */

.main-content {
  overflow: hidden;
}

/* 共通：英数字の強調表示 */
.hero-num {
  font-family: var(--num-font);
  font-weight: 700;
}

/* 共通：セクション見出し */
.section-heading {
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

/* 共通：注釈テキスト */
.num-section-note {
  margin-top: 32px;
  font-size: 1.2rem;
  color: var(--sub-color);
}


/* ===== セクション装飾（縦線＋テキスト） ===== */
.sections-group {
  position: relative;
}

/* デフォルト非表示 */
.sections-accent {
  display: none;
  pointer-events: none;
}

/* 1201px以上: 縦線エリア表示 + セクションを左に寄せる */
@media (min-width: 1201px) {
  .sections-accent {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 130px;
    border-left: 1px solid #ccc;
    z-index: 1;
  }

  .sections-accent-text {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    left: -2px;
    right: 0;
    font-family: var(--num-font);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: var(--base-color);
    background: #fff;
    padding: 12px 4px 12px 8px;
  }

  .sections-group .num-section,
  .sections-group .message {
    padding-right: 170px;
  }

  /* brand-barのborder-top/bottomを縦線の手前まで限定 */
  .sections-group .brand-bar {
    position: relative;
    border-top: none;
    border-bottom: none;
  }

  .sections-group .brand-bar::before,
  .sections-group .brand-bar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 170px;
    height: 1px;
    background-color: var(--base-color);
  }

  .sections-group .brand-bar::before { top: 0; }
  .sections-group .brand-bar::after  { bottom: 0; }

  /* border-bottomを縦線の手前まで限定（MESSAGEの区切り線も同仕様にする） */
  .sections-group .num-section,
  .sections-group .message {
    position: relative;
    border-bottom: none;
  }

  .sections-group .num-section::after,
  .sections-group .message::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 170px;
    height: 1px;
    background-color: var(--base-color);
  }

  /* MEDIAは最終セクションのため下線（::after）を描かない */
  .sections-group .num-section.media::after {
    content: none;
  }
}

/* ===== Hero ===== */
.hero {
  padding-top: 16px;
  padding-bottom: 40px;
}

.hero-visual {
  width: 100%;
}

.hero-visual img {
  width: 100%;
  height: auto;
}

/* ===== Brand Bar ===== */
.brand-bar {
  padding: 24px 5%;
  border-top: 1px solid var(--base-color);
  border-bottom: 1px solid var(--base-color);
  text-align: center;
}

.brand-bar-text {
  font-family: var(--en-font);
  font-size: clamp(1.8rem, 2.4vw, 2.8rem);
  letter-spacing: 0.05em;
}

/* ===== セクション共通（01〜06） ===== */
.num-section {
  padding: 64px 5%;
  border-bottom: 1px solid var(--base-color);
}

.num-section-grid {
  display: flex;
  gap: 0;
}

.num-section-head {
  flex-shrink: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.num-section-body {
  flex: 1;
  min-width: 0;
}

.num-section-number {
  font-family: var(--num-font);
  font-size: clamp(7rem, 14vw, 13.4rem);
  font-weight: 700;
  line-height: 1;
}

.num-section-en {
  font-family: var(--num-font);
  font-size: clamp(1.7rem, 2.7vw, 2.7rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

/* 「01」と「PROLOGUE」を同じ幅に揃え、罫線はそれより短くする */
.num-section-label {
  width: fit-content;
}

.num-section-divider {
  display: block;
  width: 65%;
  height: 1px;
  margin: 8px 0;
  background-color: var(--base-color);
}

.num-section-jp {
  font-size: 1.8rem;
  font-weight: 700;
}

.num-section-link {
  display: inline-flex;
  align-items: stretch;
  align-self: flex-start;
  transition: opacity 0.2s;
}

.num-section-link:hover {
  opacity: 0.75;
}

.num-section-link-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background-color: var(--base-color);
  color: #fff;
  padding: 14px 28px;
  border-radius: 4px 0 0 4px;
}

.num-section-link-jp {
  font-size: 1.4rem;
  font-weight: 700;
}

.num-section-link-en {
  font-family: var(--num-font);
  font-weight: 500;
  font-size: 1rem;
  color: #aaa;
}

.num-section-link-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  background-color: #a5a5a5;
  border-radius: 0 4px 4px 0;
  font-size: 1.2rem;
  color: var(--base-color);
}

.num-section-lead {
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  font-weight: 700;
  line-height: 1.8;
  margin-bottom: 40px;
}

/* ===== 01 PROLOGUE：実績数値 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat-item {
  padding: 24px clamp(12px, 2vw, 32px);
  border-left: 1px solid #ccc;
  text-align: center;
}

.stat-item:first-child {
  border-left: none;
}

.stat-label {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-number {
  font-size: clamp(4rem, 8vw, 7.6rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.stat-desc {
  font-size: 1.3rem;
  color: var(--sub-color);
}

/* ===== 02 OUR STANCE ===== */
#stance .num-section-head {
  width: 200px;
}

.stance-grid {
  display: flex;
  gap: 16px;
}

.stance-intro {
  flex: 1.1;
  /* 右半分（.stance-wrap）を一時非表示にしている間、単独の左カラムが
     横に間延びしないよう最大幅を設定。最長の一文が1行に収まり、
     中途半端な折り返し（「す。」等のオーファン）が出ない幅にしている。
     （2カラム復活時はこの値まで達しないため無影響） */
  max-width: 820px;
}

/* 「す。」のような短い最終行（オーファン）を避けて折り返しを整える */
.stance-intro .num-section-lead,
.stance-intro .stance-statement,
.stance-intro .num-section-note {
  text-wrap: pretty;
}

.stance-intro .section-heading {
  font-size: clamp(2.6rem, 3.8vw, 3.8rem);
  margin-bottom: 20px;
}

.stance-intro .num-section-lead {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.stance-intro .num-section-note {
  margin-top: 16px;
}

.stance-statement {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.8;
  margin-bottom: 16px;
}

.stance-wrap {
  flex: 1.6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stance-heading {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 12px 16px;
}

.stance-heading-en {
  font-family: var(--en-font);
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.stance-heading-sub {
  font-family: var(--en-font);
  font-size: clamp(1.6rem, 2vw, 2rem);
  line-height: 1.6;
  color: var(--sub-color);
}

/* stance-list の li を stance-wrap の3列グリッドに直接並べる */
.stance-list {
  display: contents;
}

.stance-item {
  position: relative;
  padding: 14px 12px;
  overflow: hidden;
}

.stance-item-icon {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 88px;
  height: 88px;
  color: #e3e3e3;
}

.stance-item-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.stance-item-body {
  position: relative;
}

.stance-item-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.stance-item-desc {
  font-size: 1.3rem;
  color: var(--sub-color);
}

/* ===== 03 RESEARCH JOURNEY ===== */
/* 「03」「RESEARCH JOURNEY/研究の軌跡」「見出し」「実証の軌跡ボタン」を横並びに配置 */
.journey-top {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px 40px;
  margin-bottom: 48px;
}

.journey-num-label {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* フォントの字面の余白差を補正し、隣の見出しと天端を揃える */
.journey-num-label .num-section-number {
  display: inline-block;
  margin-top: -0.09em;
}

.journey-num-label .num-section-label-text {
  width: fit-content;
}

.journey-num-label .num-section-en {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  line-height: 1.25;
}

.journey-top .section-heading {
  flex: 1;
  min-width: 280px;
}

.journey-link {
  flex-shrink: 0;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

/* 西暦をつなぐ線 */
.timeline::before {
  content: "";
  position: absolute;
  top: 1.87rem;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #ccc;
}

.timeline-item {
  position: relative;
}

/* 線の上に重ならないよう西暦の背後を背景色でマスク */
.timeline-year {
  position: relative;
  z-index: 1;
  display: inline-block;
  background-color: #fff;
  padding-right: 8px;
  font-family: var(--en-font);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

/* 項目間の線上に丸印を表示 */
.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.87rem;
  right: -12px;
  width: 8px;
  height: 8px;
  background-color: #999;
  border-radius: 50%;
  transform: translate(50%, -50%);
}

.timeline-photo {
  margin-top: 16px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.timeline-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-year .hero-num {
  font-family: inherit;
  font-weight: inherit;
}

.timeline-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 1.3rem;
  color: var(--sub-color);
}

/* ===== 04 THE SCIENCE ===== */
.num-section-body .section-heading {
  margin-bottom: 40px;
}

.science-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.science-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.science-card-desc {
  font-size: 1.3rem;
  color: var(--sub-color);
}

.science-card-photo {
  margin-top: 16px;
  aspect-ratio: 8 / 7;
  overflow: hidden;
}

.science-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 05 ACADEMIC ROOTS ===== */
.academic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.academic-card-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 16px;
  background-color: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.academic-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.academic-card-photo--logo img {
  width: 70%;
  height: auto;
  object-fit: contain;
}

.academic-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.academic-card-desc {
  font-size: 1.3rem;
  color: var(--sub-color);
}

/* 外部サイトへのリンクカード（小林整骨院グループ）
   他カードと区別するため、常時「公式サイトを見る↗」の手がかりを表示し、
   ホバーで画像ズーム＋タイトル下線でクリック可能であることを明示する。 */
.academic-card-link {
  display: block;
  color: inherit;
}

.academic-card-link .academic-card-photo img {
  transition: transform 0.3s;
}

.academic-card-link:hover .academic-card-photo img {
  transform: scale(1.05);
}

.academic-card-link:hover .academic-card-title {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* 常時表示のリンク手がかり */
.academic-card-cue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--base-color);
}

.academic-card-cue svg {
  width: 14px;
  height: 14px;
}

.academic-card-link:hover .academic-card-cue {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ===== 06 DATA LIBRARY / NEWS ===== */
.datalib-news {
  display: flex;
  gap: 0;
}

.datalib-col {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.datalib-col .num-section-head {
  margin-bottom: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.datalib-col .num-section-link {
  align-self: flex-start;
}

.datalib-content {
  flex: 1;
  min-width: 0;
}

.datalib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0 64px;
}

.datalib-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--base-color);
}

.datalib-icon {
  width: 64px;
  height: 64px;
  color: var(--base-color);
}

.datalib-icon svg {
  width: 100%;
  height: 100%;
}

.datalib-card-title {
  font-size: 1.6rem;
  font-weight: 700;
}

/* ===== NEWS ===== */
.news-layout {
  display: flex;
  gap: 0;
}

.news-col {
  flex-shrink: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.news-body {
  flex: 1;
  min-width: 0;
}

.news-body .section-heading {
  margin-bottom: 24px;
}

.news-list li {
  border-bottom: 1px dashed #ccc;
}

.news-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 20px 0;
  transition: opacity 0.2s;
}

.news-list a:hover {
  opacity: 0.6;
}

.news-date {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.news-tag {
  flex-shrink: 0;
  background-color: var(--base-color);
  color: #fff;
  font-size: 1.1rem;
  padding: 4px 14px;
}

.news-title {
  font-size: 1.4rem;
  width: 100%;
}

/* ===== MESSAGE ===== */
.message {
  padding: 64px 5%;
  /* MESSAGE と MEDIA の間にセクション区切り線を入れる（他セクションと同仕様） */
  border-bottom: 1px solid var(--base-color);
}

/* MEDIA は最終セクションのため、フッター直上に線を出さない */
.num-section.media {
  border-bottom: none;
}

.message-label {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
}

.message-body {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  margin-bottom: 32px;
}

.message-text {
  flex: 1;
}

.message-heading {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* 見出し直下のリード一文 */
.message-intro {
  font-size: 1.4rem;
  line-height: 1.9;
  margin-bottom: 16px;
}

.message-jp {
  font-size: 1.5rem;
  line-height: 1.9;
  margin-bottom: 20px;
}

/* 英文は本文末尾（セリフ体・サブカラー） */
.message-en {
  font-family: var(--en-font);
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--sub-color);
}

.message-photo {
  flex: 0 0 44%;
}

/* 会長メッセージの動画はカラム幅いっぱいにレスポンシブ表示 */
.message-photo video {
  width: 100%;
  height: auto;
  display: block;
}

/* 動画サムネ（クリックで再生/停止。再生アイコンは common.js が制御） */
.message-photo .movie-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
}

/* 中央の再生ボタン（サイトのモノトーンに合わせたダーク円＋白い三角） */
.movie-thumb .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.6);
  transition: background 0.2s, opacity 0.25s, transform 0.2s;
}

.movie-thumb .play-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}

.movie-thumb:hover .play-btn {
  background: var(--base-color);
  transform: translate(-50%, -50%) scale(1.06);
}

/* 再生中は再生ボタンをフェードアウト（クリックは動画に届く） */
.movie-thumb.is-playing .play-btn {
  opacity: 0;
  pointer-events: none;
}

/* ===== MEDIA ===== */
/* num-section と同じ「ラベル列＋本文列」の2カラム構成 */
.media-layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.media-col {
  flex-shrink: 0;
  width: 240px;
}

.media-body {
  flex: 1;
  min-width: 0;
}

.media-lead {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* 左に大きいカード（縦2枠分）、右にカード2枚を縦積み。左カラムを広めに取る */
.media-cards {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 24px;
  list-style: none;
  align-items: stretch;
}

/* 左の大カードは縦2枠分。画像を枠いっぱいに伸ばし、下端を右下（ethos）に揃える */
.media-card--wide {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
}

.media-card--wide .media-card-thumb {
  flex: 1;
  min-height: 0;
}

.media-card--wide .media-card-thumb img {
  height: 100%;
  object-fit: cover;
}

.media-card-thumb {
  overflow: hidden;
}

/* サムネは各メディアの外部サイトへのリンク。アンカーを枠いっぱいに広げる
   （横長カードの object-fit: cover を効かせるため height:100% が必要） */
.media-card-thumb a {
  display: block;
  height: 100%;
  transition: opacity 0.2s;
}

.media-card-thumb a:hover {
  opacity: 0.85;
}

.media-card-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.media-card-caption {
  margin-top: 12px;
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--sub-color);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .stance-grid {
    flex-direction: column;
  }

  .stance-wrap {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 複数行になり線の位置が揃わなくなるため非表示 */
  .timeline::before,
  .timeline-item::after {
    display: none;
  }

  .science-grid,
  .academic-grid,
  .datalib-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    padding-bottom: 32px;
  }

  .num-section {
    padding: 48px 6%;
  }

  .num-section-grid {
    flex-direction: column;
    gap: 24px;
  }

  /* #stance の PC用オーバーライドをモバイルでリセット */
  #stance .num-section-head {
    width: auto;
  }

  .num-section-head {
    width: auto;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 32px;
  }

  .stat-item:nth-child(3) {
    border-left: none;
  }

  .stance-wrap {
    grid-template-columns: 1fr;
  }

  .journey-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .science-grid,
  .academic-grid,
  .datalib-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .datalib-news {
    flex-direction: column;
    gap: 32px;
  }

  .datalib-col {
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .news-layout {
    flex-direction: column;
    gap: 24px;
  }

  .news-col {
    width: auto;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }

  .message-body {
    flex-direction: column-reverse;
  }

  .message-photo {
    flex: none;
    width: 100%;
  }

  /* MEDIA：ラベルを上、本文を下に積む */
  .media-layout {
    flex-direction: column;
    gap: 24px;
  }

  .media-col {
    width: auto;
  }

  /* カードは1列に積む（横長カードの2枠分指定も解除） */
  .media-cards {
    grid-template-columns: 1fr;
  }

  .media-card--wide {
    grid-row: auto;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-item {
    border-left: none;
    border-top: 1px solid #ccc;
  }

  .stat-item:first-child {
    border-top: none;
  }

  .timeline {
    grid-template-columns: 1fr 1fr;
  }

  .science-grid,
  .academic-grid,
  .datalib-grid {
    grid-template-columns: 1fr;
  }

}
