/* Dated seasonal layer (config/seasonal.php). Loaded only while a campaign is
   active and scoped by its body class, so the regular storefront is untouched.

   The homepage slide is rendered by the « Slider d’accueil » extension, which
   has no per-slide class: the seasonal slide is recognised by its image path.
   The theme slider rules below only apply when the extension is disabled. */

/* ── Fêtes de fin d'année — homepage slide (extension) ─────────────────────── */

/* Copy: plain eyebrow, white title, softened description. On desktop the
   sizes follow the viewport so the copy fits the slider's 31.25vw height
   without stretching the other slides. */
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-eyebrow {
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-content h2 {
  color: #fff;
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-description {
  color: rgb(255 255 255 / 82%);
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-button {
  gap: 10px;
  box-shadow: 0 12px 30px rgb(255 185 31 / 26%);
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-button::after {
  content: "\2192";
  transition: transform 180ms ease;
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-button:hover::after,
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-button:focus-visible::after {
  transform: translateX(3px);
}

/* Société des Avis Garantis badge with its caption (the slide « details »),
   anchored bottom right. The caption carries the meaning; the badge image is
   decorative here. */
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details {
  position: absolute;
  z-index: 4;
  right: max(clamp(24px, 5vw, 72px), calc((100% - var(--tlc-container, 1230px)) / 2));
  bottom: 14px;
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 12px;
  color: rgb(255 255 255 / 78%);
  font-size: 12px;
  line-height: 1.35;
  list-style: none;
  text-align: right;
  text-shadow: 0 1px 10px rgb(0 0 0 / 55%);
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details li {
  display: block;
  grid-column: 1;
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details li:first-child {
  align-self: end;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details li:last-child {
  align-self: start;
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details li span {
  display: none;
}

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details::after {
  width: clamp(52px, 4.2vw, 68px);
  aspect-ratio: 1;
  grid-column: 2;
  grid-row: 1 / span 2;
  background: url("../images/badges/avis-garantis-excellence-2026.webp") center / contain no-repeat;
  content: "";
  filter: drop-shadow(0 6px 14px rgb(0 0 0 / 40%));
}

@media (min-width: 768px) {
  /* Left gradient for the copy and a soft corner shade behind the badge,
     instead of the uniform veil, so the photo stays bright. */
  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"])::after {
    background:
      radial-gradient(farthest-side at 100% 100%, rgb(7 12 24 / 74%), rgb(7 12 24 / 40%) 50%, rgb(7 12 24 / 0%)) right bottom / min(560px, 46%) 240px no-repeat,
      linear-gradient(90deg, rgb(7 12 24 / 72%) 0%, rgb(7 12 24 / 40%) 36%, rgb(7 12 24 / 0%) 56%);
    opacity: 1;
  }

  /* Static so the badge anchors to the slide; the copy stays above the shade. */
  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-content {
    position: static;
    width: 50%;
    padding-block: clamp(10px, 1.4vw, 40px);
    padding-inline: max(clamp(24px, 5vw, 72px), calc((100% - var(--tlc-container, 1230px)) / 2)) clamp(16px, 2vw, 32px);
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-copy--desktop > *,
  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-button {
    position: relative;
    z-index: 1;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-eyebrow {
    margin-bottom: clamp(10px, 1vw, 16px);
    font-size: clamp(11px, 0.85vw, 13px);
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-content h2 {
    margin-bottom: clamp(12px, 1.1vw, 20px);
    font-size: clamp(30px, 3.4vw, 60px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.03em;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-description {
    max-width: 44ch;
    margin-bottom: clamp(18px, 1.7vw, 30px);
    font-size: clamp(15px, 1.25vw, 19px);
    line-height: 1.45;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-button {
    min-height: clamp(42px, 3.4vw, 52px);
    padding: 0 clamp(20px, 1.8vw, 28px);
    font-size: clamp(14px, 1vw, 16px);
  }
}

/* Tablet: fixed 540 px slider with the controls in a bar below the slide. */
@media (min-width: 768px) and (max-width: 1024px) {
  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"])::after {
    background:
      radial-gradient(farthest-side at 100% 100%, rgb(7 12 24 / 74%), rgb(7 12 24 / 40%) 50%, rgb(7 12 24 / 0%)) right bottom / min(480px, 60%) 220px no-repeat,
      linear-gradient(90deg, rgb(7 12 24 / 84%) 0%, rgb(7 12 24 / 52%) 46%, rgb(7 12 24 / 0%) 70%);
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-content {
    width: 58%;
    padding-block: 24px;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-eyebrow {
    font-size: 12px;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-content h2 {
    font-size: clamp(32px, 4.2vw, 42px);
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-description {
    font-size: 16px;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-button {
    min-height: 46px;
    font-size: 15px;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details {
    bottom: 18px;
  }
}

/* Mobile: copy on the dark ceiling, badge right-aligned above the button. */
@media (max-width: 767px) {
  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"])::before {
    height: 260px;
    background: linear-gradient(180deg, transparent, rgb(0 0 0 / 55%) 45%, rgb(0 0 0 / 72%));
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-copy--mobile h2 {
    font-size: min(38px, 9.4vw);
    line-height: 1.04;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-copy--mobile .tlcs-description {
    max-width: 30ch;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details {
    right: 24px;
    bottom: calc(var(--mobile-button-bottom, 80px) + 64px);
    column-gap: 10px;
    font-size: 11.5px;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details li:first-child {
    font-size: 13px;
  }

  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-details::after {
    width: 48px;
  }
}

/* ── Fêtes de fin d'année — homepage slide (theme slider, fallback) ───────── */

.tlc-season--fetes .tlc-home-slider__slide--fetes {
  background: #0b1320;
}

.tlc-season--fetes .tlc-home-slider__slide--fetes::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(6 11 22 / 78%) 0%, rgb(6 11 22 / 42%) 38%, transparent 58%);
  content: "";
}

.tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__comfort-content {
  width: 42%;
}

.tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__comfort-description {
  max-width: 26rem;
}

.tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__cta {
  bottom: 14%;
  left: 7%;
  transform: none;
}

.tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__cta:hover,
.tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__cta:focus-visible {
  transform: translateY(-2px);
}

@media (max-width: 767px) {
  .tlc-season--fetes .tlc-home-slider__slide--fetes::after {
    background: linear-gradient(180deg, rgb(6 11 22 / 80%) 0%, rgb(6 11 22 / 20%) 42%, transparent 62%, rgb(6 11 22 / 70%) 100%);
  }

  .tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__comfort-content {
    width: 84%;
  }

  .tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__comfort-description {
    max-width: none;
  }

  .tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__cta {
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
  }

  .tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__cta:hover,
  .tlc-season--fetes .tlc-home-slider__slide--fetes .tlc-home-slider__cta:focus-visible {
    transform: translateX(-50%) translateY(-2px);
  }
}

/* ── Snowfall ──────────────────────────────────────────────────────────────
   Two compositor-only layers (near and far) at different speeds, several
   flakes per tile so no grid shows. Each layer travels 720 px, a multiple of
   every tile height, so the loop has no visible seam. */

.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture {
  overflow: hidden;
}

.tlc-home-slider__snow,
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture::before,
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture::after {
  position: absolute;
  z-index: 2;
  top: -720px;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  content: "";
  will-change: transform;
}

/* Near layer: larger, softer flakes. */
.tlc-home-slider__snow,
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture::after {
  background-image:
    radial-gradient(circle at 22% 40%, rgb(255 255 255 / 85%) 0 1.8px, transparent 3px),
    radial-gradient(circle at 68% 12%, rgb(255 255 255 / 70%) 0 2.4px, transparent 3.6px),
    radial-gradient(circle at 54% 72%, rgb(255 255 255 / 60%) 0 1.5px, transparent 2.6px),
    radial-gradient(circle at 88% 54%, rgb(255 255 255 / 75%) 0 2px, transparent 3.2px);
  background-size: 360px 360px;
  opacity: 0.75;
  animation: tlc-season-snowfall 24s linear infinite;
}

/* Far layer: tiny, slower flakes. */
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture::before {
  background-image:
    radial-gradient(circle at 12% 18%, rgb(255 255 255 / 70%) 0 1px, transparent 1.8px),
    radial-gradient(circle at 47% 63%, rgb(255 255 255 / 55%) 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 78% 34%, rgb(255 255 255 / 65%) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 29% 88%, rgb(255 255 255 / 50%) 0 0.8px, transparent 1.5px),
    radial-gradient(circle at 93% 81%, rgb(255 255 255 / 60%) 0 1px, transparent 1.8px);
  background-size: 240px 240px;
  opacity: 0.6;
  animation: tlc-season-snowfall 46s linear infinite;
}

/* In the extension, stay under its overlay and text (z-index 1 and above). */
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture::before,
.tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture::after {
  z-index: 0;
}

@keyframes tlc-season-snowfall {
  to {
    transform: translate3d(0, 720px, 0);
  }
}

.tlc-home-slider__slide:not(.is-active) .tlc-home-slider__snow,
.tlc-home-slider:has([data-home-slider-toggle][aria-pressed="true"]) .tlc-home-slider__snow,
.tlcs-slide:not(.is-active) .tlcs-picture::before,
.tlcs-slide:not(.is-active) .tlcs-picture::after,
.tlcs-slider:has([data-tlcs-toggle][aria-pressed="true"]) .tlcs-picture::before,
.tlcs-slider:has([data-tlcs-toggle][aria-pressed="true"]) .tlcs-picture::after {
  animation-play-state: paused;
}

/* ── Fêtes de fin d'année — promotions page: blue night, still snowfall ─── */

.tlc-season--fetes .tlc-promo {
  --promo-night: #0d1627;
}

.tlc-season--fetes .tlc-promo-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 22%, rgb(255 255 255 / 75%) 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 64% 58%, rgb(255 255 255 / 50%) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 84%, rgb(255 233 179 / 55%) 0 1.8px, transparent 2.8px);
  background-size: 170px 170px, 230px 230px, 340px 340px;
  content: "";
  mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / 45%) 70%, transparent 100%);
}

@media (prefers-reduced-motion: reduce) {
  .tlc-home-slider__snow,
  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture::before,
  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-picture::after,
  .tlc-season--fetes .tlcs-slide:has(img[src*="/seasonal/fetes/"]) .tlcs-button::after {
    animation: none;
    transition: none;
  }
}
