/* WhereTooEat :8765 — ONE shared glass system (reviewfix 2026-09-30). Loaded after every other stylesheet.
   Spec (Daniel): glass only on the floating layer; dark tinted black-and-gold glass (reference = the
   "Promoted near you" scroll cue) with readable text; food images, videos and the map stay crisp
   (never blurred by a permanent overlay: map popups/panels over the map and cards over the fire video are
   tint-only); lighter blur on mobile; transform/opacity-only animation; solid fallback without
   backdrop-filter support. */

:root {
  --wte-glass-bg: rgba(14, 26, 34, 0.35);          /* floating chrome (header, dock, pills) */
  --wte-glass-bg-card: rgba(16, 28, 38, 0.30);      /* cards */
  --wte-glass-bg-strong: rgba(10, 22, 30, 0.26);    /* dialogs, drawers, sheets, popups, panels */
  --wte-glass-bg-hover: rgba(24, 38, 48, 0.42);
  --wte-glass-border: rgba(255, 255, 255, 0.15);
  --wte-glass-border-strong: rgba(242, 195, 90, 0.35);
  --wte-glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --wte-glass-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  --wte-glass-blur: blur(14px) saturate(1.25);
  --wte-glass-blur-card: blur(10px) saturate(1.2);
  --wte-glass-blur-strong: blur(16px) saturate(1.3);
  --wte-glass-text: #f3ead8;
  --wte-glass-muted: #d2c7b2;
}
@media (max-width: 900px) { /* phones + tablets (dock layout) */
  :root {
    --wte-glass-blur: blur(8px) saturate(1.1);
    --wte-glass-blur-card: none;                     /* mobile: cards are tint-only (cheaper scrolling) */
    --wte-glass-blur-strong: blur(10px) saturate(1.1);
    --wte-glass-bg-card: rgba(18, 15, 10, 0.8);
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --wte-glass-bg: rgba(20, 16, 10, 0.92);
    --wte-glass-bg-card: rgba(18, 15, 10, 0.94);
    --wte-glass-bg-strong: rgba(15, 12, 8, 0.96);
  }
}

/* ---------- 1. Floating chrome: header/nav, promo strip, view bar, dock ---------- */
.header,
.promo,
.view-bar,
.mobile-nav {
  background: var(--wte-glass-bg);
  -webkit-backdrop-filter: var(--wte-glass-blur);
          backdrop-filter: var(--wte-glass-blur);
  border-color: var(--wte-glass-border);
  box-shadow: var(--wte-glass-hi), 0 6px 22px rgba(0, 0, 0, 0.35);
}
@media (max-width: 900px) {
  .mobile-nav { border: 1px solid var(--wte-glass-border); }
}
.nav a { color: var(--wte-glass-text); }

/* ---------- 2. Search input + results ---------- */
.header .search,
.search {
  background: rgba(10, 8, 5, 0.55);
  border-color: rgba(255, 194, 74, 0.34);
  box-shadow: var(--wte-glass-hi);
}
.search-results {
  background: var(--wte-glass-bg-strong);
  -webkit-backdrop-filter: var(--wte-glass-blur-strong);
          backdrop-filter: var(--wte-glass-blur-strong);
  border-color: var(--wte-glass-border-strong);
}
.search-hit:hover, .search-hit.active { background: rgba(255, 194, 74, 0.12); }

/* ---------- 3. Filter / social panels, legend, spot tip, map popup (over the MAP: tint-only, no blur) ---------- */
.panel,
.legend,
.spot-tip,
.preview,
.cluster-sheet {
  background: var(--wte-glass-bg-strong);
  border-color: var(--wte-glass-border-strong);
  box-shadow: var(--wte-glass-hi), var(--wte-glass-shadow);
  -webkit-backdrop-filter: var(--wte-glass-blur-strong);
          backdrop-filter: var(--wte-glass-blur-strong);
}
.preview-close { background: rgba(10, 8, 5, 0.8); }

/* ---------- 4. Cards: promo strip, Promoted / Near / Exclusive / Featured / Newest, Signature (one tone) ---------- */
.promo-card,
.premium-card,
.discovery-stack .premium-card,
.disc-card,
#discDishCarousel .sig-card {
  background: var(--wte-glass-bg-card);
  -webkit-backdrop-filter: var(--wte-glass-blur-card);
          backdrop-filter: var(--wte-glass-blur-card);
  border-color: var(--wte-glass-border);
  box-shadow: var(--wte-glass-hi), var(--wte-glass-shadow);
}
.disc-card-body,
.discovery-stack .premium-card-body,
.premium-card.wte-cardish .premium-card-body {
  background: linear-gradient(180deg, rgba(12, 10, 6, 0.35), rgba(12, 10, 6, 0.12) 40%, transparent);
}
.disc-card-logo { background: rgba(12, 10, 6, 0.9); }
/* cards over the footer fire video: tint-only (the video stays crisp) */
#discFeatured .premium-card, #discFeatured .disc-card,
#discNewest .premium-card, #discNewest .disc-card {
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
  background: rgba(16, 13, 8, 0.84);
}
/* card media never gets a glass layer */
.premium-card-media, .disc-card-media, #discDishCarousel .sig-card-media { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- 5. Secondary controls: carousel arrows, follow pills, card secondary buttons, scroll cue ---------- */
.disc-arrow,
.site-footer .follow-pill,
#premiumScrollCue.premium-scroll-cue {
  background: var(--wte-glass-bg);
  -webkit-backdrop-filter: var(--wte-glass-blur);
          backdrop-filter: var(--wte-glass-blur);
  border: 1px solid var(--wte-glass-border-strong);
  color: var(--wte-glass-text);
  box-shadow: var(--wte-glass-hi), 0 8px 22px rgba(0, 0, 0, 0.35);
}
#premiumScrollCue.premium-scroll-cue { background: rgba(40, 34, 22, 0.72); } /* the reference tint */
.disc-arrow:hover,
.site-footer .follow-pill:hover { background: var(--wte-glass-bg-hover); }
/* footer pills sit over the fire video: tint-only */
.site-footer .follow-pill { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(16, 13, 8, 0.78); }

/* ---------- 6. Profile sheet, orb chat, dialogs, drawers, live panel ---------- */
.wte-profile-modal .wte-profile-sheet,
.orb-chat,
.dialog,
.trip-board,
.classified-board,
.fav-drawer,
.live-notif-panel {
  background: var(--wte-glass-bg-strong);
  -webkit-backdrop-filter: var(--wte-glass-blur-strong);
          backdrop-filter: var(--wte-glass-blur-strong);
  border-color: var(--wte-glass-border-strong);
  box-shadow: var(--wte-glass-hi), 0 24px 60px rgba(0, 0, 0, 0.55);
  color: var(--wte-glass-text);
}
.dialog p, .orb-chat .food-ai-sub { color: var(--wte-glass-muted); }
/* modal backdrops: dim only, never blur the map / food behind (restaurant profile: see section 9) */
.fav-drawer-backdrop,
.wte-cr-backdrop,
.trip-panel,
.classified {
  -webkit-backdrop-filter: none !important;
          backdrop-filter: none !important;
}
.trip-panel { background: rgba(4, 3, 2, 0.72); }

/* ---------- 7. Never glass over media ---------- */
.promo-hero-controls,
.wte-cr-hero-chip,
.promo-hero-media,
.wte-profile-media,
.mlb,
.maplibregl-canvas,
video {
  -webkit-backdrop-filter: none !important;
          backdrop-filter: none !important;
}

/* ---------- 8. Motion: glass elements animate transform/opacity only ---------- */
.promo-card, .disc-arrow, .site-footer .follow-pill { transition-property: transform, opacity; }
@media (prefers-reduced-motion: reduce) {
  .promo-card, .disc-arrow, .site-footer .follow-pill, .mobile-nav { transition: none; }
}

/* ---------- 9. PROFILEGLASS (Daniel 2026-09-30): restaurant PROFILE modal only ----------
   Light blurred backdrop (scene stays recognisable), translucent dark-gold glass card, fade+scale
   open/close (opacity/transform only). The blur lives on the overlay layer only; the profile's own
   images/video sit above it and stay crisp. Other dialogs keep the dim-only backdrop. */
.wte-profile-modal .wte-profile-backdrop {
  background: rgba(0, 0, 0, 0.16);
  -webkit-backdrop-filter: blur(7px) saturate(1.15);
          backdrop-filter: blur(7px) saturate(1.15);
}
.wte-profile-modal .wte-profile-sheet {
  background: rgba(12, 10, 8, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
          backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(212, 175, 55, 0.36);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 175, 55, 0.12), 0 0 40px rgba(212, 175, 55, 0.08);
  color: var(--wte-glass-text);
}
@media (max-width: 900px) {
  .wte-profile-modal .wte-profile-backdrop {
    -webkit-backdrop-filter: blur(4px) saturate(1.1);
            backdrop-filter: blur(4px) saturate(1.1);
  }
  .wte-profile-modal .wte-profile-sheet {
    background: rgba(12, 10, 8, 0.8);
    /* 390 @ 4x CPU: card blur re-rasterised on every sheet scroll (~25% frames lost); the backdrop
       is already blurred, so the card is tint-only here */
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .wte-profile-modal .wte-profile-backdrop { background: rgba(0, 0, 0, 0.42); }
  .wte-profile-modal .wte-profile-sheet { background: rgba(12, 10, 8, 0.95); }
}
/* text over the lighter glass: solid gold label (was 75% alpha, <4.5:1 over a bright scene) */
.wte-profile-modal .wte-profile-dishes-label { color: #f2c35a; }
/* dock + orb stay hidden while a profile is open (the light backdrop no longer covers them) */
html.wte-profile-open .mobile-nav { opacity: 0; transform: translateY(120%); pointer-events: none; }
/* open: backdrop fades (its blur fades in with it), card fades + scales 0.96 -> 1; close reverses */
.wte-profile-modal.wte-pg-closing { display: flex; pointer-events: none; }
.wte-profile-modal.show .wte-profile-backdrop { animation: wtePgFadeIn 240ms ease-out both; }
.wte-profile-modal.show .wte-profile-sheet { animation: wtePgCardIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.wte-profile-modal.wte-pg-closing .wte-profile-backdrop { animation: wtePgFadeOut 220ms ease-in both; }
.wte-profile-modal.wte-pg-closing .wte-profile-sheet { animation: wtePgCardOut 220ms ease-in both; }
@keyframes wtePgFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes wtePgFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes wtePgCardIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes wtePgCardOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) {
  .wte-profile-modal.show .wte-profile-backdrop,
  .wte-profile-modal.show .wte-profile-sheet,
  .wte-profile-modal.wte-pg-closing .wte-profile-backdrop,
  .wte-profile-modal.wte-pg-closing .wte-profile-sheet { animation: none; }
  html.wte-profile-open .mobile-nav { transform: none; }
}
