/* ============================================================
   WhereToEat — EXPLORE LAYOUT (consolidated 2026-10-01)
   ONE desktop architecture: full-canvas map + absolute overlays.
   No grid columns. Mobile drawers untouched.
   ============================================================ */

/* ---------- DESKTOP ARCHITECTURE (>=901px) ---------- */
@media (min-width: 901px) {
  /* FULLSCREEN MAP (auditfix 2026-10-02): the stage spans the whole viewport,
     header/promo/panels float over it as glass chrome. */
  .app {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* workspace: single stage covering the entire screen, no reserved columns */
  .workspace {
    position: absolute;
    inset: 0;
    display: block;
    flex: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  /* status line floats over the map like the rest of the chrome */
  .view-bar {
    position: relative;
    z-index: 25;
  }

  /* map owns the entire stage */
  .map-shell {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: 1;
  }

  /* one dedicated overlay: vignette + panel-edge shading + map->video fade */
  .map-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.16), transparent 26%, transparent 74%, rgba(0, 0, 0, 0.16)),
      radial-gradient(115% 90% at 50% 42%, transparent 62%, rgba(0, 0, 0, 0.22) 100%),
      linear-gradient(180deg, transparent calc(100% - clamp(100px, 12vh, 150px)), rgba(8, 32, 48, 0.55) calc(100% - clamp(50px, 6vh, 75px)), rgba(8, 32, 48, 1) 100%);
  }

  /* floating glass panels (absolute overlays, never subtract from the map) */
  .left-panel,
  .right-panel {
    position: absolute;
    margin: 0;
    z-index: 20;
    background: rgba(5, 14, 18, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
    backdrop-filter: blur(18px) saturate(125%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 22px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
  }
  .left-panel {
    top: 18px;
    left: 20px;
    bottom: 18px;
    width: clamp(255px, 15vw, 285px);
  }
  .right-panel {
    top: 18px;
    right: 20px;
    bottom: 18px;
    width: clamp(300px, 18vw, 330px);
  }

  /* floating map controls: lower-left of the usable area, right of the Atlas */
  .controls {
    left: calc(clamp(255px, 15vw, 285px) + 36px);
    right: auto;
    bottom: calc(clamp(100px, 12vh, 150px) + 28px);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(7, 15, 18, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
  .controls button {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    color: #fff;
  }
  .controls button + button { border-top: 1px solid rgba(255, 255, 255, 0.08); }
  .controls button:hover { background: rgba(255, 196, 45, 0.14); color: #ffe199; }

  /* legend floats ~28px above the fade */
  .legend {
    bottom: calc(clamp(100px, 12vh, 150px) + 28px);
    background: rgba(7, 15, 18, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.30);
    padding: 7px 16px;
    gap: 12px;
    font-size: 11.5px;
    max-width: 60%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .legend.show { display: flex !important; }

  /* video teaser: gentler pull-up so the map stays dominant */
  .promo-hero-pin {
    margin-top: -10vh;
  }
}

/* ---------- SCROLL COOPERATION (all viewports, auditfix 2026-10-02) ----------
   Vertical touch swipes over the map must scroll the page (into the video section)
   instead of being swallowed by map panning. Horizontal drags still pan the globe;
   pinch still zooms; plain mouse wheel scrolls the page, Ctrl+wheel zooms the map. */
.map-shell {
  touch-action: pan-y;
  /* auditfix 2026-10-02: overscroll-behavior:none was killing scroll chaining —
     wheel/touch over the map could never reach the page (video section). */
  overscroll-behavior: auto;
}
.map-shell .ml-root,
.map-shell .maplibregl-canvas-container,
.map-shell .maplibregl-canvas {
  touch-action: pan-y !important;
}

/* ---------- MARKER HIERARCHY (all viewports) ----------
   MAPVIS 2026-10-09: cuisine colour + edge/glow owned by app.css / polish.
   Do not paint regional dots as dark slate — that hid cuisine identity. */
.spot {
  transition: width .18s ease, height .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease;
  opacity: 0.9;
}
.spot:hover, .spot:focus-visible { transform: translate(-50%, -50%) scale(1.35); }
.pin {
  transition: transform .22s ease, box-shadow .22s ease;
  border-color: color-mix(in srgb, var(--pin-color, #ffc24a) 70%, #8b969e);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.pin:hover { transform: translate(-50%, -50%) scale(1.05); }
.pin .pin-face { border-radius: 50%; overflow: hidden; }
.pin .pin-face img { width: 100%; height: 100%; object-fit: cover; }
.pin.promoted { border-color: #ffd24a; box-shadow: 0 0 12px rgba(255, 210, 74, 0.38), 0 4px 14px rgba(0, 0, 0, 0.45); }
.pin.exclusive { border-color: #67e8f9; box-shadow: 0 0 12px rgba(103, 232, 249, 0.32), 0 4px 14px rgba(0, 0, 0, 0.45); }
.pin.spotlight { border-color: #ffd24a; box-shadow: 0 0 16px rgba(255, 210, 74, 0.5), 0 4px 14px rgba(0, 0, 0, 0.45); }
#mapShell[data-zoom="city"] .pin.photo-pin { width: 46px !important; height: 46px !important; }
#mapShell[data-zoom="near"] .pin.photo-pin { width: 54px !important; height: 54px !important; }
.pin.selected {
  border-color: #ffc24a;
  z-index: 30;
  animation: wteSelectedHalo 2.8s ease-in-out infinite;
}
@keyframes wteSelectedHalo {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55), 0 0 18px rgba(255, 190, 40, 0.45); }
  50%      { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 32px rgba(255, 190, 40, 0.7); }
}
.pin .pin-city { opacity: 0; transition: opacity 0.18s ease; }
.pin:hover .pin-city,
.pin.selected .pin-city,
.pin.promoted .pin-city,
.pin.spotlight .pin-city { opacity: 1; }
.pin.is-hover, .spot.is-hover { z-index: 12; }
.pin.is-hover { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 20px rgba(255, 190, 40, 0.55); }

/* user location beacon */
.user-dot {
  background: #3b82f6;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 7px rgba(59, 130, 246, 0.22), 0 0 18px rgba(59, 130, 246, 0.55);
}

/* dim unrelated dots while a restaurant is selected */
.map-shell:has(.preview.show) .spot { opacity: 0.55; }
.map-shell:has(.preview.show) .spot:hover,
.map-shell:has(.preview.show) .spot.is-hover { opacity: 1; }
.map-shell:has(.preview.show) .pin { opacity: 1; }

/* ---------- PROMOTED STRIP: fully transparent, floating ---------- */
.promo {
  height: 56px;
  padding: 6px 14px;
  border-bottom: 0;
  background: transparent;
}
.promo-track { scroll-padding-left: 14px; }
.promo-card {
  min-width: 200px;
  height: 42px;
  gap: 10px;
  padding: 4px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
.promo-card:hover {
  border-color: rgba(255, 190, 45, 0.55);
  box-shadow: 0 0 16px rgba(255, 182, 46, 0.28);
}
.promo-card + .promo-card { margin-left: 2px; }
.promo-card .food-pic {
  width: 34px;
  height: 34px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* ---------- TRANSPARENT GLASS HEADER ---------- */
/* R4 2026-10-27: transparent navy .header background removed (desktop header now in gui-fix-r4.css; phone glass in header-glass-r2.css) */

/* view-bar: no divider */
.view-bar { border-bottom: 0; background: transparent; }

/* ---------- CUISINE ATLAS ---------- */
.left-panel .filters {
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.left-panel .filters::-webkit-scrollbar { width: 6px; }
.left-panel .filters::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 999px; }
.filter-search {
  height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}
.filter-search:focus { border-color: rgba(255, 196, 45, 0.45); box-shadow: none; outline: none; }
.filter-row { border-bottom-color: rgba(255, 255, 255, 0.06); min-height: 28px; font-size: 12px; }
.filter-row > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 901px) {
  .toggle { width: 36px; height: 20px; padding: 4px 0; box-sizing: content-box; }
  .toggle::after { width: 14px; height: 14px; top: 7px; left: 3px; }
  .toggle[aria-pressed="true"]::after { left: 19px; }
}

/* ---------- RIGHT PANEL: unified discovery + selected profile ---------- */
.right-panel .mini-section {
  margin: 4px 14px;
  padding: 10px 4px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  background: transparent;
}
.right-panel .mini-section:first-of-type { border-top: 0; }
.right-panel .mini-section h2 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.08em; }
.right-panel .intel, .right-panel .feed { border-color: rgba(255, 255, 255, 0.07); }

#social.has-selection { overflow-y: auto; }
.wte-selected-profile { padding: 12px 14px 16px; }
.wte-sp-hero-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.wte-sp-hero { width: 100%; height: 100%; object-fit: cover; display: block; }
.wte-sp-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(5, 12, 15, 0.78);
  border: 1px solid rgba(255, 190, 45, 0.55);
  color: #ffe199; font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.wte-sp-badge.live { border-color: #ff3b50; color: #ffb3bc; }
.wte-sp-name { margin: 0 0 2px; font-size: 18px; font-weight: 800; }
.wte-sp-loc { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.wte-sp-meta { display: flex; gap: 12px; align-items: center; margin: 0 0 10px; font-size: 13px; }
.wte-sp-stars { color: #ffe199; font-weight: 700; }
.wte-sp-reviews { color: var(--muted); }
.wte-sp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.wte-sp-tag { font-size: 11px; color: #d7e3ea; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 999px; padding: 3px 9px; }
.wte-sp-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.wte-sp-view {
  flex: 1; background: linear-gradient(#ffd77a, #d98f14); color: #181006;
  border: 0; border-radius: 12px; font-weight: 800; font-size: 13px;
  letter-spacing: 0.04em; padding: 10px 12px; cursor: pointer;
}
.wte-sp-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wte-sp-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.08); }

/* preview sheet: glass */
.preview, .cluster-sheet {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(7, 15, 18, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

/* ---------- SEAMLESS SECTION CLEANUP ---------- */
.discovery-stack {
  border-top: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 194, 74, 0.10), transparent 50%),
    linear-gradient(180deg, rgba(6, 24, 34, 0) 0%, rgba(6, 24, 34, 1) clamp(90px, 14vh, 160px), #0a2434 35%, #07141c 100%);
}
#discoveryStack.discovery-stack:not(.wte-fire-ready),
#discoveryStack.wte-fire-ready::before {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 194, 74, 0.10), transparent 50%),
    linear-gradient(180deg, rgba(6, 24, 34, 0) 0%, rgba(6, 24, 34, 1) clamp(90px, 14vh, 160px), #0a2434 35%, #07141c 100%);
}
#discoveryStack.wte-fire-ready { background: transparent; }
.site-footer {
  border-top: 0;
  box-shadow: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 194, 74, 0.05), transparent 55%),
    linear-gradient(180deg, #07141c 0%, #061822 28%, #0a2434 70%, #07141c 100%);
}
.site-footer-bottom { border-top: 0; }
.discovery-stack .premium-card { border-color: rgba(255, 194, 74, 0.22); }

@media (max-width: 768px) {
  #discoveryStack.discovery-stack:not(.wte-fire-ready),
  #discoveryStack.wte-fire-ready::before {
    background:
      radial-gradient(ellipse at 50% 0%, rgba(255, 194, 74, 0.08), transparent 50%),
      linear-gradient(180deg, rgba(6, 24, 34, 0) 0%, rgba(6, 24, 34, 1) clamp(56px, 10vh, 90px), #0a2434 35%, #07141c 100%);
  }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .spot, .pin, .promo-card, .preview, .panel { transition: none !important; }
  .pin.selected { animation: none; }
}
