/* ============================================================
   AMSTERDAM LIVE MUSIC & ARTS CALENDAR — STYLES v3.0
   ============================================================ */

:root {
  --bg: #0f0f14;
  --bg-secondary: #1a1a24;
  --bg-tertiary: #222233;
  --surface: #1a1a24;
  --border: #333344;
  --text: #e8e8f0;
  --text-muted: #888899;
  --accent: #6c5ce7;
  --accent-hover: #7f70f0;
  --header-bg-1: rgba(26, 26, 36, 0.8);
  --header-bg-2: rgba(15, 15, 20, 0.9);
  --font-display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e9ecef;
  --surface: #ffffff;
  --border: #dee2e6;
  --text: #212529;
  --text-muted: #6c757d;
  --header-bg-1: rgba(248, 249, 250, 0.9);
  --header-bg-2: rgba(233, 236, 239, 0.95);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

.header-controls {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.6rem;
  z-index: 10;
}

/* Base styles for circular icons */
.theme-toggle, .lang-toggle, .beer-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  text-decoration: none;
}

@media (max-width: 1000px) {
  header {
    padding-top: 0;
  }
  .header-controls {
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
    padding: 1rem 0;
    background: rgba(0,0,0,0.05); /* Subtle bar look */
    justify-content: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
  }
}
/* .header-container / .header-logo-wrapper / .header-titles mobile overrides
   live further down (after their base rules) so equal-specificity cascade
   order doesn't silently discard them — see the block near header h1. */

.lang-toggle {
  font-size: 0.8rem;
  font-weight: 800;
}

.theme-toggle:hover, .lang-toggle:hover, .beer-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  transform: scale(1.05);
}

.beer-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.beer-modal-content {
  max-width: 400px;
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.beer-popup-content h2 {
  margin-bottom: 1rem;
  color: var(--text);
}

.beer-popup-content p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.paypal-container {
  margin-top: 1rem;
}

.paypal-btn {
  display: inline-block;
  background: #0070ba;
  color: white !important;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s;
}

.paypal-btn:hover {
  background: #005ea6;
  transform: translateY(-2px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================================
   WCAG 2.2 ACCESSIBILITY & 2026 PERFORMANCE TRENDS
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

header {
  position: relative;
  background: linear-gradient(135deg, var(--header-bg-1) 0%, var(--header-bg-2) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.header-container {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 2rem;
  align-items: flex-start; /* Upper */
  padding-top: 2rem;
  padding-bottom: 1.5rem;
}

.header-logo-wrapper {
  grid-column: 1 / 2;
  display: flex;
  justify-content: flex-start; /* Left */
  align-items: flex-start; /* Upper */
}

.header-titles {
  grid-column: 2 / 3;
  text-align: left;
}

.fomo-square-logo {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border: 2px solid var(--accent);
}

/* Mobile header diet: controls become an in-flow bar (see the block near the
   top of this file); no phantom padding, subtitle tightened. Placed after the
   base .header-container/.header-logo-wrapper/.header-titles rules above so
   these overrides actually win the cascade (equal specificity, source order). */
@media (max-width: 1000px) {
  .header-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
    padding-top: 1rem;
  }
  .header-logo-wrapper {
    display: none;
  }
  .header-titles {
    grid-column: 1 / -1;
    text-align: center;
    padding: 0 1rem;
  }
  header p {
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 auto;
  }
}

/* WCAG 2.5.8: all filter pills/chips reach 44px touch targets on touch layouts */
@media (max-width: 768px) {
  .chip,
  .quick-filter-btn,
  .city-stat-pill,
  .venue-type-btn,
  .search-clear-btn {
    min-height: 44px;
  }
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(108, 92, 231, 0.15), transparent 40%),
              radial-gradient(circle at 80% 20%, rgba(0, 184, 148, 0.1), transparent 30%);
  z-index: -1;
  pointer-events: none;
}

header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
}

header h1 .fomo-mark {
  color: var(--accent);
}

header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ============================================================
   DASHBOARD LAYOUT (2026 TREND)
   ============================================================ */
.dashboard-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.25rem 2rem;
  align-items: start;
}

/* Top bar: primary nav + quick date filters, spans both grid columns.
   Never lives in the mobile drawer. min-width:0 overrides the grid-item
   default of min-width:auto — without it this item refuses to shrink below
   its content's natural width and forces the whole page to scroll sideways
   once the sidebar column collapses away on mobile. */
.dashboard-topbar {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.dashboard-topbar .tabs {
  width: auto;
  margin-bottom: 0;
  border-bottom: none;
}

.dashboard-topbar .tab {
  flex: 0 0 auto;
  padding: 0.6rem 1rem;
}

.dashboard-topbar .quick-filters {
  margin-bottom: 0;
}

/* Mobile-only wrapper: groups tabs + the Filters trigger on their own row,
   above the quick-filters scroll strip (see index.html). No-op on desktop
   (tabs render inline via .dashboard-topbar's own flex row there). */
.topbar-row {
  display: contents;
}

@media (max-width: 1000px) {
  .dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.5rem 1.5rem 0.4rem;
    margin: 0 -1.5rem;
    border-bottom: 1px solid var(--border);
  }
  /* .dashboard-topbar is flex-direction:column here, so .topbar-row and
     .quick-filters are CROSS-axis children — min-width/flex-shrink (main-axis
     properties) don't clamp their width there. An explicit width:100% is what
     stops them growing to fit their unwrapped children; overflow-x:auto on
     the nested .tabs/.quick-filters strips then does the actual scrolling. */
  .topbar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;  /* view-toggle drops to its own line under the tabs on mobile */
  }
  .dashboard-topbar .quick-filters {
    width: 100%;
    min-width: 0;
  }
  .dashboard-topbar .tabs,
  .dashboard-topbar .quick-filters {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .dashboard-topbar .tabs {
    flex: 1 1 auto;
    min-width: 0;
  }
  .dashboard-topbar .tabs::-webkit-scrollbar,
  .dashboard-topbar .quick-filters::-webkit-scrollbar {
    display: none;
  }
  .dashboard-topbar .quick-filter-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.dashboard-sidebar {
  position: sticky;
  top: 1.5rem;
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 3rem);
  box-sizing: border-box;
}

.dashboard-sidebar::-webkit-scrollbar {
  display: none;
}

.dashboard-content {
  min-width: 0;
  flex: 1;
}

@media (max-width: 1000px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  /* Mobile filters trigger: an in-flow pill at the end of .topbar-row
     (the old fixed-corner hamburger overlapped the header title). */
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .mobile-menu-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }
  .dashboard-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    max-height: 100vh;
    z-index: 1000;
    background: var(--bg);
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  .dashboard-sidebar.open {
    left: 0;
  }
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .mobile-overlay.active {
    display: block;
  }
}

/* Hide hamburger on desktop */
@media (min-width: 1001px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  text-align: center;
  min-width: 0;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
  display: grid;
  /* Explicit, deterministic columns: the city-summary card gets a wider track,
     and the five stat cards (Total Events, Venues, Genres, Art Forms, Last
     Updated) are all exactly 1fr — so Last Updated can never render wider than
     the others (auto-fit/auto-fill let the trailing card stretch). */
  grid-template-columns: minmax(150px, 1.5fr) repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.stat-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(108, 92, 231, 0.1);
}

.city-summary-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  /* D2: match the surrounding stat cards so the city breakdown reads as a
     framed "by city" card instead of a bare, unfinished list. */
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  min-width: 0;
}

.city-stat-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.city-stat-pill:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.city-stat-pill strong {
  color: var(--accent);
}

.city-stat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.city-stat-pill.active strong {
  color: #fff;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

/* D3: the "Last Updated" value is a date string, not a big number — shrink it
   so "July 09, 2026" stays on one line instead of wrapping to three. */
#lastUpdated {
  font-size: 0.95rem;
  line-height: 1.3;
  white-space: nowrap;
}

.stat-label {
  color: var(--text);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mid range (single-column layout, ~730–970px content): the 6-track grid would
   overflow, so the city card takes its own full-width row and the 5 stat cards
   flow 3-up — still all equal 1fr, no horizontal overflow. */
@media (min-width: 769px) and (max-width: 1000px) {
  .stats-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .city-summary-container { grid-column: 1 / -1; }
}

/* Mobile: stats collapse from vanity tiles to one compact strip so the first
   event card lands within the first screen. */
@media (max-width: 768px) {
  .stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
  }
  .stat-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
  }
  .stat-item .stat-number {
    font-size: 0.9rem;
  }
  .stat-item .stat-label {
    font-size: 0.65rem;
  }
  .city-summary-container {
    flex-basis: 100%;
  }
}

/* ============================================================
   FILTERS
   ============================================================ */
/* ============================================================
   QUICK FILTERS (NARRATIVE UI)
   ============================================================ */
.quick-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.quick-filter-btn {
  background: rgba(108, 92, 231, 0.1);
  color: var(--accent);
  border: 1px solid rgba(108, 92, 231, 0.3);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-filter-btn:hover {
  background: rgba(108, 92, 231, 0.2);
}

.quick-filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.quick-filter-btn:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent) !important;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: color-mix(in srgb, var(--bg-tertiary) 55%, transparent);
  border-radius: 16px;
  border: 1px dashed var(--border);
  margin-top: 2rem;
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.empty-state button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.empty-state button:hover {
  background: var(--accent-hover);
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.filter-group {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.filter-group label,
.filter-group .filter-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* D4: quiet inline hint that Genre refines the Music art form */
.filter-hint {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

/* Multi-select facet chips — same pill language as quick filters,
   but neutral until chosen so the narrative row stays the loud one */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Search Wrapper & Clear Button */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-wrapper input {
  padding-right: 32px;
  width: 100%;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  display: none;
  line-height: 1;
  transition: color 0.15s;
}

.search-clear-btn:hover {
  color: var(--text);
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.filter-checkbox input {
  width: auto;
}

.filter-checkbox label {
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.radius-search-group {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.radius-search-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.radius-controls {
  display: flex;
  gap: 0.4rem;
  width: 100%;
}

.radius-controls input {
  flex: 1;
  min-width: 0; /* Critical for flex shrinking */
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

.radius-btn {
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radius-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#radiusFilter {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.location-status {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: var(--accent);
}

.filter-clear {
  margin-top: 1.25rem;
}

.clear-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  /* WCAG 2.2 Target Size (2.5.8) */
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clear-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.view-toggle {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;  /* right-aligns in the tab row; no top margin (moved out of the search row) */
}

.view-toggle button {
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.view-toggle button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.view-toggle button svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   EVENT CARDS
   ============================================================ */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.events-grid.list-view {
  grid-template-columns: 1fr;
}

.event-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  content-visibility: visible;
  contain-intrinsic-size: 380px;
  animation: fadeInCard 0.4s ease-out;
}

@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Skeleton Loading Screen Styles */
.skeleton-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 380px;
}

.skeleton-img {
  height: 240px;
  width: 100%;
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.skeleton-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
}

.skeleton-line {
  height: 1rem;
  background: var(--bg-tertiary);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-100 { width: 100%; }

/* Shimmer animation */
.skeleton-img::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--text) 6%, transparent),
    transparent
  );
  animation: skeleton-shimmer 1.5s infinite;
  transform: translateX(-100%);
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.event-card-image {
  height: 240px;
  width: 100%;
  object-fit: cover;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.5s ease-in-out;
  /* Fade in when venue image loads */
  opacity: 1;
}

.event-card-image.venue-image-loading {
  opacity: 0.7;
}

.event-card-image.venue-image-loaded {
  opacity: 1;
}

.event-card:hover .event-card-image {
  transform: scale(1.05);
}

.event-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.event-card-info {
  margin-bottom: 0.6rem;
  display: flex;
  gap: 0.85rem;
  align-items: stretch;      /* stub + text column share a height... */
  min-height: 72px;          /* ...and keep a uniform ticket-stub rhythm */
}

.event-card-headline {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;    /* title on top, location pinned to the bottom */
}

/* Ticket date-stub — the FOMONONONO signature: the ticket you didn't miss */
.date-stub {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* stay centered if stretched by a 2-line title */
  min-width: 54px;
  padding: 0.35rem 0.55rem 0.4rem;
  border-radius: 8px 2px 2px 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-right: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  line-height: 1.05;
  text-align: center;
}

.stub-dow, .stub-mon {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stub-day {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--accent);
}

.stub-time {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.event-tags {
  margin: 0 0 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.event-card-desc {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* LIST VIEW REFORMAT */
.events-grid.list-view .event-card {
  flex-direction: row;
  height: 220px;
  align-items: stretch;
}

.events-grid.list-view .event-card-image {
  display: block;
  width: 220px; /* Equal to height for a square look or close to it */
  height: 100%;
  flex-shrink: 0;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

.events-grid.list-view .event-card-body {
  flex-direction: row;
  padding: 1.25rem;
  gap: 2rem;
  width: 100%;
  min-width: 0; /* Important for flex-child clamping */
}

.events-grid.list-view .event-card-info {
  flex: 0 0 300px; /* Fixed width for the middle column */
  margin-bottom: 0;
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.events-grid.list-view .event-title {
  font-size: 1.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.25rem;
}

.events-grid.list-view .event-card-desc {
  flex: 1;
  min-width: 0;
  justify-content: space-between;
  display: flex;
  flex-direction: column;
}

.events-grid.list-view .event-desc-short {
  -webkit-line-clamp: 4;
  margin-top: 0;
}

/* List view: the pills row is now a sibling of .event-card-info, so lay the body
   out as a grid — info as a full-height left column, tags + description stacked
   in the right column — instead of the pills becoming a stray middle column. */
.events-grid.list-view .event-card-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 2rem;
  row-gap: 0.5rem;
}
.events-grid.list-view .event-card-info { grid-column: 1; grid-row: 1 / span 2; }
.events-grid.list-view .event-tags { grid-column: 2; grid-row: 1; margin: 0; align-self: end; }
.events-grid.list-view .event-card-desc { grid-column: 2; grid-row: 2; }

@media (max-width: 900px) {
  .events-grid.list-view .event-card-info {
    flex: 0 0 220px;
    padding-right: 1rem;
  }
  .events-grid.list-view .event-card-body {
    grid-template-columns: 220px 1fr;
  }
}

@media (max-width: 768px) {
  .events-grid.list-view .event-card {
    flex-direction: column;
    height: auto;
  }
  .events-grid.list-view .event-card-image {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .events-grid.list-view .event-card-body {
    flex-direction: column;
    gap: 1rem;
  }
  .events-grid.list-view .event-card-info {
    width: 100%;
    flex: none;
    border-right: none;
    padding-right: 0;
  }
}

.event-card:hover,
.event-card:focus-within {   /* keyboard users get the same lift when tabbing in */
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(108, 92, 231, 0.15);
}

.event-card:focus-within .event-title {
  color: var(--accent);
}

.event-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.time-tbd {
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Location line (Proposal B treatment): 📍 pin + bold venue + muted ", city",
   pinned to the bottom edge of the date-stub via margin-top:auto. */
.event-venue {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: baseline;
  min-width: 0;          /* only the venue name truncates... */
}

.venue-pin {
  margin-right: 0.15rem;
  font-size: 0.8rem;
  flex: 0 0 auto;
}

.event-venue-name {
  color: var(--text);
  font-weight: 600;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-city {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: none;
  flex-shrink: 0;        /* ...the city is always kept */
  white-space: nowrap;
}

.event-city::before {
  /* comma + non-breaking space: a plain trailing space in generated content
     collapses in some browsers (Safari), concatenating "Venue,City". */
  content: ",\00A0";
}

.event-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
  transition: color 0.2s ease-in-out;
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* keep titles to one or two lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card:hover .event-title {
  color: var(--accent);
}

/* Genre chip (Proposal A): a color dot carries the genre color (per-card via
   --pill-c) while the text stays neutral for AA in both themes. */
.event-genre {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--pill-c, var(--accent)) 14%, var(--surface));
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--pill-c, var(--accent)) 45%, var(--border));
}

.event-genre::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pill-c, var(--accent));
  flex: 0 0 auto;
}

.event-price {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text);
}

/* Art-form chip (Proposal A): outlined, quiet — the segment above the genre. */
.event-type {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.fav-indicator {
  display: inline-block;
  margin-left: 0.25rem;
}

.event-desc-short {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.event-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;        /* pin to card bottom even when there is no description */
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.event-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.event-link:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.event-card:hover .event-link {
  transform: translateX(4px);
}

.event-action-btns {
  display: flex;
  gap: 0.5rem;
}

.fav-btn,
.share-btn,
.ics-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
  /* WCAG 2.2 Target Size (2.5.8) */
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fav-btn:hover,
.share-btn:hover,
.ics-btn:hover {
  background: var(--bg-tertiary);
}

.fav-btn-active {
  filter: none;
}

.wap-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent);
  color: white;
  margin-left: 0.5rem;
}

/* ============================================================
   MONTH SECTIONS
   ============================================================ */
.month-section {
  margin-bottom: 2rem;
}

.month-header {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  padding-left: 0.75rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px dashed color-mix(in srgb, var(--accent) 45%, transparent);
}

/* Brand empty state: the stub says no no no */
.no-events-stub {
  display: inline-flex;
  margin-bottom: 1rem;
}
.no-events-stub .stub-day { font-size: 1.4rem; }

.month-count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1rem;
}

/* Filtering Transition States */
#calendarContainer.filtering {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(108, 92, 231, 0.2);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   NO EVENTS
   ============================================================ */
.no-events {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
}

.no-events-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.no-events h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ============================================================
   VENUE STATS
   ============================================================ */
.venue-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.venue-stat-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.venue-stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}

.venue-stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ============================================================
   VENUE TYPE FILTERS
   ============================================================ */
.venue-type-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.venue-type-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.venue-type-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.venue-type-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ============================================================
   VENUE GRID
   ============================================================ */
.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.venue-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.venue-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.venue-item-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.venue-type-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  white-space: nowrap;
}

.venue-item-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.venue-item-details {
  margin-bottom: 0.75rem;
}

.venue-detail-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.venue-detail-icon {
  font-size: 0.9rem;
}

.venue-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.venue-link-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  text-decoration: none;
  color: white;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: opacity 0.2s;
}

.venue-link-btn:hover {
  opacity: 0.8;
}

.venue-link-btn.calendar {
  background: #00b894;
}

.venue-link-btn.facebook {
  background: #3b5998;
}

.venue-link-btn.website {
  background: var(--accent);
}

.link-icon {
  font-size: 0.85rem;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  will-change: opacity;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  color: var(--text);
  will-change: transform;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  /* WCAG 2.2 Target Size (2.5.8) */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-meta-item {
  background: var(--bg);
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.modal-meta-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.modal-meta-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.modal-venue-info {
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 1rem;
}

.modal-venue-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.modal-venue-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-cta-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.modal-cta-btn:hover {
  background: var(--accent-hover);
}

.modal-secondary-btn {
  padding: 0.75rem 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.modal-secondary-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   MARK HIGHLIGHT (search)
   ============================================================ */
mark {
  background: rgba(108, 92, 231, 0.3);
  color: var(--text);
  padding: 0 0.15rem;
  border-radius: 3px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-links {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  font-weight: 600;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-hover);
}

footer p {
  margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

.filters {
    flex-direction: column;
    gap: 0.5rem;
  }

  .filter-group {
    min-width: 100%;
  }

  .filter-checkbox {
    margin-top: 0.5rem;
    padding: 0.75rem 0; /* Expanded touch target */
  }

  .filter-clear {
    margin-top: 0.25rem;
    width: 100%;
  }

  .clear-btn {
    width: 100%;
    padding: 0.75rem; /* Expanded touch target */
    text-align: center;
  }

  .view-toggle {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    margin-top: 0.75rem;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .venue-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 1.5rem;
    max-height: 90vh;
  }

  .modal-meta-grid {
    grid-template-columns: 1fr;
  }

  /* Full-width touch CTA buttons inside event modal for mobile thumb ease */
  .modal-cta-btn,
  .modal-secondary-btn {
    width: 100%;
    text-align: center;
    padding: 0.85rem 1.25rem;
  }
}

/* Archive Styles */
#archiveTab {
  padding: 1.5rem 0;
}

.archive-header {
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
}

.archive-header h2 {
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.archive-header p {
  color: var(--text-muted);
}

/* ============================================================
   ERROR BANNER
   ============================================================ */
.error-banner {
  background: var(--bg-secondary);
  border: 1px solid #e74c3c;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  color: #ff6b6b;
}
.error-banner strong {
  color: #ff4757;
  font-size: 1.1rem;
}
.error-banner p {
  margin: 8px 0;
  color: var(--text-muted);
}
.error-banner small {
  color: var(--text-muted);
  opacity: 0.7;
}
.error-retry-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 8px;
}
.error-retry-btn:hover {
  background: #c0392b;
}

/* ============================================================
   MAP TAB VISIBILITY
   ============================================================ */
#mapTab {
  display: none;
}
#mapTab.active {
  display: block;
}

/* ============================================================
   PREMIUM LEAFLET DARK THEME OVERRIDES (Improvement 9)
   ============================================================ */
.leaflet-popup-content-wrapper {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-popup-tip {
  background-color: var(--surface) !important;
  border-left: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.leaflet-popup-content {
  margin: 12px 16px !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
}

.leaflet-popup-content h3 {
  font-size: 1.1rem !important;
  color: var(--accent) !important;
  margin: 0 0 4px 0 !important;
  font-weight: 600 !important;
}

.leaflet-popup-content p {
  margin: 4px 0 !important;
  color: var(--text-muted) !important;
}

.leaflet-popup-content a {
  color: var(--accent) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.leaflet-popup-content a:hover {
  text-decoration: underline !important;
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--text-muted) !important;
  font-size: 1.25rem !important;
  padding: 8px 8px 0 0 !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  color: var(--accent) !important;
}

/* Marker Cluster Custom Dark Gold Styling */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: color-mix(in srgb, var(--accent) 25%, transparent) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-family: inherit !important;
}

/* Card Badge Styling Overlays */
.card-badges-container {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
  pointer-events: none;
}

.card-badge {
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  width: fit-content;
}

.badge-tonight {
  background: #ff4757 !important; /* bright vibrant red */
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-free {
  background: #2ed573 !important; /* bright vibrant green */
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Premium Distance Range Slider Styling */
.distance-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
}

#radiusFilter {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  transition: background 0.3s;
}

#radiusFilter:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Slider Thumb (Webkit / Chrome / Safari / Edge) */
#radiusFilter::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent); /* Premium Gold */
  cursor: pointer;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s, background-color 0.2s;
}

#radiusFilter::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #fff;
}

/* Slider Thumb (Firefox) */
#radiusFilter::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s, background-color 0.2s;
}

#radiusFilter::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #fff;
}

.radius-value-label {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 110px;
  text-align: right;
  white-space: nowrap;
}

/* ============================================================
   CYCLE 16 — DISCOVERY BAR (Proposal B) + COMPACT VIEW
   ============================================================ */
/* Layout: sidebar retired -> single column; the bar spans full width */
.dashboard-layout { grid-template-columns: 1fr; }
.discovery-bar {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.db-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
.db-top .search-wrapper { flex: 1 1 260px; min-width: 200px; }
.db-count { font-size: 0.95rem; color: var(--text-muted); white-space: nowrap; }
.db-count strong { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.db-clearall { background: transparent; border: 0; color: var(--text-muted); font-weight: 600; font-size: 0.8rem; cursor: pointer; text-decoration: underline; }
.db-clearall:hover { color: var(--accent); }

/* chips + triggers: one 999px family */
.db-chip, .db-trigger {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text);
  border-radius: 999px; padding: 0.45rem 0.8rem; min-height: 34px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
  font-variant-numeric: tabular-nums;
}
.db-chip:hover, .db-trigger:hover { border-color: var(--accent); }
.db-smart { background: color-mix(in srgb, var(--accent) 14%, var(--bg-secondary)); border-color: transparent; color: var(--accent); }
.db-chip[aria-pressed="true"], .db-chip[aria-checked="true"], .db-chip.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.db-trigger.has { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-secondary)); }

/* facet popovers (desktop) */
.db-facet { position: relative; display: inline-flex; }
.db-pop {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
  padding: 0.9rem; min-width: 280px; max-width: 360px; max-height: 46vh; overflow: auto;
  display: none; z-index: 300;
}
.db-pop.open { display: block; }
.db-pop .filter-label { display: block; margin-bottom: 0.5rem; }
.db-pop select { width: 100%; }
.db-pop-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; padding-top: 0.7rem; border-top: 1px solid var(--border); }
.db-pop-clear { background: transparent; border: 0; color: var(--text-muted); font-weight: 600; font-size: 0.78rem; cursor: pointer; text-decoration: underline; }
.db-pop-done { background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 0.45rem 0.9rem; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }

/* per-option live counts on chips; zero-count = dimmed + disabled */
.chip .chip-ct { color: var(--text-muted); font-size: 0.72rem; margin-left: 0.3rem; font-variant-numeric: tabular-nums; }
.chip.active .chip-ct { color: #fff; opacity: .85; }
.chip[disabled], .chip[aria-disabled="true"] { opacity: .42; cursor: not-allowed; }

/* applied pills (mobile only — desktop triggers carry the state) */
.db-pills { display: none; }
.db-pill { display: inline-flex; align-items: center; gap: 0.3rem; background: color-mix(in srgb, var(--accent) 16%, var(--bg-secondary)); color: var(--accent); border: 0; border-radius: 999px; padding: 0.3rem 0.65rem; font-size: 0.74rem; font-weight: 700; cursor: pointer; }
.db-pill .x { opacity: .7; }

/* master "Filters" entry point — mobile only (desktop shows the facet triggers) */
.db-facet-all { display: none; }
.db-filters-btn { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.db-filters-btn:hover { border-color: var(--accent); }
/* stays white when active — overrides the generic .db-trigger.has {color:accent},
   which otherwise turned the "Filters" label purple-on-purple (invisible). */
.db-filters-btn.has { background: var(--accent); color: #fff; border-color: var(--accent); }
.db-fbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: rgba(255,255,255,.25); font-size: 0.72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.db-fbadge[hidden] { display: none; }

/* master-sheet menu: one row per facet + two switch rows */
.db-allmenu { display: flex; flex-direction: column; }
.db-menu-row { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 52px; padding: 0.7rem 0.35rem; background: transparent; border: 0; border-bottom: 1px solid var(--border); color: var(--text); font-size: 0.95rem; font-weight: 600; cursor: pointer; text-align: left; }
.db-menu-row:last-child { border-bottom: 0; }
.db-menu-row .mr-lbl { flex: 0 0 auto; }
.db-menu-row .mr-val { flex: 1 1 auto; min-width: 0; text-align: right; color: var(--accent); font-weight: 700; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-menu-row .mr-chev { flex: 0 0 auto; color: var(--text-muted); font-size: 1.25rem; line-height: 1; }
.db-menu-toggle { justify-content: space-between; }
.db-menu-toggle .mr-switch { flex: 0 0 auto; position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--border); transition: background .15s; }
.db-menu-toggle .mr-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.db-menu-toggle[aria-checked="true"] .mr-switch { background: var(--accent); }
.db-menu-toggle[aria-checked="true"] .mr-switch::after { transform: translateX(18px); }

/* mobile: no sideways-scroll strip — row wraps, facets live in the master sheet */
.db-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 250; display: none; }
.db-scrim.open { display: block; }
@media (max-width: 768px) {
  .db-controls { flex-wrap: wrap; overflow: visible; }
  .db-controls .db-facet:not(.db-facet-all) { display: none; }  /* facets → master sheet */
  #freeChip, #wapChip { display: none; }                         /* switches → master sheet */
  .db-facet-all { display: inline-flex; flex: 1 0 100%; }        /* Filters: own full-width row */
  .db-filters-btn { width: 100%; justify-content: center; }
  .db-chip, .db-trigger { min-height: 44px; padding: 0.6rem 0.9rem; }
  .db-pills { display: flex; }
  .db-pop {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    min-width: 0; max-width: none; max-height: 72vh;
    border-radius: 20px 20px 0 0; z-index: 400;
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
    box-shadow: 0 -14px 44px rgba(0,0,0,.45);
  }
  .db-pop::before { content: ""; display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 10px; }
}

/* ============================================================
   COMPACT VIEW (dense rows + sticky date-group headers)
   ============================================================ */
.compact-list { display: flex; flex-direction: column; margin-bottom: 2rem; }
.compact-date-header {
  position: sticky; top: 0; z-index: 5; margin: 0;
  padding: 0.5rem 0.25rem 0.4rem;
  background: var(--bg); border-bottom: 1px solid var(--border);
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted);
}
.compact-row {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 64px; padding: 0.5rem 0.75rem; margin: 0.35rem 0;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease;
  content-visibility: auto; contain-intrinsic-size: auto 64px;
}
.compact-row:hover, .compact-row:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-secondary));
}
.compact-row:hover .compact-title, .compact-row:focus-visible .compact-title { color: var(--accent); }
.compact-stub { min-width: 48px; padding: 0.25rem 0.45rem 0.3rem; }
.compact-stub .stub-day { font-size: 1.25rem; }
.compact-thumb { flex: 0 0 48px; width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--bg-tertiary); border: 1px solid var(--border); }
.compact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.compact-title {
  font-family: var(--font-display); font-size: 0.98rem; font-weight: 800; letter-spacing: -0.01em;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.2s ease-in-out;
}
.compact-venue { margin-top: 0; font-size: 0.8rem; }
.compact-tag { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 520px) { .compact-tag { display: none; } }

/* Discovery bar search input (old rule was sidebar-scoped) */
.discovery-bar .search-wrapper input {
  width: 100%;
  padding: 0.6rem 2rem 0.6rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color .15s;
}
.discovery-bar .search-wrapper input:focus { border-color: var(--accent); }
.discovery-bar .search-wrapper { position: relative; }
.discovery-bar .search-clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }

/* ── Design-QA punch-list fixes (Cycle 16 review) ─────────────────── */
/* #7 Clear-all: tertiary button, real hit target */
.db-clearall { padding: 6px 10px; margin: 0 4px; border-radius: 8px; text-decoration: none; border: 1px solid var(--border); }
.db-clearall:hover { border-color: var(--accent); }

/* #6 popover options: single-column rows, count right-aligned (scan > style) */
.db-pop .chip-group { flex-direction: column; align-items: stretch; gap: 4px; }
.db-pop .chip-group .chip { display: flex; justify-content: space-between; width: 100%; border-radius: 10px; }
.db-pop .chip-group .chip .chip-ct { margin-left: auto; padding-left: 12px; }

/* #8 compact rows: hit the 64px density target */
.compact-row { min-height: 56px; padding: 6px 12px; margin: 5px 0; }
.compact-tag { margin-left: auto; }

/* #3 stats bar: compact cards; results deserve the fold.
   DESKTOP-ONLY: the site already collapses stats to inline pills on mobile
   (style.css ~631) — unscoped, these later rules stomped that pill layout
   and made labels overlap the numbers. */
@media (min-width: 769px) {
  .stats-bar { gap: 0.6rem; margin-bottom: 1rem; }
  /* min-height: uniform card height so the shorter "Last Updated" date card
     matches the number cards. flex-center vertically so the number+label block
     sits in the same place in every card (else the shorter date text rides high). */
  .stats-bar .stat-item {
    padding: 0.7rem 0.9rem; min-height: 5rem; align-self: start; box-sizing: border-box;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
  }
  /* fixed number-slot height (matches the 1.35rem number line-box) with the
     value centered in it, so the smaller "Last Updated" date occupies the same
     vertical slot and its label lines up with the neighbouring cards' labels. */
  .stats-bar .stat-number { font-size: 1.35rem; min-height: 2.16rem; display: flex; align-items: center; justify-content: center; }
  /* match the date to the numbers (the #lastUpdated ID otherwise forces 0.95rem,
     making it read visibly smaller); it fits at 1.35rem (~129px in a ~153px card). */
  .stats-bar #lastUpdated { font-size: 1.35rem; }
  .stats-bar .stat-label { font-size: 0.62rem; }
}

@media (max-width: 768px) {
  /* #4 mobile bar: search full row; count left + toggle right on one row */
  .db-top { flex-wrap: wrap; }
  .db-top .search-wrapper { flex: 1 1 100%; }
  .db-top .db-count { margin-right: auto; }
  /* #5 scroll affordance: end padding so the cut reads as scrollable */
  .db-controls { padding-inline-end: 28px; }
  /* #3 mobile: hide the bulky per-city breakdown card (the site's own
     compact pill strip at ~631 handles the rest — don't restyle it) */
  .city-summary-container { display: none; }
}

/* ── Mobile chrome diet v2 (user: banner + icons + tabs ate the fold) ──
   One compact row: title left, icon cluster right; subtitle gone; slim tabs. */
@media (max-width: 768px) {
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.45rem 0.85rem;
  }
  .header-container {
    display: flex;
    align-items: center;
    padding: 0;
    gap: 0.5rem;
    text-align: left;
  }
  .header-titles { padding: 0; text-align: left; }
  header h1 { font-size: 1.15rem; margin: 0; white-space: nowrap; }
  header p { display: none; }
  .header-controls {
    position: static;
    width: auto;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    gap: 0.35rem;
    justify-content: flex-end;
  }
  .header-controls .theme-toggle,
  .header-controls .beer-btn,
  .header-controls .lang-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .dashboard-topbar { padding-bottom: 0; gap: 0.5rem; }
  .dashboard-topbar .tab { padding: 0.5rem 0.7rem; font-size: 0.9rem; }
}
