/* ==========================================================================
   AMUCAM : page Nos formations
   Catalogue en cartes + fiches techniques dans des <dialog> natifs.
   Fondations communes : css/base.css. Couleurs de base : css/layout.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. CODE COULEUR DES FORMATIONS
   Chaque formation garde sa couleur, de la carte du catalogue à sa fiche.
   --c       : couleur d'accent (sigle, icônes, titre, bouton d'inscription)
   --c-dark  : fond du bloc « contenu »
   --c-line  : liseré en haut de la fiche
   -------------------------------------------------------------------------- */
#fiche-sst,   [data-open="sst"]   { --c: #16a34a; --c-dark: #1e3a8a; --c-line: #16a34a; }
#fiche-pse,   [data-open="pse"]   { --c: #2563eb; --c-dark: #1e3a8a; --c-line: #2651dc; }
#fiche-psc,   [data-open="psc"]   { --c: #16a34a; --c-dark: #166534; --c-line: #26dc51; }
#fiche-udae,  [data-open="udae"]  { --c: #059669; --c-dark: #059669; --c-line: #05780f; }
#fiche-psmc,  [data-open="psmc"]  { --c: #047857; --c-dark: #064e3b; --c-line: #079a13; }
#fiche-aps,   [data-open="aps"]   { --c: #1d4ed8; --c-dark: #1d4ed8; --c-line: #1e4ad1; }
#fiche-psr,   [data-open="psr"]   { --c: #15803d; --c-dark: #166534; --c-line: #05780f; }
#fiche-sport, [data-open="sport"] { --c: #16a34a; --c-dark: #15803d; --c-line: #05780f; }
#fiche-bnis,  #fiche-bnmps       { --c: #0056b3; --c-dark: #092f4e; --c-line: #eab308; }
#fiche-psms,  [data-open="psms"]  { --c: #d97706; --c-dark: #b45309; --c-line: #d97706; --c-dot: #fff; }

.course-card,
.sheet,
.sheet__nav button {
    --c-soft: color-mix(in srgb, var(--c, var(--amu-logo)) 10%, #fff);
}

/* --------------------------------------------------------------------------
   1. INTRODUCTION (styles communs dans css/base.css)
   Accès direct aux fiches, propre à cette page.
   -------------------------------------------------------------------------- */
/* Accès direct aux fiches : la couleur de chaque formation au survol */
.intro__index {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 28px 0 36px;
}

.intro__index p {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.intro__index ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.intro__index button {
    padding: 7px 14px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--amu-navy);
    cursor: pointer;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.intro__index button:hover,
.intro__index button:focus-visible {
    border-color: var(--c, var(--amu-blue));
    background: var(--c, var(--amu-blue));
    color: #fff;
}

/* Mobile : un seul bouton plein (le catalogue) ; la demande de session
   devient un lien fléché, comme sur les pages Accueil et À propos.
   Les deux actions respirent avant la photo. */
@media (max-width: 767px) {
    .intro__grid { gap: 44px; }
    .intro__actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-top: 30px;
    }

    /* Bouton à la taille de son texte, calé à gauche comme le lien fléché
       en dessous ; halo jaune adouci */
    .intro__actions .btn--yellow {
        width: auto;
        min-height: 52px;
        padding: 0 26px;
        box-shadow: 0 10px 22px -14px rgba(234, 179, 8, 0.8);
    }

    .intro__actions .btn--outline {
        width: auto;
        min-height: 44px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
        gap: 18px;
        font-size: 16px;
        color: var(--amu-navy);
    }

    .intro__actions .btn--outline i { display: none; }

    /* Flèche fine jaune, même dessin que .arrow-link */
    .intro__actions .btn--outline::after {
        content: '';
        width: 56px;
        height: 12px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 12'%3E%3Cpath d='M0 6h54M48.5 1 54 6l-5.5 5' fill='none' stroke='%23eab308' stroke-width='2'/%3E%3C/svg%3E") no-repeat left center / 56px 12px;
    }

    .intro__actions .btn--outline:hover,
    .intro__actions .btn--outline:active {
        background: none;
        color: var(--amu-blue);
    }
}

@media (max-width: 767px) {
    /* Accès direct : défilement horizontal */
    .intro__index { flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px 0 32px; }
    .intro__index p { font-size: 10.5px; }
    .intro__index ul {
        flex-wrap: nowrap;
        width: calc(100% + var(--gutter) * 2);
        margin: 0 calc(var(--gutter) * -1);
        padding: 0 var(--gutter);
        overflow-x: auto;
        scrollbar-width: none;
    }
    .intro__index ul::-webkit-scrollbar { display: none; }
    .intro__index button { white-space: nowrap; -webkit-tap-highlight-color: transparent; }

    /* Au toucher, la pastille prend la couleur de sa formation */
    .intro__index button:active {
        border-color: var(--c, var(--amu-blue));
        background: var(--c, var(--amu-blue));
        color: #fff;
    }
}

/* --------------------------------------------------------------------------
   3. NOTRE APPROCHE : titre à gauche, parcours numérotés à droite
   -------------------------------------------------------------------------- */
.approach {
    padding: var(--section-y) 0;
    background: var(--surface-blue);
}

.approach__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
    gap: 88px;
}

.approach__head {
    position: sticky;
    top: calc(var(--nav-h) + 40px);
}

.approach__title {
    max-width: 520px;
    font-family: var(--font-nav);
    font-size: clamp(2rem, 1.4rem + 1.7vw, 2.85rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--amu-navy);
    text-wrap: balance;
}

.approach__lead {
    max-width: 440px;
    margin-top: 24px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
}

.tracks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.track {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: first baseline;
    gap: 24px;
    padding: 36px 0;
}

.track:first-child {
    padding-top: 0;
}

.track:last-child {
    padding-bottom: 0;
}

.track + .track {
    border-top: 1px solid var(--hairline);
}

.track__num {
    font-family: var(--font-nav);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    color: var(--amu-blue);
    font-variant-numeric: lining-nums tabular-nums;
}

.track__title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--amu-navy);
}

.track__text {
    max-width: 560px;
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-soft);
}

.track__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--amu-blue);
    transition: color 0.2s var(--ease);
}

.track__link i {
    font-size: 12px;
    transition: transform 0.25s var(--ease-out);
}

.track__link:hover {
    color: var(--amu-navy);
}

.track__link:hover i {
    transform: translateX(4px);
}

@media (max-width: 1023px) {
    .approach__grid { grid-template-columns: 1fr; gap: 48px; }
    .approach__head { position: static; }
    .approach__title,
    .approach__lead { max-width: 640px; }
}

@media (max-width: 767px) {
    .approach__title { font-size: 1.85rem; }
    .approach__lead { margin-top: 16px; font-size: 16px; }
    .approach__grid { gap: 36px; }
    .track { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 28px 0; }
    .track__num { font-size: 28px; }
    .track__title { font-size: 18px; }
    .track__text { font-size: 15px; }
    .track__link { margin-top: 12px; font-size: 14.5px; }
}

/* --------------------------------------------------------------------------
   4. CATALOGUE : carrousel de cartes, flèches en haut à droite
   -------------------------------------------------------------------------- */
.catalog {
    padding: var(--section-y) 0;
    background: #fff;
}

.catalog__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 44px;
}

.catalog__title {
    font-family: var(--font-nav);
    font-size: clamp(2rem, 1.4rem + 1.7vw, 2.85rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--amu-navy);
}

.catalog__lead {
    max-width: 560px;
    margin-top: 16px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
}

.catalog__nav {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

/* Piste : défilement horizontal aimanté. Trois cartes et demie visibles sur
   grand écran : la demi-carte signale qu'il y a une suite. */
.catalog__track {
    --gap: 28px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--gap) * 3) / 3.5);
    gap: var(--gap);
    margin: -6px;
    padding: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 6px;
    scrollbar-width: none;
}

.catalog__track::-webkit-scrollbar {
    display: none;
}

.course-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    color: inherit;
    cursor: pointer;
    scroll-snap-align: start;
}

.course-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-bottom: 3px solid var(--c);
    border-radius: 4px 4px 0 0;
    background: var(--surface-blue);
}

.course-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease-out);
}

.course-card:hover .course-card__media img,
.course-card:focus-visible .course-card__media img {
    transform: scale(1.04);
}

.course-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding-top: 20px;
}

.course-card__abbr {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c);
}

.course-card__name {
    margin-top: 8px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--amu-navy);
}

.course-card__text {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-soft);
}

.course-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-top: 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--amu-navy);
}

.course-card__meta i {
    margin-right: 4px;
    font-size: 12px;
    color: var(--c);
}

.course-card__more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 20px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--c);
}

.course-card__more i {
    font-size: 12px;
    transition: transform 0.25s var(--ease-out);
}

.course-card:hover .course-card__more i,
.course-card:focus-visible .course-card__more i {
    transform: translateX(4px);
}

@media (max-width: 1023px) {
    .catalog__track { --gap: 20px; grid-auto-columns: calc((100% - var(--gap) * 2) / 2.5); }
}

@media (max-width: 767px) {
    .catalog__head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 20px; }
    .catalog__title { font-size: 1.85rem; }
    .catalog__lead { margin-top: 12px; font-size: 16px; }
    .catalog__nav { justify-content: flex-end; }

    /* Mobile : la carte suivante dépasse pour inviter au glissement */
    .catalog__track {
        --gap: 14px;
        grid-auto-columns: 74%;
        margin: -6px calc(var(--gutter) * -1);
        padding: 6px var(--gutter);
        scroll-padding: 0 var(--gutter);
    }
    .course-card__name { font-size: 17.5px; }
    .course-card__text { font-size: 14.5px; }
}

/* --------------------------------------------------------------------------
   5. FORMATION DES FORMATEURS : bandeau bleu profond, liste des brevets
   Chaque ligne ouvre la fiche technique du brevet.
   -------------------------------------------------------------------------- */
.trainers {
    position: relative;
    overflow: hidden;
    padding: var(--section-y) 0;
    background: var(--amu-navy);
    color: #fff;
}

/* Emblème en filigrane derrière la liste des brevets */
.trainers__mark {
    right: -6%;
    top: 50%;
    width: min(620px, 50vw);
    margin-top: -260px;
    opacity: 0.045;
}

.trainers > .container {
    position: relative;
    z-index: 1;
}

.trainers__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 88px;
}

.trainers__title {
    font-family: var(--font-nav);
    font-size: clamp(2rem, 1.4rem + 1.7vw, 2.85rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: #fff;
}

.trainers__lead {
    max-width: 440px;
    margin-top: 24px;
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
}

.brevets {
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.brevets li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brevet {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    width: 100%;
    padding: 32px 0;
    border: 0;
    background: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
}

.brevet__abbr {
    font-family: var(--font-nav);
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    color: var(--amu-yellow);
}

.brevet__name {
    display: block;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}

.brevet__text {
    display: block;
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
}

.brevet__go {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    font-size: 13px;
    color: #fff;
    transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.brevet__go i {
    transition: transform 0.25s var(--ease-out);
}

.brevet:hover .brevet__go,
.brevet:focus-visible .brevet__go {
    border-color: var(--amu-yellow);
    background: var(--amu-yellow);
    color: var(--amu-navy);
}

.brevet:hover .brevet__go i,
.brevet:focus-visible .brevet__go i {
    transform: translateX(2px);
}

.brevet:focus-visible {
    outline-color: var(--amu-yellow);
}

@media (max-width: 1023px) {
    .trainers__grid { grid-template-columns: 1fr; gap: 40px; }
    .trainers__lead { max-width: 640px; }
}

@media (max-width: 767px) {
    .trainers__title { font-size: 1.85rem; }
    .trainers__lead { margin-top: 16px; font-size: 16px; }
    .brevet { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 24px 0; }
    .brevet__abbr { grid-column: 1 / -1; font-size: 24px; }
    .brevet__name { font-size: 17px; }
    .brevet__text { font-size: 14.5px; }
    .brevet__go { width: 40px; height: 40px; }
}

/* --------------------------------------------------------------------------
   6. ENCADREMENT PÉDAGOGIQUE : portrait au format d'origine, profil à côté
   -------------------------------------------------------------------------- */
.mentor {
    padding: var(--section-y) 0;
    background: var(--surface-blue);
}

.mentor__grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: center;
    gap: 96px;
}

/* Portrait d'origine sur fond blanc : posé comme une carte sur le fond clair */
.mentor__photo {
    margin: 0;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
}

.mentor__photo img {
    width: 100%;
    height: auto;
}

.mentor__title {
    font-family: var(--font-nav);
    font-size: clamp(2rem, 1.4rem + 1.7vw, 2.85rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--amu-navy);
}

.mentor__lead {
    max-width: 560px;
    margin-top: 24px;
    font-size: 18px;
    line-height: 1.7;
    color: var(--ink-soft);
}

.mentor__profile {
    margin-top: 44px;
}

.mentor__status {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--amu-blue);
}

.mentor__name {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--amu-navy);
}

.mentor__roles {
    margin-top: 10px;
}

.mentor__roles li {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-soft);
}

@media (max-width: 1023px) {
    .mentor__grid { grid-template-columns: 280px minmax(0, 1fr); gap: 56px; }
}

@media (max-width: 767px) {
    .mentor__grid { grid-template-columns: 1fr; gap: 32px; }
    .mentor__photo { max-width: 300px; }
    .mentor__title { font-size: 1.85rem; }
    .mentor__lead { margin-top: 16px; font-size: 16px; }
    .mentor__profile { margin-top: 28px; }
    .mentor__name { font-size: 21px; }
    .mentor__roles li { font-size: 15px; }
}

/* --------------------------------------------------------------------------
   7. APPEL À L'ACTION
   -------------------------------------------------------------------------- */
.cta {
    padding: var(--section-y) 0;
    background: #fff;
}

.cta__box {
    position: relative;
    overflow: hidden;
    padding: 80px 72px;
    border-radius: 28px;
    background: var(--amu-navy);
    color: #fff;
}

.cta__box > img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cta__box::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(9, 47, 78, 0.96) 0%, rgba(9, 47, 78, 0.82) 55%, rgba(0, 86, 179, 0.55) 100%);
}

.cta__content {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.cta__title {
    font-size: clamp(1.9rem, 1.3rem + 2vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.cta__title span {
    color: var(--amu-yellow);
}

.cta__text {
    margin-top: 20px;
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
}

.cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

@media (max-width: 767px) {
    .cta__box { padding: 48px 24px; border-radius: 22px; }
    .cta__actions .btn { flex: 1 1 100%; }
}

/* --------------------------------------------------------------------------
   8. FICHE TECHNIQUE : un document de référence dans un panneau latéral
   Couverture, fiche signalétique, sommaire collant, sections numérotées,
   interlocuteur. La couleur de la formation (--c) ne sert qu'au sigle.
   -------------------------------------------------------------------------- */
.sheet {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(1120px, calc(100vw - 56px));
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    background: #fff;
    color: var(--ink);
    box-shadow: -40px 0 90px -40px rgba(9, 47, 78, 0.55);
    scrollbar-width: thin;
    scrollbar-color: rgba(9, 47, 78, 0.25) transparent;
}

.sheet::backdrop {
    background: rgba(9, 47, 78, 0.5);
}

.sheet[open] {
    animation: sheet-in 0.6s var(--ease-out);
}

.sheet[open]::backdrop {
    animation: fade-in 0.4s var(--ease);
}

.sheet.is-closing {
    animation: sheet-out 0.3s var(--ease) forwards;
}

.sheet.is-closing::backdrop {
    animation: fade-out 0.3s var(--ease) forwards;
}

@keyframes sheet-in {
    from { transform: translateX(100%); }
    to { transform: none; }
}

@keyframes sheet-out {
    to { transform: translateX(100%); }
}

@keyframes fade-in {
    from { opacity: 0; }
}

@keyframes fade-out {
    to { opacity: 0; }
}

/* Barre du haut, collante : référence de la fiche et outils */
.sheet__top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
    padding: 0 40px 0 56px;
    background: #fff;                 /* opaque : le texte ne transparaît pas */
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--hairline);
}

.sheet__crumb {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sheet__crumb b {
    margin-right: 6px;
    color: var(--amu-navy);
}

.sheet__tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet__tool,
.sheet__close {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--amu-navy);
    cursor: pointer;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.sheet__tool {
    padding: 0 16px;
}

.sheet__close {
    width: 40px;
    padding: 0;
    font-size: 15px;
}

.sheet__tool:hover {
    background: var(--surface-blue);
}

.sheet__close:hover {
    border-color: var(--amu-navy);
    background: var(--amu-navy);
    color: #fff;
}

.sheet__doc {
    padding: 48px 56px 24px;
}

/* En-tête imprimé : logo et coordonnées (créé par js/formations.js) */
.sheet__print-head,
.sheet__print-foot {
    display: none;
}

/* Couverture : titre et résumé à gauche, photos à droite */
.sheet__cover {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: end;
    gap: 56px;
}

.sheet__badge {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--c, var(--amu-blue));
}

.sheet__logo {
    width: auto;
    height: 52px;
    object-fit: contain;
}

.sheet__title {
    margin-top: 20px;
    font-family: var(--font-nav);
    font-size: clamp(2rem, 1.4rem + 1.8vw, 3rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--amu-navy);
    text-wrap: balance;
}

.sheet__summary {
    max-width: 460px;
    margin-top: 16px;
    font-size: 18px;
    line-height: 1.65;
    color: var(--ink-soft);
}

.sheet__media {
    margin: 0;
}

/* height: auto neutralise l'attribut height de l'image : le format 4:3 s'applique */
.sheet__photo {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 4px;
    background: var(--surface-blue);
    transition: opacity 0.25s var(--ease);
}

.sheet__photo.is-changing {
    opacity: 0;
}

.sheet__thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.sheet__thumb {
    width: 76px;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 3px;
    background: var(--surface-blue);
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s var(--ease);
}

.sheet__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sheet__thumb:hover,
.sheet__thumb.is-active {
    opacity: 1;
}

.sheet__thumb.is-active {
    outline: 2px solid var(--amu-navy);
    outline-offset: 2px;
}

/* Fiche signalétique, présentée comme un tableau */
.sheet__specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin: 44px 0 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}

.sheet__specs > div {
    padding: 20px 24px 20px 0;
}

.sheet__specs dt {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sheet__specs dd {
    margin: 8px 0 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--amu-navy);
}

.sheet__specs small {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
}

/* Sommaire collant à gauche, contenu à droite */
.sheet__layout {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 64px;
    margin-top: 56px;
}

.sheet__toc {
    position: sticky;
    top: 96px;
    align-self: start;
    display: grid;
}

.sheet__toc p {
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sheet__toc a {
    padding: 9px 0 9px 16px;
    border-left: 2px solid var(--hairline);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.sheet__toc a:hover {
    color: var(--amu-navy);
}

.sheet__toc a.is-active {
    border-left-color: var(--amu-navy);
    color: var(--amu-navy);
}

.sheet__content {
    max-width: 720px;
}

.sheet__part {
    scroll-margin-top: 88px;
}

.sheet__part + .sheet__part {
    margin-top: 56px;
}

.sheet__part h3 {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 0 0 20px;
    font-family: var(--font-nav);
    font-size: 25px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--amu-navy);
}

.sheet__part h3 span {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--amu-blue);
}

.sheet__part p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink-soft);
}

.sheet__part p + p {
    margin-top: 14px;
}

.sheet__lead {
    font-family: var(--font-nav);
    font-size: 20px !important;
    line-height: 1.6 !important;
    color: var(--amu-navy) !important;
}

.sheet__note {
    margin-top: 22px !important;
    padding: 16px 20px;
    border-radius: 4px;
    background: var(--surface-blue);
    font-size: 15px !important;
    color: var(--amu-navy) !important;
}

.sheet__note b {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* Objectifs : puces (la numérotation 01, 02... est réservée aux sections) */
.sheet__goals {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--hairline);
}

.sheet__goals li {
    position: relative;
    padding: 16px 0 16px 28px;
    border-bottom: 1px solid var(--hairline);
    font-size: 16px;
    line-height: 1.7;
    color: var(--amu-navy);
}

.sheet__goals li::before,
.program__list li::before {
    content: '';
    position: absolute;
    left: 2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--amu-blue);
}

.sheet__goals li::before {
    top: 27px;
}

/* Programme : chiffre clé, puis modules numérotés sur deux colonnes */
.program__count {
    font-size: 16px !important;
    color: var(--ink-soft) !important;
}

.program__count strong {
    margin-right: 10px;
    font-family: var(--font-nav);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    color: var(--amu-navy);
}

.program__label {
    margin-top: 22px !important;
    font-size: 15px !important;
    font-weight: 700;
    color: var(--amu-navy) !important;
}

.program__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.program__list li {
    position: relative;
    padding: 13px 0 13px 24px;
    border-bottom: 1px solid var(--hairline);
    font-size: 15px;
    line-height: 1.55;
    color: var(--amu-navy);
}

.program__list li::before {
    top: 21px;
}

.program__levels {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--hairline);
}

.program__levels li {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--hairline);
}

.program__levels b {
    font-family: var(--font-nav);
    font-size: 20px;
    font-weight: 600;
    color: var(--amu-navy);
}

.program__levels span {
    font-size: 16px;
    font-weight: 600;
    color: var(--amu-navy);
}

.program__levels small {
    font-size: 14px;
    color: var(--ink-soft);
}

/* Inscription : interlocuteur, actions, coordonnées */
.advisor {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    border-radius: 6px;
    background: var(--surface-blue);
}

.advisor__photo {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.sheet__part .advisor__label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.4;
    color: var(--amu-blue);
}

.sheet__part .advisor__name {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--amu-navy);
}

.sheet__part .advisor__role {
    margin-top: 0;
    font-size: 14px;
    line-height: 1.5;
}

.sheet__invite {
    margin-top: 20px !important;
}

.sheet__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.sheet__actions .btn {
    min-height: 52px;
    padding: 0 26px;
    font-size: 15px;
}

.sheet__actions .fa-whatsapp {
    font-size: 19px;
}

.sheet__contacts {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 12px 40px;
    margin: 28px 0 0;
    padding: 20px 0 0;
    list-style: none;
    border-top: 1px solid var(--hairline);
    font-size: 15px;
    font-weight: 600;
    color: var(--amu-navy);
}

.sheet__contacts span {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sheet__contacts a:hover {
    color: var(--amu-blue);
}

.sheet__print-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--amu-blue);
    cursor: pointer;
}

.sheet__print-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Formation précédente / suivante (créée par js/formations.js) */
.sheet__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 64px;
}

.sheet__nav button {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 0 0;
    border: 0;
    border-top: 1px solid var(--hairline);
    background: none;
    text-align: left;
    cursor: pointer;
}

.sheet__nav button:last-child {
    align-items: flex-end;
    text-align: right;
}

.sheet__nav small {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sheet__nav span {
    font-family: var(--font-nav);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--amu-navy);
    transition: color 0.2s var(--ease);
}

.sheet__nav button:hover span {
    color: var(--amu-blue);
}

/* Carte flottante de l'interlocuteur pendant la lecture (créée par js/formations.js) */
.sheet__dock {
    position: sticky;
    bottom: 20px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    margin: 32px 28px 20px auto;
    padding: 8px 8px 8px 10px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 18px 40px -18px rgba(9, 47, 78, 0.45);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.4s var(--ease-out);
}

.sheet__dock.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.sheet__dock img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.sheet__dock-text small {
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sheet__dock-text b {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--amu-navy);
}

.sheet__dock .btn {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 14px;
    box-shadow: none;
}

@media (max-width: 1023px) {
    .sheet { width: 100vw; }
    .sheet__top { padding: 0 20px 0 28px; }
    .sheet__doc { padding: 36px 28px 16px; }
    .sheet__cover { grid-template-columns: 1fr; gap: 28px; }

    /* Sommaire : rangée d'onglets collée sous la barre du haut */
    .sheet__layout { grid-template-columns: 1fr; gap: 28px; margin-top: 32px; }
    .sheet__toc {
        position: sticky;
        top: 64px;
        z-index: 3;
        display: flex;
        gap: 24px;
        margin: 0 -28px;
        padding: 0 28px;
        overflow-x: auto;
        scrollbar-width: none;
        background: #fff;
        border-bottom: 1px solid var(--hairline);
    }
    .sheet__toc::-webkit-scrollbar { display: none; }
    .sheet__toc p { display: none; }
    .sheet__toc a { flex-shrink: 0; padding: 14px 0; border-left: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
    .sheet__toc a.is-active { border-bottom-color: var(--amu-navy); }
    .sheet__part { scroll-margin-top: 124px; }
}

@media (max-width: 767px) {
    .sheet__top { height: 56px; padding: 0 12px 0 18px; }
    .sheet__tool span { display: none; }
    .sheet__tool { width: 40px; padding: 0; }
    .sheet__doc { padding: 28px 18px 8px; }
    .sheet__logo { height: 42px; }
    .sheet__title { margin-top: 14px; font-size: 1.85rem; }
    .sheet__summary { font-size: 16px; }
    .sheet__thumb { width: 64px; }
    .sheet__specs { grid-template-columns: 1fr 1fr; margin-top: 32px; }
    .sheet__specs > div { padding: 16px 12px 16px 0; }
    .sheet__specs dd { font-size: 16px; }
    .sheet__toc { top: 56px; margin: 0 -18px; padding: 0 18px; gap: 20px; }
    .sheet__part { scroll-margin-top: 112px; }
    .sheet__part + .sheet__part { margin-top: 44px; }
    .sheet__part h3 { font-size: 21px; }
    .sheet__part p { font-size: 15px; }
    .sheet__lead { font-size: 18px !important; }
    .sheet__goals li { font-size: 15px; }
    .sheet__goals li::before { top: 25px; }
    .program__list { grid-template-columns: 1fr; }
    .program__levels li { grid-template-columns: 76px minmax(0, 1fr); }
    .program__levels small { grid-column: 2; }
    .advisor { padding: 16px; gap: 14px; }
    .advisor__photo { width: 60px; height: 60px; }
    .sheet__actions .btn { flex: 1 1 100%; }
    .sheet__contacts { grid-template-columns: 1fr; }
    .sheet__nav { grid-template-columns: 1fr; gap: 0; margin-top: 44px; }
    .sheet__nav button { padding-bottom: 18px; }
    .sheet__nav button:last-child { align-items: flex-start; text-align: left; }

    /* Mobile : la carte flottante devient une barre d'inscription pleine largeur */
    .sheet__dock {
        bottom: 0;
        width: auto;
        margin: 24px 0 0;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        border: 0;
        border-top: 1px solid var(--hairline);
        border-radius: 0;
        box-shadow: none;
    }
    .sheet__dock .btn { margin-left: auto; }
}

/* --------------------------------------------------------------------------
   Impression / PDF : une fiche propre, avec logo et coordonnées
   -------------------------------------------------------------------------- */
@media print {
    @page { margin: 14mm 14mm 16mm; }

    html,
    body {
        height: auto !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body > *:not(.sheet[open]) {
        display: none !important;
    }

    .sheet[open] {
        position: static;
        display: block;
        width: auto;
        height: auto;
        overflow: visible;
        box-shadow: none;
        animation: none !important;
        transform: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sheet::backdrop { display: none; }

    .sheet__top,
    .sheet__toc,
    .sheet__thumbs,
    .sheet__actions,
    .sheet__print-link,
    .sheet__nav,
    .sheet__dock { display: none !important; }

    .sheet__doc { padding: 0; }

    .sheet__print-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding-bottom: 10px;
        margin-bottom: 14px;
        border-bottom: 1px solid #c9d3de;
    }

    .sheet__print-head img { width: 44px; height: auto; }
    .sheet__print-head div { display: flex; align-items: center; gap: 12px; }
    .sheet__print-head b { display: block; font-size: 18px; color: var(--amu-blue); }
    .sheet__print-head span { display: block; font-size: 10px; color: var(--ink-soft); }
    .sheet__print-head p { margin: 0; text-align: right; }
    .sheet__print-head em { display: block; font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
    .sheet__print-head p span { margin-top: 2px; font-size: 10px; font-weight: 700; color: var(--amu-navy); }

    .sheet__print-foot {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 4px 18px;
        margin-top: 14px;
        padding-top: 8px;
        border-top: 1px solid #c9d3de;
        font-size: 9.5px;
        color: var(--ink-soft);
    }

    /* La largeur imprimée déclenche les styles mobiles : on les neutralise ici */
    .sheet__cover { grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: center; }
    .sheet__badge { font-size: 11px; }
    .sheet__logo { height: 34px; }
    .sheet__title { margin-top: 8px; font-size: 22px; }
    .sheet__summary { margin-top: 6px; font-size: 11.5px; }
    .sheet__photo { max-height: 4cm; }
    .sheet__specs { grid-template-columns: repeat(4, 1fr); margin-top: 14px; }
    .sheet__specs > div { padding: 8px 12px 8px 0; }
    .sheet__specs dt { font-size: 8px; }
    .sheet__specs dd { margin-top: 3px; font-size: 11.5px; }
    .sheet__specs small { font-size: 9.5px; }
    .sheet__layout { display: block; margin-top: 14px; }
    .sheet__content { max-width: none; }
    .sheet__part + .sheet__part { margin-top: 11px; }
    .sheet__part h3 { margin-bottom: 6px; font-size: 14px; break-after: avoid; }
    .sheet__part h3 span { font-size: 10px; }
    .sheet__part p,
    .sheet__goals li,
    .program__list li { font-size: 10.5px; line-height: 1.5; }
    .sheet__part p + p { margin-top: 6px; }
    .sheet__lead { font-size: 12px !important; }
    .sheet__note { margin-top: 8px !important; padding: 8px 12px; font-size: 10.5px !important; }
    .sheet__goals li { padding: 5px 0 5px 18px; }
    .sheet__goals li::before { top: 10px; width: 5px; height: 5px; }
    .program__count { font-size: 11px !important; }
    .program__count strong { font-size: 20px; }
    .program__label { margin-top: 8px !important; font-size: 11px !important; }
    .program__list { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
    .program__list li { padding: 4px 0 4px 18px; break-inside: avoid; }
    .program__list li::before { top: 9px; width: 5px; height: 5px; }
    .program__levels li { grid-template-columns: 70px minmax(0, 1fr) auto; padding: 6px 0; }
    .program__levels b { font-size: 13px; }
    .program__levels span,
    .program__levels small { grid-column: auto; font-size: 11px; }
    .advisor { padding: 8px 12px; gap: 10px; break-inside: avoid; }
    .advisor__photo { width: 40px; height: 40px; }
    .sheet__part .advisor__label { font-size: 8px; }
    .sheet__part .advisor__name { font-size: 12px; }
    .sheet__part .advisor__role { font-size: 10px; }
    .sheet__invite { margin-top: 8px !important; }
    .sheet__contacts { grid-template-columns: repeat(3, auto); gap: 6px 32px; margin-top: 10px; padding-top: 8px; font-size: 11px; break-inside: avoid; }
    .sheet__contacts span { font-size: 8px; }
}

/* --------------------------------------------------------------------------
   8 bis. FORMATIONS INITIALES : la fiche présentée par ONA NJOCK Benjamin
   Grand écran : l'instructeur apparaît en bas à gauche, la fiche sort de lui
   et se pose à côté ; une bulle invite à lui écrire. La structure de la fiche
   (couverture, tableau, sommaire, sections) est celle de la section 8.
   Éléments créés par js/formations.js : .sheet__paper, .presenter.
   -------------------------------------------------------------------------- */
.sheet--presented {
    inset: 0;
    width: 100vw;
    height: 100%;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
}

.sheet--presented[open] {
    display: grid;
    grid-template-columns: 320px minmax(0, 1040px);
    justify-content: center;
    align-items: end;
    padding: 28px 40px 0 0;
    animation: none;
}

.sheet--presented::backdrop {
    background:
        radial-gradient(900px 600px at 12% 100%, rgba(10, 120, 212, 0.35), transparent 70%),
        rgba(6, 22, 38, 0.72);
}

.sheet--presented.is-closing {
    animation: none;
}

/* La feuille : seule zone qui défile */
.sheet__paper {
    position: relative;
    z-index: 1;
    align-self: stretch;
    margin-bottom: 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.6);
    transform-origin: 0% 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(9, 47, 78, 0.25) transparent;
}

.sheet--presented .sheet__top {
    border-radius: 8px 8px 0 0;
}

/* L'instructeur, en buste, devant le bord gauche de la feuille */
.presenter {
    position: relative;
    z-index: 2;
    align-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: -56px;
}

.presenter__photo {
    display: block;
    width: auto;
    height: min(54vh, 440px);
    max-width: none;
    filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35));
    /* Fondu des bords coupés de la photo (gauche et bas) */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14%), linear-gradient(to top, transparent 0, #000 22%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent 0, #000 14%), linear-gradient(to top, transparent 0, #000 22%);
    mask-composite: intersect;
}

.presenter__plate {
    position: absolute;
    left: 50%;
    bottom: 36px;
    min-width: 230px;
    padding: 12px 18px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: translateX(-50%);
}

.presenter__plate b {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: var(--amu-navy);
}

.presenter__plate span {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--ink-soft);
}

/* Bulle au-dessus de l'instructeur, pointe vers lui */
.presenter__bubble {
    position: relative;
    width: 270px;
    margin-bottom: 18px;
    padding: 18px 20px 20px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.55);
}

.presenter__bubble::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 0 0 3px 0;
}

.presenter__bubble p {
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-soft);
}

.presenter__bubble p b {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-nav);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--amu-navy);
}

.presenter__bubble .btn {
    width: 100%;
    min-height: 44px;
    margin-top: 14px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: none;
}

.presenter__bubble .fa-whatsapp {
    font-size: 17px;
}

/* Chorégraphie : l'instructeur monte, la fiche sort de lui, la bulle apparaît */
.sheet--presented[open] .presenter__photo,
.sheet--presented[open] .presenter__plate {
    animation: presenter-in 0.6s var(--ease-out) backwards;
}

.sheet--presented[open] .presenter__plate {
    animation-delay: 0.15s;
}

.sheet--presented[open] .sheet__paper {
    animation: paper-in 0.75s cubic-bezier(0.2, 0.9, 0.25, 1) 0.18s backwards;
}

.sheet--presented[open] .presenter__bubble {
    animation: bubble-in 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) 0.8s backwards;
}

.sheet--presented.is-closing .sheet__paper {
    animation: paper-out 0.38s cubic-bezier(0.6, 0, 0.8, 0.3) forwards;
}

.sheet--presented.is-closing .presenter,
.sheet--presented.is-closing::backdrop {
    animation: fade-out 0.38s var(--ease) forwards;
}

@keyframes presenter-in {
    from { opacity: 0; transform: translateY(60px); }
}

/* La fiche part de la poitrine de l'instructeur, à gauche, et se déploie */
@keyframes paper-in {
    from { opacity: 0; transform: translate(-18%, 8%) scale(0.18); border-radius: 40px; }
    55% { opacity: 1; }
    to { opacity: 1; transform: none; }
}

@keyframes paper-out {
    to { opacity: 0; transform: translate(-18%, 8%) scale(0.18); }
}

@keyframes bubble-in {
    from { opacity: 0; transform: translateY(14px) scale(0.9); }
}

/* La carte flottante est inutile quand l'instructeur est à l'écran */
@media (min-width: 1180px) {
    .sheet--presented .sheet__dock { display: none; }
}

/* Moins de place : la fiche occupe l'écran, l'instructeur passe dans la barre de contact */
@media (max-width: 1179px) {
    .sheet--presented[open] {
        display: block;
        padding: 0;
    }

    .sheet--presented::backdrop {
        background: rgba(9, 47, 78, 0.5);
    }

    .presenter { display: none; }

    .sheet__paper {
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .sheet--presented .sheet__top { border-radius: 0; }

    .sheet--presented[open] .sheet__paper {
        animation: sheet-in 0.6s var(--ease-out);
    }

    .sheet--presented.is-closing .sheet__paper {
        animation: sheet-out 0.3s var(--ease) forwards;
    }
}

@media (min-width: 1024px) and (max-width: 1179px) {
    .sheet--presented .sheet__paper {
        width: min(1120px, calc(100vw - 56px));
        margin-left: auto;
    }
}

@media print {
    .sheet--presented[open] { display: block; padding: 0; background: none; }
    .presenter { display: none !important; }
    .sheet__paper { height: auto; margin: 0; overflow: visible; border-radius: 0; box-shadow: none; animation: none !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .sheet--presented[open] .presenter__photo,
    .sheet--presented[open] .presenter__plate,
    .sheet--presented[open] .sheet__paper,
    .sheet--presented[open] .presenter__bubble,
    .sheet--presented.is-closing .sheet__paper,
    .sheet--presented.is-closing .presenter {
        animation: none !important;
    }
}

/* --------------------------------------------------------------------------
   Mouvement réduit
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .gallery__frame img.is-active,
    .sheet[open],
    .sheet[open]::backdrop,
    .sheet.is-closing,
    .sheet.is-closing::backdrop {
        animation: none !important;
    }
}

/* --------------------------------------------------------------------------
   8 ter. TÉLÉPHONE : la fiche présentée par ONA NJOCK Benjamin
   Comme sur grand écran, l'instructeur présente la fiche : en buste, en bas
   à gauche, devant le coin de la feuille ; à sa droite, l'invitation à lui
   écrire. La feuille sort de lui à l'ouverture et y retourne à la fermeture
   (croix) ; un glissement vers le bas la fait descendre (js/formations.js).
   Formateurs (BNIS, BNMPS) : la même feuille qui monte, sans l'instructeur.
   -------------------------------------------------------------------------- */
.presenter__by {
    display: none;
}

@media screen and (max-width: 767px) {
    .sheet--presented {
        --stage: calc(92px + env(safe-area-inset-bottom));
    }

    /* ---- Feuilles : décollées du haut, coins arrondis, poignée ---------- */
    .sheet:not(.sheet--presented) {
        inset: calc(12px + env(safe-area-inset-top)) 0 0 0;
        width: 100vw;
        height: auto;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -20px 50px -30px rgba(0, 0, 0, 0.5);
    }

    .sheet--presented .sheet__paper {
        position: absolute;
        top: calc(12px + env(safe-area-inset-top));
        right: 8px;
        bottom: var(--stage);
        left: 8px;
        z-index: 1;
        height: auto;
        border-radius: 18px;
        box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
        transform-origin: 14% 100%;
    }

    /* Le bas de la fiche défile au-dessus de l'instructeur */
    .sheet--presented .sheet__doc { padding-bottom: 72px; }

    /* L'instructeur remplace la barre d'inscription flottante */
    .sheet--presented .sheet__dock { display: none; }

    .sheet::backdrop,
    .sheet--presented::backdrop {
        background:
            radial-gradient(520px 420px at 0% 100%, rgba(10, 120, 212, 0.4), transparent 70%),
            rgba(6, 22, 38, 0.82);
    }

    .sheet__top {
        height: 60px;
        padding: 6px 12px 0 18px;
    }

    .sheet__top::before {
        content: '';
        position: absolute;
        top: 7px;
        left: 50%;
        width: 36px;
        height: 4px;
        margin-left: -18px;
        border-radius: 2px;
        background: rgba(9, 47, 78, 0.18);
    }

    .sheet__crumb {
        min-width: 0;
        overflow: hidden;
        font-size: 11px;
        letter-spacing: 0.08em;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    /* Sommaire collant juste sous la barre du haut */
    .sheet__toc { top: 60px; }
    .sheet__part { scroll-margin-top: 116px; }

    /* ---- L'instructeur, devant le coin bas gauche de la feuille --------- */
    .sheet--presented .presenter {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 2;
        display: block;
        height: var(--stage);
        margin: 0;
    }

    .sheet--presented .presenter__photo {
        position: absolute;
        bottom: 0;
        left: 2px;
        height: 144px;
        pointer-events: none;
        filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
        -webkit-mask-image: linear-gradient(to top, transparent 0, #000 16%);
        mask-image: linear-gradient(to top, transparent 0, #000 16%);
    }

    .sheet--presented .presenter__plate { display: none; }

    /* Son invitation, sur le bandeau sombre */
    .sheet--presented .presenter__bubble {
        position: absolute;
        right: 14px;
        bottom: calc(env(safe-area-inset-bottom) + 14px);
        left: 124px;
        display: flex;
        align-items: center;
        gap: 12px;
        width: auto;
        margin: 0;
        padding: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    .sheet--presented .presenter__bubble::after { display: none; }

    .sheet--presented .presenter__bubble p {
        flex: 1;
        min-width: 0;
    }

    .sheet--presented .presenter__bubble p b {
        margin: 0;
        font-family: var(--font-ui);
        font-size: 14.5px;
        font-weight: 700;
        line-height: 1.3;
        color: #fff;
    }

    .presenter__more { display: none; }

    .sheet--presented .presenter__by {
        display: block;
        margin-top: 4px;
        font-size: 12px;
        line-height: 1.3;
        color: rgba(255, 255, 255, 0.65);
    }

    /* Bouton WhatsApp rond ; le libellé reste lu par les lecteurs d'écran */
    .sheet--presented .presenter__bubble .btn {
        flex-shrink: 0;
        width: 50px;
        min-height: 0;
        height: 50px;
        margin: 0;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        box-shadow: 0 10px 22px -12px rgba(234, 179, 8, 0.9);
        -webkit-tap-highlight-color: transparent;
    }

    .sheet--presented .presenter__bubble .btn .fa-whatsapp { font-size: 22px; }
    .sheet--presented .presenter__bubble .btn:active { scale: 0.94; }
}

@media screen and (max-width: 767px) and (prefers-reduced-motion: no-preference) {
    /* Ouverture : l'instructeur monte, la fiche sort de lui et se déploie,
       puis son invitation apparaît */
    .sheet:not(.sheet--presented)[open] {
        animation: m-sheet-up 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
    }

    .sheet--presented[open] .presenter__photo {
        animation: presenter-in 0.45s var(--ease-out) backwards;
    }

    .sheet--presented[open] .sheet__paper {
        animation: m-paper-in 0.62s cubic-bezier(0.2, 0.9, 0.25, 1) 0.18s backwards;
    }

    .sheet--presented[open] .presenter__bubble {
        animation: m-fade-up 0.4s var(--ease-out) 0.5s backwards;
    }

    /* Fermeture à la croix : la fiche retourne vers l'instructeur (elle le
       rejoint aux trois quarts du temps), puis l'instructeur et le voile
       s'effacent ensemble */
    .sheet--presented.is-closing .sheet__paper {
        animation: m-paper-out 0.5s cubic-bezier(0.45, 0, 0.3, 1) forwards;
    }

    .sheet--presented.is-closing .presenter {
        animation: fade-out 0.2s var(--ease) 0.3s forwards;
    }

    .sheet--presented.is-closing::backdrop {
        animation: fade-out 0.24s var(--ease) 0.26s forwards;
    }

    .sheet:not(.sheet--presented).is-closing {
        animation: m-sheet-drop 0.32s cubic-bezier(0.5, 0, 0.75, 0) forwards;
    }

    /* Formation précédente ou suivante : l'instructeur reste en place, seule
       la nouvelle fiche apparaît en fondu */
    .sheet.is-swap::backdrop,
    .sheet--presented.is-swap .presenter__photo,
    .sheet--presented.is-swap .presenter__bubble { animation: none; }
    .sheet:not(.sheet--presented).is-swap[open],
    .sheet--presented.is-swap[open] .sheet__paper { animation: m-swap-in 0.35s var(--ease-out); }

    /* Fermeture au glissement (ou après un changement de fiche) : la feuille
       descend derrière l'instructeur, puis tout s'efface */
    .sheet--presented.is-swiped .sheet__paper,
    .sheet--presented.is-swap.is-closing .sheet__paper,
    .sheet:not(.sheet--presented).is-swiped,
    .sheet:not(.sheet--presented).is-swap.is-closing {
        animation: m-sheet-drop 0.3s cubic-bezier(0.5, 0, 0.75, 0) forwards;
    }

    .sheet--presented.is-swiped.is-closing .presenter,
    .sheet--presented.is-swap.is-closing .presenter {
        animation: fade-out 0.24s var(--ease) 0.06s forwards;
    }

    .sheet.is-swiped.is-closing::backdrop,
    .sheet.is-swap.is-closing::backdrop {
        animation: fade-out 0.28s var(--ease) forwards;
    }

    /* Pendant le glissement, la feuille suit le doigt (sans animation) */
    .sheet.is-dragging,
    .sheet.is-dragging .sheet__paper { animation: none !important; }
}

@keyframes m-sheet-up {
    from { transform: translateY(100%); }
}

@keyframes m-sheet-drop {
    to { transform: translateY(110%); }
}

@keyframes m-paper-in {
    from { opacity: 0; transform: scale(0.12); border-radius: 48px; }
    45% { opacity: 1; }
    to { opacity: 1; transform: none; }
}

@keyframes m-paper-out {
    75% { opacity: 1; transform: scale(0.12); border-radius: 48px; }
    to { opacity: 0; transform: scale(0.12); border-radius: 48px; }
}

@keyframes m-swap-in {
    from { opacity: 0; transform: translateY(12px); }
}

@keyframes m-fade-up {
    from { opacity: 0; transform: translateY(8px); }
}

/* --------------------------------------------------------------------------
   9. CHORÉGRAPHIE : arrivée sur la page et apparitions au scroll
   Les animations utilisent un remplissage « backwards » : l'état de départ
   s'applique pendant le délai, puis l'élément retrouve ses styles propres
   (survols et transitions intacts).
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {

    /* Titres découpés en mots : chaque mot monte derrière un masque */
    .split .w {
        display: inline-block;
        overflow: hidden;
        vertical-align: top;
        padding: 0.12em 0.04em 0.14em;
        margin: -0.12em -0.04em -0.14em;
    }

    .split .w > span {
        display: inline-block;
        will-change: transform;
    }

    /* ---- Arrivée : en-tête ------------------------------------------------ */
    .js .intro__crumbs {
        animation: fx-text-in 0.8s var(--ease-out) backwards;
    }

    /* Filet de sécurité : sans découpage, le titre apparaît quand même */
    .js .intro__title:not(.split) {
        animation: fx-text-in 0.8s var(--ease-out) 0.9s backwards;
    }

    .intro__title.split .w > span {
        animation: fx-word-up 1.15s var(--ease-out) backwards;
        animation-delay: calc(120ms + var(--i) * 75ms);
    }

    .js .intro__lead {
        animation: fx-text-in 1.1s var(--ease-out) 0.55s backwards;
    }

    .js .intro__actions > * {
        animation: fx-rise-in 0.9s var(--ease-out) backwards;
    }

    .js .intro__actions > :nth-child(1) { animation-delay: 0.75s; }
    .js .intro__actions > :nth-child(2) { animation-delay: 0.85s; }

    .js .intro__media .gallery__frame {
        animation: fx-frame-in 1.4s cubic-bezier(0.77, 0, 0.18, 1) 0.25s backwards;
    }

    .js .intro__media .gallery__bar {
        animation: fx-text-in 0.9s var(--ease-out) 1.1s backwards;
    }

    .js .intro__facts {
        animation: fx-line-in 1.2s var(--ease-out) 0.8s backwards;
    }

    .js .intro__facts > div {
        animation: fx-rise-in 0.9s var(--ease-out) backwards;
    }

    .js .intro__facts > :nth-child(1) { animation-delay: 0.95s; }
    .js .intro__facts > :nth-child(2) { animation-delay: 1.05s; }
    .js .intro__facts > :nth-child(3) { animation-delay: 1.15s; }
    .js .intro__facts > :nth-child(4) { animation-delay: 1.25s; }

    .js .intro__index p {
        animation: fx-text-in 0.8s var(--ease-out) 1.3s backwards;
    }

    .js .intro__index li {
        animation: fx-chip-in 0.6s var(--ease-out) backwards;
        animation-delay: calc(1.35s + var(--i, 0) * 45ms);
    }

    /* ---- Au scroll : titres, textes d'accroche, listes -------------------- */
    [data-reveal].is-in .split .w > span,
    [data-reveal].is-in.split .w > span {
        animation: fx-word-up 1s var(--ease-out) backwards;
        animation-delay: calc(var(--d, 0ms) + 80ms + var(--i) * 55ms);
    }

    [data-reveal].is-in :is(.approach__lead, .catalog__lead, .trainers__lead, .mentor__lead, .cta__text, .track__text, .mentor__profile) {
        animation: fx-text-in 1.1s var(--ease-out) backwards;
        animation-delay: calc(var(--d, 0ms) + 300ms);
    }

    [data-reveal].is-in :is(.track__link, .cta__actions) {
        animation: fx-rise-in 0.9s var(--ease-out) backwards;
        animation-delay: calc(var(--d, 0ms) + 450ms);
    }

    .track[data-reveal].is-in .track__num {
        animation: fx-num-in 1.1s var(--ease-out) backwards;
        animation-delay: var(--d, 0ms);
    }

    /* Cartes du catalogue et brevets : entrée en cascade */
    .catalog__track[data-reveal].is-in > .course-card {
        animation: fx-card-in 1s var(--ease-out) backwards;
        animation-delay: calc(var(--d, 0ms) + var(--i, 0) * 90ms);
    }

    .brevets[data-reveal].is-in > li {
        animation: fx-rise-in 0.9s var(--ease-out) backwards;
        animation-delay: calc(var(--d, 0ms) + var(--i, 0) * 120ms);
    }

    /* Photo de l'encadrant : dévoilement de bas en haut */
    .mentor__photo[data-reveal].is-in img {
        animation: fx-photo-in 1.5s cubic-bezier(0.77, 0, 0.18, 1) backwards;
    }

    /* Bandeau final : léger recul de la photo de fond */
    .cta__box[data-reveal].is-in > img {
        animation: fx-zoom-out 2.4s var(--ease-out) backwards;
    }

    /* ---- Fiches techniques : contenu en cascade à l'ouverture ------------- */
    .sheet[open]:not(.is-closing) :is(.sheet__intro, .sheet__media, .sheet__specs, .sheet__layout) {
        animation: fx-text-in 0.8s var(--ease-out) backwards;
    }

    .sheet[open] .sheet__intro { animation-delay: 0.18s; }
    .sheet[open] .sheet__media { animation-delay: 0.26s; }
    .sheet[open] .sheet__specs { animation-delay: 0.34s; }
    .sheet[open] .sheet__layout { animation-delay: 0.42s; }
}

/* ---- Téléphone : pas de chorégraphie, un fondu simple et fluide ---------
   L'en-tête apparaît d'un bloc ; plus bas, seule l'apparition commune du
   site (css/base.css) s'applique. Les titres ne sont pas découpés en mots
   (js/formations.js). */
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
    .js .intro__crumbs,
    .js .intro__title:not(.split),
    .js .intro__lead,
    .js .intro__actions > *,
    .js .intro__media .gallery__frame,
    .js .intro__media .gallery__bar,
    .js .intro__facts,
    .js .intro__facts > div,
    .js .intro__index p,
    .js .intro__index li,
    [data-reveal].is-in :is(.approach__lead, .catalog__lead, .trainers__lead, .mentor__lead, .cta__text, .track__text, .mentor__profile),
    [data-reveal].is-in :is(.track__link, .cta__actions),
    .track[data-reveal].is-in .track__num,
    .catalog__track[data-reveal].is-in > .course-card,
    .brevets[data-reveal].is-in > li,
    .mentor__photo[data-reveal].is-in img,
    .cta__box[data-reveal].is-in > img,
    .sheet[open]:not(.is-closing) :is(.sheet__intro, .sheet__media, .sheet__specs, .sheet__layout) {
        animation: none;
    }

    .js .intro__crumbs,
    .js .intro__text {
        animation: fx-soft-in 0.6s var(--ease-out) backwards;
    }

    .js .intro__media,
    .js .intro__facts,
    .js .intro__index {
        animation: fx-soft-in 0.6s var(--ease-out) 0.12s backwards;
    }
}

@keyframes fx-soft-in {
    from { opacity: 0; transform: translateY(10px); }
}

@keyframes fx-word-up {
    from { transform: translateY(110%) rotate(2deg); }
}

@keyframes fx-text-in {
    from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
}

@keyframes fx-rise-in {
    from { opacity: 0; transform: translateY(20px); }
}

@keyframes fx-chip-in {
    from { opacity: 0; transform: translateY(10px) scale(0.92); }
}

@keyframes fx-card-in {
    from { opacity: 0; transform: translateX(48px); }
}

@keyframes fx-num-in {
    from { opacity: 0; transform: translateY(0.4em); }
}

@keyframes fx-line-in {
    from { border-top-color: transparent; }
}

@keyframes fx-frame-in {
    from { clip-path: inset(100% 0 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

@keyframes fx-photo-in {
    from { clip-path: inset(100% 0 0 0); transform: scale(1.15); }
    to { clip-path: inset(0 0 0 0); transform: none; }
}

@keyframes fx-zoom-out {
    from { transform: scale(1.12); }
}
