/* ============================================================
   KW Deals — style.css
   Warm amber pub palette, mobile-first, light + dark mode
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}
body {
  min-height: 100dvh;
  line-height: 1.55;
  font-family: var(--font-body, 'Satoshi', sans-serif);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}
img, picture, svg { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
h1,h2,h3,h4 { text-wrap: balance; line-height: 1.15; }
p, li { text-wrap: pretty; }
a, button, [role='button'], input, select {
  transition: color 180ms cubic-bezier(0.16,1,0.3,1),
              background 180ms cubic-bezier(0.16,1,0.3,1),
              border-color 180ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 180ms cubic-bezier(0.16,1,0.3,1);
}
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 4px; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0; }

/* ============================================================
   TOKENS — Warm Amber Pub
   ============================================================ */
:root, [data-theme='light'] {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);

  --space-1:.25rem;--space-2:.5rem;--space-3:.75rem;--space-4:1rem;
  --space-5:1.25rem;--space-6:1.5rem;--space-8:2rem;--space-10:2.5rem;
  --space-12:3rem;--space-16:4rem;

  --color-bg: #faf8f4;
  --color-surface: #fefcf8;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f3ede2;
  --color-border: #e2d9cb;
  --color-divider: #ead9c4;
  --color-text: #241c10;
  --color-text-muted: #7a6e5f;
  --color-text-faint: #b8ad9e;
  --color-text-inverse: #fefcf8;

  /* Primary amber */
  --color-primary: #b86b00;
  --color-primary-hover: #934f00;
  --color-primary-highlight: #fde8c4;

  /* Deal type palette */
  --color-wings: #c0392b;        --color-wings-bg: #fdf0ee;
  --color-wine: #7d2248;         --color-wine-bg: #f9eaf1;
  --color-hh: #2e6b30;           --color-hh-bg: #eaf4ea;
  --color-burgers: #d35400;      --color-burgers-bg: #fef0e6;
  --color-ribs: #8b2500;         --color-ribs-bg: #fdeee8;
  --color-fish: #1a6b8a;         --color-fish-bg: #e6f3f8;
  --color-indian: #6d4800;       --color-indian-bg: #fdf4e3;
  --color-kids: #5b3d9e;         --color-kids-bg: #f1ecfb;

  /* City accent stripes */
  --color-cambridge: #b86b00;
  --color-kitchener: #1a6b8a;
  --color-waterloo: #5b3d9e;

  --shadow-sm: 0 1px 3px oklch(0.2 0.03 60 / 0.07);
  --shadow-md: 0 4px 14px oklch(0.2 0.03 60 / 0.10);
  --shadow-lg: 0 12px 32px oklch(0.2 0.03 60 / 0.13);

  --radius-sm:.375rem;--radius-md:.5rem;--radius-lg:.75rem;
  --radius-xl:1rem;--radius-full:9999px;

  --content-wide: 1200px;
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #18140d;
  --color-surface: #1f1a11;
  --color-surface-2: #251f14;
  --color-surface-offset: #1a1509;
  --color-border: #3a3021;
  --color-divider: #2e2618;
  --color-text: #f0e8d8;
  --color-text-muted: #9a8e7a;
  --color-text-faint: #5a5245;
  --color-text-inverse: #18140d;
  --color-primary: #f0a040;
  --color-primary-hover: #e08020;
  --color-primary-highlight: #3d2c10;
  --color-wings: #e05548;        --color-wings-bg: #3d1512;
  --color-wine: #d46090;         --color-wine-bg: #3d1428;
  --color-hh: #66bb6a;           --color-hh-bg: #1b3d1c;
  --color-burgers: #fd8c3a;      --color-burgers-bg: #3d2010;
  --color-ribs: #e07050;         --color-ribs-bg: #3d1a10;
  --color-fish: #4ab0d4;         --color-fish-bg: #0e2e3d;
  --color-indian: #e8b840;       --color-indian-bg: #3d2e06;
  --color-kids: #a888ef;         --color-kids-bg: #1e1040;
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:#18140d;--color-surface:#1f1a11;--color-surface-2:#251f14;
    --color-surface-offset:#1a1509;--color-border:#3a3021;--color-divider:#2e2618;
    --color-text:#f0e8d8;--color-text-muted:#9a8e7a;--color-text-faint:#5a5245;
    --color-text-inverse:#18140d;--color-primary:#f0a040;--color-primary-hover:#e08020;
    --color-primary-highlight:#3d2c10;
    --color-wings:#e05548;--color-wings-bg:#3d1512;--color-wine:#d46090;--color-wine-bg:#3d1428;
    --color-hh:#66bb6a;--color-hh-bg:#1b3d1c;--color-burgers:#fd8c3a;--color-burgers-bg:#3d2010;
    --color-ribs:#e07050;--color-ribs-bg:#3d1a10;--color-fish:#4ab0d4;--color-fish-bg:#0e2e3d;
    --color-indian:#e8b840;--color-indian-bg:#3d2e06;--color-kids:#a888ef;--color-kids-bg:#1e1040;
    --shadow-sm:0 1px 3px oklch(0 0 0 / 0.25);--shadow-md:0 4px 14px oklch(0 0 0 / 0.35);--shadow-lg:0 12px 32px oklch(0 0 0 / 0.45);
  }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--content-wide); margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
}
.logo-wrap { display: flex; align-items: center; gap: var(--space-2); color: var(--color-primary); }
.logo-text { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--color-text); letter-spacing: -0.01em; }
.logo-text strong { color: var(--color-primary); }
.header-right { display: flex; align-items: center; gap: var(--space-3); }
.updated-badge { font-size: var(--text-xs); color: var(--color-text-muted); background: var(--color-surface-offset); border: 1px solid var(--color-border); padding: .2em .6em; border-radius: var(--radius-full); white-space: nowrap; }
.theme-toggle { display:flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:var(--radius-full); color:var(--color-text-muted); border:1px solid var(--color-border); }
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-offset); }

/* ============================================================
   CITY TABS
   ============================================================ */
.city-nav {
  background: var(--color-surface-offset);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 53px; z-index: 99;
}
.city-nav-inner {
  max-width: var(--content-wide); margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex; gap: 0;
}
.city-tab {
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
  white-space: nowrap;
}
.city-tab:hover { color: var(--color-text); }
.city-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* Active city colour overrides */
body.city-kitchener .city-tab.active { color: var(--color-fish); border-bottom-color: var(--color-fish); }
body.city-waterloo .city-tab.active { color: var(--color-kids); border-bottom-color: var(--color-kids); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  min-height: 220px;
}
.hero-image-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  transition: opacity 400ms ease;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0.55) 60%,
    rgba(0,0,0,0.72) 100%
  );
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: clamp(var(--space-10), 6vw, var(--space-16)) var(--space-4);
}
.hero-headline {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-2);
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.hero-sub { font-size: var(--text-base); color: rgba(255,255,255,0.85); max-width: 56ch; }
.hero-sub strong { color: #fff; }

/* ============================================================
   FILTERS
   ============================================================ */
.filters-section {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-5) var(--space-4);
  position: sticky; top: 100px; z-index: 90;
  box-shadow: var(--shadow-sm);
}
.filters-inner {
  max-width: var(--content-wide); margin: 0 auto;
  display: flex; flex-direction: column; gap: var(--space-4);
}
.filter-group { display: flex; flex-direction: column; gap: var(--space-2); }
.filter-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-muted); }
.pill-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pill {
  padding: .35em .85em;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  white-space: nowrap;
  line-height: 1.4;
}
.pill:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-highlight); }
.pill.active { background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary); font-weight: 700; }

/* ============================================================
   RESULTS BAR
   ============================================================ */
.results-bar { padding: var(--space-3) var(--space-4); background: var(--color-bg); }
.results-bar-inner { max-width: var(--content-wide); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.results-count { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); }
.reset-btn { font-size: var(--text-xs); font-weight: 600; color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.reset-btn:hover { color: var(--color-primary-hover); }

/* ============================================================
   CARDS
   ============================================================ */
.cards-section { padding: var(--space-5) var(--space-4) var(--space-16); max-width: var(--content-wide); margin: 0 auto; }
.cards-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 600px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

.deal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.deal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Confidence strip top */
.deal-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.deal-card.confidence-HIGH::before { background: var(--color-hh); }
.deal-card.confidence-MEDIUM::before { background: var(--color-primary); }
.deal-card.confidence-LOW::before { background: var(--color-text-faint); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.card-name { font-family: var(--font-display); font-size: var(--text-base); font-weight: 800; color: var(--color-text); letter-spacing: -.01em; line-height: 1.2; }
.price-badge { font-size: var(--text-xs); font-weight: 700; padding: .2em .5em; border-radius: var(--radius-sm); background: var(--color-surface-offset); color: var(--color-text-muted); border: 1px solid var(--color-border); white-space: nowrap; flex-shrink: 0; }

.card-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.day-badge { font-size: var(--text-xs); font-weight: 700; padding: .2em .6em; border-radius: var(--radius-full); background: var(--color-primary-highlight); color: var(--color-primary); }
.hood-badge { font-size: var(--text-xs); color: var(--color-text-muted); }
.hood-badge::before { content: '📍'; margin-right: .2em; }

.type-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.type-tag { font-size: var(--text-xs); font-weight: 600; padding: .15em .5em; border-radius: var(--radius-full); border: 1px solid transparent; }
.type-tag.wings    { background: var(--color-wings-bg);   color: var(--color-wings); }
.type-tag.wine     { background: var(--color-wine-bg);    color: var(--color-wine); }
.type-tag.happy_hour { background: var(--color-hh-bg);   color: var(--color-hh); }
.type-tag.burgers  { background: var(--color-burgers-bg); color: var(--color-burgers); }
.type-tag.ribs     { background: var(--color-ribs-bg);    color: var(--color-ribs); }
.type-tag.fish_chips { background: var(--color-fish-bg); color: var(--color-fish); }
.type-tag.indian   { background: var(--color-indian-bg);  color: var(--color-indian); }
.type-tag.kids     { background: var(--color-kids-bg);    color: var(--color-kids); }

.card-deal { font-size: var(--text-sm); color: var(--color-text); font-weight: 500; line-height: 1.5; }
.card-hours { font-size: var(--text-xs); color: var(--color-text-muted); }
.confidence-low-note { font-size: var(--text-xs); color: var(--color-text-faint); font-style: italic; margin-top: var(--space-1); }

.card-footer { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--color-divider); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.card-address { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.3; }
.card-link { font-size: var(--text-xs); font-weight: 700; color: var(--color-primary); text-decoration: none; display: flex; align-items: center; gap: .2em; white-space: nowrap; flex-shrink: 0; }
.card-link:hover { color: var(--color-primary-hover); text-decoration: underline; }
.card-link svg { width: 11px; height: 11px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: var(--space-16) var(--space-4); color: var(--color-text-muted); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.empty-state svg { color: var(--color-text-faint); }
.empty-state p { font-size: var(--text-base); }
.inline-reset { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; }

/* ============================================================
   AD SLOTS
   ============================================================ */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.ad-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  align-self: center;
}
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
  border: 1.5px dashed color-mix(in srgb, var(--color-primary) 30%, transparent);
  border-radius: var(--radius-md);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: .03em;
}
.ad-placeholder--leaderboard {
  width: 100%;
  max-width: 728px;
  height: 60px;
}
.ad-placeholder--mid {
  width: 300px;
  max-width: 100%;
  height: 250px;
}

/* In-feed ad card — same grid slot as deal cards */
.ad-card--infeed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-lg);
  border: 1.5px dashed color-mix(in srgb, var(--color-primary) 30%, transparent);
  background: color-mix(in srgb, var(--color-primary) 5%, var(--color-surface));
  padding: var(--space-6);
  min-height: 160px;
}
.ad-card--infeed .ad-label {
  font-size: 0.6rem;
}
.ad-card--infeed .ad-placeholder {
  width: 100%;
  max-width: 300px;
  height: 100px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--color-border); padding: var(--space-8) var(--space-4); background: var(--color-surface); }
.footer-inner { max-width: var(--content-wide); margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer p { font-size: var(--text-sm); color: var(--color-text-muted); max-width: none; }
.footer-small { font-size: var(--text-xs) !important; color: var(--color-text-faint) !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 768px) {
  .filters-inner { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4) var(--space-8); }
  .filters-section { top: 104px; }
}
@media (min-width: 1024px) {
  .filters-inner { grid-template-columns: repeat(4, 1fr); gap: var(--space-4) var(--space-6); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
