/* youtube(유튜브 브리핑) — news/templates/style.css 를 복사한 것에 영상용 규칙을 덧붙임(토큰은 news 와 동일).
   외부 요청 0 — 폰트·아이콘·스크립트를 밖에서 받지 않는다. */
:root {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --fg: #191f28;
  --fg-2: #4e5968;
  --muted: #8b95a1;
  --line: #e5e8eb;
  --primary: #3182f6;
  --primary-soft: #e8f3ff;
  --radius-card: 16px;
  --radius-chip: 8px;
  --nav-h: 56px;
  --pad: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --surface: #17171c;
    --fg: #e5e8eb;
    --fg-2: #b0b8c1;
    --muted: #6b7684;
    --line: #2a2f36;
    --primary: #4e93f8;
    --primary-soft: #1b2a3f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
p, ul, ol { margin: 0 0 12px; }
ul, ol { padding-left: 20px; }
li { margin: 4px 0; }
strong { font-weight: 700; }

/* ── 상단 고정 내비게이션 바 ── */
.nav {
  position: sticky; top: 0; z-index: 10;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 640px; margin: 0 auto; height: 100%;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: 0 8px;
}
.nav-back, .nav-action {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  font-size: 22px; color: var(--fg);
}
.nav-back:hover, .nav-action:hover { background: var(--bg); }
.nav-title {
  text-align: center; font-size: 17px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-title a { color: inherit; }

main { max-width: 640px; margin: 0 auto; padding: var(--pad) var(--pad) 40px; }

/* ── 타이포 ── */
h1 { font-size: 26px; line-height: 1.3; font-weight: 700; margin: 8px 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 20px; line-height: 1.4; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.02em; }
h3 { font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--fg-2); margin: 20px 0 6px; }
.caption { font-size: 13px; color: var(--muted); }
.sub { font-size: 15px; color: var(--fg-2); margin-bottom: 20px; }

/* ── 카드 ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--pad);
  margin: 0 0 16px;
}
.card > h2:first-child { margin-top: 0; }

/* ── ListRow ── */
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { margin: 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; color: var(--fg);
}
.card .rows li:first-child .row { padding-top: 4px; }
.card .rows li:last-child .row { padding-bottom: 4px; }
.row:hover .row-title { color: var(--primary); }
.row-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.row-body { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 16px; line-height: 1.45; }
.row-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.row-chev { flex: none; color: var(--muted); font-size: 18px; }
.row-ext .row-chev { font-size: 14px; }

/* ── 칩·버튼 ── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; margin: 0; list-style: none; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips li { margin: 0; flex: none; }
.chip {
  display: inline-block; background: var(--bg); color: var(--fg-2);
  border-radius: var(--radius-chip); padding: 6px 10px; font-size: 13px; font-weight: 500;
}
.chip:hover { color: var(--primary); }
.tags { margin: 8px 0 4px; }
.btn-primary {
  display: flex; align-items: center; justify-content: center;
  height: 52px; width: 100%; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: 600;
  margin: 4px 0 20px;
}
.btn-primary:hover { filter: brightness(1.05); }
.daynav { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.daynav .chip { background: var(--surface); }
.daynav .spacer { flex: 1; }

/* ── 날짜 페이지 ── */
.headline {
  background: var(--primary-soft); color: var(--fg);
  border-radius: 12px; padding: 14px 16px; font-size: 15px; font-weight: 500;
  margin: 12px 0 16px;
}
.issue { scroll-margin-top: calc(var(--nav-h) + 12px); }
.issue-head { display: flex; align-items: flex-start; gap: 10px; }
.issue-head .row-num { margin-top: 3px; }
.issue-head h2 { margin: 0; }
.issue p:last-child, .issue ul:last-child { margin-bottom: 0; }
.issue .body p { color: var(--fg); }
.issue .body ul { padding-left: 18px; }
.issue .body li { margin: 8px 0; }
.issue .body li::marker { color: var(--muted); }
.issue .body a { color: var(--primary); }
.muted { color: var(--muted); font-size: 14px; }
.webctx { margin-top: 12px; font-size: 14px; color: var(--muted); }
.webctx summary { cursor: pointer; list-style: none; }
.webctx summary::-webkit-details-marker { display: none; }
.webctx summary::after { content: " ›"; }
.webctx[open] summary::after { content: " ⌄"; }
.webctx ul { margin: 8px 0 0; padding-left: 18px; }
.webctx a { color: var(--fg-2); }
.stats { font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; }
.stats p { margin: 0 0 4px; }

/* ── 아카이브·홈 ── */
.group-title { font-size: 15px; font-weight: 600; color: var(--fg-2); margin: 20px 0 8px; }
.group-title a { color: inherit; }
.group-title:first-of-type { margin-top: 4px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
/* ── 카테고리 딱지 — 분야 설정 categories 순서대로 cat-0 … cat-6, 목록 밖은 cat-x. 주석은 정치 기준 ── */
.badge {
  display: inline-block; vertical-align: 1px; margin-right: 8px;
  padding: 1px 7px; border-radius: 6px;
  font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap;
  background: var(--b-bg, var(--bg)); color: var(--b-fg, var(--fg-2));
}
.cat-0 { --b-bg: #e8f3ff; --b-fg: #1b64da; }  /* 청와대 */
.cat-1 { --b-bg: #f1ebff; --b-fg: #6b3fd4; }  /* 국회·정당 */
.cat-2 { --b-bg: #ffebee; --b-fg: #d22030; }  /* 북한 */
.cat-3 { --b-bg: #e5f7ef; --b-fg: #0e8a55; }  /* 행정 */
.cat-4 { --b-bg: #f4efe4; --b-fg: #7a5a1f; }  /* 국방 */
.cat-5 { --b-bg: #e3f6f8; --b-fg: #0a7c8c; }  /* 외교 */
.cat-6 { --b-bg: #fdecf4; --b-fg: #c2267a; }
@media (prefers-color-scheme: dark) {
  .cat-0 { --b-bg: #16294a; --b-fg: #6aa8ff; }
  .cat-1 { --b-bg: #2a2147; --b-fg: #b59cff; }
  .cat-2 { --b-bg: #3d1c22; --b-fg: #ff7b86; }
  .cat-3 { --b-bg: #143427; --b-fg: #4fd39a; }
  .cat-4 { --b-bg: #352c1a; --b-fg: #d9b56a; }
  .cat-5 { --b-bg: #12343a; --b-fg: #5fd0de; }
  .cat-6 { --b-bg: #3d1a2d; --b-fg: #ff7fbf; }
}

/* ── 기사 페이지 ── */
.issue-meta { display: flex; align-items: center; font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.issue h1 { margin-bottom: 12px; }
.sec { padding-top: 22px; }
.sec-title { font-size: 19px; font-weight: 700; color: var(--fg); margin: 0 0 2px; letter-spacing: -0.02em; }
.sec-desc { font-size: 13px; color: var(--muted); margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sec h3 { margin-top: 20px; }
.sub + .sub { margin-top: 32px; }
.issue-nav { display: grid; gap: 12px; margin-top: 8px; }
.issue-nav-item { display: flex; flex-direction: column; gap: 4px; margin: 0; color: var(--fg); }
.issue-nav-item.next { text-align: right; }
.issue-nav-item:hover .row-title { color: var(--primary); }
@media (min-width: 560px) { .issue-nav { grid-template-columns: 1fr 1fr; } .issue-nav-item.next:only-child { grid-column: 2; } }
.day-headline { font-size: 14px; color: var(--fg-2); margin: -4px 0 10px; }
.row-more .row-sub { margin: 0; font-size: 14px; }

footer.site {
  max-width: 640px; margin: 0 auto; padding: 0 var(--pad) 40px;
  font-size: 13px; color: var(--muted); text-align: center;
}

/* ── 안내(?) 버튼·안내 페이지 — news 와 같은 규칙 ── */
.nav-help { font-size: 15px; font-weight: 700; color: var(--fg-2); position: relative; }
.nav-help::before { content: ""; position: absolute; width: 24px; height: 24px; border: 1.8px solid currentColor; border-radius: 50%; }
.about-badges .badge { margin: 0 6px 6px 0; }
.steps { padding-left: 20px; }
.steps li { margin: 8px 0; }

/* ── youtube — 채널 섹션·영상 목록·페이지 ── */
.channel + .channel { margin-top: 28px; }
.channel-title { font-size: 19px; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em; }
.channel-note { font-size: 13px; color: var(--muted); margin: -4px 0 10px; }
.channel-empty { padding: 20px 0; }
.row-video { align-items: flex-start; }
.thumb-sm { flex: none; width: 96px; height: 54px; object-fit: cover; border-radius: 8px; margin-top: 2px; background: var(--bg); }
.one-line { color: var(--fg-2); margin-top: 4px; line-height: 1.45; }
.thumb-wrap { display: block; position: relative; border-radius: var(--radius-card); overflow: hidden; margin: 12px 0 16px; background: var(--bg); }
.thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.play { position: absolute; right: 12px; top: 12px; background: rgba(0,0,0,.72); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.one-line-big { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 6px 0 0; }
.chapter + .chapter { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.chapter-title { font-size: 16px; font-weight: 700; color: var(--fg); margin: 0 0 6px; }
.chapter-title a { color: inherit; }
.chapter-title a:hover { color: var(--primary); }
.chapter-title .t { display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); border-radius: 6px; padding: 1px 6px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.terms li { color: var(--fg-2); }
.articles { list-style: none; margin: 8px 0 0; padding: 0; }
.articles li { padding: 10px 0; }
.articles li + li { border-top: 1px solid var(--line); }
.articles a { font-weight: 600; color: var(--fg); line-height: 1.45; }
.articles a:hover { color: var(--primary); }
.art-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.art-note { display: block; font-size: 14px; color: var(--fg-2); margin-top: 4px; line-height: 1.45; }
.corrections summary { cursor: pointer; font-weight: 700; color: var(--fg-2); }
.corrections[open] summary { margin-bottom: 8px; }
.corrections s { color: var(--muted); }
.chk { font-size: 12px; color: #0e8a55; font-weight: 600; }
.guess { font-size: 12px; color: var(--muted); }

/* ── 배경 용어 툴팁 — 본문에서 용어 위에 마우스를 올리거나(데스크톱) 탭하면(휴대폰) 풀이가 뜬다 ── */
.term { position: relative; border-bottom: 1.5px dotted var(--muted); cursor: help; outline: none; }
.term:focus-visible { border-bottom-color: var(--primary); }
.term .tip {
  display: none; position: absolute; z-index: 20; left: 50%; top: calc(100% + 6px);
  transform: translateX(calc(-50% + var(--dx, 0px)));
  width: max-content; max-width: min(300px, calc(100vw - 24px));
  padding: 10px 12px; border-radius: 10px;
  background: var(--fg); color: var(--surface);
  font-size: 13px; font-weight: 400; line-height: 1.5; text-align: left; white-space: normal;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.term .tip strong { color: inherit; margin-right: 4px; }
.term:hover .tip, .term:focus .tip, .term:focus-within .tip { display: block; }
.term-demo { border-bottom: 1.5px dotted var(--muted); }
