/* ============================================================
   Hero cinématographique par club.

   Une seule photographie occupe toujours le cadre. Club connu, le hero s'y
   fixe ; sinon les trois scènes font un seul tour. Une sélection
   synchronise l'accent, le produit et l'appel à l'action. Le H1 reste sur
   l'image, protégé par un dégradé léger.
   ============================================================ */

.hero {
  --hero-chrome: 112px;
  --hero-accent: #c6ff4a;
  --hero-accent-ink: #0a2340;
  position: relative;
  isolation: isolate;
  min-height: min(820px, max(640px, calc(100svh - var(--hero-chrome))));
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}

.hero__media,
.hero__scene,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__media { z-index: -1; background: var(--ink); }

.hero__scene {
  opacity: 0;
  visibility: hidden;
  transition: opacity 460ms cubic-bezier(.22, 1, .36, 1), visibility 460ms;
}

.hero__scene[data-active="true"] {
  opacity: 1;
  visibility: visible;
}

/* Scène pas encore demandée : hors rendu, sa photo ne se charge pas. */
.hero__scene[data-hero-defer] { display: none; }

.hero__scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-position, center);
}

.hero__scene img {
  transform: scale(1.02);
  transition: transform 1.1s cubic-bezier(.16, 1, .3, 1);
}

.hero__scene[data-active="true"] img { transform: scale(1); }

/* Aucun voile blanc derrière les blasons (règle du client) : la rangée des
   clubs se lit sur une ombre d'encre en haut de l'image. */
.hero__shade {
  background:
    linear-gradient(180deg, rgba(4, 22, 36, .5) 0%, rgba(4, 22, 36, .22) 120px, transparent 220px),
    linear-gradient(90deg, rgba(4, 22, 36, .88) 0%, rgba(4, 22, 36, .68) 34%, rgba(4, 22, 36, .2) 67%, rgba(4, 22, 36, .14) 100%),
    linear-gradient(0deg, rgba(4, 22, 36, .58) 0%, transparent 46%);
  pointer-events: none;
}

.hero__frame {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  min-height: inherit;
  padding-block: clamp(18px, 2vw, 28px) clamp(28px, 4vw, 54px);
}

/* Choix du club */

.hero__bar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 34px);
  align-self: start;
  min-width: 0;
}

.hero__clubs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(16px, 2.2vw, 34px);
  min-width: 0;
}

.hero__club-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 4px 0 8px;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 2px 16px rgba(0, 12, 22, .72);
  transition: color 220ms ease, opacity 220ms ease, transform 220ms ease;
}

.hero__club-toggle::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--hero-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1), background-color 260ms ease;
}

.hero__club-toggle:hover { transform: translateY(-2px); }

.hero__club-toggle[aria-pressed="true"] {
  color: #fff;
}

.hero__club-toggle[aria-pressed="true"]::after { transform: scaleX(1); }

.hero__club-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.hero__club-crest {
  display: block;
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 4px 12px rgba(0, 12, 22, .35));
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
}

.hero__club-toggle[aria-pressed="true"] .hero__club-crest { transform: scale(1.08); }

/* Message */

.hero__copy {
  grid-column: 1 / 8;
  grid-row: 2;
  align-self: end;
  display: grid;
  justify-items: start;
  max-width: 760px;
}

.hero__title {
  margin: 0;
  font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  font-size: var(--fs-display);
  font-weight: 900;
  line-height: .82;
  letter-spacing: -.04em;
  text-transform: uppercase;
  text-shadow: 0 3px 30px rgba(0, 12, 22, .24);
  text-wrap: balance;
}

.hero__title-main,
.hero__title-accent { display: block; }

.hero__title-accent {
  position: relative;
  width: fit-content;
  color: #fff;
}

/* « De vos couleurs » prend littéralement les couleurs du club affiché.
   Les trois teintes sont des propriétés enregistrées pour que le passage
   d'un club à l'autre se fasse en fondu, pendant la rotation comme au choix.
   L'ombre passe par drop-shadow : un text-shadow se verrait à travers les
   lettres, qui sont transparentes. */
@property --hero-t1 { syntax: '<color>'; inherits: true; initial-value: #8edcff; }
@property --hero-t2 { syntax: '<color>'; inherits: true; initial-value: #27b7ed; }
@property --hero-t3 { syntax: '<color>'; inherits: true; initial-value: #0072bc; }

.hero { --hero-t1: #8edcff; --hero-t2: #27b7ed; --hero-t3: #0072bc; }
.hero[data-active-club="om"] { --hero-t1: #8edcff; --hero-t2: #27b7ed; --hero-t3: #0072bc; }
.hero[data-active-club="psg"] { --hero-t1: #6f8cff; --hero-t2: #b84b87; --hero-t3: #ed2939; }
.hero[data-active-club="lens"] { --hero-t1: #ffd100; --hero-t2: #ffb000; --hero-t3: #ff4b3e; }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__title-accent {
    background: linear-gradient(100deg, var(--hero-t1) 8%, var(--hero-t2) 48%, var(--hero-t3) 92%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 3px 22px rgba(0, 12, 22, .35));
    transition: --hero-t1 700ms ease, --hero-t2 700ms ease, --hero-t3 700ms ease;
  }
}


.hero__lead {
  max-width: 54ch;
  margin: clamp(22px, 2.5vw, 34px) 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: 1.02rem;
  line-height: 1.55;
  text-shadow: 0 2px 20px rgba(0, 12, 22, .5);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 24px;
}

.hero__cta {
  min-width: 244px;
  justify-content: center;
  border-color: var(--hero-accent);
  background: var(--hero-accent);
  color: var(--hero-accent-ink);
  transition: background-color 260ms ease, border-color 260ms ease, color 260ms ease, transform 220ms ease;
}

.hero__cta:hover { transform: translateY(-2px); background: var(--hero-accent); color: var(--hero-accent-ink); }

.hero__quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: #fff;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--hero-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* Produit synchronisé */

.hero__products {
  grid-column: 9 / -1;
  grid-row: 2;
  align-self: end;
  justify-self: stretch;
  min-width: 0;
}

.hero-product {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 18px;
  min-height: 136px;
  padding: 0 18px 0 0;
  border-top: 4px solid var(--hero-accent);
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 12, 22, .26);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.hero-product[hidden] { display: none; }

/* Le visuel occupe toute la hauteur de la carte, à gauche. Repli sans
   détourage : la photo du produit se fond dans le papier, jamais sur un
   carré blanc. */
.hero-product__visual {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-height: 132px;
  overflow: hidden;
  background: var(--paper);
}

.hero-product__visual > img {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Le casque détouré posé sur l'aplat du club, le même que le filet de la
   carte et le bouton : ni halo, ni ombre, ni fondu. */
.hero-product--cutout .hero-product__visual { background: var(--hero-accent); }

.hero-product--cutout .hero-product__visual > img {
  padding: 12px 8px 8px;
  mix-blend-mode: normal;
}

.hero-product__body { display: grid; gap: 4px; min-width: 0; padding-block: 14px; }

.hero-product__label {
  color: var(--ink-70);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-product__body strong {
  font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  text-transform: uppercase;
}

.hero-product__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: .82rem;
  font-weight: 800;
}

.hero-product__facts span { padding-left: 12px; border-left: 1px solid var(--ink-20); }

.hero-product .icon-arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform 220ms ease;
}

.hero-product:hover .icon-arrow,
.hero-product:focus-visible .icon-arrow { transform: translateX(4px); }

/* Tablette */

@media (max-width: 1100px) {
  .hero__scene img { object-position: var(--hero-position-tablet, var(--hero-position)); }
  .hero__copy { grid-column: 1 / 8; }
  .hero__products { grid-column: 8 / -1; }
  .hero-product { grid-template-columns: 112px minmax(0, 1fr) 22px; gap: 14px; }
}

/* Mobile : boutons au doigt, photographie plein écran et produit compact. */

@media (max-width: 760px) {
  /* Bandeau d'annonce et en-tête font 100 px sur téléphone : le hero, carte
     produit comprise, tient dans le premier écran. */
  .hero {
    --hero-chrome: 100px;
    min-height: max(720px, calc(100svh - var(--hero-chrome)));
  }

  .hero__shade {
    background:
      linear-gradient(180deg, rgba(4, 22, 36, .6) 0%, rgba(4, 22, 36, .3) 110px, transparent 210px),
      linear-gradient(0deg, rgba(4, 22, 36, .88) 0%, rgba(4, 22, 36, .5) 50%, rgba(4, 22, 36, .16) 78%);
  }

  .hero__scene img { object-position: var(--hero-position-mobile, var(--hero-position-tablet, var(--hero-position))); }

  .hero__frame {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 18px;
    padding: 12px 18px 22px;
  }

  .hero__bar {
    grid-column: 1;
    grid-row: 1;
    gap: 12px;
  }

  .hero__clubs {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 4px;
  }

  .hero__club-toggle {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 46px;
    gap: 6px;
    padding: 2px 0 7px;
    font-size: .64rem;
  }

  .hero__club-crest { width: 34px; height: 34px; }

  .hero__copy {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }

  .hero__title { line-height: .84; }

  /* Le chapeau se lit en entier : un texte coupé au milieu d'une phrase
     dit moins que pas de texte. Il est écrit pour tenir en trois lignes. */
  .hero__lead {
    max-width: 44ch;
    margin-top: 18px;
    font-size: .9rem;
    line-height: 1.45;
  }

  /* Sur mobile, un seul bouton. Le lien vers le guide ne tenait qu'en flèche
     seule, sans dire où il menait ; le guide reste dans le menu, dans
     « Vérifier ma taille » du Vestiaire et dans le curseur plus bas. */
  .hero__actions { display: block; width: 100%; margin-top: 18px; }
  .hero__cta { width: 100%; min-width: 0; }
  .hero__quiet { display: none; }

  .hero__products {
    grid-column: 1;
    grid-row: 3;
  }

  .hero-product {
    grid-template-columns: 104px minmax(0, 1fr) 20px;
    min-height: 104px;
    gap: 12px;
    padding: 0 14px 0 0;
  }

  .hero-product__visual { min-height: 100px; }
  .hero-product__body { padding-block: 10px; }
  .hero-product__body strong { font-size: 1.1rem; }
}

/* Mouvement */

@media (prefers-reduced-motion: no-preference) {
  [data-hero-step] { animation: hero-rise .58s cubic-bezier(.22, 1, .36, 1) backwards; }
  .hero__title-main { animation-delay: .08s; }
  .hero__title-accent { animation-delay: .15s; }
  .hero__lead { animation-delay: .23s; }
  .hero__actions { animation-delay: .3s; }

  .hero__products { animation: hero-product-in .72s .34s cubic-bezier(.22, 1, .36, 1) backwards; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scene,
  .hero__scene img,
  .hero__club-toggle,
  .hero__title-accent,
  .hero__cta,
  .hero-product .icon-arrow { transition: none; animation: none; }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}


@keyframes hero-product-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pause et lecture de la rotation : réservé au clavier. Hors focus, le
   bouton sort de l'écran ; au focus, un petit rond sur la photo, sans lueur. */
.hero__rotation {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hero__rotation[hidden] { display: none; }
.hero__rotation:focus-visible {
  position: static;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: visible;
  clip: auto;
  padding: 0;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: rgba(4, 22, 36, .6);
  color: #fff;
  outline: 3px solid #fff;
  outline-offset: 3px;
  cursor: pointer;
}
.hero__rotation-icon { grid-area: 1 / 1; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; }
.hero__rotation-icon--play { fill: currentColor; stroke: none; }
.hero__rotation[data-state="playing"] .hero__rotation-icon--play,
.hero__rotation[data-state="paused"] .hero__rotation-icon--pause { display: none; }
