/* ============================================================================
   vd-layout.css — 화면 형태(흐름 / 풀화면 장면) · 폭 배율(80~130%) 구성 규칙
   개정: 2026-09-16

   실을 순서 (맨 뒤)
     vd-article.css → vd-brand.css → vd-<skin>.css → vd-chart-forms.css → vd-wide.css → vd-layout.css

   발행 계약에 맞춘다 — 새 속성을 만들지 않는다
     · 화면 형태  : 루트 `data-theme="scene"`           (없으면 흐름형)
     · 폭 배율    : 루트 `style="--vd-w-k: 1.15"`        (0.8 ~ 1.3 · 0.05 단위 · 1 이면 안 찍는다)
     · 글자 사다리: `--vd-fs-3xs … --vd-fs-5xl`          (정본이 `--vd-fs-e × --vd-scale` 로 만든다)
     세 가지 모두 vstudio 렌더(article-render.tsx · SiteSerializer)가 이미 내는 것이다.
     이 파일은 그 위에 **구성 규칙**만 얹는다.

   ───────────────────────────────────────────────────────────────────────────
   1. 두 화면 형태의 차이는 '글자 크기'가 아니라 '한 화면이 감당하는 정보량'이다
   ───────────────────────────────────────────────────────────────────────────
   흐름형   독자가 속도를 정한다. 블록은 내용만큼만 높다. 정본 그대로.
   풀화면형 한 화면 = 한 블록. 블록이 화면을 **채워야** 한다 — 같은 크기로 두면 화면의
            60% 가 빈다. 그래서 풀화면에서는
              · 본문 18 → 20px, 사다리 전체 ×1.1 (제목·숫자·라벨이 한 단씩 올라간다)
              · 본문 폭 700 → 880 (글자가 커진 만큼 줄당 글자수를 지킨다)
              · 차트·사진·무대는 **화면 높이 기준**으로 크기를 정한다 (svh)
              · 소제목은 흐름형과 같은 모양이다 (아래 §3)
              · 구분선·가로선은 화면을 차지하지 않는다
   ========================================================================== */

/* ── 2. 풀화면 — 치수 ────────────────────────────────────────────────────── */
.vd-article[data-theme="scene"] {
  --vd-fs: 20px;
  --vd-scale: 1.1;
  --vd-col: 880px;
  --vd-wide: 1280px;
  --vd-pad-y: clamp(20px, 2.4cqw, 34px);
}
.vd-article[data-theme="scene"].is-page {
  --vd-wide: 1600px;
}
/* 본문 — 한 화면에 문단 3~4개가 상한이다. 그 이상은 두 블록으로 가른다(편집 규칙, CSS 는 행간만) */
.vd-article[data-theme="scene"] .vd-p {
  line-height: 1.95;
}
/* 사진 — 화면 높이의 72% 안에 들어온다. 캡션 자리를 남긴다 */
.vd-article[data-theme="scene"] :is(.vd-figure__media, .vd-img, .vd-slider, .vd-pdetail__stage) {
  max-height: 72svh;
}
.vd-article[data-theme="scene"] .vd-figure__media .vd-img,
.vd-article[data-theme="scene"] .vd-figure__media img {
  object-fit: contain;
}
/* 차트 — 높이를 화면에서 받는다. 흐름형의 260px 은 풀화면에서 띠가 된다 */
.vd-article[data-theme="scene"] .vd-bars {
  height: min(48svh, 560px);
}
.vd-article[data-theme="scene"] .vd-linechart {
  max-height: min(50svh, 560px);
}
.vd-article[data-theme="scene"] .vd-pie__svg {
  width: min(34cqw, 40svh, 400px);
  height: min(34cqw, 40svh, 400px);
}
.vd-article[data-theme="scene"] .vd-map__stage,
.vd-article[data-theme="scene"] .vd-parts__stage {
  aspect-ratio: auto;
  height: min(66svh, 760px);
}
/* 숫자 — 풀화면의 주인공. 세 칸이면 칸당 화면 너비 30% 를 숫자가 쓴다 */
.vd-article[data-theme="scene"] .vd-stat__num {
  font-size: clamp(var(--vd-fs-3xl, 34px), 9cqw, var(--vd-fs-5xl, 64px));
}
.vd-article[data-theme="scene"] .vd-stat__label {
  font-size: var(--vd-fs-sm, 15px);
  max-width: 30ch;
}
/* 인용 — 한 화면에 한 문장. 한 단 올리고 폭을 열어 준다 */
.vd-article[data-theme="scene"] .vd-quote {
  max-width: calc(var(--vd-col) * 1.15);
}
.vd-article[data-theme="scene"] .vd-quote__text {
  font-size: clamp(var(--vd-fs-xl, 22px), 3cqw, var(--vd-fs-3xl, 36px));
}
/* 핵심 요약·카드·표 — 항목이 적을 때 화면이 비지 않게 칸을 키운다 */
.vd-article[data-theme="scene"] .vd-kp__text {
  font-size: var(--vd-fs-lg, 19px);
}
.vd-article[data-theme="scene"] .vd-kp__list {
  gap: clamp(14px, 2svh, 24px);
}
.vd-article[data-theme="scene"] .vd-cards {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.vd-article[data-theme="scene"] .vd-card__body,
.vd-article[data-theme="scene"] .vd-cswipe__body {
  font-size: var(--vd-fs-sm, 15px);
}
.vd-article[data-theme="scene"] .vd-table td {
  padding-block: 15px;
}
.vd-article[data-theme="scene"] .vd-tl__item {
  padding-block: 18px;
}

/* ── 3. 소제목 — 풀화면에서도 고른 모양 그대로 ────────────────────────────────
   정본은 여기서 소제목만 있는 화면을 **장 표지**(자동 번호 01 · 02 + 사다리 3xl~5xl 큰 제목, 스킨의 띠·막대를 걷음)로 바꿨다.
   vstudio 는 쓰지 않는다 — 사용자 결정 2026-10-08 「숫자에 큰 글자로 했다고? 그럼 안 되는데」(api D-99 덧붙임).
   기자가 고른 소제목 모양(띠 · 선)과 스킨의 소제목 디자인이 풀화면에서도 흐름형과 같게 선다 — 화면 한 장의 세로 가운데에.
   정본을 다시 받을 때 이 절을 되살리지 않는다(SYNC-DESIGN §5). */

/* ── 4. 화면을 차지하지 않는 블록 ───────────────────────────────────────────
   구분선·가로선은 '쉼'이다. 한 화면을 통째로 주면 쉼이 아니라 빈 페이지가 된다. */
.vd-article[data-theme="scene"] > :is(.vd-divider, .vd-artline, :has(> .vd-divider), :has(> .vd-artline)) {
  min-height: 0;
  scroll-snap-align: none;
  border-bottom: 0;
  overflow: visible;
}

/* ── 5. 폭 배율 — 구성은 그대로, 캔버스만 늘린다 ─────────────────────────────
   `--vd-w-k` 가 폭을 곱하면 정본은 글자를 75% 비율로 따라 올린다(`--vd-fs-w`).
   여기서는 **세로 리듬을 50% 비율**로, **격자 칸 하한을 100% 비율**로 따라 올린다.
   그래야 배율을 바꿔도 칸 수(카드 3열, 숫자 3칸)가 바뀌지 않는다 — 배율은 확대/축소지
   재배치가 아니다. 칸 수를 바꾸고 싶으면 블록의 열 옵션을 쓴다.

     배율   본문폭  wide(1600 기준)  글자     리듬     격자 하한
     0.80    560     1280           ×0.85   ×0.90    ×0.80
     0.90    630     1440           ×0.925  ×0.95    ×0.90
     1.00    700     1600           ×1      ×1       ×1
     1.15    805     1840           ×1.11   ×1.075   ×1.15
     1.30    910     2080*          ×1.225  ×1.15    ×1.30
     * 화면 폭이 그보다 좁으면 화면에 갇힌다 — 1.3 은 2100px 이상 화면·풀화면형에서 뜻이 있다.
     0.8 은 기사 본문 삽입(is-embed)·좁은 호스트용, 1.15~1.3 은 전용 페이지·전시 화면용이다. */
.vd-article {
  --vd-sp-w: calc(1 + (var(--vd-w-k, 1) - 1) * 0.5);
  --vd-pad-y: clamp(calc(26px * var(--vd-sp-w)), 3.4cqw, calc(44px * var(--vd-sp-w)));
}
.vd-article .vd-cards {
  grid-template-columns: repeat(auto-fit, minmax(calc(230px * var(--vd-w-k, 1)), 1fr));
}
.vd-article .vd-stats {
  grid-template-columns: repeat(auto-fit, minmax(calc(200px * var(--vd-w-k, 1)), 1fr));
}
.vd-article .vd-grid {
  grid-template-columns: repeat(auto-fit, minmax(calc(240px * var(--vd-w-k, 1)), 1fr));
}
.vd-article .vd-bars {
  height: calc(260px * var(--vd-w-k, 1));
}
.vd-article .vd-pie__svg {
  width: calc(250px * var(--vd-w-k, 1));
  height: calc(250px * var(--vd-w-k, 1));
}
.vd-article .vd-thumb__media {
  height: calc(180px * var(--vd-w-k, 1));
}
.vd-article .vd-rel__thumb {
  width: calc(112px * var(--vd-w-k, 1));
}
.vd-article .vd-scroller > *,
.vd-article .vd-cswipe__card {
  flex-basis: clamp(calc(240px * var(--vd-w-k, 1)), 32%, calc(420px * var(--vd-w-k, 1)));
}
/* 히어로 — 배율 0.8 에서는 제목 상한을 내린다(좁은 호스트에서 세 줄을 넘긴다) */
.vd-article[style*="--vd-w-k: 0.8"] .vd-hero__title,
.vd-article[style*="--vd-w-k:0.8"] .vd-hero__title {
  font-size: clamp(var(--vd-fs-2xl, 26px), 5.4cqw, var(--vd-fs-4xl, 44px));
}

/* 풀화면 + 배율은 곱이다 — 1.3 풀화면에서 차트가 화면을 넘지 않게 상한을 건다 */
.vd-article[data-theme="scene"] .vd-bars {
  height: min(48svh, calc(560px * var(--vd-w-k, 1)));
}

@media (max-width: 760px) {
  /* 좁은 화면에서는 배율을 무시한다 — 정본이 장면도 흐름으로 되돌리는 것과 같은 지점 */
  .vd-article {
    --vd-sp-w: 1;
  }
  .vd-article :is(.vd-cards, .vd-stats, .vd-grid) {
    grid-template-columns: 1fr;
  }
}
