/* ══════════════════════════════════════════════════════════════════════
   SimiTOLK — Festival Design System (admin-controlled festive skin)

   Everything here is gated behind attributes written by /src/js/festival-design.js
   from GET /api/festivals/active:
     html[data-fest="on"]           a campaign is running and chrome is wanted
     [data-fest-preset="…"]     theme / default design picked in admin
     html[data-fest-chrome="1"]     marketplace-style skin (header, lights, ticker)
     html[data-fest-hdr="theme|color|image|video|none"]
     html[data-fest-hdr-anim="none|lights|shimmer|glow|pulse|pan"]
     html[data-fest-banner-bg="theme|color|image|video|none"

   RULES OF THE ROAD
   · No attribute → this file is inert. A campaign with no design saved looks
     exactly as it did before this feature existed.
   · Every layer that can fail (video URL, uploaded image, custom CSS) has a
     visual fallback on the element itself, so a dead asset degrades to the
     theme gradient instead of punching a hole in the page.
   · Only paint changes. Nothing here moves layout boxes, so the empty-row
     collapse and the rest of the grid maths stay untouched.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Design tokens ───────────────────────────────────────────────────── */
:root {
  --fest-p: #8b1a1a;
  --fest-s: #c0392b;
  --fest-a: #f1c40f;
  --fest-t: #ffffff;
  --fest-hdr-ov: 0.55;
  --fest-anim-dur: 6s;
  --fest-b1: #ffd740;
  --fest-b2: #ff5252;
  --fest-b3: #69f0ae;
  --fest-b4: #40c4ff;
  --fest-b5: #ff80ab;
}

/* ── Theme / default design presets (admin "Design preset" select) ─────
   `auto` deliberately declares nothing: festival-design.js copies the
   campaign's own theme_primary / theme_secondary / accent / text colours
   into the inline custom properties, so a campaign that predates presets
   keeps the exact palette it already had. */
[data-fest-preset="diwali"] {
  --fest-p: #8f1414; --fest-s: #d35400; --fest-a: #ffd700; --fest-t: #ffffff;
  --fest-b1: #ffd740; --fest-b2: #ff5252; --fest-b3: #ffab40; --fest-b4: #ffd740; --fest-b5: #ff6f00;
}
[data-fest-preset="marigold"] {
  --fest-p: #e65100; --fest-s: #ffb300; --fest-a: #fff176; --fest-t: #ffffff;
  --fest-b1: #ffca28; --fest-b2: #ff7043; --fest-b3: #ffd54f; --fest-b4: #ffab40; --fest-b5: #ffb300;
}
[data-fest-preset="simitolkFkt"] {
  --fest-p: #d32f2f; --fest-s: #ff5722; --fest-a: #ffd700; --fest-t: #ffffff;
  --fest-b1: #ffd740; --fest-b2: #ff5252; --fest-b3: #ffee58; --fest-b4: #ff8a65; --fest-b5: #ffd740;
}
[data-fest-preset="royal"] {
  --fest-p: #4a148c; --fest-s: #7b1fa2; --fest-a: #ffd700; --fest-t: #ffffff;
  --fest-b1: #ffd740; --fest-b2: #ce93d8; --fest-b3: #ffd740; --fest-b4: #b388ff; --fest-b5: #ffd740;
}
[data-fest-preset="holi"] {
  --fest-p: #ad1457; --fest-s: #7b1fa2; --fest-a: #ffeb3b; --fest-t: #ffffff;
  --fest-b1: #ffeb3b; --fest-b2: #ff4081; --fest-b3: #69f0ae; --fest-b4: #40c4ff; --fest-b5: #b388ff;
}
[data-fest-preset="gudi"] {
  --fest-p: #1b5e20; --fest-s: #e65100; --fest-a: #ffd700; --fest-t: #ffffff;
  --fest-b1: #ffd740; --fest-b2: #ffd740; --fest-b3: #69f0ae; --fest-b4: #ffb300; --fest-b5: #ffd740;
}
[data-fest-preset="midnight"] {
  --fest-p: #0d1b2a; --fest-s: #1b3a5c; --fest-a: #f5c542; --fest-t: #ffffff;
  --fest-b1: #f5c542; --fest-b2: #64b5f6; --fest-b3: #f5c542; --fest-b4: #ffd700; --fest-b5: #64b5f6;
}
/* `none` and unknown values: no palette of their own, JS still supplies the
   campaign colours inline, so the banner keeps working with no skin. */

/* ════════════════════════════════════════════════════════════════════
   1. STRING-LIGHT / TORAN STRIP  (the festive top edge)
   Two bulb layers of different colours cross-fade so the strand twinkles
   without animating `box-shadow` or `filter` on a full-width element.
   ════════════════════════════════════════════════════════════════════ */
.fest-lights {
  position: relative;
  height: 18px;
  overflow: hidden;
  pointer-events: none;
  z-index: 61;
  background-color: rgba(0, 0, 0, 0.28);
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
  /* the wire the bulbs hang from */
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}
.fest-lights::before,
.fest-lights::after {
  content: '';
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-size: 48px 18px;
  filter: drop-shadow(0 0 2px rgba(255, 236, 160, 0.9));
}
.fest-lights::before {
  background-image:
    radial-gradient(circle 3.5px at 8px 8px, var(--fest-b1) 92%, transparent 100%),
    radial-gradient(circle 3.5px at 24px 11px, var(--fest-b2) 92%, transparent 100%),
    radial-gradient(circle 3.5px at 40px 8px, var(--fest-b3) 92%, transparent 100%);
  animation: fest-bulb-a 1.8s ease-in-out infinite;
}
.fest-lights::after {
  background-image:
    radial-gradient(circle 3.5px at 16px 11px, var(--fest-b4) 92%, transparent 100%),
    radial-gradient(circle 3.5px at 32px 8px, var(--fest-b5) 92%, transparent 100%),
    radial-gradient(circle 3.5px at 0px 8px, var(--fest-b1) 92%, transparent 100%),
    radial-gradient(circle 3.5px at 48px 8px, var(--fest-b1) 92%, transparent 100%);
  animation: fest-bulb-b 1.8s ease-in-out infinite;
}
@keyframes fest-bulb-a { 0%, 100% { opacity: 1; } 50% { opacity: 0.18; } }
@keyframes fest-bulb-b { 0%, 100% { opacity: 0.18; } 50% { opacity: 1; } }

/* ════════════════════════════════════════════════════════════════════
   2. FESTIVE HEADER SKIN  (chrome = on)
   ════════════════════════════════════════════════════════════════════ */
html[data-fest="on"][data-fest-chrome="1"] .topbar {
  background: linear-gradient(90deg, var(--fest-p) 0%, var(--fest-s) 50%, var(--fest-p) 100%) !important;
  border-bottom: 1px solid rgba(255, 215, 0, 0.45) !important;
}
html[data-fest="on"][data-fest-chrome="1"] .topbar .topbar-item i {
  color: var(--fest-a) !important;
}

html[data-fest="on"][data-fest-chrome="1"] .app-header,
html[data-fest="on"][data-fest-chrome="1"] header.app-header {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 55%),
    linear-gradient(90deg, var(--fest-p) 0%, var(--fest-s) 55%, var(--fest-p) 100%) !important;
  border-bottom: 2px solid var(--fest-a) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18) !important;
}

/* Header copy must stay legible on the festive gradient in BOTH themes. */
html[data-fest="on"][data-fest-chrome="1"] .app-header .brand-name,
html[data-fest="on"][data-fest-chrome="1"] .app-header .brand-name small,
html[data-fest="on"][data-fest-chrome="1"] .app-header .icon-btn,
html[data-fest="on"][data-fest-chrome="1"] .app-header .simi-mega-trigger,
html[data-fest="on"][data-fest-chrome="1"] .app-header .simi-mega-trigger * {
  color: var(--fest-t) !important;
}
html[data-fest="on"][data-fest-chrome="1"] .app-header .icon-btn {
  border-color: rgba(255, 255, 255, 0.32) !important;
}
html[data-fest="on"][data-fest-chrome="1"] .app-header .icon-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}
/* The category strip under the search bar gets the warm wash + gold underline. */
html[data-fest="on"][data-fest-chrome="1"] .simi-mega-wrap {
  background: rgba(0, 0, 0, 0.14) !important;
  border-top: 1px solid rgba(255, 215, 0, 0.35) !important;
}
html[data-fest="on"][data-fest-chrome="1"] .simi-mega-trigger.active {
  border-bottom-color: var(--fest-a) !important;
}

/* Search field stays a readable light card over the gradient. */
html[data-fest="on"][data-fest-chrome="1"] .app-header .search-inner-container {
  border: 1px solid rgba(255, 215, 0, 0.55) !important;
}

/* Warm page wash behind the header so the festive colour bleeds down a
   little, exactly like the festive skin — light themes only, and
   it stops before it can touch any section background. */
html[data-fest="on"]:not([data-theme="dark"]) body {
  background-image: linear-gradient(180deg, rgba(255, 236, 214, 0.9) 0, rgba(255, 250, 243, 0) 340px) !important;
}

/* ── Marquee / announcement strip the admin fills with ticker_text ────── */
.fest-ticker {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--fest-s), var(--fest-p));
  color: var(--fest-t);
  border-bottom: 1px solid rgba(255, 215, 0, 0.5);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1;
  padding: 7px 0;
  z-index: 60;
}
.fest-ticker span {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: fest-ticker-roll 22s linear infinite;
}
.fest-ticker b { color: var(--fest-a); font-weight: 900; }
@keyframes fest-ticker-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ── Festival line riding INSIDE the top bar (.topbar-inner) ─────────────
   festival-design.js puts #festTicker here as the first flex child, so the
   line scrolls across the free width of the top bar instead of adding a
   second strip below the header. The top bar already wears the festive
   gradient, so only the text colours are needed here. */
.topbar-inner .fest-ticker {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  background: none;
  border: none;
  padding: 0;
  color: var(--fest-a);
  font-size: 11.5px;
  line-height: 1.35;
}
.topbar-inner .fest-ticker span {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: fest-ticker-roll 24s linear infinite;
}
.topbar-inner .fest-ticker b { color: #fff; font-weight: 900; }

/* ══════════════════════════════════════════════════════════════════════
   2b. HEADER DECORATION LAYER — marigold garland + falling petals +
   firework sparkles. Added by festival-design.js as #festHdrDeco whenever
   the festive chrome is on, so the header is a living festival surface
   rather than a flat colour bar (the admin's "Header animation" select
   then intensifies flowers/fireworks on top of this baseline).
   Paint only: absolute, pointer-events:none, z-index pinned BELOW the
   header content — no layout box ever moves.
   ════════════════════════════════════════════════════════════════════ */
.fest-hdr-deco {
  position: absolute;
  inset: 0;
  z-index: 0 !important;
  overflow: hidden;
  pointer-events: none;
  display: none;
}
html[data-fest="on"][data-fest-chrome="1"] .fest-hdr-deco { display: block; }
/* Admin asked to keep the header plain ("none") -> decorations stand down. */
html[data-fest="on"] [data-fest-hdr="none"] .fest-hdr-deco { display: none; }

/* Toran / garland strung across the top edge, swaying gently. */
.fest-deco-garland {
  position: absolute;
  top: 0;
  left: -24px;
  right: -24px;
  height: 26px;
  background-image:
    radial-gradient(circle 4.5px at 12px 10px, var(--fest-b1) 94%, transparent 100%),
    radial-gradient(circle 3.5px at 12px 18px, var(--fest-b2) 94%, transparent 100%),
    radial-gradient(circle 4.5px at 36px 10px, var(--fest-b3) 94%, transparent 100%),
    radial-gradient(circle 3.5px at 36px 18px, var(--fest-b1) 94%, transparent 100%),
    linear-gradient(90deg, transparent 11px, rgba(255, 255, 255, 0.38) 11px 13px, transparent 13px 35px, rgba(255, 255, 255, 0.38) 35px 37px, transparent 37px);
  background-size: 48px 26px;
  background-repeat: repeat-x;
  transform-origin: 50% 0;
  animation: fest-garland-sway 3.6s ease-in-out infinite alternate;
}
@keyframes fest-garland-sway {
  from { transform: translateX(-7px) rotate(-0.35deg); }
  to { transform: translateX(7px) rotate(0.35deg); }
}

/* Petals drifting down over the gradient. Colours come from the campaign's
   own festive palette tokens, so every preset stays on-brand. */
.fest-petal {
  position: absolute;
  top: -18px;
  width: 9px;
  height: 13px;
  border-radius: 62% 38% 55% 45%;
  background: var(--fest-b5);
  opacity: 0;
  animation: fest-petal-fall 7s linear infinite;
}
.fest-petal.p1 { left: 7%; background: #ff8a65; animation-delay: 0s; }
.fest-petal.p2 { left: 26%; background: #ffd54f; animation-delay: 1.4s; }
.fest-petal.p3 { left: 47%; background: #ff80ab; animation-delay: 2.8s; }
.fest-petal.p4 { left: 68%; background: #ffb300; animation-delay: 4.2s; }
.fest-petal.p5, .fest-petal.p6 { display: none; }
@keyframes fest-petal-fall {
  0% { transform: translate3d(0, -16px, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.95; }
  45% { transform: translate3d(15px, 70px, 0) rotate(160deg); opacity: 0.85; }
  75% { opacity: 0.5; }
  100% { transform: translate3d(-10px, 170px, 0) rotate(350deg); opacity: 0; }
}

/* Firework sparkle: an 8-spoke starburst that blooms and burns out. */
.fest-deco-burst {
  position: absolute;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0 2.5px, transparent 3px),
    radial-gradient(circle at 50% 8%, var(--fest-a) 0 2.5px, transparent 3px),
    radial-gradient(circle at 50% 92%, var(--fest-a) 0 2.5px, transparent 3px),
    radial-gradient(circle at 8% 50%, var(--fest-b4) 0 2.5px, transparent 3px),
    radial-gradient(circle at 92% 50%, var(--fest-b4) 0 2.5px, transparent 3px),
    radial-gradient(circle at 23% 23%, var(--fest-b2) 0 2px, transparent 3px),
    radial-gradient(circle at 77% 23%, var(--fest-b2) 0 2px, transparent 3px),
    radial-gradient(circle at 23% 77%, var(--fest-b1) 0 2px, transparent 3px),
    radial-gradient(circle at 77% 77%, var(--fest-b1) 0 2px, transparent 3px);
  animation: fest-burst 3.8s ease-out infinite;
}
.fest-deco-burst.b1 { left: 78%; top: 36%; animation-delay: 0s; }
.fest-deco-burst.b2 { left: 22%; top: 66%; animation-delay: 1.7s; animation-duration: 4.4s; }
.fest-deco-burst.b3 { left: 54%; top: 22%; animation-delay: 3.1s; animation-duration: 3.2s; }
@keyframes fest-burst {
  0% { transform: scale(0.25); opacity: 0; }
  12% { opacity: 0.95; }
  55% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Admin "Header animation" choices intensify one of the decorations. */
[data-fest-hdr-anim="flowers"] .fest-petal {
  width: 13px;
  height: 17px;
  animation-duration: 5.6s;
}
[data-fest-hdr-anim="flowers"] .fest-petal.p5,
[data-fest-hdr-anim="flowers"] .fest-petal.p6 { display: block; }
[data-fest-hdr-anim="fireworks"] .fest-deco-burst { animation-duration: 2.6s; }
[data-fest-hdr-anim="fireworks"] .fest-deco-burst.b2 { animation-duration: 3.4s; }
[data-fest-hdr-anim="fireworks"] .fest-deco-burst.b3 { animation-duration: 2.2s; }

/* ════════════════════════════════════════════════════════════════════
   3. HEADER BACKGROUND MEDIA  (video URL / uploaded video / image / colour)
   The layer is a plain absolutely-positioned child. If the video 404s or
   the codec is unsupported, festival-design.js flips the element to
   data-fest-hdr="color" and this gradient is what shows instead.
   ════════════════════════════════════════════════════════════════════ */
/* The media layer is positioned against its host. JS only sets
   `position:relative` on the host when its computed position is `static`,
   so an existing position:sticky header keeps sticking. */

/* Layout-critical properties are pinned with !important so the admin's own
   scoped design (which may also carry !important) can restyle the layer's
   paint but can never turn it into a fixed full-viewport overlay. */
.fest-hdr-media {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  background: linear-gradient(135deg, var(--fest-p), var(--fest-s));
}
.fest-hdr-media video,
.fest-hdr-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* `theme` = no asset supplied, the layer just carries the campaign palette.
   It reproduces the chrome header gradient exactly, so the header looks the
   same whether or not the admin picked an explicit background. */
[data-fest-hdr="theme"] .fest-hdr-media {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 55%),
    linear-gradient(90deg, var(--fest-p) 0%, var(--fest-s) 55%, var(--fest-p) 100%);
}
.fest-hdr-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55));
  opacity: var(--fest-hdr-ov);
}
/* Content must always paint above the media layer (the layer itself is
   excluded, otherwise it would be lifted out of its z-index:0 slot). */
[data-fest-hdr] > *:not(.fest-hdr-media) {
  position: relative;
  z-index: 1;
}

/* ── Header animations (admin "Header animation" select) ─────────────── */
[data-fest-hdr-anim="shimmer"] .fest-hdr-media::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  z-index: 1;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  animation: fest-shimmer 3.6s linear infinite;
}
@keyframes fest-shimmer { to { left: 120%; } }

[data-fest-hdr-anim="glow"] .fest-hdr-media {
  animation: fest-glow 2.8s ease-in-out infinite;
}
@keyframes fest-glow {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 215, 0, 0); }
  50% { box-shadow: inset 0 0 46px 6px rgba(255, 215, 0, 0.45); }
}

[data-fest-hdr-anim="pulse"] .fest-hdr-media {
  animation: fest-pulse 3.2s ease-in-out infinite;
}
@keyframes fest-pulse {
  0%, 100% { filter: brightness(1) saturate(1); }
  50% { filter: brightness(1.28) saturate(1.25); }
}

[data-fest-hdr-anim="pan"] .fest-hdr-media video,
[data-fest-hdr-anim="pan"] .fest-hdr-media img {
  animation: fest-pan var(--fest-anim-dur) ease-in-out infinite alternate;
  transform-origin: center;
}
@keyframes fest-pan {
  from { transform: scale(1) translate3d(-1.5%, 0, 0); }
  to { transform: scale(1.14) translate3d(1.5%, 0, 0); }
}

[data-fest-hdr-anim="lights"] .fest-hdr-media::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  z-index: 1;
  background-repeat: repeat-x;
  background-size: 36px 14px;
  background-image:
    radial-gradient(circle 3px at 9px 7px, var(--fest-b1) 92%, transparent 100%),
    radial-gradient(circle 3px at 27px 7px, var(--fest-b4) 92%, transparent 100%);
  filter: drop-shadow(0 0 3px rgba(255, 236, 160, 0.95));
  animation: fest-bulb-a 1.4s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════════════
   4. FESTIVAL BANNER  — media layer + gold frame (festival card trim)
   ════════════════════════════════════════════════════════════════════ */
#festivalBanner.fest-frame,
html[data-fest="on"] .festival-banner {
  border: 2px solid rgba(255, 215, 0, 0.7);
  box-shadow: 0 10px 30px rgba(139, 26, 26, 0.22);
}
.fest-banner-media {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--fest-p), var(--fest-s));
}
.fest-banner-media video,
.fest-banner-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fest-banner-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.25) 60%, rgba(0, 0, 0, 0.45) 100%);
}
/* Lift the banner's own content (badge / title / buttons / product slider)
   above the media layer — never the layer itself. */
[data-fest-banner-bg="image"] > *:not(.fest-banner-media),
[data-fest-banner-bg="video"] > *:not(.fest-banner-media),
[data-fest-banner-bg="color"] > *:not(.fest-banner-media) {
  position: relative;
  z-index: 1;
}

/* ════════════════════════════════════════════════════════════════════
   5. SECTION ACCENTS — every festive section header picks up the gold rule
   ════════════════════════════════════════════════════════════════════ */
html[data-fest="on"][data-fest-chrome="1"] .festival-section-header,
html[data-fest="on"][data-fest-chrome="1"] .festival-offers {
  border-left: 3px solid var(--fest-a);
}
html[data-fest="on"][data-fest-chrome="1"] .deal-timer {
  border-color: var(--fest-a) !important;
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.35);
}

/* ════════════════════════════════════════════════════════════════════
   6. ADMIN LIVE PREVIEW — the studio reuses this file so the thumbnail is
      pixel-identical to the storefront. Scoped to #festPreview only.
   ════════════════════════════════════════════════════════════════════ */
#festPreview {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #0f172a;
  min-height: 190px;
}
#festPreview .fp-header {
  position: relative;
  overflow: hidden;
  padding: 12px 14px;
  background: linear-gradient(90deg, var(--fest-p), var(--fest-s));
  color: var(--fest-t);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#festPreview .fp-body {
  position: relative;
  overflow: hidden;
  margin: 12px;
  padding: 16px 14px;
  border-radius: 10px;
  border: 2px solid rgba(255, 215, 0, 0.7);
  background: linear-gradient(135deg, var(--fest-p), var(--fest-s));
  color: var(--fest-t);
}
#festPreview .fp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--fest-a);
  color: var(--fest-p);
  font-size: 11px;
  font-weight: 900;
}
#festPreview .fp-title { margin: 6px 0 2px; font-size: 17px; font-weight: 900; }
#festPreview .fp-sub { font-size: 12px; opacity: 0.9; }
#festPreview .fp-btn {
  display: inline-block;
  margin-top: 9px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--fest-p);
  font-size: 12px;
  font-weight: 800;
}

/* ════════════════════════════════════════════════════════════════════
   7. RESPONSIVE + ACCESSIBILITY
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .fest-lights { height: 14px; background-size: 48px 14px; }
  .fest-lights::before, .fest-lights::after { background-size: 48px 14px; }
  .fest-ticker { font-size: 11.5px; padding: 6px 0; }
  html[data-fest="on"][data-fest-chrome="1"] .app-header { border-bottom-width: 2px; }

  /* ── The festival line stays on screen on phones ──────────────────────
     On a phone the page scrolls with the header pinned, so a static top bar
     would leave the marquee off-screen after the first few pixels. With the
     line confirmed inside it (data-fest-marquee is written by the JS that
     measured the height), the string lights + top bar pin to the top and the
     sticky header parks underneath at the measured offset. Everything is
     gated on that attribute: no JS measurement -> no sticky behaviour, and
     the page behaves exactly as it did before. */
  html[data-fest-marquee="1"] .fest-lights {
    position: sticky;
    top: 0;
    z-index: 102;
  }
  html[data-fest-marquee="1"] .topbar {
    position: sticky;
    top: 14px;               /* .fest-lights height at this breakpoint */
    z-index: 101;
  }
  html[data-fest-marquee="1"] .app-header {
    top: calc(14px + var(--fest-topbar-h, 0px));
  }
  /* The marquee carries the campaign message, so the trust items make way
     for it on phones (they remain on wider screens and on normal days). */
  html[data-fest-marquee="1"] .topbar-inner > .topbar-item:not(.lang-switch):not(.fest-ticker) {
    display: none;
  }
  html[data-fest-marquee="1"] .topbar-inner .fest-ticker { font-size: 11px; }
  /* responsive.css turns .topbar-inner into a COLUMN at this width (a
     dashboard rule that also hits the homepage bar). In column direction the
     marquee's flex:1 grows in HEIGHT, and align-items:flex-start shrinks its
     width to fit-content (~150px): the line reads "happy d…" clipped inside
     a narrow box with a dead purple gap beside it (production screenshot).
     The marquee is built to ride the top bar's flex ROW, so restore the row
     while the festival line is in the bar — the line then scrolls across the
     full width and the language switch sits at its right edge. Trust items
     stay hidden by the rule above; non-festival days and dashboard pages
     (no data-fest-marquee) are untouched. */
  html[data-fest-marquee="1"] .topbar-inner {
    flex-direction: row;
    align-items: center;
  }
}
@media (max-width: 480px) {
  .fest-lights::before, .fest-lights::after { filter: none; }
}

/* Motion is decoration here, never information — kill all of it when the
   visitor asked for less motion. */
@media (prefers-reduced-motion: reduce) {
  .fest-lights::before,
  .fest-lights::after,
  .fest-ticker span,
  .topbar-inner .fest-ticker span,
  .fest-deco-garland,
  .fest-petal,
  .fest-deco-burst,
  [data-fest-hdr-anim="flowers"] .fest-petal,
  [data-fest-hdr-anim="fireworks"] .fest-deco-burst,
  [data-fest-hdr-anim="shimmer"] .fest-hdr-media::before,
  [data-fest-hdr-anim="glow"] .fest-hdr-media,
  [data-fest-hdr-anim="pulse"] .fest-hdr-media,
  [data-fest-hdr-anim="pan"] .fest-hdr-media video,
  [data-fest-hdr-anim="pan"] .fest-hdr-media img,
  [data-fest-hdr-anim="lights"] .fest-hdr-media::before {
    animation: none !important;
  }
  /* With the roll stopped, the off-screen start padding would leave the line
     INVISIBLE (it was parked 100% off to the right) — show it in place. */
  .fest-ticker span,
  .topbar-inner .fest-ticker span {
    padding-left: 0 !important;
    transform: none !important;
  }
}
