/* 「sbccを知る」ページ(page-about.php)専用。style.css の後に読み込む。
   クラスはすべて .about で始め、他のページには影響しない。色・フォント・ボタンは、style.css の変数と .button をそのまま使う。
   文章量の多い読み物なので、スマホ(390px)での読みやすさを優先する。縦書きラベルは使わず、見出しは横書き+紺と金の細い線。
   背景は、導入と年表が白、理由が帯、大切にしていることが白、これからもが帯(白と帯を交互に) */

.about {
  /* 本文の段落・強調・箇条書き・目次の最大幅(1行の長さ。16px で約38字) */
  --about-text-max: 38em;

  /* 年表の縦のレールの位置と、そのぶんの字下げ */
  --about-rail-x: 5px;
  --about-rail-indent: 28px;

  /* 行頭禁則を厳しくする(小さい「っ」「ゃ」や長音「ー」を行頭に置かない)。子に継承される */
  line-break: strict;
}

/* 文節の切れ目で折り返す(対応ブラウザだけ。Chrome / Edge 119 以降)。子に継承される */
@supports (word-break: auto-phrase) {
  .about {
    word-break: auto-phrase;
  }
}

/* 漢字・カタカナ・英数字が続く1つの語(inc/about.php の sbcc_about_html() が包む)。語の途中では折り返さない */
.about__word {
  white-space: nowrap;
}

/* セクション(白と帯)。幅と列(読み物の列は --content-width で中央、区切り線は --content-wide)は style.css の共通の枠 */
.about__section {
  scroll-margin-top: var(--anchor-offset);
}

.about__section--alt {
  background: var(--color-bg-alt);
}

.about__inner {
  position: relative;
  padding: 56px var(--page-x) 64px;
}

/* 白が続く箇所(導入 → 年表)だけ、コンテナ内に収めた区切り線を入れる */
.about__section--intro + .about__section:not(.about__section--alt) .about__inner::before {
  content: "";
  position: absolute;
  top: 0;
  right: var(--page-x);
  left: var(--page-x);
  height: 1px;
  background: var(--color-line-soft);
}

/* 縦の並びの間隔(子の間だけに余白を入れる) */
.about__inner > *,
.about__era > * {
  margin-block: 0;
}

.about__inner > * + *,
.about__era > * + * {
  margin-top: 1.2em;
}

/* 文字の折り返し:本文は pretty(最終行が1〜2字だけにならない)、見出し・強調は balance(行の長さをそろえる)。
   1つの塊が行に収まらないときだけ、その中で折り返す(はみ出し防止) */
.about__text,
.about__list li,
.about__cta-text {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.about__title,
.about__catch,
.about__h2,
.about__h3,
.about__h4,
.about__milestone,
.about__keyline,
.about__closing,
.about__cta-title,
.about__btn,
.about__toc-link {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* 本文の段落 */
.about__text {
  max-width: var(--about-text-max);
  font-size: 16px;
  line-height: 1.9;
}

/* ページの見出し(h1)。下に金の短い線 */
.about__title {
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.about__title::after,
.about__h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-top: 20px;
  background: var(--color-gold);
}

/* 冒頭のキャッチ */
.about__inner > .about__title + .about__catch {
  margin-top: 32px;
}

.about__catch {
  max-width: var(--about-text-max);
  font-size: 19px;
  line-height: 1.75;
  letter-spacing: 0.02em;
}

.about__catch + * {
  margin-top: 28px;
}

/* セクション見出し(h2) */
.about__h2 {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.55;
}

.about__h2::after {
  margin-top: 16px;
}

.about__inner > .about__h2 + * {
  margin-top: 36px;
}

/* 小見出し(h3。年表以外)。左に金の縦線 */
.about__h3--plain {
  padding-left: 14px;
  border-left: 2px solid var(--color-gold);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.6;
}

.about__inner > * + .about__h3--plain {
  margin-top: 2.8em;
}

.about__inner > .about__h2 + .about__h3--plain {
  margin-top: 36px;
}

.about__h3--plain + * {
  margin-top: 1em;
}

/* 小見出し(h4)。先頭に紺の細い横線 */
.about__h4 {
  position: relative;
  padding-left: 26px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.7;
}

.about__h4::before {
  content: "";
  position: absolute;
  top: 0.85em;
  left: 0;
  width: 16px;
  height: 1px;
  background: var(--color-navy);
}

.about__inner > * + .about__h4,
.about__era > * + .about__h4 {
  margin-top: 2.4em;
}

.about__h4 + * {
  margin-top: 0.9em;
}

/* 強調ブロック(milestone)。帯の色の地に、左に金の縦線 */
.about__milestone {
  max-width: var(--about-text-max);
  padding: 16px 20px;
  border-left: 2px solid var(--color-gold);
  background: var(--color-bg-alt);
  font-size: 17px;
  line-height: 1.8;
}

.about__section--alt .about__milestone {
  background: var(--color-bg);
}

/* 一言の強調(keyline)。上下を紺の細線で挟み、中央寄せ */
.about__keyline {
  max-width: var(--about-text-max);
  padding: 22px 4px;
  border-block: 1px solid var(--color-rule);
  font-size: 18px;
  line-height: 1.8;
  text-align: center;
}

/* 締めの一文(closing)。上に金の短い線 */
.about__closing {
  max-width: var(--about-text-max);
  padding-top: 26px;
  font-size: 18px;
  line-height: 1.85;
}

.about__closing::before {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-bottom: 22px;
  background: var(--color-gold);
}

/* 強調の前後は、少し広く空ける */
.about__inner > * + :is(.about__milestone, .about__keyline, .about__closing),
.about__era > * + :is(.about__milestone, .about__keyline, .about__closing),
.about__inner > :is(.about__milestone, .about__keyline, .about__closing) + *,
.about__era > :is(.about__milestone, .about__keyline, .about__closing) + * {
  margin-top: 2em;
}

/* 箇条書き:行頭に紺の細い横線(/support/ の .support-overview__list と同じ形) */
.about__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: var(--about-text-max);
  padding: 0;
  list-style: none;
  font-size: 16px;
  line-height: 1.85;
}

.about__list li {
  position: relative;
  padding-left: 1.4em;
}

.about__list li::before {
  content: "";
  position: absolute;
  top: 0.95em;
  left: 0;
  width: 0.7em;
  height: 1px;
  background: var(--color-navy);
}

/* ページ内目次(折りたたみ)。上下に細線。開閉の目印は、線で描いた「+」「−」(単発ページの FAQ と同じ形) */
.about__toc {
  width: 100%;
  max-width: var(--about-text-max);
  border-block: 1px solid var(--color-line-soft);
}

.about__inner > * + .about__toc {
  margin-top: 40px;
}

.about__toc-summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 44px 12px 2px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.6;
  list-style: none;
}

.about__toc-summary::-webkit-details-marker {
  display: none;
}

.about__toc-summary::before,
.about__toc-summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 14px;
  height: 1px;
  background: var(--color-navy);
}

.about__toc-summary::after {
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.about__toc-details[open] > .about__toc-summary::after {
  transform: rotate(0deg);
}

.about__toc-list,
.about__toc-sublist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.about__toc-list {
  padding: 0 0 8px;
  border-top: 1px solid var(--color-line-soft);
}

.about__toc-list > li {
  border-bottom: 1px solid var(--color-line-soft);
}

.about__toc-list > li:last-child {
  border-bottom: 0;
}

/* 目次のリンク:高さ 44px 以上。下線は金(テーマのリンクと同じ) */
.about__toc-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 2px;
  font-size: 15px;
  line-height: 1.6;
  text-decoration-thickness: 1px;
}

.about__toc-link:hover {
  text-decoration-color: var(--color-navy);
}

/* 年表の年:横に並べて折り返す */
.about__toc-sublist {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: -6px 0 10px;
  padding-left: 14px;
}

.about__toc-link--sub {
  display: inline-flex;
  min-height: 44px;
  padding: 4px 10px;
  font-size: 14px;
  white-space: nowrap;
}

/* 年表:左に縦のレール、各時代の先頭に丸印 */
.about__timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding-left: var(--about-rail-indent);
}

.about__timeline::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 0;
  left: var(--about-rail-x);
  width: 1px;
  background: var(--color-line);
}

.about__era {
  position: relative;
  scroll-margin-top: var(--anchor-offset);
}

.about__era::before {
  content: "";
  position: absolute;
  top: 8px;
  left: calc(var(--about-rail-x) - var(--about-rail-indent) - 5px);
  width: 11px;
  height: 11px;
  border: 2px solid var(--color-gold);
  border-radius: 50%;
  background: var(--color-bg);
}

/* 時代の見出し:年のバッジ(紺地に白)の下に、見出しの文 */
.about__era-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.about__year {
  display: inline-block;
  padding: 2px 12px;
  background: var(--color-navy);
  color: var(--color-bg);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.75;
  white-space: nowrap;
}

.about__era-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.about__era > .about__era-heading + * {
  margin-top: 1.4em;
}

/* 最後の相談の案内。枠線で囲み、上辺に金の短い線(トップのカードと同じ形) */
.about__cta {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  padding: 32px 20px 28px;
  border: 1px solid var(--color-line-soft);
  background: var(--color-bg);
  scroll-margin-top: var(--anchor-offset);
}

.about__cta::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20px;
  width: 28px;
  height: 2px;
  background: var(--color-gold);
}

.about__inner > * + .about__cta {
  margin-top: 56px;
}

.about__cta > * {
  margin: 0;
}

.about__cta-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.about__cta-text {
  font-size: 16px;
  line-height: 1.9;
}

.about__cta-action {
  padding-top: 8px;
}

/* .button は inline-flex だが、その中では text-wrap: balance が効かないため、inline-block にする(高さは .button の min-height で 44px 以上) */
.about__btn {
  display: inline-block;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  text-align: center;
  white-space: normal;
}

/* 768px 以上 */
@media (min-width: 768px) {
  .about {
    --about-rail-indent: 36px;
  }

  .about__inner {
    padding-block: 80px 88px;
  }

  .about__section--intro .about__inner {
    padding-block: 64px 80px;
  }

  .about__text,
  .about__list,
  .about__cta-text {
    line-height: 1.95;
  }

  .about__catch {
    font-size: 22px;
  }

  .about__h2 {
    font-size: 28px;
  }

  .about__h3--plain {
    font-size: 19px;
  }

  .about__keyline {
    font-size: 20px;
  }

  .about__closing {
    font-size: 20px;
  }

  .about__era-title {
    font-size: 22px;
  }

  .about__timeline {
    gap: 72px;
  }

  .about__cta {
    padding: 40px 36px 36px;
  }

  .about__cta::before {
    left: 36px;
  }

  .about__btn {
    width: auto;
    min-width: min(100%, 320px);
    padding-inline: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about__toc-summary::after {
    transition: none;
  }
}
