/* Today in ABQ — prototype design system (Phase 1).
   Familiar first: system type, white surfaces, rounded cards, soft shadows.
   Color carries meaning only: green = open / happening now, amber = soon, gray = closed. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --raised: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #c2410c;          /* warm terracotta: links, primary actions */
  --accent-ink: #ffffff;
  --open: #1a7f37;
  --soon: #b45309;
  --closed: #8e8e93;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --r-card: 14px;
  --r-chip: 999px;
  --pad: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f10; --surface: #1c1c1e; --raised: #2c2c2e; --text: #f5f5f7;
    --muted: #a1a1a6; --line: #38383a; --accent: #fb923c; --accent-ink: #1c1c1e;
    --open: #30d158; --soon: #ffb340; --closed: #8e8e93;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; }
main { max-width: 1100px; margin: 0 auto; padding: 0 var(--pad) calc(32px + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 20px; letter-spacing: -0.01em; margin: 28px 0 10px; font-weight: 650; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Top bar (browser) and tab bar (installed to home screen) */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px var(--pad); padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: -0.01em; font-size: 17px; }
.toplinks { display: flex; gap: 4px; }
.toplinks a { padding: 8px 12px; border-radius: var(--r-chip); color: var(--muted); font-size: 15px; font-weight: 500; }
.toplinks a.on { color: var(--text); background: var(--raised); }
.tabbar { display: none; }
@media (display-mode: standalone) {
  .toplinks { display: none; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a { min-width: 72px; min-height: 44px; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
  .tabbar a.on { color: var(--accent); font-weight: 600; }
  main { padding-bottom: 96px; }
}

/* Home */
.hello { padding: 20px 0 8px; }
.when { margin: 0 0 4px; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); margin: 0; }

/* Search + chips */
.search { position: sticky; top: 57px; z-index: 10; padding: 10px 0; background: var(--bg); }
.search input { width: 100%; height: 48px; padding: 0 16px 0 44px; border-radius: 24px; border: 1px solid var(--line);
  background: var(--raised) no-repeat 16px 50%/18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  font-size: 16px; color: var(--text); box-shadow: none; -webkit-appearance: none; }
.search input:focus { outline: none; border-color: var(--accent); background-color: var(--surface); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px;
  border-radius: var(--r-chip); border: 1px solid var(--line); background: var(--surface); font-size: 15px;
  font-weight: 500; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Rows (home) */
.row { margin-top: 22px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.row-head h2 { margin: 0; }
.row-head a { color: var(--accent); font-size: 15px; font-weight: 500; }
.row-why { margin: -6px 0 10px; color: var(--muted); font-size: 14px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: min(74%, 260px); gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* Cards */
.card { display: block; background: var(--surface); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.card .ph, .card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--raised); }
.ph { display: grid !important; place-items: center; font-size: 44px; font-weight: 700; color: var(--muted);
  background: linear-gradient(135deg, var(--raised), var(--line)) !important; }
.card-body { padding: 10px 12px 12px; }
.card-name { font-weight: 650; font-size: 16px; line-height: 1.25; margin: 0; }
.card-meta { color: var(--muted); font-size: 14px; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-line { font-size: 14px; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--closed); }
.is-open { color: var(--open); } .is-open .dot, .dot.open { background: var(--open); }
.is-soon { color: var(--soon); } .is-soon .dot, .dot.soon { background: var(--soon); }
.is-closed { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; margin-top: 8px; }
.viewbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 4px; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; background: var(--raised); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-size: 14px; min-height: 32px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.map { height: calc(100dvh - 230px); min-height: 360px; border-radius: var(--r-card); overflow: hidden; margin-top: 8px; }
.empty { padding: 32px 8px; text-align: center; color: var(--muted); }
.empty a { color: var(--accent); font-weight: 500; }
.loading { color: var(--muted); }

/* Place page */
.place { max-width: 680px; margin: 0 auto; }
.hero { position: relative; margin: 12px calc(-1 * var(--pad)) 0; }
@media (min-width: 700px) { .hero { margin: 16px 0 0; } .hero-img { border-radius: var(--r-card); } }
.hero-img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--raised); }
.hero-img.ph { font-size: 72px; }
.save { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); color: #1d1d1f; font-size: 22px; box-shadow: var(--shadow); cursor: pointer; }
.save.on { color: #e11d48; }
.place-body { padding-top: 16px; }
.meta { color: var(--muted); margin: 0; }
.status { margin: 6px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.45em; }
.take { font-size: 17px; margin: 14px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 4px; }
.act { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 15px; cursor: pointer; }
.act.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.week-list, .facts { list-style: none; margin: 0; padding: 0; }
.week-list li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.week-list li:first-child { border-top: 0; }
.wk-day { font-weight: 650; font-variant-numeric: tabular-nums; }
.wk-day.today { color: var(--open); }
.wk-what { margin: 0; }
.wk-src { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.wk-src a { text-decoration: underline; text-underline-offset: 2px; }
.facts li { padding: 8px 0; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; }
.hours-raw { color: var(--muted); }
.fix { margin-top: 32px; font-size: 14px; }
.fix a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* Map popup */
.maplibregl-popup-content { background: var(--surface) !important; color: var(--text); border-radius: 12px !important;
  padding: 10px 12px !important; box-shadow: var(--shadow) !important; font: 14px/1.35 -apple-system, BlinkMacSystemFont, Inter, sans-serif; }
.maplibregl-popup-tip { display: none; }
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; background: var(--closed); box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
.pin.open { background: var(--open); }
.pin.soon { background: var(--soon); }

/* Hours table on place pages */
.hours-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours-table th, .hours-table td { text-align: left; padding: 6px 0; font-weight: 400; color: var(--muted); border-top: 1px solid var(--line); }
.hours-table tr:first-child th, .hours-table tr:first-child td { border-top: 0; }
.hours-table td { text-align: right; }
.hours-table tr.today th, .hours-table tr.today td { color: var(--text); font-weight: 650; }
.grid-wide { grid-column: 1 / -1; padding: 8px 0; text-align: left; }

/* Happenings pages */
.evday h2 { margin-top: 26px; }
.evlist { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.evlist a { display: grid; grid-template-columns: 76px 1fr; grid-template-rows: auto auto; column-gap: 12px; padding: 12px 14px; min-height: 56px; border-top: 1px solid var(--line); }
.evlist li:first-child a { border-top: 0; }
.ev-time { grid-row: 1 / 3; font-weight: 650; font-variant-numeric: tabular-nums; align-self: center; }
.ev-name { font-weight: 600; }
.ev-meta { color: var(--muted); font-size: 14px; }
.intro { margin: 10px 0 0; font-size: 17px; max-width: 640px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

/* Editorial rows (guides, big days, single nights) */
.picks { list-style: none; margin: 8px 0 0; padding: 0; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.picks a { display: grid; grid-template-columns: 1fr; column-gap: 12px; padding: 14px; border-top: 1px solid var(--line); min-height: 56px; }
.picks li:first-child a { border-top: 0; }
.pk-time { grid-row: 1 / 4; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 64px; }
.picks a:has(.pk-time) { grid-template-columns: auto 1fr; }
.picks a:has(.pk-time) > :not(.pk-time) { grid-column: 2; }
.pk-name { font-weight: 650; }
.pk-sub { color: var(--muted); font-size: 14px; }
.pk-fact { font-size: 15px; margin-top: 4px; }
a.more { color: var(--accent); font-weight: 600; }

/* Places without a photo: plain rows, never cards */
.prows { margin-top: 8px; }
.prows h3 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 8px 0 4px; }
.prow { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-height: 52px; }
.prow-name { font-weight: 600; }
.prow-meta { grid-row: 2; color: var(--muted); font-size: 14px; }
.prow-take { grid-row: 3; grid-column: 1; font-size: 14px; margin-top: 3px; }
.prow-line { grid-row: 1 / 4; grid-column: 2; align-self: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.hero.nophoto { min-height: 60px; }
.hero.nophoto .save { position: absolute; right: 0; top: 4px; box-shadow: none; border: 1px solid var(--line); }
.card-take { font-size: 14px; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Niche guide picks: card + source line */
.nguide .card-take { -webkit-line-clamp: unset; display: block; }
.card-order, .card-know { font-size: 14px; margin: 6px 0 0; }
.card-order b { font-weight: 600; }
.card-know { color: var(--muted); font-size: 13px; }
.ngroup h2 { margin: 28px 0 12px; }
.ngroup:first-child h2 { margin-top: 8px; }
.browse { margin-top: 28px; }
.browse h2 { margin: 0 0 10px; }
.plain-links { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; font-size: 15px; }
.plain-links li { break-inside: avoid; padding: 4px 0; }
.plain-links a { color: inherit; text-decoration: underline; text-decoration-color: var(--line, #ddd); text-underline-offset: 3px; }
@media (min-width: 720px) { .plain-links { columns: 3; } }
.nearby ul { list-style: none; margin: 0; padding: 0; }
.nearby li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line, #eee); color: inherit; text-decoration: none; }
.nearby li:first-child a { border-top: 0; }
.nb-name { font-weight: 600; }
.nb-meta { color: var(--muted); font-size: 14px; white-space: nowrap; }
.ev-take { grid-column: 2; color: var(--muted); font-size: 14px; margin-top: 4px; }

.evlist li { display: flex; align-items: stretch; }
.evlist li > a:first-child { flex: 1; min-width: 0; }
.ev-src, .wk-src { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.evlist .ev-src { display: flex; align-items: center; padding: 0 14px; border-top: 1px solid var(--line); }
.evlist li:first-child .ev-src { border-top: 0; }
.evlist li.is-past { opacity: .45; }
.ev-at { font-weight: 400; color: var(--muted); }
.ev-day-link { font-size: 14px; font-weight: 500; margin-left: 8px; }

/* Place page: an occasion offer (Thanksgiving dinner, Thanksgiving Eve night) comes first while it's near. */
.offers { margin: 14px 0 4px; }
.offer { background: var(--raised); border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 10px; }
.offer-k { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.offer-when { margin: 4px 0 0; font-weight: 600; }
.offer-b { margin: 6px 0 0; font-size: 15px; line-height: 1.4; }
.offer-more { margin: 10px 0 0; font-size: 14px; } .offer-more a { color: var(--accent); font-weight: 500; }
.bd-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.bd-acts .act { display: inline-block; padding: 8px 12px; border-radius: 10px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; box-shadow: var(--shadow); }
.bd-acts .act:first-child { background: var(--accent); color: var(--accent-ink); }
.bd-acts .src { font-size: 12px; color: var(--muted); margin-left: auto; }
