/* The edition page (ADR-0017) — heritage-broadsheet, docs/design/edition/DESIGN.md.
   One paper world on purpose: no dark mode, every colour named. Korean sets in
   Noto Serif KR with keep-all and a wide leading; English in Public Sans. */

  :root {
    --ink: #1a1c1e;
    --ink-2: #4a4e54;
    --muted: #696f76;
    --clay: #b8422e;
    --paper: #f7f5f2;
    --rule: #d8d4cd;
    --rule-strong: #b4afa6;
    --absent: #e3ded6;
    --positive: #3d6b4a;
    --caution: #8a6a18;

    --kr: "Noto Serif KR", "AppleMyungjo", ui-serif, Georgia, serif;
    --en: "Public Sans", ui-sans-serif, "Helvetica Neue", Arial, sans-serif;
    --grot: "Space Grotesk", ui-sans-serif, "Helvetica Neue", Arial, sans-serif;
    --xs: 4px; --sm: 8px; --md: 16px; --lg: 28px; --xl: 48px;
  }
  body {
    background: var(--paper); color: var(--ink);
    font-family: var(--kr); font-size: 15.5px; line-height: 1.78; letter-spacing: -0.003em;
    word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
  }
  .sheet { max-width: 1240px; margin: 0 auto; padding-inline: var(--md); padding-block: var(--lg) var(--xl); }
  h1, h2, h3, h4, p, ol, ul { margin: 0; }
  ol, ul { padding: 0; list-style: none; }
  a { color: inherit; text-decoration: none; }
  a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  :focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
  .fig { font-family: var(--grot); font-variant-numeric: tabular-nums; letter-spacing: 0; }
  .rid { font-family: var(--grot); font-weight: 600; font-size: 12.5px; color: var(--muted); letter-spacing: 0; }
  .cap { font-size: 13px; line-height: 1.75; color: var(--muted); max-width: 60ch; }
  .sec-head { display: grid; gap: 6px; margin-bottom: var(--md); }
  .sec-head h2 { font-size: 22px; font-weight: 900; letter-spacing: -.012em; line-height: 1.35; }

  /* ── 제호 ──────────────────────────────────────────────── */
  .mast-top, .mast-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--sm) var(--lg); }
  .mast-top { font-size: 13px; color: var(--muted); padding-bottom: var(--sm); border-bottom: 1px solid var(--rule); }
  .mast-top b { color: var(--ink); font-weight: 700; }
  .wordmark { font-size: clamp(64px, 12vw, 132px); font-weight: 900; letter-spacing: -.035em; line-height: .96; padding-block: 10px 6px; }
  .wordmark a { color: inherit; text-decoration: none; }
  .mast-bottom { padding-block: 6px 10px; }
  .edition-date { font-size: 17px; font-weight: 700; }
  .edition-nav { display: flex; gap: var(--md); font-family: var(--grot); font-weight: 600; font-size: 13.5px; }
  .edition-nav a { color: var(--ink-2); }
  .edition-nav a[aria-disabled="true"] { color: var(--rule-strong); pointer-events: none; }
  .rule-heavy { height: 3px; background: var(--ink); }
  .rule-hair { height: 1px; background: var(--ink); margin-top: 2px; }

  /* ── 1면 ───────────────────────────────────────────────── */
  .front {
    display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: var(--xl);
    grid-template-areas: "lede fresh" "rise fresh"; align-items: start;
    /* the side column spans both rows: a long one must stretch the second row,
       never the first — or a gap opens between the lead and "rising now" */
    grid-template-rows: auto 1fr;
    padding-block: var(--lg); border-bottom: 1px solid var(--rule-strong);
  }
  .lede { grid-area: lede; padding-bottom: var(--lg); }
  .headline { font-size: clamp(30px, 4.3vw, 50px); font-weight: 900; letter-spacing: -.028em; line-height: 1.24; text-wrap: balance; max-width: 22ch; }
  .dek { margin-top: var(--md); font-size: 17.5px; line-height: 1.8; color: var(--ink-2); max-width: 44ch; }
  .board-line { margin-top: var(--md); font-size: 13px; color: var(--muted); }
  .board-line b { font-family: var(--grot); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

  /* A day with nothing rising yet (the first week of history, or a supply gap
     around the start panel) has no main column — let the side column lead. */
  .front.solo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lede" "fresh"; grid-template-rows: auto auto; }
  .front.solo .fresh { border-left: none; padding-left: 0; }
  .rise { grid-area: rise; border-top: 2px solid var(--ink); padding-top: var(--md); }
  .rise-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--md); margin-bottom: 6px; }
  .rise-head h2 { font-size: 22px; font-weight: 900; letter-spacing: -.012em; }
  .rrow {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 208px; column-gap: var(--md);
    padding-block: 14px; border-bottom: 1px solid var(--rule); align-items: start;
  }
  .rank { font-family: var(--grot); font-weight: 700; font-size: 26px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
  .rkind { font-size: 18.5px; font-weight: 700; line-height: 1.45; letter-spacing: -.01em; margin-top: 2px; }
  .rsum { margin-top: 4px; font-size: 14.5px; line-height: 1.75; color: var(--ink-2); max-width: 58ch; }
  .rsum.en { color: var(--muted); }
  .rmeta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
  .rfig { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 5px; align-items: baseline; padding-top: 4px; }
  .delta { font-family: var(--grot); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; color: var(--ink); }
  .unit { font-size: 12px; color: var(--muted); }
  .bar { grid-column: 1 / -1; height: 8px; background: var(--absent); position: relative; }
  .bar i { position: absolute; inset: 0 auto 0 0; background: var(--clay); }
  .pct { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
  .pct .fig { color: var(--ink-2); font-weight: 500; }

  /* 상태 표시: 글자와 기호가 뜻을 싣고, 색은 기호에만 쓴다 */
  .flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
  .flag::before { content: ""; width: 8px; height: 8px; display: inline-block; flex: none; }
  .flag.hot::before { background: var(--caution); transform: rotate(45deg); width: 7px; height: 7px; }
  .flag.watch::before { border: 1.5px solid var(--caution); border-radius: 50%; width: 7px; height: 7px; }
  .flag.real::before { background: var(--positive); border-radius: 50%; }
  .flag.none::before { background: var(--rule-strong); height: 2px; }
  .flag.new::before { background: var(--clay); }
  .flag .fig { font-weight: 500; color: var(--muted); }
  .soft { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }

  .fresh { grid-area: fresh; border-left: 1px solid var(--rule); padding-left: var(--lg); }
  .fresh h2 { font-size: 20px; font-weight: 900; letter-spacing: -.01em; }
  .fresh .cap { margin-top: 4px; }
  .fitem { padding-block: 14px; border-bottom: 1px solid var(--rule); }
  .fitem .fk { margin-top: 3px; font-size: 16.5px; font-weight: 700; line-height: 1.5; }
  .fitem .fs { margin-top: 3px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
  .fitem .fm { margin-top: 5px; font-size: 12px; color: var(--muted); }
  .devs { margin-top: var(--md); font-size: 13px; color: var(--muted); line-height: 1.8; }
  .devs .rid { font-size: 12.5px; color: var(--ink-2); }

  .inside { margin-top: var(--xl); border-top: 2px solid var(--ink); padding-top: var(--md); }
  .inside h2 { font-size: 17px; font-weight: 900; }
  .inside li { border-bottom: 1px solid var(--rule); }
  .inside a { display: grid; gap: 2px; padding-block: 11px; }
  .inside a:hover { text-decoration: none; }
  .inside a:hover b { text-decoration: underline; text-underline-offset: 3px; }
  .inside b { font-size: 15px; font-weight: 700; }
  .inside span { font-size: 12.5px; line-height: 1.7; color: var(--muted); }

  .daily { margin-top: var(--xl); border-top: 2px solid var(--ink); padding-top: var(--md); }
  .daily h2 { font-size: 17px; font-weight: 900; }
  .daily .cap { margin-top: 2px; }
  .daily li { display: grid; grid-template-columns: 22px 46px minmax(0, 1fr); column-gap: 8px; align-items: baseline; padding-block: 9px; border-bottom: 1px solid var(--rule); }
  .daily .dr { font-family: var(--grot); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
  .daily .dk { display: block; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
  .mv { font-family: var(--grot); font-size: 11.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .mv.up { color: var(--clay); }
  .mv.down { color: var(--muted); }
  .mv.new, .mv.back { color: var(--ink); }
  .mv.same { color: var(--rule-strong); }
  .lang-switch { font-family: var(--grot); font-weight: 600; font-size: 13px; color: var(--ink-2); }

  section.band { padding-block: var(--lg); border-bottom: 1px solid var(--rule-strong); }

  /* ── 분야별 ─────────────────────────────────────────────── */
  .field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--xl); }
  .field { padding-block: var(--md); border-top: 1px solid var(--ink); }
  .field h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; font-weight: 900; }
  .field h3 .fig { font-size: 13px; font-weight: 600; color: var(--muted); }
  .field li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sm); padding-block: 9px; border-bottom: 1px solid var(--rule); }
  .field li:last-child { border-bottom: none; }
  .field .fk { font-size: 14.5px; font-weight: 700; line-height: 1.5; }
  .field .fig { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-top: 2px; }
  /* 쇼핑: 순위 숫자와 두 줄 목록 */
  .kn { font-family: var(--grot); font-weight: 600; color: var(--muted); margin-right: 10px; font-variant-numeric: tabular-nums; }
  .kw-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--xl); }

  /* ── 오늘의 흐름 ────────────────────────────────────────── */
  .flow-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--lg) var(--xl); }
  .flow { border-top: 1px solid var(--ink); padding-top: var(--md); }
  .flow h3 { font-size: 19px; font-weight: 900; line-height: 1.4; letter-spacing: -.01em; }
  .flow .fline { margin-top: 6px; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
  .fmeta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: var(--sm); }
  .track { position: relative; height: 8px; background: var(--absent); }
  .track i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
  .track b { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--paper); }
  .fmeta .fig { font-size: 12.5px; color: var(--muted); }
  .fmeta .fig b { color: var(--ink); font-weight: 700; }
  .members { margin-top: var(--sm); font-size: 12.5px; line-height: 1.8; color: var(--muted); }
  .members .rid { font-size: 12px; color: var(--ink-2); }

  /* ── 믿을 만한가 ────────────────────────────────────────── */
  .tscroll { overflow-x: auto; }
  table.trust { width: 100%; border-collapse: collapse; min-width: 720px; }
  .trust th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 12px 8px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
  .trust td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; font-size: 13.5px; }
  .trust td.num, .trust th.num { text-align: right; font-family: var(--grot); font-variant-numeric: tabular-nums; }
  .trust .tk { font-size: 14px; font-weight: 700; line-height: 1.45; }
  .scale { position: relative; height: 22px; min-width: 200px; }
  .scale .axis { position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--absent); }
  .scale .thr { position: absolute; top: 3px; height: 16px; width: 1px; background: var(--rule-strong); }
  .scale .thr.hi { background: var(--caution); width: 2px; }
  .scale .dot { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
  .trust .per { display: flex; align-items: center; gap: 10px; }
  .trust .per .scale { flex: 1; }
  .trust .per .v { font-family: var(--grot); font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
  .scale-key { display: flex; justify-content: space-between; font-family: var(--grot); font-size: 11px; color: var(--muted); min-width: 200px; }

  /* ── 오래가는 ───────────────────────────────────────────── */
  .srow { display: grid; grid-template-columns: 250px minmax(0, 1fr) 92px 64px; gap: var(--md); align-items: center; padding-block: 11px; border-bottom: 1px solid var(--rule); }
  .shead { padding-block: 0 6px; border-bottom: 1px solid var(--ink); font-size: 12px; font-weight: 600; color: var(--muted); }
  .srow .sk { font-size: 14px; font-weight: 700; line-height: 1.45; }
  .strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: 34px; align-items: end; }
  .cell { position: relative; height: 100%; }
  .cell i { position: absolute; bottom: 0; left: 0; right: 0; background: var(--clay); }
  .cell.gap { background: repeating-linear-gradient(135deg, var(--absent) 0 3px, transparent 3px 6px); }
  .srow .num { text-align: right; font-family: var(--grot); font-size: 13px; font-variant-numeric: tabular-nums; }
  .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: var(--sm); font-size: 12.5px; color: var(--muted); }
  .legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 6px; }
  .legend i.fill { background: var(--clay); }
  .legend i.gap { background: repeating-linear-gradient(135deg, var(--rule-strong) 0 2px, transparent 2px 4px); }
  .legend i.pad { border: 1px solid var(--rule); }

  /* ── 색인 ───────────────────────────────────────────────── */
  .idx { columns: 4; column-gap: var(--lg); column-rule: 1px solid var(--rule); }
  .irow { break-inside: avoid; padding-block: 6px; line-height: 1.55; }
  .irow .rid { display: block; font-size: 11.5px; color: var(--ink); }
  .irow.on .rid::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--clay); margin-right: 6px; vertical-align: 1px; }
  .irow .k { display: block; font-size: 12.5px; color: var(--ink-2); }
  .irow.blank .k { color: var(--rule-strong); font-weight: 600; }

  .colophon { padding-top: var(--lg); display: grid; gap: 6px; font-size: 12.5px; line-height: 1.8; color: var(--muted); max-width: 72ch; }
  .colophon b { color: var(--ink-2); font-weight: 700; }

  /* 영문판: heritage-broadsheet 원래 활자(Public Sans) · 라틴 행간 · 어절 규칙 해제 */
  .sheet:lang(en) { font-family: var(--en); line-height: 1.55; letter-spacing: 0; word-break: normal; }
  .sheet:lang(en) .wordmark { font-weight: 800; letter-spacing: -.05em; }
  .sheet:lang(en) .headline { letter-spacing: -.028em; line-height: 1.1; max-width: 20ch; }
  .sheet:lang(en) .dek { line-height: 1.55; max-width: 48ch; }
  .sheet:lang(en) .rsum, .sheet:lang(en) .fitem .fs, .sheet:lang(en) .flow .fline { line-height: 1.55; }
  .sheet:lang(en) .rkind, .sheet:lang(en) .fitem .fk { letter-spacing: -.012em; }

  @media (max-width: 1100px) { .idx { columns: 3; } .flow-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 900px) {
    .front { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lede" "rise" "fresh"; grid-template-rows: auto auto auto; }
    .fresh { border-left: none; padding-left: 0; border-top: 2px solid var(--ink); padding-top: var(--md); margin-top: var(--lg); }
    .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .idx { columns: 2; }
    .srow { grid-template-columns: minmax(0, 1fr) 84px 52px; }
    .srow .strip-cell { grid-column: 1 / -1; grid-row: 2; }
  }
  @media (max-width: 600px) {
    body { font-size: 15px; }
    .rrow { grid-template-columns: 30px minmax(0, 1fr); }
    .rank { font-size: 21px; }
    .rfig { grid-column: 2; margin-top: 8px; grid-template-columns: auto auto 1fr; }
    .rfig .bar { grid-column: 3; grid-row: 1; align-self: center; }
    .rfig .pct { grid-column: 1 / -1; }
    .rkind { font-size: 17px; }
    .field-grid, .flow-list, .kw-rows { grid-template-columns: minmax(0, 1fr); }
    .idx { columns: 1; }
    .edition-nav { width: 100%; justify-content: space-between; }
    /* 표를 휴대폰에서 옆으로 밀게 하지 않는다: 행 하나를 한 덩어리로 쌓는다 */
    table.trust { min-width: 0; }
    .trust thead { display: none; }
    .trust tbody, .trust tr { display: block; }
    .trust tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
    .trust td { display: block; border: none; padding: 0; }
    .trust td:first-child, .trust td.scale-cell { flex: 1 0 100%; }
    .trust td.num { font-size: 13px; }
    .trust [data-l]::before { content: attr(data-l) " "; font-family: var(--kr); color: var(--muted); font-size: 12px; }
  }
  @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
