/* Play Utah v3 — warm cream + deep teal + sunny yellow. Toggle chips, no dropdowns. */
:root {
  --bg: #fff6e5;
  --card: #ffffff;
  --ink: #22303c;
  --muted: #5d6b78;
  --teal: #0f766e;
  --teal-dark: #0b5e57;
  --teal-soft: #dff0ee;
  --sun: #ffd34e;
  --coral: #e4572e;
  --coral-dark: #c7431f;
  --line: #eadfc6;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--teal); }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; color: var(--ink); }
h1 { font-size: 1.4rem; margin: 0 0 .2rem; }
h2 { font-size: 1.45rem; margin: 2rem 0 .6rem; scroll-margin-top: 16px; }
h3 { font-size: 1.15rem; margin: 0 0 .3rem; }
p { margin: 0 0 .8rem; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 18px; }
main.wrap.wide { max-width: 1240px; }
.site-header .wrap, .site-footer .wrap { max-width: 1240px; }

/* Compact header — deep teal, minimal */
.site-header { background: var(--teal); color: #fff; padding: 10px 0; }
.site-header a { color: #fff; text-decoration: none; }
.logo { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; flex: 0 0 auto; }
.logo span { color: var(--sun); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.site-nav { margin-left: auto; font-size: .95rem; }
.site-nav a { margin-left: 16px; color: #cdeae7; }
.site-nav a:hover { color: #fff; }
@media (max-width: 699px) { .site-nav { display: none; } }

/* Header tools — search + Filters button, always in reach */
.header-tools { display: flex; gap: 8px; align-items: center; flex: 1 1 auto; min-width: 0; }
.header-tools input[type="search"] {
  flex: 1 1 auto; min-width: 0; font-size: 1rem; padding: 8px 14px;
  border: 2px solid rgba(255, 255, 255, .4); border-radius: 999px; background: #fff; color: var(--ink);
}
.header-tools input[type="search"]:focus { outline: 3px solid var(--sun); border-color: var(--sun); }
.filters-btn { background: var(--sun); color: var(--ink); flex: 0 0 auto; }
.filters-btn:hover { background: #ffcb2e; }
.filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--coral); color: #fff; font-size: .8rem; font-weight: 800;
}
.filter-count[hidden] { display: none; }

/* Compact intro — one line, then the grid starts */
.intro { padding: 14px 0 0; }
.intro .lede { font-size: 1rem; color: var(--muted); margin: 0; max-width: 640px; }

/* Layout — collapsible left sidebar + content; grid starts right under the intro */
.layout { display: block; }
.content { min-width: 0; }

/* Sidebar — a white card column on desktop, a slide-in drawer on phones */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-top: 14px;
}
.sidebar-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sidebar-head h2 { font-size: 1.1rem; margin: 0; flex: 1 1 auto; }
.sidebar-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 2px; }
.icon-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line);
  background: #fff; color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.icon-btn:focus-visible { outline: 3px solid var(--sun); }
#filters-close { display: none; }
#filters-collapse { display: none; }

/* Filter groups stack vertically inside the sidebar */
.filter-group { margin: 0 0 18px; }
.filter-group > h3 {
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 0 0 8px;
}
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* Location group inside the sidebar */
.loc-group .btn { display: block; width: 100%; margin-bottom: 8px; }
.loc-group input[type="text"] {
  display: block; width: 100%; font-size: .95rem; padding: 8px 14px; margin-bottom: 8px;
  border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
}
.loc-group input[type="text"]:focus { outline: 3px solid var(--sun); border-color: var(--teal); }
.nearby-status { display: block; font-size: .88rem; color: var(--muted); }
.nearby-status:empty { display: none; }

/* Scrim behind the phone drawer */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(20, 30, 38, .45); }
.scrim[hidden] { display: none; }

/* Desktop: sidebar sits left of the grid, sticky, independently scrollable */
@media (min-width: 900px) {
  .layout { display: flex; gap: 28px; align-items: flex-start; }
  .sidebar {
    flex: 0 0 264px; position: sticky; top: 16px;
    max-height: calc(100vh - 32px);
  }
  .content { flex: 1 1 auto; }
  body.sidebar-collapsed .sidebar { display: none; }
  #filters-collapse { display: inline-block; }
}

/* Phones: sidebar is a slide-in drawer, hidden by default */
@media (max-width: 899px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    width: min(320px, 86vw); margin-top: 0; border-radius: 0;
    border-top: none; border-bottom: none; border-left: none;
    transform: translateX(-105%); visibility: hidden;
    transition: transform .25s ease, visibility .25s ease;
    box-shadow: none;
  }
  body.filters-open .sidebar {
    transform: none; visibility: visible;
    box-shadow: 8px 0 32px rgba(0, 0, 0, .25);
  }
  body.filters-open { overflow: hidden; }
  #filters-close { display: inline-flex; }
}
.fchip {
  flex: 0 0 auto; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer;
  padding: 7px 13px; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); white-space: nowrap;
}
.fchip:hover { border-color: var(--teal); }
.fchip:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
.fchip .cnt { font-weight: 600; color: var(--muted); margin-left: 2px; }
.fchip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.fchip[aria-pressed="true"] .cnt { color: rgba(255, 255, 255, .85); }
.fchip.party[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); }

/* Active filters — removable chips */
.active-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.active-row[hidden] { display: none; }
.active-label { font-size: .85rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.active-chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .9rem; font-weight: 700;
  padding: 5px 6px 5px 12px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--sun); color: var(--ink);
}
.active-chip:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; }
.active-chip .x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .15);
  font-size: .8rem; line-height: 1;
}

/* Buttons */
.btn {
  display: inline-block; border: none; cursor: pointer; font: inherit; font-size: .95rem; font-weight: 700;
  padding: 10px 16px; border-radius: 999px; background: var(--coral); color: #fff; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--coral-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--teal-dark); border: 2px solid var(--line); padding: 8px 14px; }
.btn.ghost:hover { border-color: var(--teal); }
.btn.small { padding: 6px 12px; font-size: .88rem; }
.btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
.btn[hidden] { display: none; }

/* Results line + sort chips */
.results-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-size: .98rem; color: var(--muted); margin: 14px 0 0;
}
.results-line strong { color: var(--ink); }
.sort-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.sort-label { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sort-group .fchip { padding: 5px 11px; font-size: .88rem; }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0 6px; }
.cat-tile {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: var(--ink);
}
.cat-tile:hover { border-color: var(--teal); text-decoration: none; }
.cat-tile b { color: var(--ink); font-size: 1.05rem; display: block; }
.cat-tile span { color: var(--muted); font-size: .95rem; }

/* Venue cards — large photo grid */
.venue-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 16px 0 30px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.card:hover { border-color: var(--teal); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-body .desc { flex: 1; }
.photo-link { display: block; }
.card-photo {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block;
  background: #dfe7ea;
}
.venue-photo {
  width: 100%; aspect-ratio: 16 / 9; max-height: 440px; object-fit: cover; display: block;
  border-radius: var(--radius); background: #dfe7ea;
}
.card-photo.placeholder, .venue-photo.placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #fff; font-weight: 800; font-size: 1.15rem; padding: 20px;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.card-photo.placeholder[data-cat="indoor-playground"] { background: linear-gradient(135deg, #e4572e, #f2a541); }
.card-photo.placeholder[data-cat="trampoline-ninja"] { background: linear-gradient(135deg, #0f766e, #2a9d8f); }
.card-photo.placeholder[data-cat="water-splash"] { background: linear-gradient(135deg, #1d7fb8, #57c4e5); }
.card-photo.placeholder[data-cat="museums"] { background: linear-gradient(135deg, #6a4c93, #b583e0); }
.card-photo.placeholder[data-cat="zoos-animals"] { background: linear-gradient(135deg, #2e7d32, #7cb342); }
.card-photo.placeholder[data-cat="nature-outdoors"] { background: linear-gradient(135deg, #33691e, #558b2f); }
.card-photo.placeholder[data-cat="arcades-fun"] { background: linear-gradient(135deg, #ad1457, #e4572e); }
.card-photo.placeholder[data-cat="parks-playgrounds"] { background: linear-gradient(135deg, #43a047, #9ccc65); }
.card-photo.placeholder[data-cat="pools"] { background: linear-gradient(135deg, #0277bd, #26c6da); }
.venue-photo.placeholder[data-cat] { background: linear-gradient(135deg, #0f766e, #2a9d8f); }
.photo-credit { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.rating { font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.rating .star { color: #e8a100; }
.dist { font-weight: 700; color: var(--teal); margin: 0 0 6px; font-size: .98rem; }
.card h3 { font-size: 1.25rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--teal); }
.card .meta { color: var(--muted); font-size: .98rem; margin-bottom: 6px; }
.card p.desc { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.chip {
  display: inline-block; font-size: .85rem; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); border: 1px solid #cfe6e4;
}
.chip.free { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.chip.party { background: #fff3e0; color: #8d4e00; border-color: #ffe0b2; }
.chip.cat { background: #eef2f8; color: var(--ink); border-color: #d6e0ee; }
.card .card-link { font-weight: 700; }

/* Venue page */
.facts {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 16px 0;
}
.facts dl { display: grid; grid-template-columns: 130px 1fr; row-gap: 10px; column-gap: 12px; margin: 0; }
.facts dt { font-weight: 700; color: var(--muted); font-size: .95rem; }
.facts dd { margin: 0; }
.crumbs { font-size: .95rem; color: var(--muted); margin: 18px 0 4px; }
.crumbs a { color: var(--muted); }
.notice {
  background: #fff8e6; border: 1px solid #ffe1a1; border-radius: 10px;
  padding: 12px 14px; font-size: .98rem; color: #6d4c00; margin: 16px 0;
}
footer.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 34px;
  color: var(--muted); font-size: .95rem;
}
footer.site-footer a { color: var(--muted); }
.no-results { display: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: center; margin: 16px 0 30px; }

@media (min-width: 640px) {
  .venue-grid { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  h1 { font-size: 1.6rem; }
}
/* 3 columns once the content column is wide enough: viewport >= 1200px
   with the sidebar open, or >= 900px with the sidebar collapsed. */
@media (min-width: 1200px) {
  .venue-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 900px) {
  body.sidebar-collapsed .venue-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* AdSense slots — only rendered once ADSENSE_PUB_ID is set in build.py */
.ad-slot { margin: 1.25rem 0; text-align: center; min-height: 0; }
.venue-grid > .ad-slot { grid-column: 1 / -1; }
