/* 방송 맛집 — 스타일
 *
 * 사진이 없는 사이트다. 그래서 카드 그리드 대신 '방송일 레일'을 축으로 삼는다:
 * 왼쪽에 방송일과 채널이 모노스페이스로 정렬되고, 오른쪽에 가게 정보가 붙는다.
 * 이 사이트에서 가장 중요한 정보가 '언제 어느 방송에 나왔나'이기 때문이다.
 *
 * 색 — 사진 없이 식욕을 만들어야 한다. 그래서 전부 따뜻한 쪽이다.
 *   바탕은 갓 지은 밥·미색 종이(#fbf5ee), 글자는 검정이 아니라 볶은 원두빛 갈색,
 *   주색은 고추장·불맛의 붉은 주황(#c1381b), 보조는 노릇하게 구운 호박색(#8a5309).
 *   accent-deep 은 accent 를 배지처럼 작은 글자로 쓸 때만 — 연한 바탕 위에서
 *   accent 그대로는 명암비 4.5:1 을 못 넘긴다.
 * 회색조차 무채색을 쓰지 않고 갈색 쪽으로 기울여, 화면 어디에도 찬 색이 없게 했다
 * (청록·회녹색은 음식 사진이 없는 화면에서 식욕을 가장 많이 누르는 색이다).
 * 웹폰트는 쓰지 않는다 — 한글 웹폰트는 무겁고, CDN 의존은 이 사이트의 목적과 맞지 않는다.
 */

:root {
  --ground: #fbf5ee;
  --surface: #fffdfa;
  --surface-2: #f6ebdd;
  --ink: #241610;
  --ink-soft: #4b352a;
  --muted: #866b59;
  --line: #ecdccb;
  --accent: #c1381b;
  --accent-soft: #fbe5dc;
  --accent-deep: #a12c12;
  --accent-ink: #fffaf7;
  --highlight: #8a5309;
  --highlight-soft: #f9ebd3;
  --warn: #9c5a1e;
  --warn-soft: #f8ecdd;
  --glow: rgba(224, 122, 46, 0.16);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
          "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "D2Coding",
          "Nanum Gothic Coding", monospace;

  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.25rem;
  --radius: 12px;
  --rail: 5.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #17100c;
    --surface: #211711;
    --surface-2: #2c1f16;
    --ink: #f6e9dd;
    --ink-soft: #dcc7b4;
    --muted: #a98d76;
    --line: #3a2a1e;
    --accent: #ff7a52;
    --accent-soft: #3a1c12;
    --accent-deep: #ff9670;
    --accent-ink: #2a0c04;
    --highlight: #e6b263;
    --highlight-soft: #33260f;
    --warn: #e39a5d;
    --warn-soft: #33210f;
    --glow: rgba(255, 138, 76, 0.14);
  }
}

:root[data-theme="dark"] {
  --ground: #17100c;
  --surface: #211711;
  --surface-2: #2c1f16;
  --ink: #f6e9dd;
  --ink-soft: #dcc7b4;
  --muted: #a98d76;
  --line: #3a2a1e;
  --accent: #ff7a52;
  --accent-soft: #3a1c12;
  --accent-deep: #ff9670;
  --accent-ink: #2a0c04;
  --highlight: #e6b263;
  --highlight-soft: #33260f;
  --warn: #e39a5d;
  --warn-soft: #33210f;
  --glow: rgba(255, 138, 76, 0.14);
}

:root[data-theme="light"] {
  --ground: #fbf5ee;
  --surface: #fffdfa;
  --surface-2: #f6ebdd;
  --ink: #241610;
  --ink-soft: #4b352a;
  --muted: #866b59;
  --line: #ecdccb;
  --accent: #c1381b;
  --accent-soft: #fbe5dc;
  --accent-deep: #a12c12;
  --accent-ink: #fffaf7;
  --highlight: #8a5309;
  --highlight-soft: #f9ebd3;
  --warn: #9c5a1e;
  --warn-soft: #f8ecdd;
  --glow: rgba(224, 122, 46, 0.16);
}

* { box-sizing: border-box; }

/* 위에서 내려오는 따뜻한 빛 — 식탁 위 전등 하나. 스크롤해도 자리를 지킨다. */
body {
  margin: 0;
  background: var(--ground);
  background-image:
    radial-gradient(60rem 26rem at 50% -8rem, var(--glow), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }

/* ─── 머리말 ─────────────────────────────────────────────── */

.site-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
@supports not (backdrop-filter: blur(1px)) {
  .site-head { background: var(--surface); }
}
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 0.75rem 0;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 800;
  font-size: var(--step-2);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
  align-self: center;
}
.brand .en {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-nav {
  display: flex;
  gap: 1rem;
  margin-inline-start: auto;
  font-size: 0.9rem;
}
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }

.searchbar { display: flex; gap: 0.5rem; width: min(24rem, 100%); }
.searchbar input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input:focus { border-color: var(--accent); }
.searchbar button {
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #ffb27a), var(--accent));
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.searchbar button:hover { filter: brightness(1.07); }

/* ─── 본문 뼈대 ──────────────────────────────────────────── */

main { padding-block: 2rem 4rem; }
.page-head { margin-bottom: 1.5rem; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.35rem;
}
h1 {
  font-size: var(--step-4);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
  text-wrap: balance;
}
h2 {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.75rem;
  text-wrap: balance;
}
/* 본문 구획 표시. .panel h2 에는 붙이지 않는다 (패널 안에서는 군더더기) */
main > h2::before {
  content: "";
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-inline-end: 0.5rem;
  border-radius: 3px;
  background: var(--accent);
}
h3 { font-size: var(--step-1); margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.lede { color: var(--ink-soft); margin: 0; max-width: 46rem; }
.en { font-weight: 400; color: var(--muted); }

/* ─── 목록: 방송일 레일 ──────────────────────────────────── */

.places {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(72, 36, 12, 0.05), 0 8px 24px -16px rgba(72, 36, 12, 0.35);
}
.places > li { background: var(--surface); }
/* 줄에 손을 얹으면 따뜻하게 데워지고 왼쪽에 불씨 한 줄이 켜진다 */
.place-row {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) 1fr auto;
  gap: 0 1rem;
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  align-items: start;
  transition: background 0.15s ease;
}
.place-row::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.18s ease;
}
.place-row:hover { background: var(--surface-2); }
.place-row:hover::before, .place-row:focus-visible::before { transform: scaleY(1); }
.place-row:hover .place-name { color: var(--accent); }

.airdate {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  display: grid;
  gap: 0.15rem;
}
.airdate b { color: var(--ink-soft); font-size: 0.95rem; font-weight: 700; }
.chan {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}
.chan::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--highlight);
}

.place-main { min-width: 0; }
.place-name {
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.15rem;
  transition: color 0.15s ease;
}
.place-meta {
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.6rem;
}
/* 메뉴는 차림표처럼 — 이 줄에서 유일하게 '먹을 것'을 말하는 자리라 가장 눈에 띄어야 한다.
 * 칸 색은 surface-2 가 아니라 highlight-soft 다. 줄에 마우스를 얹으면 바탕이 surface-2 로
 * 바뀌는데, 같은 색이면 메뉴가 그때 사라져 버린다. */
.place-menu {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
}
.place-menu > span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--highlight-soft);
  font-weight: 600;
}
.place-menu .price {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--highlight);
}
.place-side { display: grid; gap: 0.3rem; justify-items: end; }

/* ─── 배지·칩 ────────────────────────────────────────────── */

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-price { background: var(--accent-soft); color: var(--accent-deep); }
.badge-check { background: var(--warn-soft); color: var(--warn); }
.badge-air { background: var(--highlight-soft); color: var(--highlight); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0 0 1rem; list-style: none; }
.chip {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip .n { font-family: var(--mono); color: var(--muted); font-size: 0.78rem; }
.chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-current="page"] .n { color: inherit; opacity: 0.8; }

/* ─── 상세 ───────────────────────────────────────────────── */

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2.5rem; align-items: start; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(72, 36, 12, 0.05), 0 8px 24px -16px rgba(72, 36, 12, 0.35);
}
.panel + .panel { margin-top: 1rem; }
.panel h2 { margin: 0 0 0.75rem; font-size: var(--step-1); }

.facts { margin: 0; display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.55rem 1rem; }
.facts dt { color: var(--muted); font-size: 0.85rem; }
.facts dt .en { display: block; font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }
.facts dd { margin: 0; }
.facts a { color: var(--accent); }

.menu-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.menu-table th { text-align: left; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-bottom: 0.4rem; }
.menu-table td { padding: 0.35rem 0; border-top: 1px solid var(--line); }
.menu-table td:first-child { font-weight: 600; }
.menu-table td:last-child {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--highlight);
  white-space: nowrap;
}
.menu-table tr:hover td { background: var(--highlight-soft); }

.maplinks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.maplinks a {
  flex: 1 1 auto;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.maplinks a:hover { background: var(--accent); color: var(--accent-ink); }
.tel-big {
  display: block;
  font-family: var(--mono);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
}

/* ─── 업체 사진 ──────────────────────────────────────────── */

.photos { padding-bottom: 0.9rem; }
.shots {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.6rem;
}
/* 첫 장은 두 칸을 차지한다 — 음식이 맨 앞에 오도록 정렬해 두었다 (build-db.js 분류순서).
 * 딱 두 장일 때는 빼야 한다. 첫 장이 두 칸을 먹으면 둘째가 혼자 반 칸에 남아 구멍이 난다.
 * :has() 를 못 읽는 브라우저는 예전처럼 첫 장이 넓어질 뿐이라 깨지지 않는다. */
.shots li:first-child { grid-column: span 2; }
.shots:has(li:nth-child(2):last-child) li:first-child { grid-column: auto; }
.shots li {
  position: relative;
  margin: 0;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: var(--surface-2);
}
.shots img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
@media (max-width: 40rem) {
  .shots { grid-template-columns: repeat(2, 1fr); }
  .shots li:first-child { grid-column: span 2; }
}

.airlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
/* 목록의 레일(--rail)을 쓰면 안 된다. 저기는 '08.03' 과 '2026' 을 두 줄로 쪼개 놓지만
 * 여기는 '2026.08.03' 이 한 덩어리라 모바일의 4.25rem 을 넘겨 프로그램 이름과 겹친다.
 * 폭을 내용에 맡긴다. */
.airlist li { display: grid; grid-template-columns: max-content 1fr; gap: 1rem; }
.airlist li > :last-child { min-width: 0; }
.airlist .airdate b { white-space: nowrap; }
.airlist .seg { color: var(--muted); font-size: 0.9rem; }

.note { color: var(--muted); font-size: 0.85rem; }
.note a { color: var(--accent); }

/* ─── 꼬리말 ─────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-foot .wrap { display: grid; gap: 0.6rem; }
.site-foot a { color: var(--accent); }

/* ─── 검색 화면 ──────────────────────────────────────────── */

.filters { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.filter-row > .k {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  width: 5.5rem;
  flex: none;
}
.filter-row button {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.filter-row button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#count { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; }

@media (max-width: 60rem) {
  .detail { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 40rem) {
  :root { --rail: 4.25rem; --step-4: 1.85rem; --step-3: 1.5rem; }
  .site-head .wrap { padding-block: 0.6rem; }
  .site-nav { width: 100%; margin-inline-start: 0; order: 3; overflow-x: auto; }
  .searchbar { width: 100%; order: 2; }
  .place-row { grid-template-columns: var(--rail) 1fr; }
  .place-side { grid-column: 2; justify-items: start; grid-auto-flow: column; }
  .facts { grid-template-columns: 1fr; gap: 0.15rem; }
  .facts dd + dt { margin-top: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
