/* ==========================================================================
   AMUCAM : fondations partagées par toutes les pages
   Reset, conteneur, titres de section, boutons, apparition au scroll,
   en-tête éditorial des pages intérieures.
   Les couleurs de base (--amu-*) viennent de css/layout.css.
   ========================================================================== */

:root {
    --ink: #0f1f33;
    --ink-soft: #52606f;
    --surface-blue: #f2f7fc;      /* fond clair teinté du bleu du logo */
    --hairline: rgba(9, 47, 78, 0.1);
    --shadow-soft: 0 24px 48px -28px rgba(9, 47, 78, 0.35);
    --shadow-lift: 0 34px 70px -34px rgba(9, 47, 78, 0.45);
    --section-y: 112px;
    --gutter: 32px;
}

@media (max-width: 767px) {
    :root {
        --section-y: 64px;
        --gutter: 20px;
    }
}

/* --------------------------------------------------------------------------
   Base (reset commun, sans Tailwind)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--nav-h);
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
}

h1, h2, h3, p, ul, figure {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--amu-logo);
    outline-offset: 3px;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* --------------------------------------------------------------------------
   Titres de section : un seul modèle pour toute la page
   -------------------------------------------------------------------------- */
.section-head {
    margin-bottom: 56px;
}

.section-head--center {
    text-align: center;
}

.section-title {
    font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--amu-navy);
}

.section-title::after {
    content: '';
    display: block;
    width: 64px;
    height: 5px;
    margin-top: 20px;
    border-radius: 999px;
    background: var(--amu-yellow);
}

.section-head--center .section-title::after {
    margin-left: auto;
    margin-right: auto;
}

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

@media (max-width: 767px) {
    .section-head { margin-bottom: 40px; }
    .section-title::after { width: 52px; height: 4px; margin-top: 16px; }
}

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 32px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.btn i {
    font-size: 14px;
    transition: transform 0.35s var(--ease-out);
}

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

.btn--yellow {
    background: var(--amu-yellow);
    color: var(--amu-navy);
    box-shadow: 0 16px 30px -16px rgba(234, 179, 8, 0.9);
}

.btn--yellow:hover {
    background: #facc15;
    transform: translateY(-2px);
}

.btn--outline {
    border-color: rgba(0, 86, 179, 0.3);
    color: var(--amu-blue);
}

.btn--outline:hover {
    background: var(--amu-blue);
    border-color: var(--amu-blue);
    color: #fff;
}

/* Contour clair, pour les fonds sombres ou photographiques */
.btn--ghost {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

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

/* Petit sur-titre au-dessus d'un titre de section */
.eyebrow {
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--amu-logo);
}

/* --------------------------------------------------------------------------
   Apparition au scroll (uniquement si JS actif)
   -------------------------------------------------------------------------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease-out), transform 1s var(--ease-out);
    transition-delay: var(--d, 0ms);
}

.js [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

/* Mobile : apparition plus courte et plus discrète */
@media (max-width: 767px) {
    .js [data-reveal] {
        transform: translateY(12px);
        transition-duration: 0.5s, 0.6s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] { transition: none !important; }
}

/* --------------------------------------------------------------------------
   Retour tactile : légère pression au doigt (écrans sans survol).
   La propriété scale est indépendante de transform, déjà utilisée
   par les apparitions et les survols.
   -------------------------------------------------------------------------- */
@media (hover: none) {
    .btn,
    .arrow-link,
    .round-btn {
        -webkit-tap-highlight-color: transparent;
    }

    .btn:active,
    .arrow-link:active,
    .round-btn:active {
        scale: 0.97;
    }
}

/* --------------------------------------------------------------------------
   En-tête éditorial de page (Formations, À propos)
   Titre en serif, photos légendées avec jauge, chiffres clés.
   -------------------------------------------------------------------------- */
.intro {
    padding-top: 28px;
    background: #fff;
}

.intro__crumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-soft);
}

.intro__crumbs a {
    transition: color 0.2s var(--ease);
}

.intro__crumbs a:hover {
    color: var(--amu-navy);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.intro__crumbs span[aria-hidden] {
    color: #b8c0ca;
}

.intro__crumbs [aria-current] {
    color: var(--amu-navy);
    font-weight: 600;
}

/* Grand écran : texte 1,15 pour photo 1. La colonne de texte prend le rapport
   1,15 / 0,75 = 23 / 15 : même hauteur exacte que la photo 4:3, titre calé en
   haut, boutons calés en bas. */
.intro__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 48px 0 64px;
}

.intro__text {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1260px) {
    .intro__grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        align-items: start;
        column-gap: 72px;
    }

    .intro__text {
        aspect-ratio: 23 / 15;
    }

    /* Le haut des capitales du titre tombe sur le bord haut de la photo */
    .intro__title {
        margin-top: -0.22em;
    }

    .intro__text .intro__actions {
        margin-top: auto;
        padding-top: 32px;
    }
}

/* Une colonne : la photo garde une taille raisonnable */
@media (max-width: 1259px) {
    .intro__media {
        max-width: 760px;
    }
}

.intro__title {
    max-width: 560px;
    font-family: var(--font-nav);
    font-size: clamp(2.3rem, 1.4rem + 2.8vw, 3.75rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: var(--amu-navy);
    text-wrap: balance;
}

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

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

/* Photos des sessions : cadre 4:3, format natif des photos (aucune coupe) */
.gallery {
    margin: 0;
}

.gallery__frame {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    background: var(--surface-blue);
}

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

/* La photo sortante reste dessous pendant que la suivante s'installe */
.gallery__frame img.is-prev {
    z-index: 1;
    opacity: 1;
}

.gallery__frame img.is-active {
    z-index: 2;
    opacity: 1;
}

/* Quatre transitions, enchaînées à tour de rôle par js/formations.js */
.gallery__frame img.is-active[data-fx="wipe"] {
    animation: fx-wipe 1.1s cubic-bezier(0.77, 0, 0.18, 1) both;
}

.gallery__frame img.is-active[data-fx="wipe"][data-dir="back"] {
    animation-name: fx-wipe-back;
}

.gallery__frame img.is-active[data-fx="rise"] {
    animation: fx-rise 1.1s cubic-bezier(0.77, 0, 0.18, 1) both;
}

.gallery__frame img.is-active[data-fx="zoom"] {
    animation: fx-zoom 1.3s var(--ease-out) both;
}

.gallery__frame img.is-active[data-fx="fade"] {
    animation: fx-fade 1s var(--ease) both;
}

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

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

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

@keyframes fx-zoom {
    from { opacity: 0; transform: scale(1.08); }
    to { opacity: 1; transform: none; }
}

@keyframes fx-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Jauge circulaire : se remplit pendant l'affichage, puis photo suivante */
.gallery__timer {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px -8px rgba(9, 47, 78, 0.5);
}

.gallery__timer svg {
    position: absolute;
    inset: 4px;
    transform: rotate(-90deg);
}

.gallery__timer circle {
    fill: none;
    stroke-width: 3;
}

.gallery__track {
    stroke: rgba(9, 47, 78, 0.12);
}

.gallery__ring {
    stroke: var(--amu-blue);
    stroke-linecap: round;
    stroke-dasharray: 119.4;
    stroke-dashoffset: 119.4;
}

.gallery__timer.is-running .gallery__ring {
    animation: gallery-timer var(--delay, 6s) linear forwards;
}

.gallery.is-paused .gallery__ring {
    animation-play-state: paused;
}

@keyframes gallery-timer {
    to { stroke-dashoffset: 0; }
}

.gallery__timer b {
    position: relative;
    font-size: 13px;
    font-weight: 800;
    color: var(--amu-navy);
    font-variant-numeric: tabular-nums;
}

.gallery__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 16px;
}

.gallery__caption {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.gallery__controls {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}

/* Flèches rondes : carrousels de photos et de cartes */
.round-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(0, 86, 179, 0.3);
    border-radius: 50%;
    background: #fff;
    font-size: 13px;
    color: var(--amu-blue);
    cursor: pointer;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.round-btn:hover:not(:disabled) {
    background: var(--amu-blue);
    border-color: var(--amu-blue);
    color: #fff;
}

.round-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Chiffres clés */
.intro__facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin: 0;
    padding: 32px 0 8px;
    border-top: 1px solid var(--hairline);
}

.intro__facts > div {
    display: flex;
    flex-direction: column;
}

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

.intro__facts dd {
    margin: auto 0 0;
    padding-top: 10px;
    font-family: var(--font-nav);
    font-size: 34px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--amu-navy);
}

@media (max-width: 1023px) {
    .intro__grid { padding: 40px 0 56px; }
    .intro__title,
    .intro__lead { max-width: 640px; }
    .intro__facts { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
}

@media (max-width: 767px) {
    .intro { padding-top: 20px; }
    .intro__crumbs { font-size: 12px; }
    .intro__grid { gap: 36px; padding: 28px 0 44px; }
    .intro__title { font-size: 2.2rem; line-height: 1.1; }
    .intro__lead { margin-top: 18px; font-size: 16px; }
    .intro__actions { gap: 10px; margin-top: 28px; }
    .intro__actions .btn { width: 100%; min-height: 52px; font-size: 15px; }
    .gallery__bar { align-items: flex-start; margin-top: 12px; }
    .gallery__caption { min-height: 3em; font-size: 13px; }
    .gallery__timer { top: 12px; right: 12px; width: 40px; height: 40px; }
    .gallery__timer b { font-size: 12px; }
    .gallery .round-btn { width: 36px; height: 36px; font-size: 12px; }
    .intro__facts { padding-top: 24px; }
    .intro__facts dt { font-size: 10.5px; letter-spacing: 0.1em; }
    .intro__facts dd { padding-top: 6px; font-size: 24px; }
}

/* --------------------------------------------------------------------------
   Titre de section en serif + introduction (pages intérieures)
   -------------------------------------------------------------------------- */
.heading {
    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;
}

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

@media (max-width: 767px) {
    .heading { font-size: 1.85rem; }
    .heading-lead { margin-top: 14px; font-size: 16px; }
}

/* --------------------------------------------------------------------------
   Lien fléché : un texte et une longue flèche qui s'allonge au survol
   -------------------------------------------------------------------------- */
.arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    padding: 6px 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--amu-navy);
    transition: color 0.25s var(--ease);
}

.arrow-link__arrow {
    position: relative;
    width: 56px;
    height: 2px;
    background: var(--amu-yellow);
    transition: width 0.4s var(--ease-out), background-color 0.25s var(--ease);
}

.arrow-link__arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 11px;
    height: 11px;
    border-top: 2px solid var(--amu-yellow);
    border-right: 2px solid var(--amu-yellow);
    transform: translateY(-50%) rotate(45deg);
    transition: border-color 0.25s var(--ease);
}

.arrow-link:hover,
.arrow-link:focus-visible {
    color: var(--amu-blue);
}

.arrow-link:hover .arrow-link__arrow,
.arrow-link:focus-visible .arrow-link__arrow {
    width: 88px;
    background: var(--amu-blue);
}

.arrow-link:hover .arrow-link__arrow::after,
.arrow-link:focus-visible .arrow-link__arrow::after {
    border-color: var(--amu-blue);
}

@media (prefers-reduced-motion: reduce) {
    .arrow-link__arrow { transition: none; }
}
