/* 공연달력 — theater night: ink + burgundy + gold */
:root,
html[data-theme="light"] {
  --wine: #3d1224;
  --wine-deep: #2a0c18;
  --wine-mid: #5c1a36;
  --gold: #c4a35a;
  --gold-hover: #d4b56c;
  --gold-soft: #f7f0de;
  --cream: #f6f3ee;
  --card: #ffffff;
  --ink: #161318;
  --ink-soft: #524a52;
  --muted: #857a80;
  --line: #e4ddd4;
  --ok: #1f7a4d;
  --ok-bg: #e8f6ee;
  --soon: #8a6a1a;
  --soon-bg: #f7f0de;
  --live: #8b1538;
  --live-bg: #f8e8ee;
  --week: #5c1a36;
  --week-bg: #f3e6ec;
  --ad-bg: #efeae6;
  --mute-bg: #eeeae4;
  --genre-ink: #6b5314;
  --mark: #f7f0de;
  --sun: #a33;
  --header-fg: #f3e6ec;
  --footer-fg: #f3e6ea;
  --footer-mute: #c9b4b8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(61, 18, 36, 0.08);
  --max: 1080px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --wine: #6b2440;
  --wine-deep: #0c080a;
  --wine-mid: #e8b4c4;
  --gold: #d4b56c;
  --gold-hover: #e8c87a;
  --gold-soft: #3d3018;
  --cream: #100e12;
  --card: #1c171b;
  --ink: #f3ebe6;
  --ink-soft: #c9b8bc;
  --muted: #9a8a90;
  --line: #3a2c32;
  --ok: #5dba86;
  --ok-bg: #163022;
  --soon: #d4b56c;
  --soon-bg: #2a2210;
  --live: #f090a8;
  --live-bg: #3a1524;
  --week: #e8b4c4;
  --week-bg: #2a1824;
  --ad-bg: #1a1618;
  --mute-bg: #2a2428;
  --genre-ink: #e8d5a0;
  --mark: #f7f0de;
  --sun: #f09090;
  --header-fg: #f3e6ec;
  --footer-fg: #f3e6ea;
  --footer-mute: #c9b4b8;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--wine-mid); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--card); color: var(--ink); padding: 8px 12px; z-index: 80; }
.site-header { background: var(--wine); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 12px rgba(42, 12, 24, 0.35); }
.header-inner { max-width: var(--max); margin: 0 auto; padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; color: #fff; text-decoration: none; }
.logo span { color: var(--mark); background: rgba(0,0,0,0.22); padding: 2px 8px 3px; border-radius: 8px; }
.nav { display: flex; gap: 16px; }
.nav a { color: var(--header-fg); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; padding: 4px 0; }
.nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.nav a[aria-current="page"], .nav a:hover { color: #fff; }
.search-wrap { margin-left: auto; flex: 1 1 160px; min-width: min(100%, 160px); max-width: 320px; }
.search-wrap input {
  border: 0; border-radius: 999px; padding: 8px 14px; min-width: 140px;
  font: inherit; background: var(--card); color: var(--ink); width: 100%;
}
.theme-toggle {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.12); color: var(--mark);
  cursor: pointer;
}
.theme-toggle:hover, .theme-toggle:focus-visible {
  background: rgba(255,255,255,0.22);
}
.theme-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.theme-toggle svg { display: block; }
.theme-toggle .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
.sample-banner {
  background: var(--gold-soft); color: var(--wine);
  text-align: center; padding: 10px 16px; font-weight: 700; font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .sample-banner { color: var(--mark); }
.page { flex: 1; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 28px 20px 64px; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.25; letter-spacing: -0.03em; margin: 0 0 12px; }
.kicker { color: var(--gold); font-weight: 700; letter-spacing: 0.06em; font-size: 0.82rem; margin: 0 0 8px; }
.lede { color: var(--ink-soft); margin: 0 0 12px; max-width: 40rem; }
.today-line { color: var(--muted); font-size: 0.92rem; }
.ad-slot { background: var(--ad-bg); color: var(--muted); text-align: center; padding: 28px; border-radius: var(--radius-sm); margin: 24px 0; border: 1px dashed var(--line); }
.section { margin-top: 36px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 1.25rem; }
.section-note { color: var(--muted); margin: 0; font-size: 0.9rem; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 999px;
  background: var(--card); color: var(--wine); text-decoration: none; font-weight: 700;
  border: 1px solid var(--line); font-size: 0.95rem; line-height: 1.2; white-space: nowrap;
}
html[data-theme="dark"] .chip { color: var(--mark); }
.chip:hover, .chip.is-on { background: var(--wine); color: #fff; border-color: var(--wine); }
.chip-grid.compact { margin-top: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 16/9; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 2.2rem; text-decoration: none; letter-spacing: -0.04em;
}
.thumb img, .thumb-block img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover;
}
.thumb.has-img span, .thumb-block.has-img span {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.card-body { padding: 14px 16px 18px; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.card-kind { color: var(--muted); font-size: 0.85rem; }
.dday { font-weight: 800; color: var(--wine); }
html[data-theme="dark"] .dday { color: var(--gold); }
.dday.is-live { color: var(--live); }
.dday.is-week { color: var(--week); }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin: 6px 4px 6px 0; }
.badge-live { background: var(--live-bg); color: var(--live); }
.badge-week { background: var(--week-bg); color: var(--week); }
.badge-soon { background: var(--soon-bg); color: var(--soon); }
.badge-mute { background: var(--mute-bg); color: var(--muted); }
.genre-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--genre-ink); }
.card h3 { margin: 4px 0; font-size: 1.05rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--gold); }
.when { color: var(--ink-soft); margin: 0; font-size: 0.92rem; }
.place { color: var(--muted); margin: 4px 0 0; font-size: 0.86rem; }
.empty { color: var(--muted); }
.detail h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.meta-line { display: flex; gap: 12px; align-items: center; color: var(--ink-soft); flex-wrap: wrap; }
.facts { display: grid; gap: 10px; margin: 20px 0; }
.facts div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 8px; }
.facts dt { color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.prose { max-width: 42rem; }
.prose h2 { margin-top: 1.6em; }
.thumb-block {
  position: relative; overflow: hidden;
  aspect-ratio: 21/9; max-width: 42rem; border-radius: var(--radius);
  display: grid; place-items: center; color: #fff; font-size: 3rem; font-weight: 800; margin: 16px 0;
}
.relates ul { padding-left: 1.2rem; }
.official-wrap { margin: 28px 0 8px; max-width: 42rem; }
.official-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 16px 20px; border-radius: 14px;
  background: var(--wine); color: #fff; font-weight: 800; font-size: 1.08rem;
  text-decoration: none; box-shadow: var(--shadow);
}
.official-btn:hover { background: var(--wine-deep); color: #fff; }
.dday-lg { font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: -0.05em; line-height: 1; color: var(--wine); margin: 8px 0 16px; }
html[data-theme="dark"] .dday-lg { color: var(--gold); }
.dday-lg.is-live { color: var(--live); font-size: clamp(1.6rem, 4vw, 2rem); }
.crumb { font-size: 0.92rem; }
.site-footer { background: var(--wine-deep); color: var(--footer-fg); padding: 28px 20px; }
.footer-inner { max-width: var(--max); margin: 0 auto; }
.footer-brand { font-weight: 800; margin: 0 0 8px; }
.site-footer a { color: var(--gold); }
.footer-legal { color: var(--footer-mute); font-size: 0.85rem; }
.empty-search { display: none; padding: 24px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }
.empty-search.is-visible { display: block; }
.card.is-hidden { display: none; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-toolbar h2 { margin: 0; font-size: 1.2rem; }
.btn-ghost {
  color: var(--wine); text-decoration: none; font-weight: 700;
  border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; background: var(--card);
}
html[data-theme="dark"] .btn-ghost { color: var(--mark); }
.btn-ghost:hover { background: var(--wine); color: #fff; border-color: var(--wine); }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  background: var(--card); padding: 12px; border-radius: var(--radius); border: 1px solid var(--line);
}
.cal-dow { text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-dow.is-sun, .cal-cell.is-sun .cal-daynum { color: var(--sun); }
.cal-cell {
  min-height: 64px; border-radius: 10px; padding: 6px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 4px; background: var(--cream);
}
.cal-cell:hover { background: var(--gold-soft); }
.cal-cell.is-empty { background: transparent; }
.cal-cell.is-today { outline: 2px solid var(--gold); }
.cal-cell.is-selected { background: var(--wine); color: #fff; }
.cal-cell.is-selected .cal-daynum { color: #fff; }
.cal-daynum { font-weight: 700; font-size: 0.92rem; }
.cal-count { font-size: 0.72rem; font-weight: 700; color: var(--gold); }
.cal-cell.is-selected .cal-count { color: var(--mark); }
@media (max-width: 640px) {
  .search-wrap { width: 100%; max-width: none; margin-left: 0; }
  .facts div { grid-template-columns: 1fr; }
  .cal-cell { min-height: 48px; padding: 4px; }
}
@media (min-width: 720px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
