/* 전국구 알람 — 사이트 공용 스타일. 날씨앱 사이트(`../jeonguku-weather/server/site/public/assets/site.css`)를 그대로 옮기고 색만 바꿨다.
   브랜드 파랑 #1F6FEB 는 앱의 강조색(iOS `Pal.accent` · Android `Pal.accent`)과 한 벌이다 — 앱 아이콘이 서면 그 색으로 다시 맞춘다. */

:root {
  --brand: #1F6FEB;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --fg: #16181d;
  --muted: #5f6472;
  --line: #e3e5ea;
  --box: #f6f7f9;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(16,20,30,.05), 0 8px 24px rgba(16,20,30,.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #6B9EFF;
    --bg: #101218;
    --bg-soft: #14171e;
    --fg: #e7e9ee;
    --muted: #9aa1b1;
    --line: #272b35;
    --box: #191d25;
    --card: #171a21;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
        "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  /* 한국어는 어절 단위로 끊어야 읽힌다 */
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: var(--brand); }
a:hover { text-decoration: none; }

img { max-width: 100%; height: auto; }

/* ── 상단 바 ───────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 62rem; margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: .6rem;
  /* 폰 폭에서는 nav 가 아랫줄로 내려간다 — 안 내려가면 링크 글자가 세로로 쪼개진다 */
  flex-wrap: wrap;
}
.topbar a.brand {
  display: flex; align-items: center; gap: .55rem;
  color: var(--fg); text-decoration: none; font-weight: 700;
}
.topbar .brand img { width: 28px; height: 28px; border-radius: 7px; }
.topbar nav { margin-left: auto; display: flex; gap: 1.1rem; font-size: .93rem; flex-wrap: wrap; }
/* ⛔ 이 한 줄이 없으면 좁은 폭에서 「자주 묻는 질문」이 세 줄로 쪼개진다 */
.topbar nav a { white-space: nowrap; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--fg); }

/* ⭐ 앱이 여는 두 장(/privacy · /licenses — 날씨앱은 /faq 까지 셋)은 주소 끝에 `#app` 을 달고 온다 — 그때만 상단 바를 접는다.
   앱 안에는 이미 설정 화면이라는 돌아갈 자리가 있어 이동 링크가 군더더기고, sticky 라 계속 따라다닌다.
   ⛔ **JS 가 아니라 `:target` 인 이유** = 앱이 여는 것은 인앱 브라우저(Custom Tabs · SFSafariViewController)라
   스크립트를 못 집어넣고, **프래그먼트는 서버·CDN 을 안 거친다**(쿼리로 하면 캐시 키가 갈린다).
   ⚠️ 세 장에 **페이지 내부 앵커가 하나도 없어야** 성립한다 — 앵커를 누르면 `:target` 이 옮겨가 상단 바가 되살아난다.
   📌 **푸터도 같이 접는다**(2026-09-19 사용자 *"하단 테일을 안보이게 할 수 없나?"*) — 홈·FAQ 로 가는 링크 줄이라 상단 바와 같은
   군더더기다. `~` 는 형제 결합자: header·main·footer 가 전부 body 의 직계 자식이라 성립한다 — **footer 를 다른 상자에 싸면 끊긴다.**
   출처 줄(기상청)은 /licenses 가 들고 있어 앱 판에선 잃는 것이 없다. */
#app:target { display: none; }
#app:target ~ .site-footer { display: none; }
/* 📌 앱 판에서 다른 장으로 가는 링크(/licenses → /licenses/sdk 와 그 반대)는 `data-app` 을 달고, 각 장 끝의 한 줄 스크립트가
   location.hash 가 #app 일 때만 그 링크에 #app 을 잇는다 — 웹에서 온 사람은 그대로. (인앱 브라우저도 페이지 자신의 JS 는 돌린다 —
   위 「JS 가 아니라 :target」은 앱 쪽에서 스크립트를 못 넣는다는 말이지 페이지 JS 가 안 돈다는 말이 아니다.) */

/* ── 본문 틀 ───────────────────────────────────────── */

main { max-width: 46rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
main.wide { max-width: 62rem; }

h1 { font-size: 1.8rem; line-height: 1.35; margin: 0 0 .4rem; letter-spacing: -.02em; }
h2 {
  font-size: 1.15rem; margin: 2.75rem 0 .75rem;
  padding-top: 1.25rem; border-top: 1px solid var(--line);
  letter-spacing: -.01em;
}
h3 { font-size: 1rem; margin: 1.6rem 0 .4rem; }
p, li { margin: .5rem 0; }
ul, ol { padding-left: 1.25rem; }

.lead { color: var(--muted); margin: 0 0 2rem; }

.box {
  background: var(--box); border: 1px solid var(--line);
  border-radius: 12px; padding: 1rem 1.15rem; margin: 1.25rem 0;
}
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .94rem; }
th, td {
  border: 1px solid var(--line); padding: .55rem .7rem;
  text-align: left; vertical-align: top;
}
th { background: var(--box); font-weight: 600; white-space: nowrap; }

/* 좁은 폭에서 표를 항목별 카드로 접는다.
   ⚠️ 앱 설정에서 여는 페이지라 **폰이 주 화면**이다 — 표를 옆으로 밀어 보게 두면
   저작권자·이용조건처럼 오른쪽 열에 있는 값이 화면 밖에 남는다.
   각 칸의 머리글은 HTML 의 `data-label` 이 들고 있다(thead 에서 굽는다). */
@media (max-width: 34rem) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr {
    border: 1px solid var(--line); border-radius: 10px;
    padding: .4rem 0; margin-bottom: .7rem;
  }
  table.stack td { border: 0; padding: .25rem .8rem; }
  table.stack td::before {
    content: attr(data-label);
    display: block; color: var(--muted); font-size: .8rem; font-weight: 600;
  }
  table.stack td:empty { display: none; }
  /* 첫 칸은 카드의 제목이다 — 「이름」·「항목」 라벨을 되풀이하지 않는다 */
  table.stack td:first-child { font-weight: 600; padding-top: .45rem; }
  table.stack td:first-child::before { display: none; }
}

pre {
  background: var(--box); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem; overflow-x: auto; font-size: .84rem; line-height: 1.6;
  word-break: normal;
}

/* /licenses/sdk — 항목 128개를 접어 둔다(펼치기 전엔 제목 한 줄). 페이지 내부 앵커 대신 details 를 쓰는 이유 =
   앵커를 누르면 :target 이 옮겨가 앱 판의 상단 바·푸터가 되살아난다(위 #app 주석). */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: .55rem 0; font-weight: 600; }
summary:hover { color: var(--brand); }
details pre { margin: 0 0 1rem; white-space: pre-wrap; }
code { font-size: .92em; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ── 푸터 ──────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-soft);
  color: var(--muted); font-size: .9rem;
}
.site-footer .inner { max-width: 62rem; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-bottom: 1.1rem; }
.site-footer nav a { color: var(--fg); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer p { margin: .35rem 0; }
