:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #1f1a17;
  --muted: #6f655d;
  --line: #e8e0d6;
  --accent: #d9480f;
  --accent-soft: #fff0e6;
  --now: #2b8a3e;
  --now-soft: #e6f6ea;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 18px rgba(0, 0, 0, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171412;
    --surface: #221e1b;
    --text: #f2ece6;
    --muted: #a99d93;
    --line: #3a332e;
    --accent: #ff8a4c;
    --accent-soft: #3a2519;
    --now: #69db7c;
    --now-soft: #1d3322;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.5;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.hero {
  background: linear-gradient(135deg, #ff6b35 0%, #f7b267 55%, #ffd166 100%);
  color: #2b1608;
  padding: 48px 0 40px;
}
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; opacity: .75; }
.hero h1 { margin: 4px 0 6px; font-size: clamp(28px, 5vw, 40px); letter-spacing: -.02em; }
.lead { margin: 0; font-size: 16px; }

.controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: -24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.months { display: flex; gap: 8px; overflow-x: auto; }
.months button, .regions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.months button[aria-selected="true"], .regions button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.regions { display: flex; flex-wrap: wrap; gap: 6px; }
.regions button { padding: 4px 11px; font-size: 13px; }
.regions button .n { opacity: .6; margin-left: 3px; font-size: 12px; }
.row { display: flex; gap: 8px; }
.row input, .row select {
  font: inherit;
  font-size: 15px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.row input { flex: 1; min-width: 0; }

.notice {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
}
.summary { color: var(--muted); font-size: 14px; margin: 20px 0 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  padding-bottom: 32px;
}
.card {
  all: unset;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 44px;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
}
.badge.now { background: var(--now-soft); color: var(--now); }
.card .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.card .date { font-size: 13px; color: var(--accent); font-weight: 600; }
.card .addr { font-size: 13px; color: var(--muted); }

.empty, .loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 0; }

dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog article { position: relative; }
.close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
.detail-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--accent-soft); }
.detail-ph { aspect-ratio: 16 / 7; display: grid; place-items: center; font-size: 64px; background: var(--accent-soft); }
.detail-content { padding: 18px 20px 22px; }
.detail-content h2 { margin: 0 0 4px; font-size: 22px; }
.detail-content dl { display: grid; grid-template-columns: 72px 1fr; gap: 6px 12px; margin: 16px 0; font-size: 14px; }
.detail-content dt { color: var(--muted); }
.detail-content dd { margin: 0; }
.overview { font-size: 15px; white-space: pre-line; }
.sub { font-size: 15px; margin: 20px 0 4px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.links a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.links a.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.foot { color: var(--muted); font-size: 12px; padding-bottom: 32px; }

@media (max-width: 560px) {
  .hero { padding: 36px 0 36px; }
  .row { flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
}
