:root {
  color-scheme: light;
  --ink: #17231d;
  --muted: #5f6963;
  --paper: #fffaf0;
  --surface: #ffffff;
  --brand: #145c42;
  --brand-soft: #dceee5;
  --accent: #f2a63b;
  --line: #dfe5e1;
  --shadow: 0 12px 32px rgba(24, 46, 35, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #326ddb; outline-offset: 3px; }

.visually-hidden {
  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: 1rem; top: -5rem; z-index: 50; background: var(--ink); color: white; padding: .7rem 1rem; border-radius: .7rem; }
.skip-link:focus { top: 1rem; }

.site-header { max-width: 76rem; margin: 0 auto; padding: 1rem 1.15rem; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-size: 1.05rem; }
.brand-mark { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50% 50% 45% 55%; background: var(--brand); color: white; font-weight: 800; }
.demo-pill, .card-demo { display: inline-flex; align-items: center; border-radius: 999px; background: #fff0c8; color: #6c4800; font-weight: 800; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
.demo-pill { padding: .35rem .65rem; }

.hero, .discover, .coming { max-width: 76rem; margin: 0 auto; padding: 2.5rem 1.15rem; }
.hero { padding-top: 3.2rem; }
.eyebrow { margin: 0 0 .4rem; color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.08; }
h1 { margin: 0; max-width: 12ch; font-size: clamp(2.65rem, 11vw, 5.7rem); letter-spacing: -.055em; }
h2 { margin: 0; font-size: clamp(1.8rem, 7vw, 2.9rem); letter-spacing: -.035em; }
.hero-copy, .about-copy { max-width: 42rem; color: var(--muted); font-size: 1.05rem; margin: 1rem 0 1.7rem; }

.search { max-width: 42rem; background: var(--surface); padding: .9rem; border: 1px solid var(--line); border-radius: 1.2rem; box-shadow: var(--shadow); }
.search label { display: block; margin: 0 .15rem .5rem; font-size: .85rem; font-weight: 700; }
.search-row { display: flex; gap: .55rem; }
.search input { min-width: 0; flex: 1; border: 1px solid #bfc9c3; border-radius: .8rem; padding: .8rem .9rem; color: var(--ink); background: white; }
.search button { min-height: 44px; border: 0; border-radius: .8rem; padding: .8rem 1rem; background: var(--brand); color: white; font-weight: 800; }
.notice { max-width: 42rem; margin-top: .85rem; padding: .8rem 1rem; border-left: 4px solid var(--accent); background: #fff4d9; border-radius: .25rem .8rem .8rem .25rem; font-size: .9rem; }

.discover { padding-top: 2rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
#result-count { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.discovery-tools { margin: 1.1rem 0; display: grid; gap: .75rem; }
.filters { display: flex; gap: .5rem; overflow-x: auto; padding: .15rem 0 .35rem; scrollbar-width: thin; }
.filter, .location-button, .map-reset, .card-map-focus { min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: .55rem .85rem; color: var(--ink); font-weight: 700; }
.filter { flex: none; }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: white; }
.location-control { display: grid; gap: .35rem; align-items: start; }
.location-button { justify-self: start; border-color: #adc8ba; background: var(--brand-soft); }
.location-status { margin: 0; max-width: 44rem; color: var(--muted); font-size: .82rem; }

.discovery-layout { display: grid; gap: 1rem; align-items: start; }
.map-panel, .list-panel { min-width: 0; }
.map-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .55rem; }
.map-heading h3 { margin: 0; font-size: 1.05rem; }
.map-reset { min-height: 44px; padding: .35rem .7rem; font-size: .82rem; }
.map {
  position: relative;
  isolation: isolate;
  height: clamp(20rem, 62vh, 28rem);
  overflow: hidden;
  border: 1px solid #bdc9c2;
  border-radius: 1.2rem;
  background-color: #dce6df;
  background-image: linear-gradient(rgba(20,92,66,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(20,92,66,.08) 1px, transparent 1px);
  background-size: 32px 32px;
  box-shadow: 0 5px 18px rgba(24, 46, 35, .05);
}
.map-tiles, .map-markers { position: absolute; inset: 0; }
.map-tiles { z-index: 0; overflow: hidden; }
.map-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.map-markers { z-index: 2; pointer-events: none; }
.map-marker {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -100%);
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}
.map-marker > span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 3px solid white;
  border-radius: 50% 50% 50% 0;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.map-marker > span::after { content: ''; position: absolute; width: 6px; height: 6px; left: 6px; top: 6px; border-radius: 50%; background: white; }
.map-marker.is-selected { z-index: 3; }
.map-marker.is-selected > span { background: #b74d23; transform: translate(-50%, -50%) rotate(45deg) scale(1.22); }
.map-marker:focus-visible > span { outline: 3px solid #326ddb; outline-offset: 4px; }
.map-empty { position: absolute; z-index: 3; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(20rem, calc(100% - 2rem)); margin: 0; padding: .8rem 1rem; border-radius: .8rem; background: rgba(255,255,255,.94); text-align: center; }
.map-attribution { position: absolute; z-index: 4; right: .35rem; bottom: .35rem; margin: 0; padding: .18rem .35rem; border-radius: .3rem; background: rgba(255,255,255,.92); font-size: .65rem; }
.map-attribution a { color: #233d32; }
.map-help { margin: .45rem 0 0; color: var(--muted); font-size: .78rem; }

.cards { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.event-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 1.2rem; background: var(--surface); box-shadow: 0 5px 18px rgba(24, 46, 35, .05); }
.event-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft), 0 8px 22px rgba(24,46,35,.1); }
.image-wrap { position: relative; aspect-ratio: 8 / 5; background: var(--brand-soft); overflow: hidden; }
.event-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-demo { position: absolute; right: .7rem; top: .7rem; padding: .3rem .55rem; }
.event-body { padding: 1rem; }
.event-date { margin: 0 0 .35rem; color: var(--brand); font-size: .82rem; font-weight: 800; }
.event-title { margin: 0; font-size: 1.25rem; }
.event-description { color: var(--muted); margin: .55rem 0 .8rem; }
.event-place { margin: 0; font-weight: 700; }
.event-distance { margin: .4rem 0 0; color: var(--brand); font-size: .85rem; font-weight: 800; }
.card-map-focus { margin-top: .85rem; border-color: var(--brand); color: var(--brand); background: white; }
.empty { padding: 1rem 0; color: var(--muted); }

.coming { padding-bottom: 7rem; }
.bottom-nav { position: fixed; z-index: 10; left: .75rem; right: .75rem; bottom: .75rem; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 31rem; margin: 0 auto; padding: .45rem; border: 1px solid var(--line); border-radius: 1.2rem; background: rgba(255,255,255,.96); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.bottom-nav a { display: grid; gap: .1rem; place-items: center; min-height: 3.2rem; border-radius: .85rem; text-decoration: none; font-size: .75rem; font-weight: 700; }
.bottom-nav a:hover { background: var(--brand-soft); }
.bottom-nav span { font-size: 1.2rem; line-height: 1; }

@media (min-width: 44rem) {
  .site-header, .hero, .discover, .coming { padding-left: 2rem; padding-right: 2rem; }
  .discovery-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .location-control { justify-items: end; text-align: right; }
  .location-button { justify-self: end; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 68rem) {
  .discovery-layout { grid-template-columns: minmax(0, 1.05fr) minmax(22rem, .95fr); gap: 1.25rem; }
  .map-panel { position: sticky; top: 1rem; }
  .cards { grid-template-columns: 1fr; }
  .bottom-nav { position: static; margin-bottom: 2rem; }
  .coming { padding-bottom: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
