/* Page publique d'une saison : socle commun aux cinq gabarits (lot E, 10/11/2026).
   Chargé seulement par pages/shows/saison/page.blade.php, avec la feuille du gabarit choisi.
   Maquettes : docs/maquettes/2026-11-10-pages-evenement/saison/.

   Couleurs : uniquement les variables du site (site_app, bloc :root) et leurs mélanges.
   Le texte et les surfaces se déduisent de la seule paire sûre d'un site, fond de contenu et
   couleur de texte : un site clair à bandeau sombre reste lisible, ce qu'une surface peinte à
   la couleur du bandeau ne garantit pas.
   Typographie : celle du site (héritée), aucune police ajoutée.
   Barre d'avancement d'une vignette : toujours en bas de l'image. */

.ps {
  --ps-fond: var(--couleur-fond-content);
  --ps-texte: var(--primary-text-color);
  --ps-muet: color-mix(in srgb, var(--primary-text-color) 70%, var(--couleur-fond-content));
  --ps-surface: color-mix(in srgb, var(--primary-text-color) 6%, var(--couleur-fond-content));
  --ps-surface-forte: color-mix(in srgb, var(--primary-text-color) 11%, var(--couleur-fond-content));
  --ps-trait: color-mix(in srgb, var(--primary-text-color) 18%, transparent);
  --ps-trait-doux: color-mix(in srgb, var(--primary-text-color) 10%, transparent);
  --ps-piste: color-mix(in srgb, var(--primary-text-color) 20%, transparent);
  /* Texte d'accent : la couleur principale tirée vers la couleur de texte, assez pour tenir 4,5:1
     jusque sur une pastille posée sur une surface (mesuré sur les deux habillages). */
  --ps-accent-texte: color-mix(in srgb, var(--primary-color) 58%, var(--primary-text-color));
  --ps-accent-doux: color-mix(in srgb, var(--primary-color) 14%, transparent);
  --ps-accent-trait: color-mix(in srgb, var(--primary-color) 45%, transparent);
  --ps-voile: color-mix(in srgb, var(--couleur-fond-content) 84%, transparent);
  --ps-ombre: color-mix(in srgb, var(--card-shadow-color) 30%, transparent);
  /* Sortie appuyée : le mouvement part vite et se pose (même courbe que le socle du backoffice). */
  --ps-ease: cubic-bezier(.23, 1, .32, 1);
  --ps-marge: 16px;
  position: relative;
  padding: 8px 0 72px;
  background: var(--ps-fond);
  color: var(--ps-texte);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  overflow-wrap: break-word;
  text-align: left;
}
@media (min-width: 760px) { .ps { --ps-marge: 28px; } }
@media (min-width: 1200px) { .ps { --ps-marge: 40px; } }

.ps *, .ps *::before, .ps *::after { box-sizing: border-box; }
/* Remise à plat des balises, en :where() : elle bat les règles de balise du site sans peser plus
   qu'une classe, pour que les classes ps-* gardent toujours la main. */
.ps :where(h1, h2, h3, p, ol, ul, dl, dt, dd, figure) { margin: 0; padding: 0; }
.ps :where(h1, h2, h3) { color: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; letter-spacing: normal; text-transform: none; }
.ps :where(ol, ul) { list-style: none; }
.ps :where(p) { color: inherit; font-size: inherit; line-height: inherit; }
.ps :where(a), .ps :where(a):hover { color: inherit; text-decoration: none; }
.ps img { display: block; max-width: 100%; }
.ps svg { display: block; }
.ps [hidden] { display: none !important; }
.ps :focus-visible { outline: 3px solid var(--ps-accent-texte); outline-offset: 3px; border-radius: 6px; }

.ps-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ps-ic { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }
.ps-cadre { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--ps-marge); }
.ps-muet { color: var(--ps-muet); }
.ps-titre { font-family: var(--font-titles, inherit); font-weight: 800; letter-spacing: -.01em; line-height: 1.05; text-wrap: balance; overflow-wrap: break-word; }

/* Boutons */
.ps .ps-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 22px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 15px; line-height: 1.2; cursor: pointer; text-align: center; transition: transform .16s var(--ps-ease); }
.ps .ps-btn:active { transform: scale(.97); }
.ps .ps-btn--plein { background: var(--primary-color); color: var(--on-primary-color); }
.ps .ps-btn--plein:hover { background: color-mix(in srgb, var(--primary-color) 86%, var(--on-primary-color)); color: var(--on-primary-color); }
/* 55 % et non 45 % : le contour d'un bouton tient 3:1 sur le fond de la page comme sur ses surfaces (mesuré à 2,7:1 le 11/11/2026). */
.ps .ps-btn--trait { background: transparent; border-color: color-mix(in srgb, var(--primary-text-color) 55%, transparent); color: var(--ps-texte); }
.ps .ps-btn--trait:hover { border-color: var(--ps-texte); }
.ps .ps-btn--grand { min-height: 52px; padding: 12px 28px; font-size: 16px; }
.ps .ps-btn--petit { padding: 8px 14px; font-size: 14px; }

/* Fil d'Ariane */
.ps-fil { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 14px; color: var(--ps-muet); }
.ps .ps-fil a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; text-decoration: underline; text-underline-offset: 3px; }
.ps-fil [aria-current] { color: var(--ps-texte); font-weight: 600; }

/* Image d'un épisode ou d'une saison : sans image, un fond aux couleurs du site */
.ps-affiche { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; container-type: inline-size; background:
  radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--primary-color) 34%, transparent), transparent 55%),
  radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--primary-enhanced-color) 28%, transparent), transparent 60%),
  var(--ps-surface-forte); }
.ps-affiche img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ps-affiche__chiffre { position: absolute; left: 6%; bottom: 2%; font-family: var(--font-titles, inherit); font-weight: 800; font-size: 2rem; font-size: min(42cqw, 9rem); line-height: 1; color: color-mix(in srgb, var(--primary-text-color) 22%, transparent); }

/* Barre d'avancement : toujours en bas de l'image */
.ps-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--progress-bg-color); z-index: 4; overflow: hidden; }
.ps-progress__fill { display: block; height: 100%; width: 100%; background: var(--progress-fill-color); transform-origin: left center; transform: scaleX(var(--ps-avance, 0)); }

/* Vignette */
.ps-vignette { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--ps-surface-forte); flex: none; border: 1px solid var(--ps-trait); }
.ps-vignette__duree { position: absolute; right: 6px; bottom: 12px; z-index: 3; padding: 1px 7px; border-radius: 4px; background: var(--ps-voile); color: var(--ps-texte); font-size: 13px; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; }
.ps-vignette__marque { position: absolute; left: 6px; top: 6px; z-index: 3; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ps-voile); color: var(--ps-texte); }
.ps-vignette__marque--vu { background: var(--primary-color); color: var(--on-primary-color); }
.ps-vignette__texte { position: absolute; left: 6px; bottom: 12px; z-index: 3; max-width: calc(100% - 92px); display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; background: var(--ps-voile); color: var(--ps-texte); font-size: 13px; font-weight: 700; line-height: 1.35; }
.ps-vignette--verrou .ps-affiche { opacity: .5; }

/* Pastilles */
.ps-pastille { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.3; background: var(--ps-accent-doux); color: var(--ps-accent-texte); border: 1px solid var(--ps-accent-trait); }
.ps-pastille--neutre { background: transparent; color: var(--ps-muet); border-color: var(--ps-trait); }
.ps-pastille--neuf { background: var(--primary-color); color: var(--on-primary-color); border-color: transparent; }
.ps-vu { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }

/* Jauge de saison */
.ps-jauge { position: relative; display: block; height: 8px; border-radius: 999px; background: var(--ps-piste); overflow: hidden; }
.ps-jauge > span { position: absolute; inset: 0; border-radius: 999px; background: var(--progress-fill-color); transform-origin: left center; transform: scaleX(var(--ps-avance, 0)); }

/* Scène : la grande vignette de l'épisode à regarder */
.ps-scene { position: relative; border-radius: 14px; overflow: hidden; background: var(--ps-surface-forte); border: 1px solid var(--ps-trait); box-shadow: 0 22px 44px -22px var(--ps-ombre); isolation: isolate; }
.ps-scene .ps-affiche { width: 100%; }
.ps .ps-scene__jouer { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; border-radius: inherit; }
.ps .ps-scene__jouer:focus-visible { outline-offset: -5px; border-radius: 14px; }
.ps-scene__rond { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-color); color: var(--on-primary-color); box-shadow: 0 0 0 10px color-mix(in srgb, var(--primary-color) 24%, transparent); transition: transform .2s var(--ps-ease); }
.ps-scene__rond .ps-ic { width: 30px; height: 30px; }
.ps-scene--verrou .ps-affiche { opacity: .45; }
.ps-scene--verrou .ps-scene__rond { background: var(--ps-fond); color: var(--ps-texte); box-shadow: 0 0 0 2px var(--primary-color); }
.ps-scene__temps { position: absolute; right: 12px; bottom: 16px; z-index: 3; padding: 2px 9px; border-radius: 5px; background: var(--ps-voile); color: var(--ps-texte); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.ps-scene__etiquette { position: absolute; left: 12px; top: 12px; z-index: 3; pointer-events: none; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 24px); }
.ps-scene__etiquette .ps-pastille { background: var(--ps-voile); color: var(--ps-texte); border-color: var(--ps-trait); }

/* Saisons de la série (chaque gabarit l'habille) */
.ps-saisons ul { display: flex; gap: 8px; }
.ps .ps-saisons__item { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ps-trait); white-space: nowrap; position: relative; }
.ps .ps-saisons__item[aria-current] { background: var(--primary-color); color: var(--on-primary-color); border-color: transparent; font-weight: 700; }
.ps-saisons__n { font-weight: 700; }
.ps-saisons__c { font-size: 13px; opacity: .85; }
/* Sur l'onglet de la saison en cours, le compte est posé sur la couleur principale : à .85 il tombait à 3,85:1
   sur un site dont la principale est un ton moyen (habillage réel relevé le 11/11/2026). Il y garde l'encre pleine. */
.ps .ps-saisons__item[aria-current] .ps-saisons__c { opacity: 1; }

/* Ce qui dit comment ouvrir un épisode */
.ps-verrou { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--ps-accent-doux); border: 1px solid var(--ps-accent-trait); }
.ps-verrou .ps-ic { margin-top: 3px; color: var(--ps-accent-texte); }

/* Replis : le passé et le lointain se replient (details natif, sans script) */
.ps-repli { border-top: 1px solid var(--ps-trait); }
.ps-repli > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 4px; cursor: pointer; font-weight: 700; font-size: 1rem; list-style: none; }
.ps-repli > summary::-webkit-details-marker { display: none; }
.ps-repli > summary .ps-ic { transition: transform .2s var(--ps-ease); color: var(--ps-accent-texte); }
.ps-repli[open] > summary .ps-ic { transform: rotate(90deg); }
.ps-repli > summary small { margin-left: auto; font-weight: 600; font-size: 14px; color: var(--ps-muet); }
.ps-repli__corps { padding: 4px 0 14px; }

/* En-tête de section, comme sur l'accueil */
.ps-entete { display: flex; align-items: baseline; gap: 14px; margin: 0 0 10px; }
.ps .ps-entete__titre { font-family: var(--font-titles, inherit); font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 800; line-height: 1.1; }
.ps-entete__trait { flex: 1; height: 2px; min-width: 20px; background: linear-gradient(to right, color-mix(in srgb, var(--primary-text-color) 35%, transparent), transparent 80%); }
.ps-entete__note { font-size: 14px; color: var(--ps-muet); white-space: nowrap; }

/* Rang : une vignette et son texte (épisode ou saison). Carte verticale avec --carte. */
.ps .ps-rang__lien { position: relative; display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; padding: 8px; border: 1px solid var(--ps-trait); border-radius: 12px; background: var(--ps-surface); transition: transform .2s var(--ps-ease); }
.ps .ps-rang__lien:hover { border-color: var(--ps-accent-trait); }
.ps-rang__txt { display: grid; gap: 3px; min-width: 0; }
.ps-rang__num { font-size: 13px; font-weight: 700; color: var(--ps-accent-texte); }
.ps-rang__titre { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ps-rang__resume { color: var(--ps-muet); line-height: 1.5; display: none; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ps-rang__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ps-muet); min-height: 26px; }
.ps .ps-rang--carte .ps-rang__lien { display: block; padding: 0; overflow: hidden; }
.ps-rang--carte .ps-vignette { border-radius: 0; border: 0; }
.ps-rang--carte .ps-rang__txt { padding: 10px 12px 14px; }
.ps-rang--carte .ps-rang__titre { font-size: 15px; min-height: 2.6em; }
.ps .ps-rang--ici .ps-rang__lien { border-color: var(--primary-color); box-shadow: 0 0 0 1px var(--primary-color); }
.ps-rang__ici { position: absolute; left: 8px; top: 8px; z-index: 5; pointer-events: none; }

/* Ligne : un épisode sur une ligne (listes repliées, brèves) */
.ps .ps-ligne__lien { display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-areas: "n t" "n m"; gap: 0 10px; align-items: center; width: 100%; min-height: 52px; padding: 8px 4px; border-bottom: 1px solid var(--ps-trait-doux); }
.ps-ligne:last-child .ps-ligne__lien { border-bottom: 0; }
.ps-ligne__n { grid-area: n; font-family: var(--font-titles, inherit); font-weight: 800; font-size: 1.3rem; line-height: 1; text-align: center; color: var(--ps-muet); font-variant-numeric: tabular-nums; }
.ps-ligne__t { grid-area: t; font-weight: 600; line-height: 1.3; }
.ps-ligne__t small { display: block; font-weight: 600; font-size: 13px; color: var(--ps-accent-texte); }
.ps-ligne__m { grid-area: m; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ps-muet); font-variant-numeric: tabular-nums; }
.ps .ps-ligne__lien:hover .ps-ligne__titre { text-decoration: underline; text-underline-offset: 3px; }
.ps-ligne--ici .ps-ligne__n { color: var(--ps-accent-texte); }
@media (min-width: 700px) {
  .ps .ps-ligne__lien { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "n t m"; }
}

/* Fenêtre de la bande-annonce (dialog natif : Échap, bouton et clic sur le fond la ferment) */
.ps-fenetre { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 22px 20px 20px; border: 1px solid var(--ps-trait); border-radius: 16px; background: var(--ps-fond); color: var(--ps-texte); box-shadow: 0 30px 80px -20px var(--ps-ombre); overflow: auto; }
.ps-fenetre::backdrop { background: color-mix(in srgb, var(--card-shadow-color) 62%, transparent); }
/* Ouverture : la fenêtre monte de peu et se pose en 220 ms ; la fermeture est immédiate (la
   réponse à un geste de sortie ne se fait pas attendre). Une fenêtre reste centrée : pas d'origine. */
.ps-fenetre[open] { animation: ps-monter .22s var(--ps-ease) both; }
.ps-fenetre[open]::backdrop { animation: ps-fondu .2s var(--ps-ease) both; }
.ps-fenetre h2 { font-size: 1.3rem; font-weight: 800; line-height: 1.25; padding-right: 48px; margin: 0 0 4px; color: inherit; }
.ps-fenetre p { margin: 0; color: var(--ps-muet); }
.ps-fenetre__fermer { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ps-surface-forte); color: var(--ps-texte); cursor: pointer; display: grid; place-items: center; }
.ps-fenetre__fermer:focus-visible, .ps-fenetre .ps-btn:focus-visible { outline: 3px solid var(--ps-accent-texte); outline-offset: 3px; }
.ps-fenetre video, .ps-fenetre iframe { display: block; width: 100%; aspect-ratio: 16 / 9; margin-top: 12px; border: 0; border-radius: 12px; background: var(--ps-surface-forte); }
.ps-fenetre__secours { display: grid; gap: 10px; justify-items: start; margin-top: 12px; padding: 14px; border-radius: 12px; border: 1px dashed var(--ps-trait); }
.ps-fenetre__barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.ps-fenetre .ps-ic { width: 1.15em; height: 1.15em; fill: currentColor; }
/* Fenêtre ouverte : la page derrière ne défile pas (classe posée par page-saison.js, retirée à la fermeture). */
html.ps-fenetre-ouverte, html.ps-fenetre-ouverte body { overflow: hidden; }
@keyframes ps-monter { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ps-fondu { from { opacity: 0; } to { opacity: 1; } }

/* Accès du membre impossible à lire : la page ne dit ni « ouvert » ni « fermé », elle le signale */
.ps-avis { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--ps-trait); background: var(--ps-surface); font-size: 14px; font-weight: 600; }
.ps-avis .ps-ic { margin-top: 3px; color: var(--ps-accent-texte); }
.ps-avis__code { display: block; font-size: 13px; font-weight: 400; color: var(--ps-muet); user-select: all; }

/* Bandeau d'aperçu (Admin seulement) et saison sans épisode */
.ps-apercu { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--ps-accent-trait); background: var(--ps-accent-doux); font-size: 14px; font-weight: 600; }
.ps .ps-apercu a { text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.ps-vide { display: grid; gap: 12px; justify-items: start; padding: 28px 0 40px; max-width: 60ch; }
.ps-vide h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); }

/* Le déplacement au survol n'existe que pour un pointeur fin : au doigt, un « survol » reste
   collé après le toucher. */
@media (hover: hover) and (pointer: fine) {
  .ps-scene__jouer:hover .ps-scene__rond { transform: scale(1.07); }
  .ps .ps-rang__lien:hover { transform: translateX(4px); }
  .ps .ps-rang--carte .ps-rang__lien:hover { transform: translateY(-4px); }
}

/* Mouvement réduit : plus aucun déplacement, la fenêtre s'ouvre en fondu */
@media (prefers-reduced-motion: reduce) {
  .ps *, .ps *::before, .ps *::after { transition-property: opacity !important; scroll-behavior: auto !important; }
  .ps-fenetre[open] { animation: ps-fondu .2s var(--ps-ease) both; }
}
