/* ==========================================================================
   FRANCO-NORD — SITES D'ÉCOLES : composants « nouveau look » sur l'ANCIEN thème
   Fichier : fn-ecoles.css · JS associé : fn-ecoles.js · Doc : docs/ECOLES.md
   --------------------------------------------------------------------------
   Pourquoi un fichier à part ?
   Les 14 sites d'écoles tournent encore sur l'ancien thème Porto (ESE.*,
   ESF.*, CHR.*…). fn-theme.css (site du Conseil) y casserait tout : ce
   fichier est AUTONOME et ISOLÉ — chaque règle est limitée à .fn-sh
   (« school hero ») ; rien ne touche le reste de la page de l'école.

   Installation (une seule fois pour toutes les écoles) — docs/ECOLES.md § 1
     /Portals/_default/Skins/Porto/fn-ecoles/fn-ecoles.css
     /Portals/_default/Skins/Porto/fn-ecoles/fn-ecoles.js
     + police Effra : <link rel="stylesheet" href="https://use.typekit.net/tgr0fbj.css">

   Sommaire
     0. Ajouter une école (mode d'emploi)
     1. Jetons (sous-ensemble de fn-tokens.css, limité à .fn-sh)
     2. Couleurs des écoles — UN bloc par école
     3. Isolation de l'ancien thème Porto
     4. Héros d'école
     5. Triangles décoratifs
     6. Bouton du kit
     7. Contrôles du défilement (WCAG 2.2.2)
     8. Tablette et mobile
   ========================================================================== */

/* ==========================================================================
   0. AJOUTER UNE ÉCOLE
   1) § 2 : vérifier / ajouter le bloc [data-fn-ecole="<code>"] (couleur).
   2) Copier modules/ecoles/esceb/01-hero.html → modules/ecoles/<code>/,
      changer data-fn-ecole, les textes, les liens et les images.
   3) Dans DNN (portail de l'école) : module HTML du héros (ContentPaneFull)
      → remplacer son contenu par celui du fichier.
   ========================================================================== */

/* ==========================================================================
   1. JETONS — copiés de assets/css/fn-tokens.css (même valeurs), portée .fn-sh
   ========================================================================== */
.fn-sh {
  --fn-navy-900: #2c2d49;
  --fn-navy-glow: #4a5486;
  --fn-lime-300: #94bb40;
  --fn-teal-500: #00b2a5;
  --fn-white: #ffffff;
  --fn-font-family: "effra", "Segoe UI", Roboto, Arial, sans-serif;
  --fn-fw-regular: 400;
  --fn-fw-bold: 700;
  --fn-fs-hero: clamp(2.5rem, 1rem + 4.2vw, 5.25rem);       /* 40 → 84 */
  --fn-fs-badge: clamp(1.125rem, .95rem + .7vw, 1.75rem);    /* 18 → 28 */
  --fn-fs-btn: 1.125rem;
  --fn-radius-pill: 999px;
  --fn-container-max: 1680px;
  --fn-gutter: clamp(1rem, .5rem + 2.5vw, 3rem);
  --fn-gap: clamp(1rem, .6rem + 1.5vw, 2.5rem);
  --fn-ease: cubic-bezier(.2, .7, .2, 1);
  --fn-dur: .25s;
  --fn-parallax-amp: 28px;
  /* Couleur de l'école (pastille) — valeur par défaut, remplacée en § 2 */
  --fn-ecole: #94bb40;
  --fn-ecole-texte: #2c2d49;
  --fn-ecole-accent: var(--fn-lime-300);   /* mot en couleur du titre (« notre école ») */
  /* Bouton (facultatif, § 2) — par défaut : contour blanc, survol blanc + texte navy */
  --fn-ecole-btn: transparent;              /* fond */
  --fn-ecole-btn-bord: var(--fn-white);
  --fn-ecole-btn-texte: var(--fn-white);
  --fn-ecole-btn-survol-texte: var(--fn-navy-900);
  /* Triangles (mêmes SVG que assets/img/svg/fn-triangle-*.svg, intégrés :
     aucun chemin d'image à régler dans le thème Porto) */
  --fn-tri-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 110'%3E%3Cpath d='M50 0 100 110 50 84 0 110Z' fill='%23ffffff'/%3E%3C/svg%3E");
  --fn-tri-teal:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 110'%3E%3Cpath d='M50 0 100 110 50 84 0 110Z' fill='%2300b2a6'/%3E%3C/svg%3E");
  --fn-tri-lime:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 110'%3E%3Cpath d='M50 0 100 110 50 84 0 110Z' fill='%2394ba40'/%3E%3C/svg%3E");
}

/* ==========================================================================
   2. COULEURS DES ÉCOLES — ordre de « Trouver une école »
   Couleur = « primaire » du thème actuel de l'école (fichier XXX.theme.css,
   .bg-color-primary), relevée le 26 nov. 2026, puis couleurs fournies le 27 nov. (CHR, MDY, STJO, ESF,
   SAM, STV, STA, LOR, ESA). !! Encore à valider : St-Raymond, Mariale,
   St-Thomas-d'Aquin (couleur du thème actuel).
   Texte de la pastille : blanc si contraste ≥ 4,5:1, sinon noir (calculé).
   ========================================================================== */
[data-fn-ecole="christ-roi"]     { --fn-ecole: #246938; --fn-ecole-texte: #fff; --fn-ecole-accent: #eabb49; }  /* CHR · couleurs fournies 27 nov. · 6,7:1 ; accent/navy 7,4:1 */
[data-fn-ecole="laresurrection"] { --fn-ecole: #cb622d; --fn-ecole-texte: #fff; --fn-ecole-accent: #fcb426;   /* RES · couleurs fournies 26 nov. */
  --fn-fs-badge: clamp(1.5rem, 1.2rem + .6vw, 1.75rem); }   /* blanc 3,9:1 → conforme en GRAND texte seulement (≥ 24 px) : pastille ≥ 24 px ; accent sur navy 7,4:1 */
[data-fn-ecole="st-joseph"]      { --fn-ecole: #1a4b9c; --fn-ecole-texte: #fff; --fn-ecole-accent: #e4b920; }  /* STJO · fournies 27 nov. · 8,3:1 ; accent 7,1:1 */
[data-fn-ecole="ste-marguerite"] { --fn-ecole: #000000; --fn-ecole-texte: #fff; --fn-ecole-accent: #fbf305;   /* MDY · fournies 27 nov. · 21:1 ; accent 11,4:1 */
                                   --fn-ecole-btn: #fbf305; --fn-ecole-btn-bord: #fbf305; --fn-ecole-btn-texte: #000; --fn-ecole-btn-survol-texte: #000; }  /* bouton jaune, texte noir 17,9:1 ; survol blanc + noir 21:1 */
[data-fn-ecole="francocite"]     { --fn-ecole: #f2652e; --fn-ecole-texte: #fff; --fn-ecole-accent: #f2652e; --fn-fs-badge: clamp(1.5rem, 1.2rem + .6vw, 1.75rem); }  /* ESF · fournies 27 nov. · blanc 3,2:1 → GRAND texte (pastille ≥ 24 px) ; accent/navy 4,2:1 (titre = grand texte) */
[data-fn-ecole="st-raymond"]     { --fn-ecole: #1c4b88; --fn-ecole-texte: #fff;   /* STR · pastille 8,7:1 (couleur du thème actuel, à valider) */
                                   --fn-ecole-btn: #ce171f; --fn-ecole-btn-bord: #ce171f; --fn-ecole-btn-texte: #fff; --fn-ecole-btn-survol-texte: #001b55; }  /* bouton rouge du logo, texte blanc 5,6:1 (le marin du logo #001b55 sur rouge = 2,9:1, refusé) ; survol blanc + marin 16,3:1 */
[data-fn-ecole="st-vincent"]     { --fn-ecole: #fdc300; --fn-ecole-texte: #000; --fn-ecole-accent: #fdc300; }  /* STV · fournies 27 nov. · noir 13:1 ; accent 8,2:1 */
[data-fn-ecole="saintsanges"]    { --fn-ecole: #b7893b; --fn-ecole-texte: #fff; --fn-fs-badge: clamp(1.5rem, 1.2rem + .6vw, 1.75rem); }  /* STA · texte blanc demandé 27 nov. · 3,2:1 → GRAND texte (pastille ≥ 24 px) */
[data-fn-ecole="escalgonquin"]   { --fn-ecole: #5c0d0d; --fn-ecole-texte: #fff; --fn-ecole-accent: #c0a36a;   /* ESA · bordeaux + or du logo (demande 27 nov.) · pastille 13,8:1 ; or/navy 5,5:1 */
                                   --fn-ecole-btn: #c0a36a; --fn-ecole-btn-bord: #c0a36a; --fn-ecole-btn-texte: #5c0d0d; --fn-ecole-btn-survol-texte: #5c0d0d; }  /* bouton or, texte bordeaux 5,7:1 ; survol blanc + bordeaux 13,8:1 */
[data-fn-ecole="lorrain"]        { --fn-ecole: #784d2a; --fn-ecole-texte: #fff; }  /* LOR · fournies 27 nov. · 7,3:1 */
[data-fn-ecole="mariale"]        { --fn-ecole: #660099; --fn-ecole-texte: #fff; }  /* MAR · 10,4:1 */
[data-fn-ecole="st-thomas"]      { --fn-ecole: #810000; --fn-ecole-texte: #fff; }  /* STT · 10,9:1 */
[data-fn-ecole="sainte-anne"]    { --fn-ecole: #008000; --fn-ecole-texte: #fff; }  /* SAM · fournies 27 nov. · 5,1:1 */
[data-fn-ecole="esceb"]          { --fn-ecole: #660099; --fn-ecole-texte: #fff; }  /* ESE · 10,4:1 — maquette */

/* ==========================================================================
   3. ISOLATION DE L'ANCIEN THÈME PORTO (dans .fn-sh SEULEMENT)
   Porto impose Open Sans, des tailles en px, des marges et le violet de
   l'école sur h1/h2/p/a ; « html .fn-sh » passe devant ses sélecteurs.
   ========================================================================== */
html .fn-sh, html .fn-sh *, html .fn-sh *::before, html .fn-sh *::after { box-sizing: border-box; }
html .fn-sh :is(h1, h2, p) {
  margin: 0; padding: 0; border: 0; background: none;
  font-family: var(--fn-font-family); letter-spacing: normal; text-transform: none; text-shadow: none;
}
html .fn-sh a { font-family: var(--fn-font-family); text-decoration: none; }
html .fn-sh img { display: block; max-width: 100%; height: auto; border: 0; }
html .fn-sh button { font-family: var(--fn-font-family); }
.fn-sh .fn-sh__vh {                       /* texte pour lecteurs d'écran seulement */
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   4. HÉROS D'ÉCOLE — même dessin que le héros de l'accueil du Conseil
   (fn-theme.css § 05) ; pastille = couleur de l'école (§ 2).
   Diapositives empilées dans la même cellule : la plus haute fixe la
   hauteur, aucun saut au changement ; fondu enchaîné (fn-ecoles.js).
   ========================================================================== */
html .fn-sh {
  position: relative; overflow: clip;          /* clip : laisse le parallaxe des triangles fonctionner */
  margin: 0; padding: 0;
  background: radial-gradient(ellipse 45% 70% at 22% 35%, var(--fn-navy-glow) 0%, transparent 70%), var(--fn-navy-900);
  color: var(--fn-white);
  font-family: var(--fn-font-family); font-size: 16px; line-height: 1.5;
}
.fn-sh__container { width: 100%; max-width: var(--fn-container-max); margin-inline: auto; padding-inline: var(--fn-gutter); }
.fn-sh__slides { display: grid; }
.fn-sh__slide {
  grid-area: 1 / 1; min-width: 0;
  display: grid;                                /* la diapo remplit la hauteur commune : photo posée en bas */
  opacity: 0; visibility: hidden;
  transition: opacity .8s var(--fn-ease), visibility 0s linear .8s;
}
.fn-sh__slide.is-active { opacity: 1; visibility: visible; transition: opacity .8s var(--fn-ease), visibility 0s; }
.fn-sh__inner {
  position: relative;
  display: grid; grid-template-columns: 1fr 1.25fr; align-items: center; gap: var(--fn-gap);
  min-height: clamp(420px, 36vw, 640px);
}
.fn-sh__media { align-self: end; }
html .fn-sh .fn-sh__media img { width: 100%; max-width: 660px; margin-inline: auto; }
/* Photo LARGE (ex. photo paysage des écoles élémentaires) : agrandie de 20 %, elle
   déborde vers la gauche (marge transparente de l'image) ; la colonne de texte ne
   rétrécit pas, le titre reste sur 2 lignes. */
@media (min-width: 992px) {
  html .fn-sh .fn-sh__inner--large .fn-sh__media img { width: 120%; max-width: none; margin-left: -20%; }
}
/* Photo LARGE avec marges transparentes à gauche ET à droite (≈ 12,5 % chacune, ex.
   -duo-large_opt) : sur tablette et mobile (photo sous le texte), les marges sont
   rognées pour que les personnes restent grandes et centrées.
   Classe .fn-sh__media--marge sur .fn-sh__media. */
@media (max-width: 991.98px) {
  html .fn-sh .fn-sh__media--marge { width: min(100%, 456px); margin-inline: auto; overflow: hidden; }
  html .fn-sh .fn-sh__media--marge img { width: 133%; max-width: none; margin-left: -16.5%; }   /* 133 % × 12,4 % ≈ 16,5 % */
}
/* Photo rectangulaire (non détourée) : posée en bas, coins arrondis en haut */
.fn-sh__media--photo { padding-top: clamp(2rem, 4vw, 4rem); }
html .fn-sh .fn-sh__media--photo img { max-width: 500px; border-radius: 28px 28px 0 0; }
html .fn-sh sup { position: relative; top: -.5em; font-size: .62em; line-height: 0; vertical-align: baseline; }
.fn-sh__content { position: relative; z-index: 2; padding-block: 3rem; padding-right: clamp(0px, 8vw, 180px); }   /* place des triangles */
html .fn-sh .fn-sh__badge {
  display: inline-block; margin: 0 0 1.25rem;
  padding: .55em 1.2em; border-radius: var(--fn-radius-pill);
  background: var(--fn-ecole); color: var(--fn-ecole-texte);
  font-size: var(--fn-fs-badge); font-style: italic; font-weight: var(--fn-fw-regular); line-height: 1.1;
  text-transform: uppercase; letter-spacing: .01em;
}
@supports (text-box: trim-both cap alphabetic) { html .fn-sh .fn-sh__badge { text-box: trim-both cap alphabetic; } }
html .fn-sh .fn-sh__title {
  margin: 0 0 2rem; color: var(--fn-white);
  font-size: var(--fn-fs-hero); font-weight: var(--fn-fw-bold); line-height: .95; letter-spacing: -.02em;
}
html .fn-sh .fn-sh__accent { color: var(--fn-ecole-accent); }
html .fn-sh .fn-sh__text { max-width: 38em; margin: -1rem 0 2rem; color: var(--fn-white); font-size: clamp(1.0625rem, 1rem + .3vw, 1.375rem); line-height: 1.5; }

/* ==========================================================================
   5. TRIANGLES DÉCORATIFS (maquette : grand blanc, petit blanc, teal à droite)
   Pseudo-éléments : rien à casser dans l'éditeur DNN. Parallaxe discret au
   défilement (CSS seul, navigateurs récents) ; coupé si « réduire les animations ».
   ========================================================================== */
.fn-sh::before, .fn-sh::after, .fn-sh__slides::after {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  width: var(--tri-size); aspect-ratio: 100 / 110;
  background: var(--tri-img) center / contain no-repeat;
}
.fn-sh::before        { --tri-img: var(--fn-tri-white); --tri-size: clamp(56px, 8.5vw, 170px); --k: .6;  right: -1%;  top: 14%; }
.fn-sh::after         { --tri-img: var(--fn-tri-white); --tri-size: clamp(30px, 4.2vw, 84px);  --k: 1.5; right: 8.5%; top: 54%; }
.fn-sh__slides::after { --tri-img: var(--fn-tri-teal);  --tri-size: clamp(30px, 4vw, 80px);    --k: 1;   right: 1.5%; top: 62%; }
@keyframes fn-sh-parallax {
  from { translate: 0 calc(var(--fn-parallax-amp) * var(--k, 1)); }
  to   { translate: 0 calc(var(--fn-parallax-amp) * var(--k, 1) * -1); }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .fn-sh::before, .fn-sh::after, .fn-sh__slides::after { animation: fn-sh-parallax linear both; animation-timeline: view(); }
  }
}

/* ==========================================================================
   6. BOUTON DU KIT (copie de fn-theme.css § 02, variante « light »)
   Structure : <a class="fn-sh__btn" href="…"><span class="fn-sh__btn-label">…</span></a>
   Lien externe (formulaire, nouvel onglet) : ajouter après le libellé le SVG
   .fn-sh__btn-ext (aria-hidden) + <span class="fn-sh__vh"> (…, nouvel onglet)</span>.
   ========================================================================== */
html .fn-sh a.fn-sh__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: max(44px, 3.25em); margin: 0; padding: .75em 1.75em;
  border: 2px solid var(--fn-ecole-btn-bord); border-radius: var(--fn-radius-pill);
  background: var(--fn-ecole-btn); color: var(--fn-ecole-btn-texte);
  font-size: var(--fn-fs-btn); font-style: italic; font-weight: var(--fn-fw-regular);
  letter-spacing: .02em; line-height: 1.2; text-align: center; text-transform: uppercase;
  transition: background-color var(--fn-dur) var(--fn-ease), color var(--fn-dur) var(--fn-ease);
}
html .fn-sh a.fn-sh__btn:is(:hover, :focus-visible) { border-color: var(--fn-white); background: var(--fn-white); color: var(--fn-ecole-btn-survol-texte); }
html .fn-sh a.fn-sh__btn:focus-visible { outline: 3px solid var(--fn-white); outline-offset: 3px; }
html .fn-sh a.fn-sh__btn:active { transform: scale(.97); }
.fn-sh__btn-label { display: block; }
.fn-sh__btn-ext { flex: none; width: .95em; height: .95em; fill: currentColor; }   /* lien externe (nouvel onglet) : pictogramme + texte masqué */
@supports (text-box: trim-both cap alphabetic) { .fn-sh__btn-label { text-box: trim-both cap alphabetic; } }

/* ==========================================================================
   7. CONTRÔLES DU DÉFILEMENT — pause/lecture, précédent, suivant (WCAG 2.2.2)
   Icônes en SVG dans le HTML (pas de police d'icônes sur les sites d'écoles).
   ========================================================================== */
.fn-sh__controls-wrap { position: absolute; inset: auto 0 0; z-index: 3; pointer-events: none; }
.fn-sh__controls { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding-bottom: clamp(1rem, 2vw, 1.75rem); pointer-events: auto; }
.fn-sh__controls[hidden] { display: none; }
html .fn-sh button.fn-sh__ctrl {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 2px solid rgba(255, 255, 255, .7); border-radius: 50%; background: rgba(44, 45, 73, .55);
  color: var(--fn-white); line-height: 1; cursor: pointer; box-shadow: none;
  transition: background-color var(--fn-dur) var(--fn-ease), color var(--fn-dur) var(--fn-ease), border-color var(--fn-dur) var(--fn-ease);
}
.fn-sh__ctrl svg { width: 18px; height: 18px; fill: currentColor; }
html .fn-sh button.fn-sh__ctrl:hover { background: var(--fn-white); border-color: var(--fn-white); color: var(--fn-navy-900); }
html .fn-sh button.fn-sh__ctrl:focus-visible { outline: 3px solid var(--fn-white); outline-offset: 3px; }
.fn-sh__ctrl .fn-sh__ico-play { display: none; }
.fn-sh__ctrl.is-paused .fn-sh__ico-play { display: block; }
.fn-sh__ctrl.is-paused .fn-sh__ico-pause { display: none; }
.fn-sh__count { min-width: 3.25em; color: var(--fn-white); font-size: 1rem; font-weight: var(--fn-fw-bold); text-align: center; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .fn-sh__slide, .fn-sh__slide.is-active { transition: none; } }

/* ==========================================================================
   8. TABLETTE ET MOBILE — texte au-dessus, photo dessous, contrôles centrés
   ========================================================================== */
@media (max-width: 991.98px) {
  .fn-sh__inner { grid-template-columns: 1fr; align-content: space-between; text-align: center; min-height: 0; }
  .fn-sh__content { padding: 2.5rem 0 0; }
  .fn-sh__media { order: 2; }
  html .fn-sh .fn-sh__media img { max-width: 380px; }
  html .fn-sh .fn-sh__text { margin-inline: auto; }
  .fn-sh__controls { justify-content: center; }
  .fn-sh::before { top: 4%; }
  .fn-sh::after, .fn-sh__slides::after { top: 70%; }
}
/* Héros ROTATIF (≤ 991 px) : les contrôles reposent sur une bande pleine
   largeur et chaque photo est posée sur cette bande (bas de photo net, pas de
   bord flottant). Le JS retire [hidden] des contrôles s'il y a 2 diapos ou
   plus : une diapo seule n'a pas de bande. Blanc sur #3e3c5a = 10,6:1. */
@media (max-width: 991.98px) {
  .fn-sh:has(.fn-sh__controls:not([hidden])) .fn-sh__inner { padding-bottom: calc(44px + 1.5rem); }
  .fn-sh:has(.fn-sh__controls:not([hidden])) .fn-sh__controls-wrap {
    background: #3e3c5a;
    border-image: linear-gradient(#3e3c5a 0 0) fill 0 / / 0 100vw;
  }
  .fn-sh:has(.fn-sh__controls:not([hidden])) .fn-sh__controls { padding-block: .75rem; }
}
@media (max-width: 575.98px) {
  html .fn-sh .fn-sh__media img { max-width: 300px; }
  .fn-sh::before { --tri-size: 44px; right: -3%; }
}
