:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #5f6368;
  --line: #e3e1da;
  --accent: #c2410c;
  --accent-soft: #fde8dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .05);
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --surface: #1e1e1e;
    --text: #ececec;
    --muted: #a0a0a0;
    --line: #333;
    --accent: #fb923c;
    --accent-soft: #3a2416;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.55; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* header */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; text-decoration: none; color: var(--text); letter-spacing: -.01em; }
.nav { order: 3; width: 100%; display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; font-size: .92rem; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: 2px 0; }
.nav a:hover { color: var(--text); }
.lang { margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 5px 12px; font-size: .85rem; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* hero */
.hero { padding: 40px 16px 28px; max-width: 1100px; margin: 0 auto; }
.hero h1 { font-size: clamp(1.8rem, 6vw, 3rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); max-width: 46em; font-size: 1.05rem; }
.hero .updated { margin-top: 10px; font-size: .82rem; }

/* sections */
.section { max-width: 1100px; margin: 0 auto; padding: 28px 16px; }
.section > h2 { font-size: 1.5rem; margin: 0 0 12px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }

/* filters */
.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-size: .9rem; cursor: pointer;
}
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row select, .row input {
  flex: 1 1 160px; min-width: 0; padding: 9px 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
}
.count { margin: 0; font-size: .85rem; color: var(--muted); }

/* map */
.map { height: 58vh; min-height: 320px; max-height: 560px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.leaflet-popup-content { margin: 10px 12px; }
.pop { display: grid; gap: 4px; font-family: var(--font); }
.pop img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }
.pop-meta, .pop-dates { color: #666; font-size: .8rem; }
.seoul-label { font-weight: 700; }

/* cards */
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
.card { display: flex; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card > img, .card > .noimg { width: 112px; flex: none; object-fit: cover; aspect-ratio: 1; height: 100%; min-height: 112px; }
.card .body { padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card h3 { font-size: 1rem; margin: 2px 0 0; line-height: 1.3; }
.tag { align-self: flex-start; font-size: .72rem; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 1px 8px; border-radius: 999px; }
.meta, .addr, .dates, .note { margin: 0; font-size: .82rem; color: var(--muted); }
.addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note { font-style: italic; }
.actions { display: flex; gap: 14px; margin-top: auto; padding-top: 4px; font-size: .86rem; }
.actions a { text-decoration: none; }
.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; }
.more { display: block; margin: 18px auto 0; padding: 10px 26px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }

/* festivals */
.festival-list { display: grid; gap: 12px; margin-top: 14px; }
.month { margin: 14px 0 0; font-size: 1rem; color: var(--accent); }
.fest { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.fest > img, .fest > .noimg { width: 104px; flex: none; object-fit: cover; background: var(--accent-soft); }
.fest .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fest h4 { margin: 0; font-size: 1rem; line-height: 1.3; }
.fest details { font-size: .86rem; }
.fest details p { margin: 6px 0 0; white-space: pre-line; color: var(--muted); }
.fest summary { cursor: pointer; color: var(--accent); }
.orig { margin: 0; font-size: .78rem; color: var(--muted); }
.ko-note { margin: 0; font-size: .85rem; }
.badge { align-self: flex-start; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }

/* gallery */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.photo { position: relative; border: 0; padding: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; background: var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo:hover img { transform: scale(1.04); }
.photo span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; color: #fff; font-size: .78rem; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); }
.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.lightbox img { max-height: 82vh; margin: 0 auto; border-radius: 8px; }
.lightbox .caption { color: #eee; text-align: center; font-size: .85rem; margin: 8px 0 0; }
.lightbox .close { position: fixed; top: 10px; right: 14px; font-size: 2rem; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }

/* access */
.tips { display: grid; gap: 10px; margin-bottom: 16px; }
.tip { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; }
.tip h3 { margin: 0 0 4px; font-size: .95rem; }
.tip p { margin: 0; font-size: .9rem; }
.access-list { display: grid; gap: 8px; }
.route { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; }
.route summary { cursor: pointer; padding: 12px 0; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.route summary::-webkit-details-marker { display: none; }
.rname { font-weight: 600; }
.rmeta { font-size: .82rem; color: var(--muted); }
.route p { margin: 0 0 14px; font-size: .92rem; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 24px 16px 40px; text-align: center; font-size: .88rem; }
.footer p { margin: 4px 0; }

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .tips { grid-template-columns: repeat(3, 1fr); }
  .card > img, .card > .noimg { width: 130px; }
  .fest > img, .fest > .noimg { width: 150px; }
}
@media (min-width: 900px) {
  .nav { order: 0; width: auto; margin-left: 24px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .card { flex-direction: column; }
  .card > img, .card > .noimg { width: 100%; aspect-ratio: 16 / 10; height: auto; min-height: 0; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .access-list { grid-template-columns: repeat(2, 1fr); align-items: start; }
}
