/* ═══════════════════════════════════════════════════════════════════
   SpotlyBD — Homepage-specific styles (extracted from index.php)
   ─────────────────────────────────────────────────────────────────
   P1 · Extracted so the browser can cache them (was ~30KB inline on
   every page load). Loaded via <link rel="stylesheet"> with the
   assetUrl() cache-busting version query so admins can edit + deploy
   without hard-refresh worries.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Language toggle in the nav ── */
.sbd-lang-toggle a {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .02em;
  transition: all .15s;
}
.sbd-lang-toggle .sbd-lang-short { display: none; }
@media (max-width: 500px) {
  .sbd-lang-toggle a           { padding: 4px 9px; font-size: .72rem; }
  .sbd-lang-toggle .sbd-lang-full  { display: none; }
  .sbd-lang-toggle .sbd-lang-short { display: inline; }
}

/* ── Live-data widget pulsing dot (was 1-line inline on line 628) ── */
@keyframes sbd-live-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%      { opacity: .4;  transform: scale(1.3); }
}

/* ── Trending Now card hover ── */
.sbd-trending-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -12px rgba(28, 25, 23, .15);
  border-color: var(--paprika, #c2410c) !important;
}

/* ── First-visit vs returning-visitor "How it works" summary ── */
.sbd-how-summary summary {
  outline: none;
  user-select: none;
}
.sbd-how-summary summary::-webkit-details-marker { display: none; }
.sbd-how-summary[open] summary { color: var(--paprika-dark, #9a3412); }

/* ══════════════════════════════════════════════════════════════════
   P3 · How-SpotlyBD-Works section animations
   ────────────────────────────────────────────────────────────────
   CSS-only animations that add life without needing a designer or
   external JSON. Later, a real Lottie file can drop into the
   [data-lottie-slot] div and take over — infrastructure ready.
   ══════════════════════════════════════════════════════════════════ */

/* Icon: gentle continuous pulse (like a heartbeat) — draws the eye
   without being distracting. Runs on hover only if user has
   prefers-reduced-motion set. */
.sbd-hiw-icon {
  animation: sbd-hiw-pulse 2.6s ease-in-out infinite;
  will-change: transform, box-shadow;
}
@keyframes sbd-hiw-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 8px 20px -6px rgba(194,65,12,.4); }
  50%      { transform: scale(1.06); box-shadow: 0 12px 28px -6px rgba(194,65,12,.5); }
}
/* Stagger each step's pulse so they don't sync (feels more alive).
   Supports both the homepage 3-step layout and the vendors page 4-step layout. */
.sbd-how-steps .sbd-how-step:nth-child(1) .sbd-hiw-icon { animation-delay: 0s;   }
.sbd-how-steps .sbd-how-step:nth-child(2) .sbd-hiw-icon { animation-delay: .5s;  }
.sbd-how-steps .sbd-how-step:nth-child(3) .sbd-hiw-icon { animation-delay: 1s;   }
.sbd-how-steps .sbd-how-step:nth-child(4) .sbd-hiw-icon { animation-delay: 1.5s; }

/* Card hover-lift — subtle "come look at me" cue */
.sbd-how-step {
  will-change: transform;
}
.sbd-how-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -12px rgba(28,25,23,.18);
}
.sbd-how-step:hover .sbd-hiw-icon {
  animation-play-state: paused;
  transform: scale(1.12) rotate(-4deg);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}

/* Scroll-in fade + slide (staggered per column) — first impression polish */
.sbd-hiw-fade {
  opacity: 0;
  transform: translateY(24px);
  animation: sbd-hiw-fadein .7s ease-out forwards;
  animation-delay: var(--sbd-hiw-delay, 0ms);
}
@keyframes sbd-hiw-fadein {
  to { opacity: 1; transform: translateY(0); }
}

/* Respect accessibility preferences — kill motion entirely for
   users who've asked for reduced motion at OS level. */
@media (prefers-reduced-motion: reduce) {
  .sbd-hiw-icon,
  .sbd-hiw-fade { animation: none; opacity: 1; transform: none; }
  .sbd-how-step:hover { transform: none; }
  .sbd-how-step:hover .sbd-hiw-icon { transform: none; }
}

/* ── Live-count strip pulsing dot (uses existing sbd-live-pulse from earlier) ── */
.sbd-live-strip {
  animation: sbd-live-fadein .8s ease-out;
}
@keyframes sbd-live-fadein {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════
   Layered hero (TasteAtlas-style) — full-bleed background with
   soft-blurred vendor banners as a collage, centered content overlay.
   Overrides the default 2-column grid from warm-theme.css.
   ══════════════════════════════════════════════════════════════════ */
.wt-hero--layered {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: 40px 0 60px;
  background: linear-gradient(180deg, #1c1917 0%, #2d1810 100%); /* deep base */
}
.wt-hero--layered .wt-hero-wrap--centered {
  position: relative;
  z-index: 2;
  display: block;                             /* kill the default grid */
  grid-template-columns: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}
.wt-hero--layered .wt-hero-content {
  color: #fef8f0;
}
.wt-hero--layered .wt-hero-title { color: #fef8f0; }
.wt-hero--layered .wt-hero-title em { color: var(--turmeric, #f59e0b); }
.wt-hero--layered .wt-hero-sub { color: rgba(254,248,240,.88); }
.wt-hero--layered .wt-hero-subtitle { color: var(--turmeric, #f59e0b) !important; }
.wt-hero--layered .wt-hero-subtitle span { color: rgba(254,248,240,.75) !important; }
.wt-hero--layered .wt-hero-title span[style] { color: rgba(254,248,240,.7) !important; }
.wt-hero--layered .wt-pill-live {
  background: rgba(255,255,255,.15);
  color: #fef8f0;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
}
.wt-hero--layered .wt-loc-pill {
  justify-content: center;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  color: #fef8f0;
  backdrop-filter: blur(6px);
}
.wt-hero--layered .wt-loc-icon,
.wt-hero--layered .wt-loc-pill span,
.wt-hero--layered .wt-loc-pill strong { color: #fef8f0; }
.wt-hero--layered .wt-loc-pill button[type="button"]:not([data-locate-me]) {
  color: rgba(254,248,240,.85);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 100px;
}
.wt-hero--layered .wt-search {
  max-width: 620px;
  margin: 0 auto 16px;
}
.wt-hero--layered .wt-search input {
  background: rgba(255,255,255,.98);
  border: none;
  box-shadow: 0 12px 40px -12px rgba(0,0,0,.5);
}
.wt-hero--layered .wt-suggestions {
  justify-content: center;
  flex-wrap: wrap;
}
.wt-hero--layered .wt-suggestions .wt-label {
  color: rgba(254,248,240,.7);
}
.wt-hero--layered .wt-chip {
  background: rgba(255,255,255,.95);
  color: var(--paprika-dark, #9a3412);
}

/* Background collage — 3 vendor banners as tiles with strong blur */
.wt-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.wt-hero-bg-tile {
  position: absolute;
  overflow: hidden;
  filter: blur(6px);
  opacity: .55;
  transform: scale(1.15);
  transition: opacity .4s;
}
.wt-hero-bg-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wt-hero-bg-tile--1 { top: 0; left: 0; width: 52%; height: 60%; }
.wt-hero-bg-tile--2 { top: 0; right: 0; width: 52%; height: 60%; }
.wt-hero-bg-tile--3 { bottom: 0; left: 20%; width: 60%; height: 55%; }
.wt-hero-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(28,25,23,.62) 0%, rgba(28,25,23,.85) 70%),
    linear-gradient(180deg, rgba(28,25,23,.55) 0%, rgba(45,24,16,.7) 100%);
}

/* Mobile: tighter padding + smaller minimum height */
@media (max-width: 640px) {
  .wt-hero--layered { min-height: 480px; padding: 24px 0 36px; }
  .wt-hero-bg-tile { filter: blur(8px); opacity: .5; }
}

/* ══════════════════════════════════════════════════════════════════
   Featured Today strip — vendor cards moved out of the hero into
   their own horizontal strip immediately below. Reuses hero-slideshow
   behavior via the same .wt-hero-visual + data-slideshow-mode combo.
   ══════════════════════════════════════════════════════════════════ */
.sbd-featured-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 20px;
  scrollbar-width: none;
  position: relative;
}
.sbd-featured-strip::-webkit-scrollbar { display: none; }
.sbd-featured-card {
  flex: 0 0 320px;
  height: 200px;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 24px -12px rgba(28,25,23,.22);
  transform: none;
  top: auto; left: auto;
  transition: transform .2s ease, box-shadow .2s ease;
}
.sbd-featured-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -12px rgba(28,25,23,.32);
}
.sbd-featured-card img { width: 100%; height: 100%; object-fit: cover; }
.sbd-featured-card .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--cream-2, #fdf4e7), var(--paprika-soft, #fde3d3));
}
.sbd-featured-card .wt-tag-corner {
  position: absolute; top: 10px; left: 10px; z-index: 2;
}
.sbd-featured-card .wt-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, rgba(28,25,23,0) 0%, rgba(28,25,23,.85) 100%);
  color: #fef8f0;
}
.sbd-featured-card .wt-caption h4 {
  margin: 0 0 3px;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fef8f0;
}
.sbd-featured-card .wt-caption p {
  margin: 0;
  font-size: .78rem;
  opacity: .9;
}
@media (max-width: 640px) {
  .sbd-featured-card { flex: 0 0 88%; max-width: 340px; }
}

/* ══════════════════════════════════════════════════════════════════
   Hero slideshow — activated by JS when data-slideshow-mode matches
   the current viewport. When active, the 3 tilted cards become a
   horizontal scroll-snap carousel with dot navigation + swipe.
   ══════════════════════════════════════════════════════════════════ */

/* Dots container — hidden by default, revealed when JS turns on slideshow */
.wt-hero-visual .wt-hero-dots {
  display: none;
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  justify-content: center;
  gap: 8px;
  z-index: 3;
}
.wt-hero-visual .wt-hero-dots button {
  width: 8px; height: 8px;
  padding: 0; border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  cursor: pointer;
  transition: width .2s, background .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.wt-hero-visual .wt-hero-dots button.is-active {
  width: 22px;
  border-radius: 4px;
  background: var(--paprika, #c2410c);
}
.wt-hero-visual .wt-hero-dots button:focus-visible {
  outline: 2px solid var(--paprika, #c2410c);
  outline-offset: 2px;
}

/* When JS activates the carousel — transforms the tilted stack into a
   horizontal scroll-snap track. The .is-slideshow-active class only
   gets added when: mode=both, OR (mode=mobile AND viewport<900px). */
.wt-hero-visual.is-slideshow-active {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;                    /* Firefox */
  padding: 8px 0 40px;                       /* room for dots */
  gap: 12px;
  min-height: unset !important;
  position: relative;
}
.wt-hero-visual.is-slideshow-active::-webkit-scrollbar { display: none; }
.wt-hero-visual.is-slideshow-active .wt-hero-dots { display: flex; }

/* Focus + peek pattern — active card is prominently larger, peek cards
   are visibly smaller and dimmed. Netflix/Spotify pattern with a stronger
   size delta so the difference reads clearly on both desktop + mobile.
   .is-current is set by hero-slideshow.js on the card closest to viewport
   center on each scroll settle. */
.wt-hero-visual.is-slideshow-active {
  /* Give the container enough vertical room for the enlarged active card
     without clipping (transform-based scale would otherwise overflow). */
  min-height: 340px !important;
  padding-top: 22px;
  padding-bottom: 26px;
  align-items: center;
}
.wt-hero-visual.is-slideshow-active .wt-food-card {
  transform: none !important;
  position: relative !important;
  top: auto !important; left: auto !important;
  right: auto !important; bottom: auto !important;
  flex: 0 0 92%;                    /* base slot: near-full width */
  max-width: 520px;
  min-width: 260px;
  height: 260px;                    /* explicit height so scale is visible */
  scroll-snap-align: center;
  scroll-snap-stop: always;
  margin: 0;
  border-radius: 20px;
  box-shadow: 0 8px 20px -10px rgba(28,25,23,.25);
  opacity: .55;                     /* dimmed peek */
  transform: scale(.82) !important; /* clearly smaller peek */
  transform-origin: center;
  transition: opacity .4s ease,
              transform .45s cubic-bezier(.34,1.25,.5,1),
              box-shadow .4s ease;
}
.wt-hero-visual.is-slideshow-active .wt-food-card.is-current {
  opacity: 1;
  transform: scale(1.06) !important;      /* active card visibly LARGER than base */
  box-shadow: 0 24px 56px -14px rgba(28,25,23,.5);
  z-index: 3;
}
.wt-hero-visual.is-slideshow-active .wt-food-card:first-of-type { margin-left: 6%; }
.wt-hero-visual.is-slideshow-active .wt-food-card:last-of-type  { margin-right: 6%; }
.wt-hero-visual.is-slideshow-active .wt-food-card + .wt-food-card { margin-left: 8px; }

/* Mobile: even taller cards, less peek room */
@media (max-width: 640px) {
  .wt-hero-visual.is-slideshow-active .wt-food-card {
    flex: 0 0 88%;
    height: 240px;
    transform: scale(.88) !important;
    opacity: .5;
  }
  .wt-hero-visual.is-slideshow-active .wt-food-card.is-current {
    transform: scale(1.02) !important;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Smoke / steam effect — per-vendor CSS animation
   ────────────────────────────────────────────────────────────────
   Rendered as 3 blurred blob particles rising from a configurable
   horizontal origin (--sbd-smoke-x set inline). Contained inside
   the top ~55% of the card via mask so it never escapes the border-
   radius clip. Battery-saved via IntersectionObserver in smoke-effect.js
   (only cards with .sbd-smoke--playing class animate).
   ══════════════════════════════════════════════════════════════════ */
.sbd-smoke {
  position: absolute;
  inset: 0 0 45% 0;                 /* only top ~55% of the card */
  z-index: 1;                       /* above image, below pills/caption */
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
}
.sbd-smoke span {
  position: absolute;
  left: var(--sbd-smoke-x, 50%);
  bottom: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transform: translate(-50%, 0) scale(.6);
  opacity: 0;
  filter: blur(10px);
  will-change: transform, opacity;
}
.sbd-smoke--steam span { background: rgba(255, 255, 255, .78); }
.sbd-smoke--smoke span { background: rgba(120, 113, 108, .82); }

/* Only animate when marked "playing" by the IntersectionObserver.
   This lets many cards mount smoke markup without burning battery
   when off-screen. */
.sbd-smoke--playing span {
  animation: sbd-smoke-rise 5.5s ease-out infinite;
}
.sbd-smoke--playing span:nth-child(1) { animation-delay: 0s;   }
.sbd-smoke--playing span:nth-child(2) { animation-delay: 1.9s; }
.sbd-smoke--playing span:nth-child(3) { animation-delay: 3.7s; }

/* Slightly slower + wider drift for smoke (feels heavier than steam) */
.sbd-smoke--smoke.sbd-smoke--playing span {
  animation-duration: 6.5s;
  filter: blur(14px);
}

@keyframes sbd-smoke-rise {
  0% {
    transform: translate(-50%, 20%) scale(.5) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: .85;
  }
  60% {
    transform: translate(calc(-50% - 14px), -80%) scale(1.6) rotate(-8deg);
    opacity: .5;
  }
  100% {
    transform: translate(calc(-50% + 22px), -170%) scale(2.4) rotate(6deg);
    opacity: 0;
  }
}

/* Card containers need position:relative for smoke to anchor properly.
   .wt-food-card and .wt-vendor-hero already are, but belt+braces: */
.wt-food-card, .wt-vendor-hero { position: relative; }

/* HARD accessibility gate — no smoke ever runs for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  .sbd-smoke span,
  .sbd-smoke--playing span { animation: none !important; opacity: 0 !important; }
}

/* Decoration badge stays on the first card while carousel is active */
.wt-hero-visual.is-slideshow-active .wt-deco-badge--top {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 4;
}

/* Respect motion preferences — no autoplay when user requested reduced motion.
   (The JS also honors this; belt + braces.) */
@media (prefers-reduced-motion: reduce) {
  .wt-hero-visual.is-slideshow-active { scroll-behavior: auto; }
}

/* Mobile viewport slight adjustments */
@media (max-width: 640px) {
  .wt-hero-visual.is-slideshow-active .wt-food-card {
    flex: 0 0 92%;
    min-width: 240px;
  }
}
