/* ============================================================
   Chicago Local Events — site.css
   Direction: "The Friendly Guide"
   Mobile-first · CSS custom-property tokens · automatic dark mode
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* color */
  --bg:          #faf5ec;
  --surface:     #fffefb;
  --surface-2:   #f6efe2;   /* breadcrumb / subtle fills */
  --ink:         #241f18;
  --ink-2:       #3a342b;   /* body text */
  --muted:       #766b5d;
  --faint:       #a89b88;   /* eyebrows, placeholders */
  --border:      #eee2d1;
  --teal:        #12514e;
  --teal-2:      #0f4442;
  --red:         #c0392b;
  --on-dark:     #faf5ec;

  /* category chip fills */
  --chip-teal-bg:  #e3edeb;  --chip-teal-ink:  #12514e;
  --chip-red-bg:   #f6e4e1;  --chip-red-ink:   #c0392b;
  --chip-amber-bg: #f3e9d7;  --chip-amber-ink: #8a5a1c;

  /* placeholder stripes (until real imagery ships) */
  --ph-a: #eee2d1;
  --ph-b: #f4ebdc;

  /* geometry */
  --r-card: 20px;
  --r-tile: 16px;
  --r-pill: 999px;
  --maxw:   1160px;
  --shadow-card: 0 8px 24px rgba(36, 31, 24, 0.08);

  /* type */
  --font-head: "Outfit", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #17120b;
    --surface:   #221a10;
    --surface-2: #1e160d;
    --ink:       #f5efe3;
    --ink-2:     #e5dccb;
    --muted:     #b0a390;
    --faint:     #8a8071;
    --border:    #342a1c;
    --teal:      #4fb8a6;
    --teal-2:    #3f9c8d;
    --red:       #f5836f;
    --on-dark:   #faf5ec;

    --chip-teal-bg:  #17302c;  --chip-teal-ink:  #7fd6c7;
    --chip-red-bg:   #3a1f1a;  --chip-red-ink:   #f5a394;
    --chip-amber-bg: #33280f;  --chip-amber-ink: #dcb06a;

    --ph-a: #2a2013;
    --ph-b: #31261a;

    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.12; margin: 0; }
svg { flex: none; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.main { padding: 24px 0 48px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-tile {
  width: 40px; height: 40px; border-radius: 13px; background: var(--teal);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.logo-tile svg polygon { fill: var(--red); }
.brand-name { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--ink); }
.brand-name .accent { color: var(--red); }

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  font-weight: 600; font-size: 14px; color: var(--ink-2);
  text-decoration: none; white-space: nowrap;
}
.nav-links a:hover { color: var(--teal); }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 6px 6px 6px 15px;
}
.search input {
  border: 0; background: transparent; font-family: var(--font-body);
  font-size: 13px; color: var(--ink); width: 150px; outline: none;
}
.search input::placeholder { color: var(--faint); }
.search button {
  width: 30px; height: 30px; border: 0; border-radius: var(--r-pill);
  background: var(--teal); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.nav-toggle {
  display: none; width: 40px; height: 40px; border: 0; background: transparent;
  cursor: pointer; flex-direction: column; gap: 4px; align-items: center; justify-content: center;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

/* mobile nav */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px;
  }
  .nav-menu[data-open="true"] { display: flex; }
  .nav-menu .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-menu .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-menu .search { margin-top: 12px; }
  .nav-menu .search input { width: 100%; flex: 1; }
}
@media (min-width: 861px) {
  .nav-menu { display: flex !important; align-items: center; gap: 24px; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--faint);
}
.breadcrumb .container { padding-top: 12px; padding-bottom: 12px; }
.breadcrumb a { text-decoration: none; color: var(--faint); }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb .sep { color: var(--border); margin: 0 4px; }
.breadcrumb .current { color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-body); font-size: 15px; font-weight: 700;
  padding: 13px 24px; border-radius: var(--r-pill); border: 1.5px solid transparent;
  text-decoration: none; transition: transform .05s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline { background: transparent; border-color: var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--chip-teal-bg); }
.btn-light { background: var(--on-dark); color: var(--teal); }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; font-family: var(--font-body);
  font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: var(--r-pill);
  background: var(--chip-teal-bg); color: var(--chip-teal-ink); text-decoration: none;
}
.chip.cat-food, .chip.cat-seasonal-holiday { background: var(--chip-red-bg); color: var(--chip-red-ink); }
.chip.cat-education, .chip.cat-kids-family { background: var(--chip-amber-bg); color: var(--chip-amber-ink); }

.filter-chip {
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 600;
  padding: 8px 15px; border-radius: var(--r-pill); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
}
.filter-chip.is-active { background: var(--teal); color: var(--on-dark); border-color: var(--teal); }

.badge-date {
  font-family: var(--font-body); font-size: 12px; font-weight: 700; color: #fff;
  background: var(--red); padding: 6px 12px; border-radius: var(--r-pill);
}
.badge-price {
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  background: var(--surface); padding: 5px 11px; border-radius: var(--r-pill); color: var(--ink);
}
.badge-price.is-free { color: var(--teal); }

/* ---------- Event card ---------- */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid.grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--surface); border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow-card); text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); transition: transform .15s ease; }
.card-media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--ph-a) 0 9px, var(--ph-b) 9px 18px);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .badge-date { position: absolute; top: 12px; left: 12px; }
.card-media .badge-price { position: absolute; top: 12px; right: 12px; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.card-meta { font-size: 12.5px; color: var(--muted); }

/* ---------- Stats + section head ---------- */
.stats {
  font-family: var(--font-head); font-size: clamp(20px, 3vw, 24px);
  font-weight: 700; color: var(--ink);
}
.stats .count { color: var(--red); }
.section-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; gap: 20px; grid-template-columns: 1fr; margin-bottom: 28px;
}
@media (min-width: 900px) { .hero { grid-template-columns: 1.55fr 1fr; } }
.hero-feature {
  position: relative; border-radius: var(--r-card); overflow: hidden;
  min-height: 300px; display: flex; align-items: flex-end;
  background: repeating-linear-gradient(135deg, var(--teal-2) 0 11px, var(--teal) 11px 22px);
}
.hero-feature .eyebrow-pill {
  position: absolute; top: 16px; left: 16px; color: var(--on-dark);
  background: var(--red); padding: 6px 13px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
}
.hero-feature .overlay {
  width: 100%; padding: 26px; color: var(--on-dark);
  background: linear-gradient(to top, rgba(18,38,36,.92), rgba(18,38,36,0));
}
.hero-feature h2 { color: #fff; font-size: clamp(24px, 4vw, 32px); }
.hero-side { display: flex; flex-direction: column; gap: 20px; }
.hero-mini { display: flex; background: var(--surface); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-card); flex: 1; text-decoration: none; color: inherit; }
.hero-mini .thumb { width: 110px; flex: none; background: repeating-linear-gradient(135deg, var(--ph-a) 0 9px, var(--ph-b) 9px 18px); }
.hero-mini .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Ad slots (reserve space to avoid CLS) ---------- */
.ad {
  border: 1.5px dashed var(--border); border-radius: 14px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--faint);
}
.ad-leaderboard { min-height: 90px; margin-bottom: 28px; }
.ad-sidebar { min-height: 250px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 6px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; text-decoration: none; color: var(--ink); border: 1px solid var(--border);
}
.pagination .is-current { background: var(--teal); color: var(--on-dark); border-color: var(--teal); font-weight: 600; }
.pagination .gap { border: 0; color: var(--faint); }

/* ---------- Event detail ---------- */
.detail { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .detail { grid-template-columns: 1fr 330px; } }
.event-hero {
  aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden; margin-bottom: 22px;
  background: repeating-linear-gradient(135deg, var(--ph-a) 0 11px, var(--ph-b) 11px 22px);
}
.event-hero img { width: 100%; height: 100%; object-fit: cover; }
.event-title { font-size: clamp(26px, 5vw, 38px); margin: 14px 0 20px; }
.meta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.meta-block {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-tile); padding: 12px 16px;
}
.date-tile {
  width: 52px; height: 52px; flex: none; border-radius: 12px; background: var(--red); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.date-tile .m { font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.date-tile .d { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.meta-icon { width: 52px; height: 52px; flex: none; border-radius: 12px; background: var(--chip-teal-bg); color: var(--chip-teal-ink); display: flex; align-items: center; justify-content: center; }
.meta-label { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--ink); }
.meta-sub { font-size: 13px; color: var(--muted); }
.price-block { background: var(--chip-teal-bg); border-color: transparent; padding: 12px 20px; }
.price-block .amount { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--teal); }
.prose p { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin: 0 0 14px; }
.source { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 24px; font-size: 13px; color: var(--faint); }
.source strong { color: var(--ink-2); font-weight: 600; }

.related { display: flex; flex-direction: column; gap: 12px; }
.related-item { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.related-item .thumb { width: 56px; height: 56px; flex: none; border-radius: 12px; background: repeating-linear-gradient(135deg, var(--ph-a) 0 8px, var(--ph-b) 8px 16px); }
.related-item .rt { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.related-item .rm { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sidebar-head { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }

/* ---------- Venue map ---------- */
.map-ph {
  aspect-ratio: 4 / 3; border-radius: var(--r-card); position: relative;
  background: repeating-linear-gradient(135deg, #dfe7e0 0 12px, #e8efe6 12px 24px);
  display: flex; align-items: center; justify-content: center;
}
.map-ph .pin { position: absolute; width: 26px; height: 26px; border-radius: 999px 999px 999px 0; background: var(--red); transform: rotate(45deg); box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.venue-addr { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); margin-bottom: 26px; }

/* ---------- Month archive ---------- */
.day-group { margin-bottom: 22px; }
.day-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px;
  border-bottom: 2px solid var(--border); padding-bottom: 8px;
}
.day-head .d { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--red); }
.day-head .n { font-size: 13px; color: var(--faint); }
.event-row {
  display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px;
}
.event-row + .event-row { margin-top: 8px; }
.event-row .t { font-family: var(--font-mono); font-size: 12px; color: var(--muted); width: 90px; flex: none; }
.event-row .name { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--ink); flex: 1; }
.event-row .venue { font-size: 13px; color: var(--muted); }
.event-row .price { font-size: 11px; font-weight: 700; color: var(--teal); width: 44px; text-align: right; }
@media (max-width: 640px) { .event-row .venue { display: none; } }

/* ---------- Page header (archive/category/venue) ---------- */
.page-head { margin-bottom: 26px; }
.page-title { font-size: clamp(28px, 5vw, 36px); margin: 12px 0 8px; }
.page-lede { font-size: 16px; color: var(--muted); max-width: 640px; }
.page-lede .count { color: var(--red); font-weight: 600; }

/* ---------- Category index ---------- */
.category-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin: 28px 0 48px;
}
.category-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-tile);
  padding: 18px 20px; text-decoration: none; display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .15s, transform .15s;
}
.category-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }
.category-card .chip { align-self: flex-start; }
.category-count { font-family: var(--font-head); font-size: 24px; font-weight: 600; color: var(--ink); }
.category-venues { font-size: 13px; color: var(--muted); }

/* ---------- Venue index ---------- */
.venue-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin: 28px 0 48px;
}
.venue-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-tile);
  padding: 16px 18px; text-decoration: none; display: flex; align-items: center; gap: 14px;
  transition: box-shadow .15s, transform .15s;
}
.venue-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }
.venue-card-icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--muted);
}
.venue-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.venue-card-name { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--ink); }
.venue-card-addr { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.venue-card-count { font-size: 12px; color: var(--teal); font-weight: 500; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 48px 24px;
}
.empty-state .star {
  width: 64px; height: 64px; border-radius: 20px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.empty-state p { color: var(--muted); margin-bottom: 22px; }

/* ---------- 404 ---------- */
.notfound {
  background: var(--teal); border-radius: var(--r-card); text-align: center;
  padding: 64px 24px; color: var(--on-dark); margin: 24px 0;
}
.notfound .star { width: 72px; height: 72px; border-radius: 22px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.notfound h1 { color: #fff; font-size: clamp(28px, 6vw, 38px); margin-bottom: 12px; }
.notfound p { color: #a9cfc9; max-width: 440px; margin: 0 auto 28px; }
.notfound .search { max-width: 400px; margin: 0 auto 22px; background: var(--surface); }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal); color: #cfe3df; padding: 36px 0 26px; margin-top: 48px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-col h3 { color: #fff; font-size: 13px; margin-bottom: 6px; }
.footer-col a { display: block; text-decoration: none; color: #cfe3df; font-size: 13px; line-height: 2; }
.footer-col a:hover { color: #fff; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand .logo-tile { background: rgba(255,255,255,.12); }
.footer-brand .logo-tile svg polygon { fill: var(--red); }
.footer-brand .name { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--on-dark); }
.footer-about { font-size: 13px; line-height: 1.6; color: #a9cfc9; max-width: 280px; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; margin-top: 28px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: #8fbdb6;
}
