/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  --red:       #C0392B;
  --red-dark:  #922B21;
  --red-pale:  #FDEDEC;
  --navy:      #002147;
  --navy-mid:  #0a3060;
  --sky:       #0a6fbf;
  --light:     #dce8f5;
  --card:      #f0f6ff;
  --white:     #ffffff;
  --cream:     #FAF6F0;
  --ink:       #1a2540;
  --muted:     #4a6080;
  --border:    #b8ccdf;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.10);
  --shadow-md: 0 4px 16px rgba(0,33,71,.14);
  --r:         10px;
  --header-h:  64px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--light);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Accessibility ────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: static; width: auto; height: auto;
  padding: .5em 1em; background: var(--red); color: #fff; z-index: 9999;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-inner {
  max-width: 1280px;
  margin: auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
}
.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}
.logo-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.logo-text strong { display: block; font-size: 1.05rem; letter-spacing: .3px; }
.logo-text span   { font-size: .7rem; opacity: .75; text-transform: uppercase; letter-spacing: .3px; }

nav { margin-left: auto; display: flex; gap: .25rem; align-items: center; }
nav a {
  padding: .45rem .85rem;
  border-radius: 6px;
  color: rgba(255,255,255,.85);
  font-size: .88rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
nav a:hover, nav a.active {
  background: var(--red);
  color: #fff;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,.5);
  color: #fff;
  padding: .3rem .55rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #0e1f40 100%);
  color: #fff;
  padding: 3.5rem 1.25rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: .6rem;
  color: #fff;
}
.hero h1 span { color: var(--red); }
.hero p {
  font-size: clamp(.95rem, 2vw, 1.1rem);
  opacity: .82;
  max-width: 640px;
  margin: 0 auto 1.5rem;
}
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
}

/* ── Stats bar ────────────────────────────────────────────────────────────── */
.stats-bar { background: var(--red); color: #fff; padding: .6rem 1.25rem; }
.stats-inner {
  max-width: 1280px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: center;
  font-size: .88rem;
  font-weight: 600;
}
.stats-inner span em { font-style: normal; opacity: .8; font-weight: 400; margin-right: .35rem; }

/* ── Page layout ──────────────────────────────────────────────────────────── */
.page {
  max-width: 1280px;
  margin: auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
.page.full { grid-template-columns: 1fr; }
main-content { min-width: 0; }
.sidebar { position: sticky; top: calc(var(--header-h) + 1rem); }

/* ── Section card ─────────────────────────────────────────────────────────── */
.section-card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.section-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1.25rem;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  cursor: pointer;
  user-select: none;
  transition: filter .2s;
}
.section-header:hover { filter: brightness(1.08); }
.section-header h2 {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
}
.section-count {
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 20px;
  padding: .1rem .55rem;
  font-size: .72rem;
  font-weight: 700;
}
.chevron {
  width: 20px; height: 20px;
  transition: transform .25s;
  flex-shrink: 0;
  opacity: .85;
}
.section-card.collapsed .chevron { transform: rotate(-90deg); }
.section-body { padding: 1rem 1.25rem; }
.section-card.collapsed .section-body { display: none; }

/* ── Summary box ──────────────────────────────────────────────────────────── */
.summary-box {
  background: var(--navy);
  border-left: 4px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: .85rem 1.1rem;
  margin-bottom: 1rem;
  font-size: .88rem;
  color: #fff;
  line-height: 1.75;
}
.summary-box strong { color: #fff; }
.summary-box em { color: rgba(255,255,255,.6); font-size: .78rem; }
.summary-past {
  background: rgba(0,33,71,.6);
  border-color: #4a7ab5;
  margin-top: .6rem;
  opacity: .9;
}

/* ── Chip filters ─────────────────────────────────────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }
.chip {
  padding: .2rem .65rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}
.chip.active, .chip:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── Pill strip ───────────────────────────────────────────────────────────── */
.pill-strip { display: flex; flex-wrap: wrap; gap: .5rem; padding: .4rem 0 .75rem; }
.event-pill {
  flex: 0 0 auto;
  min-width: 150px;
  max-width: 200px;
  padding: .6rem .85rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
  box-shadow: var(--shadow-sm);
}
.event-pill:hover { border-color: var(--red); box-shadow: 0 2px 8px rgba(192,57,43,.15); }
.event-pill.active {
  border-color: var(--red);
  background: var(--red-pale);
  box-shadow: 0 0 0 2px var(--red);
}
.pill-date     { font-size: .68rem; color: var(--muted); margin-bottom: .15rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pill-location { font-weight: 700; font-size: .82rem; color: var(--red); }
.pill-time     { font-size: .7rem; color: var(--muted); margin-top: .15rem; }

/* ── Detail panel ─────────────────────────────────────────────────────────── */
.detail-panel {
  margin-top: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.detail-hero {
  background: var(--navy);
  color: #fff;
  padding: .85rem 1rem;
}
.detail-hero-loc  { font-weight: 700; font-size: 1rem; margin-bottom: .2rem; }
.detail-hero-time { color: rgba(255,255,255,.75); font-size: .8rem; }

/* ── Map ──────────────────────────────────────────────────────────────────── */
.map-container { height: 500px; width: 100%; }
.today-map     { height: 460px; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--border); }
@media(max-width:600px) { .map-container { height: 320px; } .today-map { height: 280px; } }

/* ── Leaflet popup ────────────────────────────────────────────────────────── */
.ra-popup .leaflet-popup-content-wrapper {
  padding: 0; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--red); box-shadow: 0 4px 20px rgba(0,33,71,.35);
  min-width: 240px; max-width: 300px;
}
.ra-popup .leaflet-popup-content { margin: 0; width: 100% !important; }
.ra-popup .leaflet-popup-tip { background: var(--red); }
.ra-popup .leaflet-popup-close-button { color: #fff !important; top: 6px !important; right: 8px !important; font-size: 18px !important; }
.ra-pu { font-family: "Segoe UI", system-ui, sans-serif; }
.ra-pu-head { background: var(--navy); color: #fff; padding: 10px 30px 10px 12px; }
.ra-pu-loc  { font-size: .95rem; font-weight: 700; margin-bottom: 3px; }
.ra-pu-time { font-size: .82rem; color: #ffd6d9; }
.ra-pu-body { background: #f0f6ff; padding: 8px 12px 10px; }
.ra-pu-row  { display: flex; gap: 6px; font-size: .85rem; color: var(--ink); line-height: 1.8; }
.ra-pu-label { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; min-width: 52px; flex-shrink: 0; }
.ra-pu-divider { height: 1px; background: var(--border); margin: 5px 0; }
.ra-map-label {
  background: var(--red);
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  border: 2px solid #fff;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  display: inline-block;
}

/* ── Reset-view button ────────────────────────────────────────────────────── */
.leaflet-control-reset a {
  display: block; width: 30px; height: 30px; line-height: 30px;
  text-align: center; font-size: 15px; font-weight: bold; color: #333;
  background: #fff; text-decoration: none; border-radius: 4px;
}
.leaflet-control-reset a:hover { background: #f0f0f0; }

/* ── Today entry ──────────────────────────────────────────────────────────── */
.today-entry {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: .7rem 1rem;
  margin-bottom: .5rem;
  font-size: .88rem;
}
.today-entry-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: .1rem; }
.today-entry-loc  { font-weight: 700; color: var(--ink); }
.today-entry-time { color: var(--muted); font-size: .78rem; margin-top: .2rem; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: .9rem;
}

/* ── Sidebar card ─────────────────────────────────────────────────────────── */
.sidebar-card {
  background: var(--card);
  border-radius: var(--r);
  border: 2px solid var(--red);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.sidebar-card-head {
  background: var(--navy);
  color: #fff;
  padding: .7rem 1rem;
  font-weight: 700;
  font-size: .92rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sidebar-card-head .dot { width: 9px; height: 9px; background: var(--red); border-radius: 50%; flex-shrink: 0; }
.sidebar-list { padding: .5rem 0; list-style: none; }
.sidebar-list li { padding: .45rem 1rem; border-bottom: 1px solid var(--border); font-size: .84rem; line-height: 1.5; }
.sidebar-list li:last-child { border: 0; }
.sidebar-list li strong { color: var(--red); display: block; }

/* ── Info box ─────────────────────────────────────────────────────────────── */
.info-box {
  margin: 1rem 0;
  padding: .9rem 1rem;
  background: var(--cream);
  border-left: 3px solid var(--red);
  border-radius: 0 6px 6px 0;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
}
.info-box p + p { margin-top: .5rem; }

/* ── Warning box ──────────────────────────────────────────────────────────── */
.warning-box {
  margin: 1rem 0;
  padding: .7rem 1rem;
  background: #FFF3CD;
  border-left: 3px solid #F0AD00;
  border-radius: 0 6px 6px 0;
  font-size: .82rem;
  color: #856404;
  font-weight: 600;
}

/* ── Homepage feature cards ───────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem 1.25rem;
  max-width: 1280px;
  margin: auto;
}
.feature-card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,33,71,.18); text-decoration: none; }
.feature-card-img { height: 200px; overflow: hidden; }
.feature-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.feature-card:hover .feature-card-img img { transform: scale(1.04); }
.feature-card-body { padding: 1.25rem; flex: 1; }
.feature-card-body h3 { font-size: 1.15rem; font-weight: 700; color: var(--navy); margin-bottom: .4rem; }
.feature-card-body p  { font-size: .88rem; color: var(--muted); line-height: 1.6; }
.feature-card-cta {
  display: inline-block;
  margin-top: .85rem;
  background: var(--red);
  color: #fff;
  padding: .45rem 1rem;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  padding: 2rem 1.25rem;
  margin-top: 2rem;
}
.footer-inner { max-width: 1280px; margin: auto; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.footer-links a { color: rgba(255,255,255,.8); font-size: .88rem; }
.footer-links a:hover { color: #fff; }
.footer-legal { font-size: .78rem; max-width: 680px; margin: 0 auto .75rem; line-height: 1.6; }
.footer-copy  { font-size: .75rem; opacity: .55; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media(max-width: 900px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .logo-text span { display: none; }
}
@media(max-width: 640px) {
  nav { display: none; flex-direction: column; width: 100%; position: absolute; top: var(--header-h); left: 0; background: var(--navy); padding: .5rem; z-index: 999; }
  nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: 2rem .75rem 1.75rem; }
  .page { padding: 1rem .75rem 2rem; }
}