/* ==========================================================
   Couleurs du site (look « Halos », inspiré du site de l'Academy) : règles.
   Les valeurs sont dans tokens.css. Chargé en fin de <head> (voir header.php), après les
   feuilles communes : « html » devant une règle la fait passer avant les fichiers des pages
   chargés plus loin (home-v9.css, tarifs-v2.css…), quel que soit leur ordre.
   Règles détaillées : includes/docs/AYP_colours.md.
   ========================================================== */

/* En-tête et barre mobile : blancs comme la page (valeurs écrites en dur ailleurs) */
.site-header {
  background: rgba(255, 255, 255, 0.97);
}

.mobile-bar {
  background: rgba(255, 255, 255, 0.97);
}

/* ==========================================================
   Zones foncées : bleu nuit. Pied de page : couleurs --footer-* dans tokens.css.
   ========================================================== */

html .v2c-a,
html .h9-hero__frame,
html .h8-hero {
  background: var(--color-deep);
}

/* Bulle des mots expliqués (session B, grand écran) */
@media (min-width: 48em) {
  html .gloss__tip {
    background: var(--color-deep);
  }
}

/* ==========================================================
   Menu, session A (includes/header.php)
   ========================================================== */

/* Rubrique survolée ou ouverte : même couleur de texte, trait du menu */
html .nav__link:hover,
html .nav__item.is-active > .nav__link,
html .site-nav--compact .nav__item.is-open > .nav__link {
  color: var(--color-ink);
}

@media (min-width: 64em) {
  html .nav__link::after {
    bottom: 0.3rem;
    height: var(--trait, 3px);
    background: var(--color-underline);
  }

  /* Sous-menu : fond bleu pastel sous le lien survolé */
  html .subnav a:hover,
  html .subnav a:focus-visible {
    background: var(--tint-ciel);
    color: var(--color-ink);
  }
}

/* Mobile : trait sous la rubrique de la page en cours */
@media (max-width: 63.99em) {
  html .nav__item.is-active > .nav__link {
    text-decoration: underline;
    text-decoration-color: var(--color-underline);
    text-decoration-thickness: var(--trait, 3px);
    text-underline-offset: 0.45em;
  }
}

/* Page en cours dans le sous-menu : son nom souligné du trait du menu */
html .subnav a[aria-current="page"] {
  color: var(--color-ink);
}

html .subnav a[aria-current="page"] .subnav__label {
  text-decoration: underline;
  text-decoration-color: var(--color-underline);
  text-decoration-thickness: var(--trait, 3px);
  text-underline-offset: 0.35em;
}

/* « Réserver » : clair par défaut (cadre et texte), rempli au survol */
html .header-book {
  background: var(--color-bg);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: calc(0.6rem - 1px) calc(1.1rem - 1px);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

html .header-book:hover,
html .header-book:focus-visible {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

/* ==========================================================
   Menu, session B (includes/site-b.php)
   ========================================================== */

/* Langue : l'autre langue en gris, la langue en cours en gras (sans trait) ;
   trait du menu seulement au survol */
html .h9-lang a {
  color: var(--color-muted);
}

html .h9-lang a[aria-current="true"] {
  color: var(--color-ink);
}

html .h9-lang a:hover,
html .h9-lang a:focus-visible {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-underline);
  text-decoration-thickness: var(--trait, 3px);
  text-underline-offset: 0.45em;
}

/* Rubriques : même couleur de texte au survol et pour la page en cours */
html .h9-nav__item.is-active > .h9-nav__link,
html .h9-nav__link:hover,
html .h9-nav__link:focus-visible,
html .h9-nav__item.is-open > .h9-nav__link,
html .h9-subnav a:hover,
html .h9-subnav a:focus-visible,
html .h9-subnav a[aria-current="page"] {
  color: var(--color-ink);
}

/* Page en cours dans le sous-menu : en gras, sans soulignement */
html .h9-subnav a[aria-current="page"] {
  font-weight: 600;
}

/* Menu sur une ligne (en-tête sans .h9-header--compact, voir site-b.css) */
  /* Trait sous la rubrique survolée ou en cours */
  html :where(.h9-header:not(.h9-header--compact)) .h9-nav__link {
    position: relative;
  }

  html :where(.h9-header:not(.h9-header--compact)) .h9-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.2rem;
    height: var(--trait, 3px);
    background: var(--color-underline);
    transform: scaleX(0);
    transition: transform 0.4s var(--ease);
  }

  html :where(.h9-header:not(.h9-header--compact)) .h9-nav__item:hover > .h9-nav__link::after,
  html :where(.h9-header:not(.h9-header--compact)) .h9-nav__item:focus-within > .h9-nav__link::after,
  html :where(.h9-header:not(.h9-header--compact)) .h9-nav__item.is-active > .h9-nav__link::after {
    transform: scaleX(1);
  }

  /* Sous-menu : fond bleu pastel sous le lien survolé */
  html :where(.h9-header:not(.h9-header--compact)) .h9-subnav a {
    transition: background-color 0.2s var(--ease);
  }

  html :where(.h9-header:not(.h9-header--compact)) .h9-subnav a:hover,
  html :where(.h9-header:not(.h9-header--compact)) .h9-subnav a:focus-visible {
    background: var(--tint-ciel);
  }

  /* « Réserver » : son trait prend la couleur du trait du menu au survol, plus épais */
  html :where(.h9-header:not(.h9-header--compact)) .h9-book:hover,
  html :where(.h9-header:not(.h9-header--compact)) .h9-book:focus-visible {
    color: var(--color-ink);
    text-decoration-color: var(--color-underline);
    text-decoration-thickness: var(--trait, 3px);
  }

/* Menu mobile : trait sous la rubrique de la page en cours */
  html :where(.h9-header--compact) .h9-nav__item.is-active > .h9-nav__link {
    text-decoration: underline;
    text-decoration-color: var(--color-underline);
    text-decoration-thickness: var(--trait, 3px);
    text-underline-offset: 0.45em;
  }

@media (prefers-reduced-motion: reduce) {
  html .h9-nav__link::after {
    transition: none;
  }
}

/* Liens animés au survol (trait qui se rétracte) : la couleur ne change pas */
html .link-more:hover,
html .link-more:focus-visible {
  color: var(--color-ink);
}

/* ==========================================================
   Accueils v1, v4, v5, v6 (.h9) : ombre de « Découvrir le studio » et titre de
   « Nouveau au studio ? » (les fonds sont plus bas, « Bandes teintées »)
   ========================================================== */

html .h9 .h9-explore__b {
  box-shadow: 0 20px 40px -24px color-mix(in srgb, var(--color-deep) 45%, transparent);
}

html .h9 .h9-newcomer .h9-title {
  color: var(--color-ink);
  /* Même calcul que les autres titres (règle ci-dessous) */
  color: oklch(from var(--color-ink) calc(l - (1 - l) * var(--titre-k, 0)) calc((1 - l) * var(--titre-c, 0)) var(--titre-h, 0));
}

/* ==========================================================
   Titres : bleu nuit sur fond clair, calculé à partir de la couleur héritée
   (réglages --titre-k, --titre-c, --titre-h dans tokens.css) ; le blanc reste blanc
   (titres sur photo ou sur bande foncée). Les titres qui ont leur propre couleur la gardent.
   Navigateur trop ancien : la règle est ignorée, les titres gardent la couleur du texte.
   ========================================================== */

html :where(h1, h2, h3, h4) {
  color: oklch(from currentColor calc(l - (1 - l) * var(--titre-k, 0)) calc((1 - l) * var(--titre-c, 0)) var(--titre-h, 0) / alpha);
}

/* ==========================================================
   Titres et détails (dates, mot en italique) sur fond teinté : réglages --ciel-… et
   --peche-… de tokens.css (aujourd'hui les mêmes couleurs qu'ailleurs).
   Une nouvelle zone teintée s'ajoute à la liste.
   ========================================================== */

html :where(.section--tint, .h8-section--tint, .h9-section--tint, .v2c--tint,
  .home-hero, .home-newsletter, .detail-hero:not(.detail-hero--event), .detail-aside, .note,
  .live-features li, .levels-marker,
  .prog__daily, .h8-newcomer, .h9-explore, .page-intro--band) {
  --titre-k: var(--ciel-titre-k);
  --titre-c: var(--ciel-titre-c);
  --titre-h: var(--ciel-titre-h);
  --color-accent: var(--ciel-accent);
  --color-ink: var(--ciel-ink);
  --color-muted: var(--ciel-muted);
  color: var(--color-ink);
}

/* Haut de page : bande teintée en session A seulement (session B : sans bande, voir page-intro-b.css).
   Règle à part : un navigateur sans :has() l'ignore sans perdre la règle ci-dessus */
html:not(:has(.h9-header)) :where(.page-intro) {
  --titre-k: var(--ciel-titre-k);
  --titre-c: var(--ciel-titre-c);
  --titre-h: var(--ciel-titre-h);
  --color-accent: var(--ciel-accent);
  --color-ink: var(--ciel-ink);
  --color-muted: var(--ciel-muted);
  color: var(--color-ink);
}

html :where(.h9 .h9-newcomer, .h4 .h4-offer) {
  --titre-k: var(--peche-titre-k);
  --titre-c: var(--peche-titre-c);
  --titre-h: var(--peche-titre-h);
  --color-accent: var(--peche-accent);
}

/* ==========================================================
   Boutons : bleus (bleu des liens), bleu nuit au survol ; coins --radius-button
   ========================================================== */

html .button {
  border-radius: var(--radius-button);
}

html .button:not(.button--ghost):not(.button--light):not(.button--outline-light) {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

html .button:not(.button--ghost):not(.button--light):not(.button--outline-light):hover,
html .button:not(.button--ghost):not(.button--light):not(.button--outline-light):focus-visible {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #ffffff;
}

/* Contour : bleu nuit, rempli au survol */
html .button--ghost {
  border-color: var(--color-ink);
  color: var(--color-ink);
}

html .button--ghost:hover,
html .button--ghost:focus-visible {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #ffffff;
}

/* Contour à côté d'un bouton plein bleu (avant ou après lui) : contour et texte bleus,
   rempli de bleu au survol, pour que la paire soit de la même couleur. Seul : bleu nuit. */
html .button:not(.button--ghost):not(.button--light):not(.button--outline-light) ~ .button--ghost,
html .button--ghost:has(~ .button:not(.button--ghost):not(.button--light):not(.button--outline-light)) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

html .button:not(.button--ghost):not(.button--light):not(.button--outline-light) ~ .button--ghost:hover,
html .button:not(.button--ghost):not(.button--light):not(.button--outline-light) ~ .button--ghost:focus-visible,
html .button--ghost:has(~ .button:not(.button--ghost):not(.button--light):not(.button--outline-light)):hover,
html .button--ghost:has(~ .button:not(.button--ghost):not(.button--light):not(.button--outline-light)):focus-visible {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

/* Clair (sur fond foncé) : blanc, bleu pastel au survol */
html .button--light {
  background: var(--color-surface);
  border-color: var(--color-surface);
  color: var(--color-ink);
}

html .button--light:hover,
html .button--light:focus-visible {
  background: var(--tint-blue);
  border-color: var(--tint-blue);
  color: var(--color-ink);
}

/* « Réserver » du menu de la session A : coins comme les boutons */
html .header-book {
  border-radius: var(--radius-button);
}

/* ==========================================================
   Bandes teintées : halos par-dessus la teinte
   ========================================================== */

html .section--tint,
html .h9 .h9-section--tint,
html .h9 .h9-explore {
  background: var(--halos), var(--color-tint);
}

/* Accueil, « Nouveau au studio ? » : bande bleutée avec les halos, encadrés d'offre blancs */
html .h9 .h9-newcomer {
  background: var(--halos), var(--color-tint);
}

/* v5, v6 : section sans fond (filets), encadrés d'offre bleutés */
html .h4 .h4-offer {
  background: var(--color-tint);
}

/* Programme des événements : heures en vert sauge */
html .prog .prog__time {
  color: var(--heure);
}

html .prog .prog__slot {
  border-left-color: color-mix(in srgb, var(--heure) 30%, transparent);
}

/* En-tête des pages intérieures (halos) : bleu, lilas et pêche comme à l'Academy */
html .page-intro.page-intro--halo::before {
  background:
    /* Halos grands et rapprochés : ils se chevauchent, opacité un peu réduite */
    radial-gradient(ellipse 44% 80% at 16% 34%, rgba(168, 200, 242, 0.6), transparent 72%),
    radial-gradient(ellipse 40% 65% at 54% 0%, rgba(232, 200, 228, 0.5), transparent 72%),
    radial-gradient(ellipse 44% 70% at 86% 66%, rgba(250, 226, 208, 0.7), transparent 72%),
    radial-gradient(ellipse 30% 50% at 78% 10%, rgba(168, 200, 242, 0.3), transparent 72%),
    var(--color-bg);
}

@media (max-width: 40em) {
  html .page-intro.page-intro--halo::before {
    background:
      radial-gradient(ellipse 60% 40% at 0% 20%, rgba(168, 200, 242, 0.7), transparent 70%),
      radial-gradient(ellipse 55% 35% at 100% 8%, rgba(232, 200, 228, 0.6), transparent 70%),
      radial-gradient(ellipse 70% 35% at 70% 72%, rgba(250, 226, 208, 0.8), transparent 70%),
      var(--color-bg);
  }
}

/* ==========================================================
   Bandeau d'appel en fin de page (« Une question avant de venir ? ») : une bande sur toute
   la largeur, sur fond de halos. Si la section du dessus a déjà un fond de halos, la bande
   devient un encadré (coins droits) pour s'en détacher.
   Le bandeau d'inscription des fiches événement (cta-band--desktop) ne change pas.
   ========================================================== */

html .cta-band:not(.cta-band--desktop) {
  background: var(--halos), var(--color-tint);
  color: var(--color-ink);
}

/* Après une section à halos : encadré sur fond blanc */
html .section--tint + .cta-band:not(.cta-band--desktop) {
  background: transparent;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 2.5rem) clamp(3rem, 7vw, 4.5rem);
}

html .section--tint + .cta-band:not(.cta-band--desktop) .cta-band__inner {
  padding: clamp(2.25rem, 6vw, 4.5rem);
  border-radius: var(--radius);
  background: var(--halos), var(--color-tint);
}

html .cta-band:not(.cta-band--desktop) h2 {
  color: var(--color-ink);
}

html .cta-band:not(.cta-band--desktop) p {
  color: var(--color-muted);
}

/* Boutons de la bande : comme les autres (bleus, bleu nuit au survol) */
html .cta-band:not(.cta-band--desktop) .button--light {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

html .cta-band:not(.cta-band--desktop) .button--light:hover,
html .cta-band:not(.cta-band--desktop) .button--light:focus-visible {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #ffffff;
}

/* Bouton secondaire (contour blanc, invisible sur les halos) : contour et texte bleus
   comme le bouton plein à côté, rempli de bleu au survol */
html .cta-band:not(.cta-band--desktop) .button--outline-light {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

html .cta-band:not(.cta-band--desktop) .button--outline-light:hover,
html .cta-band:not(.cta-band--desktop) .button--outline-light:focus-visible {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

/* ==========================================================
   Photos et encadrés
   ========================================================== */

/* Fiche événement, page 2 (en-tête simple) : photo légèrement arrondie, posée sur une carte
   colorée décalée à gauche et en bas */
html .detail-hero--event:not(.detail-hero--fade) .detail-hero__media {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: calc(-1 * clamp(0.75rem, 1.6vw, 1.25rem)) clamp(0.75rem, 1.6vw, 1.25rem) 0 var(--carte-photo);
}

/* Encadrés d'offre de l'accueil */
html .h4 .h4-offer {
  border-radius: var(--radius-card);
}

/* ==========================================================
   Rose : seulement pour attirer l'attention (early bird, places restantes ou complet,
   « Nouveau ! », badges de la page Tarifs). Couleurs --color-highlight… dans tokens.css.
   ========================================================== */

/* Early bird et disponibilité : cartes version 4 */
html .event-card__note--earlybird,
html .event-card__note--status {
  color: var(--color-highlight);
  font-weight: 600;
}

/* Early bird : cartes « À ne pas manquer » de l'accueil (pastille) */
html .card--home .card__early-note {
  background: var(--color-highlight-soft);
  color: var(--color-highlight);
}

/* Early bird sur les cartes (encadré sur la photo) : fond rose très pâle derrière le texte rose */
html .early-banner {
  background: var(--color-highlight-soft);
}

/* Early bird sur les cartes « À ne pas manquer » (légende sous l'image) : bandeau rose plein,
   texte blanc (6,0) */
html .card--caption .card__notes .early-banner:not(.early-banner--open) {
  background: var(--color-highlight);
  color: #fff;
}

html .card--caption .card__notes .early-banner:not(.early-banner--open) .early-banner__tag {
  color: #fff;
}

/* Early bird et disponibilité : cartes versions 1 à 3 */
html .card__earlybird {
  color: var(--color-highlight);
}

html .card__flag--status {
  border-color: var(--color-highlight);
  color: var(--color-highlight);
}

/* Fiche événement : état (complet, dernières places), mention et tarif early bird */
html .event-status {
  border-color: var(--color-highlight);
  color: var(--color-highlight);
}

html .price-banner {
  border-left-color: var(--color-highlight);
}

html .price-banner__tag,
html .price-options__until,
html .price-early {
  color: var(--color-highlight);
}

/* Étiquettes « Nouveau ! » (cartes de cours, mosaïque v3, photos v4, familles session B) */
html .card__media .badge.badge--new,
html .h3-tile__new,
html .h4-need__new,
html .way__new {
  background: var(--color-highlight);
  color: #ffffff;
}

/* « À quoi s'attendre » (session B) : galets teintés de la couleur des détails, comme leur contour */
html .detail-aside .check-list li::before {
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
}

/* Bandeau early bird des cartes « À ne pas manquer » de l'accueil : rose framboise, plus rose
   que --color-highlight (choix de Linda, accueil seulement ; blanc sur framboise : 5,0) */
html .h9-cards .card--caption .card__notes .early-banner:not(.early-banner--open) {
  background: #b8457e;
}
