/* =============================================================
 * typography.css v0.4
 * 変更点: 見出しの字間を 0 に揃えて日本語の詰まりを解消。
 *         本文は 0.02em でゆとり。h3装飾を square に一本化。
 * ========================================================== */

body {
  font-family: var(--ff-sans);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  color: var(--c-text);
  background: var(--c-bg);
}

/* --------------------------------------------------------
 * 見出し（ベース）
 *   日本語を基本にするので letter-spacing は 0 を基準に。
 *   見出しの上下マージンをここで一括管理（垂直リズム）。
 *   - 上: 前の要素との「セクション感」を出すため大きめ
 *   - 下: 次の本文との距離、読みやすさ優先で中程度
 * -------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-sans);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  color: var(--c-text);
}

h1 {
  font-size: var(--fs-h1);
  margin: 0 0 var(--sp-5);            /* 上0 下24px */
}
h2 {
  font-size: var(--fs-h2);
  margin: var(--sp-7) 0 var(--sp-5);  /* 上48px 下24px */
}
h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  margin: var(--sp-6) 0 var(--sp-4);  /* 上32px 下16px */
}
h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  margin: var(--sp-5) 0 var(--sp-3);  /* 上24px 下12px */
}

/* 親の最初の子にあたる見出しは上マージンを消す
   （セクション先頭で不要な余白が出ないように） */
:where(h1, h2, h3, h4, h5, h6):first-child {
  margin-top: 0;
}

/* .l-section__header 内の見出しは flex gap で制御するためマージン解除 */
.l-section__header > :where(h1, h2, h3, h4) {
  margin: 0;
}

/* --------------------------------------------------------
 * ディスプレイ級の見出し
 * -------------------------------------------------------- */
.t-display {
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
}

/* --------------------------------------------------------
 * Eyebrow
 * -------------------------------------------------------- */
.t-eyebrow {
  display: inline-block;
  font-family: var(--ff-num);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--c-brand-800);
  line-height: 1;
}

/* =============================================================
 * Heading Decorations — 見出し装飾バリエーション
 *
 * h2 向け: 4パターン（underline / bar / number / centered）
 * h3 向け: 1パターン + 特殊1パターン（square / logo-mark）
 * h4 向け: 1パターン（accent-line）
 *
 * 運用ルール:
 *   - デフォルトの見出しには装飾を入れない
 *   - 装飾はクラス追加で指定
 *   - セクションごとに「この装飾を使う」と決めて、乱用しない
 * ========================================================== */

/* ---------- h2 向け ---------- */

/* A. 下線（左側に短い太線） */
.t-heading--underline {
  position: relative;
  padding-bottom: 0.65em;
}
.t-heading--underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.5em;
  height: 3px;
  background: var(--c-brand-800);
  border-radius: 2px;
}

/* B. 左縦線（雑誌・エディトリアル風） */
.t-heading--bar {
  position: relative;
  padding-left: 0.9em;
}
.t-heading--bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 4px;
  background: var(--c-brand-800);
  border-radius: 2px;
}

/* C. 番号付き（data-number="01"） */
.t-heading--number {
  display: flex;
  align-items: baseline;
  gap: 0.85em;
}
.t-heading--number::before {
  content: attr(data-number);
  font-family: var(--ff-num);
  font-size: 0.5em;
  font-weight: var(--fw-medium);
  color: var(--c-brand-800);
  letter-spacing: var(--tr-eyebrow);
  flex-shrink: 0;
}

/* D. センター＋下線 */
.t-heading--centered {
  text-align: center;
  position: relative;
  padding-bottom: 0.75em;
}
.t-heading--centered::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 2.5em;
  height: 2px;
  background: var(--c-brand-800);
}

/* ---------- h3 向け（基本はこの1種類で十分） ---------- */

/* E. 左に■（ロゴと統一・一番汎用的）
 *    複数行でも1行目の高さに■が合うように flex-start + margin-top で調整 */
.t-heading--square {
  display: flex;
  align-items: flex-start;
  gap: 0.55em;
}
.t-heading--square::before {
  content: "";
  display: block;
  width: 0.55em;
  height: 0.55em;
  background: var(--c-brand-800);
  flex-shrink: 0;
  /* line-height: 1.5 の場合、1行目の中心は 0.75em 位置、■の中心は top + 0.275em なので 0.475em 下げる */
  margin-top: 0.475em;
}

/* F. 3つ並んだ四角（特殊・ブランド強調時のみ使用） */
.t-heading--logo-mark {
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.t-heading--logo-mark::before {
  content: "";
  display: block;
  width: 1.4em;
  height: 0.35em;
  background:
    linear-gradient(to right,
      var(--c-brand-800) 0, var(--c-brand-800) 30%,
      transparent 30%, transparent 35%,
      var(--c-brand-800) 35%, var(--c-brand-800) 65%,
      transparent 65%, transparent 70%,
      var(--c-brand-800) 70%, var(--c-brand-800) 100%);
  flex-shrink: 0;
}

/* ---------- h4 向け ---------- */

/* G. 左に細い縦線 */
.t-heading--accent-line {
  position: relative;
  padding-left: 0.7em;
  border-left: 2px solid var(--c-brand-800);
}

/* --------------------------------------------------------
 * 段落・リード文
 * -------------------------------------------------------- */
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.t-lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-loose);
  letter-spacing: var(--tr-body);
  color: var(--c-text-muted);
}

.t-caption {
  font-size: var(--fs-caption);
  color: var(--c-text-subtle);
  line-height: 1.6;
}

/* --------------------------------------------------------
 * リンク
 * -------------------------------------------------------- */
a {
  color: var(--c-brand-800);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--dur) var(--ease);
}
a:hover {
  color: var(--c-brand-900);
}

.t-link-plain {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------
 * リスト（本文内）
 * -------------------------------------------------------- */
.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin: 0 0 1em;
}
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--c-brand-800); }

/* --------------------------------------------------------
 * 引用
 * -------------------------------------------------------- */
blockquote {
  margin: 1.5em 0;
  padding: 0 0 0 1.25em;
  border-left: 3px solid var(--c-brand-200);
  color: var(--c-text-muted);
  font-style: normal;
}

/* --------------------------------------------------------
 * 強調
 * -------------------------------------------------------- */
strong, b {
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}
em {
  font-style: normal;
  color: var(--c-brand-800);
}

/* --------------------------------------------------------
 * 数字
 * -------------------------------------------------------- */
.t-num {
  font-family: var(--ff-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0;
}
