/* base.css — 글꼴, 초기화, 페이지 틀, 공통 도우미
   반응형 기준(데스크톱 우선): Tablet ≤ 1199px · Mobile ≤ 767px  (scripts/build-tokens.mjs BP 와 같음) */

/* 글꼴: SUIT (OFL, 직접 호스팅) · Zeniq Tech (브랜드 영문, 라이선스 확인 필요) */
@font-face { font-family: 'SUIT'; font-weight: 400; font-display: swap; src: url('/assets/fonts/SUIT-Regular.woff2') format('woff2'); }
@font-face { font-family: 'SUIT'; font-weight: 500; font-display: swap; src: url('/assets/fonts/SUIT-Medium.woff2') format('woff2'); }
@font-face { font-family: 'SUIT'; font-weight: 600; font-display: swap; src: url('/assets/fonts/SUIT-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'SUIT'; font-weight: 700; font-display: swap; src: url('/assets/fonts/SUIT-Bold.woff2') format('woff2'); }
@font-face { font-family: 'SUIT'; font-weight: 800; font-display: swap; src: url('/assets/fonts/SUIT-ExtraBold.woff2') format('woff2'); }
/* Zeniq: 대체 글꼴로 먼저 보였다 바뀌는 깜빡임 방지 — block(글꼴 올 때까지 잠깐 숨김) + base.njk에서 미리 받기. 11KB라 거의 바로 옴 */
@font-face { font-family: 'Zeniq Tech'; font-weight: 400; font-display: block; src: url('/assets/fonts/ZeniqTech.otf') format('opentype'); }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;          /* 한국어: 단어 중간에서 줄바꿈하지 않음 */
  overflow-wrap: anywhere;
}
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
address { font-style: normal; }
:focus-visible { outline: 2px solid var(--color-border-brand); outline-offset: 2px; }

/* 페이지 틀: 최대 폭 1440 (layout/max-width), 가운데 정렬 */
.page-frame {
  max-width: var(--layout-max-width);
  margin-inline: auto;
  background: var(--color-bg-page);
  overflow-x: clip;
  min-height: 100vh;
}
main { display: block; }

/* 도우미 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 16px; background: var(--color-bg-inverse); color: var(--color-text-inverse); border-radius: var(--radius-8); }
.skip-link:focus { top: 16px; }
.uppercase { text-transform: uppercase; }
.icon { flex: none; }

/* 기기별 보이기 (Figma 기기별 줄바꿈·문구 차이) */
.only-tablet, .only-mobile, .only-tablet-up-to { display: none; }
@media (max-width: 1199.98px) {
  .hide-tablet { display: none !important; }
  .only-tablet { display: revert; }
  .only-desktop { display: none !important; }
}
@media (max-width: 767.98px) {
  .hide-mobile { display: none !important; }
  .only-mobile { display: revert; }
  .only-tablet { display: none !important; }
}
br.only-mobile, br.only-tablet { display: none; }
@media (max-width: 1199.98px) { br.only-tablet { display: inline; } br.only-desktop { display: none; } }
@media (max-width: 767.98px) { br.only-mobile { display: inline; } br.only-tablet { display: none; } }
.accent { color: var(--color-text-brand); }
/* 고정 상단 메뉴에 가리지 않게: #앵커로 이동할 때 메뉴 높이만큼 띄움 */
[id] { scroll-margin-top: var(--layout-nav-height); }
/* 글자 드래그 선택·글자 커서(I자) 막기 — 요청(2026-11-24). 입력칸·편집 영역만 예외 */
body { -webkit-user-select: none; user-select: none; cursor: default; caret-color: transparent; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; cursor: text; caret-color: auto; }
a, button, [role="button"], [role="link"], label[for], summary { cursor: pointer; }
img { -webkit-user-drag: none; }

/* ───────── 페이드인 (main.js initReveal) ─────────
   헤더·푸터 빼고 본문(main) 요소가 하나씩 0.05초 간격으로 시작, 각각 0.25초 동안 아래→위(16px)로 나타남.
   from만 적어서 끝값은 요소 원래 값으로 감. 요소가 translate를 이미 쓰면 transform으로, 둘 다 쓰면 페이드만 (main.js가 고름)
   .reveal-wait = 아직 화면에 안 들어온 요소 (들어오면 .reveal) */
html.is-loading main > *, html.is-loading main > [data-media-feed] > * { opacity: 0; } /* display: contents 묶음(뉴스 목록)은 투명도가 안 먹어서 안쪽까지 숨김 */
/* 같은 큰 제목 페이지에서 왔으면(하위 탭 이동) 큰 제목·탭 줄은 그대로 보임 — page-title.njk 인라인 스크립트가 keep-title을 붙임 */
html.is-loading.keep-title main > :is(.page-title, .subnav, .media-nav) { opacity: 1; }
.reveal-wait { opacity: 0; }
@keyframes reveal-up { from { opacity: 0; translate: 0 16px; } }
@keyframes reveal-up-t { from { opacity: 0; transform: translateY(16px); } }
@keyframes reveal-fade { from { opacity: 0; } }
.reveal { animation: reveal-up .25s cubic-bezier(.2, .7, .3, 1) backwards; }
.reveal.reveal--t { animation-name: reveal-up-t; }
.reveal.reveal--fade { animation-name: reveal-fade; }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } .reveal-wait { opacity: 1; } }
