/* 오늘재즈 — 밤의 재즈바 테마. 브랜드 색: upload/README.md */
:root {
  color-scheme: dark;
  --bg: #14151c;
  --surface: #1c1d27;
  --surface-2: #262735;
  --line: #34364a;
  --text: #f4ead5;      /* 크림 */
  --muted: #bdb4a3;     /* 배경 대비 약 8:1 */
  --amber: #f5a623;
  --amber-soft: rgba(245, 166, 35, 0.14);
  --red: #e5484d;
  --radius: 14px;
  --gutter: 16px;
  --maxw: 640px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--amber); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
h1 { font-size: 1.45rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.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: 8px; top: -60px; background: var(--amber); color: var(--bg); padding: 10px 14px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip-link:focus { top: 8px; }

/* ---------- 틀 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(20, 21, 28, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.site-header .inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); height: 56px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; min-height: 44px; }
.brand svg { width: 30px; height: 30px; border-radius: 8px; }
.header-note { margin-left: auto; color: var(--muted); font-size: 0.88rem; }

main { max-width: var(--maxw); margin: 0 auto; padding: 16px var(--gutter) calc(var(--nav-h) + var(--safe-b) + 32px); }
.page-head { margin: 4px 0 14px; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 0.95rem; }

.site-footer { color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--line); margin-top: 32px; padding-top: 18px; display: grid; gap: 8px; }
.site-footer .tagline { color: var(--text); font-weight: 700; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.site-footer nav a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }

/* 하단 탭 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(20, 21, 28, 0.97);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar ul { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); color: var(--muted); text-decoration: none; font-size: 0.78rem; font-weight: 600;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--amber); }

/* ---------- 필터 칩 ---------- */
.filters { display: grid; gap: 10px; margin-bottom: 16px; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter);
  scroll-padding-inline: var(--gutter);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 0.95rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.segment { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.segment button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.segment button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- 섹션, 카드 ---------- */
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-head .count { color: var(--muted); font-size: 0.9rem; }
.stack { display: grid; gap: 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.show { display: grid; grid-template-columns: 64px 1fr; gap: 12px; }
.show-time { font-variant-numeric: tabular-nums; }
.show-time strong { display: block; font-size: 1.12rem; color: var(--amber); }
.show-time span { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.show-time .tbd { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.show-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.9rem; color: var(--muted); }
.show-meta a { color: var(--text); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.show-meta a:hover { text-decoration: underline; }
.show-title { margin-top: 2px; font-size: 1.02rem; }
.lineup { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lineup li { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 8px; padding: 0 10px; min-height: 36px; font-size: 0.9rem; }
.lineup a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(245, 166, 35, 0.6); min-height: 36px; display: inline-flex; align-items: center; }
.lineup .inst { color: var(--muted); font-size: 0.8rem; }
.sets { margin-top: 8px; display: grid; gap: 2px; font-size: 0.92rem; }
.sets b { color: var(--amber); font-variant-numeric: tabular-nums; margin-right: 6px; }
.trust { margin-top: 10px; font-size: 0.8rem; color: var(--muted); }
.trust a { color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 1px 8px; font-size: 0.76rem; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.badge-live { background: var(--amber); color: var(--bg); }
.badge-listening { border: 1px solid var(--text); color: var(--text); }
.badge-both { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); }
.badge-kind { background: var(--surface-2); color: var(--text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; }

.place { display: grid; gap: 6px; }
.place-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.place-name { color: var(--text); font-weight: 800; font-size: 1.02rem; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.place-name:hover { text-decoration: underline; }
.place-sub { color: var(--muted); font-size: 0.9rem; }
.place-hours { font-size: 0.92rem; }
.place-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.9rem; }
.place-actions a { display: inline-flex; align-items: center; min-height: 44px; }

.empty { text-align: left; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; }
.empty p { color: var(--muted); }
.empty strong { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.note { color: var(--muted); font-size: 0.9rem; }
.loading { color: var(--muted); padding: 20px 0; }

/* 광고 자리: ADS.enabled=false면 아예 그리지 않는다(레이아웃 변화 없음). 켜면 높이를 미리 확보 */
.ad-slot { display: grid; place-items: center; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 0.75rem; overflow: hidden; }

/* ---------- 상세 ---------- */
.detail-head { display: grid; gap: 8px; margin-bottom: 18px; }
.detail-head .sub { color: var(--muted); }
.info-list { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.info-list > div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.info-list > div:first-child { border-top: 0; }
.info-list dt { color: var(--muted); font-size: 0.9rem; }
.info-list dd { margin: 0; }
.link-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.fav-btn[aria-pressed="true"] { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.prose { display: grid; gap: 12px; }
.prose h2 { margin-top: 12px; }
.prose ul { list-style: disc; padding-left: 20px; display: grid; gap: 4px; }
.prose p, .prose li { color: var(--text); }

/* 캘린더 날짜 줄 */
.datebar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scroll-padding-inline: var(--gutter); }
.datebar::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 auto; width: 54px; min-height: 64px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-variant-numeric: tabular-nums;
}
.day small { font-size: 0.72rem; color: var(--muted); }
.day b { font-size: 1.05rem; }
.day i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.day.has i { background: var(--amber); }
.day.sun small { color: #ff8a8e; }
.day[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.day[aria-pressed="true"] small { color: var(--bg); }
.day[aria-pressed="true"] i { background: var(--bg); }
.month-label { font-weight: 800; margin: 4px 0 8px; }
.date-pick { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 0.9rem; }
.date-pick input { min-height: 44px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; }

.group-title { font-size: 0.95rem; color: var(--muted); margin: 16px 0 8px; font-weight: 700; }
.region-title { font-size: 1.15rem; margin-top: 26px; }

@media (min-width: 720px) {
  :root { --gutter: 24px; }
  h1 { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .chip, .segment button, .day, .btn { transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
}

.gap-top { margin-top: 10px; }
.gap-bottom { margin-bottom: 10px; }

/* ---------- 지도 탭 ---------- */
.map-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.map-actions .chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-toggle[aria-pressed="true"] { background: rgba(229, 72, 77, 0.16); border-color: var(--red); color: var(--text); }
.chip-toggle[aria-pressed="true"] .live-dot { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.3); }

/* 지도 보기: 머리글과 아래 탭 사이를 지도가 채운다 */
body.map-mode main {
  max-width: none; padding: 0; display: flex; flex-direction: column;
  height: calc(100vh - 56px - env(safe-area-inset-top, 0px) - var(--nav-h) - var(--safe-b));
  height: calc(100dvh - 56px - env(safe-area-inset-top, 0px) - var(--nav-h) - var(--safe-b));
}
body.map-mode .site-footer { display: none; }
body.map-mode .map-controls { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 10px var(--gutter) 8px; }
body.map-mode .map-controls .filters { gap: 8px; margin-bottom: 8px; }
.map-shell { position: relative; flex: 1; min-height: 280px; background: var(--bg); overflow: hidden; }
#map-canvas { position: absolute; inset: 0; }
.map-list { padding-top: 4px; }

.map-float {
  position: absolute; z-index: 2; border: 1px solid var(--line); background: rgba(28, 29, 39, 0.94); color: var(--text);
  border-radius: 12px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.map-missing { left: 10px; top: 10px; padding: 0 12px; max-width: calc(100% - 80px); }
.map-locate { right: 10px; top: 116px; width: 44px; display: grid; place-items: center; }
.map-toast {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); top: 62px; width: max-content; max-width: calc(100% - 32px);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 0.85rem;
}
.map-attrib {
  position: absolute; z-index: 1; right: 0; bottom: 0; margin: 0; padding: 2px 6px; border-top-left-radius: 6px;
  background: rgba(20, 21, 28, 0.82); color: var(--muted); font-size: 0.66rem; line-height: 1.5;
}
.map-attrib a { color: var(--muted); }

.map-sheet {
  position: absolute; z-index: 4; left: 10px; right: 10px; bottom: 22px; margin: 0 auto; max-width: 480px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5); display: grid; gap: 6px; max-height: 70%; overflow: auto;
}
.map-sheet h2 { font-size: 1.12rem; padding-right: 40px; }
.map-sheet h2:focus { outline: none; }
.map-sheet h2:focus-visible { outline: 3px solid var(--amber); }
.sheet-close {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 1.5rem; cursor: pointer;
}
.sheet-shows { display: grid; gap: 4px; font-size: 0.95rem; }
.sheet-shows b { color: var(--amber); margin-right: 8px; font-variant-numeric: tabular-nums; }
.sheet-line { font-size: 0.95rem; }
.sheet-approx { font-size: 0.82rem; color: var(--muted); }
.sheet-actions .btn { flex: 1; }
.badge-today { background: rgba(229, 72, 77, 0.16); color: var(--text); border: 1px solid var(--red); }

@media (prefers-reduced-motion: no-preference) {
  .map-sheet { animation: sheet-in 0.18s ease-out; }
  @keyframes sheet-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* MapLibre 컨트롤을 어두운 테마·44px 터치 영역에 맞춤(maplibre-gl.css가 나중에 로드되므로 .map-shell로 우선순위를 높임) */
.map-shell .maplibregl-ctrl-group { background: rgba(28, 29, 39, 0.94); border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); }
.map-shell .maplibregl-ctrl-group button { width: 44px; height: 44px; background-color: transparent; }
.map-shell .maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.map-shell .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(0.92); }
.map-shell .maplibregl-ctrl-group button:focus-visible { box-shadow: 0 0 0 3px var(--amber); }
.map-shell .maplibregl-ctrl-top-right { top: 0; right: 0; }

/* site.config.mjs ADS.slotMinHeight */
.ad-slot { min-height: 120px; }
