/* Metroplex Live — one stylesheet, no framework. Mobile first. */

:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --border: rgba(22, 24, 29, 0.12);
  --text: #16181d;
  --muted: #5a6170;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --link: #b23a09;
  --focus: #2563eb;
  --ok: #15803d;
  --danger: #b91c1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.05);
  --radius: 14px;
  --tap: 44px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --surface: #151a22;
    --surface-2: #1d2430;
    --border: rgba(255, 255, 255, 0.1);
    --text: #e9edf2;
    --muted: #9ba5b4;
    --accent: #ff8a3d;
    --accent-ink: #1b0e04;
    --link: #ffb07a;
    --focus: #7cb2ff;
    --ok: #4ade80;
    --danger: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #151a22;
  --surface-2: #1d2430;
  --border: rgba(255, 255, 255, 0.1);
  --text: #e9edf2;
  --muted: #9ba5b4;
  --accent: #ff8a3d;
  --accent-ink: #1b0e04;
  --link: #ffb07a;
  --focus: #7cb2ff;
  --ok: #4ade80;
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 0; } }

img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.2rem, 2.6vw, 1.5rem); font-weight: 750; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 24px; } }

.skip-link { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip-link:focus { top: 8px; }

.demo-banner { background: #fde68a; color: #422006; text-align: center; padding: 8px 16px; font-size: 0.9rem; }
.notice { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; font-size: 0.95rem; }
.notice-past { border-left: 4px solid var(--accent); margin-bottom: 16px; }

/* ---------- Header & navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.1rem; margin-right: auto; min-height: var(--tap); }
.main-nav { display: none; gap: 4px; }
.main-nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 10px 12px; border-radius: 10px; min-height: var(--tap); display: inline-flex; align-items: center; }
.main-nav a:hover { background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--accent); background: var(--surface-2); }
@media (min-width: 900px) { .main-nav { display: flex; } }

.tabbar { position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; color: var(--muted); text-decoration: none; font-size: 0.75rem; font-weight: 600; }
.tabbar a[aria-current="page"] { color: var(--accent); }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ---------- Buttons, chips, tags ---------- */
.icon { flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 0.95rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 1.05rem; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--tap); min-height: var(--tap); border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; font-weight: 700; }
.btn-icon.with-label { padding: 0 16px; }
.save[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.save[aria-pressed="true"] svg { fill: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 699px) {
  /* One swipeable row on phones so the first shows land above the fold. */
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 650; font-size: 0.95rem; }
.chip:hover { border-color: var(--accent); }
.chip .icon { color: var(--accent); width: 18px; height: 18px; }
.chip-count { background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-size: 0.8rem; color: var(--muted); }

.tag-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; }
.tag span { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.tag:hover { border-color: var(--accent); }
.tag-list-lg .tag { min-height: 52px; font-size: 1.05rem; }

/* ---------- Page sections ---------- */
main { padding-top: 16px; padding-bottom: 48px; }
.hero { padding: 20px 0 8px; }
.hero h1 { max-width: 18ch; }
.lede { font-size: 1.05rem; color: var(--muted); max-width: 65ch; }
.hero-search { display: flex; gap: 8px; margin: 16px 0; max-width: 640px; }
.hero-search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.hero-search .btn span { display: none; }
@media (min-width: 500px) { .hero-search .btn span { display: inline; } }

.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head a { font-weight: 650; display: inline-flex; align-items: center; min-height: var(--tap); }
.page-header { margin: 8px 0 20px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 4px 0 12px; font-size: 0.9rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; }
.breadcrumbs a { color: var(--muted); }

.day-group { margin-top: 28px; }
.day-heading { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.day-heading a { color: var(--text); text-decoration: none; }
.day-heading a:hover { text-decoration: underline; }
.count { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.day-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }

.day-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.day-strip a { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.day-strip a:hover { border-color: var(--accent); }
.ds-dow { font-size: 0.8rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.ds-date { font-weight: 700; }
.ds-count { font-size: 0.85rem; color: var(--muted); }

.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.area-card { display: block; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.area-card:hover { border-color: var(--accent); }
.area-card h2, .area-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.area-card p { margin: 0 0 4px; color: var(--muted); font-size: 0.92rem; }

.venue-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.venue-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-height: var(--tap); border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.venue-list a:hover { border-color: var(--accent); }
.venue-list .muted { font-size: 0.88rem; }

.empty { padding: 28px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.list-empty { color: var(--muted); padding: 12px 0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 28px; }

/* ---------- Filters ---------- */
.filters { display: none; flex-wrap: wrap; align-items: end; gap: 10px; padding: 12px; margin-bottom: 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.js .filters { display: flex; }
.filter { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 700; color: var(--muted); flex: 1 1 140px; }
.filter select { min-height: var(--tap); padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; }
.filter-status { flex-basis: 100%; margin: 0; font-size: 0.9rem; color: var(--muted); }

/* ---------- Event cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.card:focus-within { border-color: var(--accent); }
.card[hidden] { display: none; }
.card-art { position: relative; aspect-ratio: 2 / 1; display: grid; place-items: center; overflow: hidden; color: rgba(255, 255, 255, 0.92); }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 599px) { .grid .card-art { aspect-ratio: 3 / 1; } }
.mono { font-size: 2.4rem; font-weight: 850; letter-spacing: 0.04em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25); }
.date-badge { position: absolute; top: 10px; left: 10px; background: rgba(10, 12, 16, 0.78); color: #fff; border-radius: 8px; padding: 4px 8px; font-size: 0.75rem; font-weight: 700; line-height: 1.25; display: flex; gap: 6px; }
.date-badge b { color: #ffb07a; }
.status-badge { position: absolute; top: 10px; right: 10px; border-radius: 8px; padding: 4px 8px; font-size: 0.75rem; font-weight: 800; background: #fff; color: #111; }
.status-cancelled, .status-postponed { background: #7f1d1d; color: #fff; }
.status-soldout { background: #111; color: #fff; }
.status-text.status-cancelled, .status-text.status-postponed { color: var(--danger); background: none; font-weight: 800; }
.card-body { padding: 14px 14px 6px; flex: 1; }
.card-kicker { margin: 0 0 4px; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.card-kicker a { color: inherit; text-decoration: none; }
.card-title { font-size: 1.08rem; margin: 0 0 4px; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-title a:hover { text-decoration: underline; }
.card-support { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; }
.card-meta { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: 0.92rem; }
.card-meta li { display: flex; gap: 8px; align-items: flex-start; }
.card-meta .icon { width: 17px; height: 17px; margin-top: 2px; color: var(--muted); }
.raise, .card-actions { position: relative; z-index: 2; }
.card-actions { display: flex; gap: 8px; padding: 10px 14px 14px; }
.card-actions .btn-primary { flex: 1; }
.is-cancelled .card-title a, .event.is-cancelled h1 { text-decoration: line-through; text-decoration-thickness: 2px; }

/* Generated artwork when there's no licensed image: a gradient per genre. */
.art-rock-indie { background: linear-gradient(135deg, #7c2d12, #ea580c); }
.art-country-americana { background: linear-gradient(135deg, #78350f, #d97706); }
.art-jazz-blues { background: linear-gradient(135deg, #1e3a8a, #6366f1); }
.art-hip-hop-rnb { background: linear-gradient(135deg, #581c87, #db2777); }
.art-electronic-dj { background: linear-gradient(135deg, #0f766e, #22d3ee); }
.art-metal-punk { background: linear-gradient(135deg, #18181b, #991b1b); }
.art-latin { background: linear-gradient(135deg, #be123c, #f59e0b); }
.art-pop { background: linear-gradient(135deg, #be185d, #a855f7); }
.art-classical-opera { background: linear-gradient(135deg, #3f3f46, #a16207); }
.art-live-music { background: linear-gradient(135deg, #9a3412, #be185d); }
.art-theater-dance { background: linear-gradient(135deg, #4c1d95, #be123c); }
.art-comedy { background: linear-gradient(135deg, #a16207, #ca8a04); }
.art-film { background: linear-gradient(135deg, #111827, #475569); }
.art-family { background: linear-gradient(135deg, #15803d, #84cc16); }
.art-trivia-games { background: linear-gradient(135deg, #0e7490, #2563eb); }
.art-food-drink { background: linear-gradient(135deg, #9a3412, #65a30d); }
.art-sports { background: linear-gradient(135deg, #1d4ed8, #0f172a); }
.art-rodeo-western { background: linear-gradient(135deg, #78350f, #b45309); }
.art-other { background: linear-gradient(135deg, #334155, #64748b); }

/* ---------- Event page ---------- */
.event-art { aspect-ratio: 3 / 1; max-height: 220px; width: 100%; border-radius: var(--radius); margin-bottom: 20px; }
.event-art .mono { font-size: clamp(2.5rem, 8vw, 4.5rem); }
.event-header h1 { margin-bottom: 6px; }
.event-support { font-size: 1.1rem; color: var(--muted); margin-bottom: 10px; }
.event-when, .event-where { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 6px; font-weight: 600; }
.event-when .icon, .event-where .icon { color: var(--accent); margin-top: 2px; }
.event-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.event-layout { display: grid; gap: 24px; margin-top: 20px; }
@media (min-width: 900px) { .event-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.event-main section { margin-bottom: 28px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1px; margin: 0 0 14px; border-radius: var(--radius); overflow: hidden; background: var(--border); border: 1px solid var(--border); }
.facts div { background: var(--surface); padding: 12px 14px; }
.facts dt { font-size: 0.78rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 650; }
.tba { color: var(--muted); font-weight: 500; font-style: italic; }
.calendar-links, .venue-links { display: flex; flex-wrap: wrap; gap: 8px; }
.lineup { padding-left: 1.2em; }
.source-note { font-size: 0.92rem; color: var(--muted); }
.source-note h2 { font-size: 1rem; color: var(--text); }
.venue-box { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.venue-box h2 { font-size: 1.2rem; margin-bottom: 4px; }
.venue-box h2 a { color: var(--text); }
.venue-box address { font-style: normal; margin: 10px 0 14px; }
.venue-header address { font-style: normal; display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }

/* ---------- Calendar ---------- */
.calendar { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.calendar th { font-size: 0.78rem; color: var(--muted); font-weight: 700; padding: 4px 0; }
.calendar abbr { text-decoration: none; }
.calendar td { height: 64px; vertical-align: top; padding: 0; }
.calendar td > a, .calendar td > span { display: flex; flex-direction: column; height: 100%; padding: 6px 8px; border-radius: 10px; }
.calendar td > a { background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.calendar td > a:hover, .calendar a[aria-current="date"] { border-color: var(--accent); }
.calendar .is-past, .calendar .is-empty { color: var(--muted); opacity: 0.55; }
.cal-day { font-weight: 700; font-size: 0.9rem; }
.cal-count { margin-top: auto; font-size: 0.8rem; font-weight: 750; color: var(--accent); }

/* ---------- Map ---------- */
.venue-map { height: min(70vh, 560px); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); z-index: 0; }

/* ---------- Prose & footer ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: 0.4em; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 32px 0 24px; font-size: 0.92rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.footer-grid h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li a { display: inline-block; padding: 6px 0; color: var(--text); text-decoration: none; }
.footer-grid li a:hover { text-decoration: underline; }
.footer-brand { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.footer-base { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .tag, .card, .area-card, .venue-list a, .day-strip a { transition: border-color 0.15s, filter 0.15s, background-color 0.15s; }
}
@media print {
  .site-header, .tabbar, .site-footer, .filters, .card-actions, .event-actions { display: none !important; }
}
