/* =========================================================
   AZORLEARN — POLICE ET HARMONISATION DU SITE (v4)
   ---------------------------------------------------------
   Chargé par l'en-tête (components/header/header.php), donc
   appliqué automatiquement à TOUTES les pages, à l'en-tête,
   au pied de page, aux cookies et au popup.

   1. Police : Sora (inchangée) — ronde, géométrique, très lisible.
   2. Textes courants plus gros, plus gras et plus foncés
      (les titres, déjà grands, ne changent pas).
   3. Bandeaux « Prêt à passer à l’action ? » compacts.
   4. Retouches du site : assets/css/retouches.css (importé ici).

   Les écritures manuscrites (Caveat) sont conservées.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Caveat:wght@700&display=swap");
@import url("retouches.css");

/* =========================================================
   1. POLICE
   ========================================================= */

:root {
    --az-font: "Sora", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --font-main: var(--az-font);
}

/* « :not(#az-f) » donne une priorité très forte : la règle
   l'emporte sur les polices définies dans chaque page. */
html:root:not(#az-f) body,
html:root:not(#az-f) body *,
html:root:not(#az-f) body *::before,
html:root:not(#az-f) body *::after {
    font-family: var(--az-font) !important;
}

html:root:not(#az-f) body :is(input, select, textarea, button)::placeholder {
    font-family: var(--az-font) !important;
}

/* Code informatique : police à chasse fixe */
html:root:not(#az-f) body :is(code, pre, kbd, samp),
html:root:not(#az-f) body :is(code, pre, kbd, samp) * {
    font-family: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace !important;
}

/* Écritures manuscrites (attestations, signatures, citation) */
html:root:not(#az-f) body :is(
    .ac-diploma__name,
    .ac-diploma__sign,
    .ac-stat--quote p,
    .ak-diploma__name,
    .ak-diploma__sign,
    [data-font="manuscrite"]
) {
    font-family: "Caveat", "Segoe Script", cursive !important;
}

/* Titres nets et serrés */
html:root:not(#az-f) body :is(h1, h2) { letter-spacing: -.03em; }
html:root:not(#az-f) body h3 { letter-spacing: -.015em; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* =========================================================
   2. TAILLES DE TEXTE
   Les titres (h1, h2, bandeaux) gardent leur taille.
   Seuls les textes courants grossissent.
   ========================================================= */

:root {
    --t-h1: clamp(34px, 4vw, 56px);      /* titre principal (hero) — inchangé */
    --t-h2: clamp(28px, 2.9vw, 40px);    /* titres de section — inchangé */
    --t-cta: clamp(21px, 1.9vw, 26px);   /* bandeaux d'appel — inchangé */
    --t-h3: 19px;                        /* titres de cartes */
    --t-lead: 18.5px;                    /* chapeau sous le titre */
    --t-body: 17.5px;                    /* texte courant */
    --t-text: 16px;                      /* texte des cartes */
}

@media (max-width: 760px) {
    :root {
        --t-h1: clamp(30px, 8.2vw, 38px);
        --t-h2: clamp(25px, 6.8vw, 31px);
        --t-cta: clamp(20px, 5.6vw, 23px);
        --t-h3: 17px;
        --t-lead: 17px;
        --t-body: 16.5px;
        --t-text: 15.5px;
    }
}

/* ---------- Textes courants : plus gros, plus gras, plus foncés ----------
   Exclus : maquettes de projets (.mk), cartes des formules et pages
   Tarifs & Offres (on n'y touche pas), outils de tri. */
html:root:not(#az-f) main :is(p, li):not([class*="lead"]):not(.ac-stat--quote p):not(:where(.mk, .mk *, .fp-offers *, .fp-compare *, .fp-builder *, .fp-recap *, .fm-tools *)) {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.65;
}
html:root:not(#az-f) main :is(h3) { font-size: max(var(--t-h3), 17.5px); }

/* Petits textes des cartes : un peu plus grands et plus nets */
html:root:not(#az-f) main small:not(:where(.mk *, .fp-offers *, .fp-compare *, .fp-builder *, .fp-recap *)) {
    font-weight: 500;
}

/* Gris trop pâles → plus foncés */
html:root:not(#az-f) :is(.home-page, .ak-main, .fm-main) {
    --ac-text: #1f2b46;
    --ac-muted: #3d4c69;
    --ak-text: #1f2b46;
    --ak-muted: #3d4c69;
    --fm-text: #1f2b46;
    --fm-muted: #3d4c69;
}
html:root:not(#az-f) body { color: #1f2b46; }

@media (max-width: 760px) {
    html:root:not(#az-f) main :is(p, li):not([class*="lead"]):not(.ac-stat--quote p):not(:where(.mk, .mk *, .fp-offers *, .fp-compare *, .fp-builder *, .fp-recap *, .fm-tools *)) { font-size: 16px; }
}

/* =========================================================
   3. BANDEAUX « PRÊT À PASSER À L’ACTION ? » (compacts)
   - Accueil     : .ac-final
   - Formations  : .fm-cta
   - Académie…   : .ak-cta  (fonction ak_cta)
   ========================================================= */

html:root:not(#az-f) :is(.ac-final, .fm-main .fm-cta, .ak-cta) {
    margin-top: 0;
    padding: 0;
    border-radius: 0;
    background:
        radial-gradient(circle at 8% 0%, rgba(67, 185, 242, .35), transparent 40%),
        linear-gradient(100deg, #0a1a3a 0%, #0b3f93 60%, #0b5fe0 100%);
    text-align: left;
}

html:root:not(#az-f) :is(.ac-final__ring, .fm-cta__ring, .ak-cta__ring) { display: none; }

html:root:not(#az-f) :is(.ac-final__inner, .fm-main .fm-cta__inner, .ak-cta__inner) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "icon title actions"
        "icon text  actions";
    align-items: center;
    column-gap: 18px;
    row-gap: 2px;
    width: min(1320px, calc(100% - 48px));
    max-width: none;
    margin-inline: auto;
    padding: 24px 0;
}

html:root:not(#az-f) :is(.fm-cta__text, .ak-cta__text) { display: contents; }

html:root:not(#az-f) :is(.ac-final__icon, .fm-main .fm-cta__icon, .ak-cta__icon) {
    grid-area: icon;
    width: 46px;
    height: 46px;
    flex: none;
    margin: 0;
    border-radius: 14px;
    font-size: 22px;
    animation: none;
}

html:root:not(#az-f) :is(.ac-main .ac-final h2, .fm-main .fm-cta__text h2, .ak-cta__text h2) {
    grid-area: title;
    align-self: end;
    margin: 0 !important;
    color: #fff;
    font-size: var(--t-cta);
    font-weight: 700;
    line-height: 1.2;
}

html:root:not(#az-f) :is(.ac-final__inner > p, .fm-main .fm-cta__text p, .ak-cta__text p) {
    grid-area: text;
    align-self: start;
    max-width: none;
    margin: 0 !important;
    color: #d7e6ff;
    font-size: 15.5px;
    line-height: 1.5;
}

html:root:not(#az-f) :is(.ac-final__actions, .fm-main .fm-cta__actions, .ak-cta__actions) {
    grid-area: actions;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 10px;
}
html:root:not(#az-f) :is(.ac-final__actions .ac-btn, .fm-main .fm-cta__actions .fm-btn, .ak-cta__actions .ak-btn) {
    width: auto;
    min-height: 46px;
    padding: 0 20px;
    font-size: 15px;
    white-space: nowrap;
}

@media (max-width: 960px) {
    html:root:not(#az-f) :is(.ac-final__inner, .fm-main .fm-cta__inner, .ak-cta__inner) {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "icon    title"
            "icon    text"
            "actions actions";
        row-gap: 4px;
        flex-direction: unset;
        text-align: left;
    }
    html:root:not(#az-f) :is(.ac-final__actions, .fm-main .fm-cta__actions, .ak-cta__actions) {
        justify-content: flex-start;
        margin-top: 12px;
    }
}

@media (max-width: 560px) {
    html:root:not(#az-f) :is(.ac-final__inner, .fm-main .fm-cta__inner, .ak-cta__inner) {
        grid-template-columns: 1fr;
        grid-template-areas: "title" "text" "actions";
        width: calc(100% - 32px);
        padding: 22px 0;
        text-align: center;
    }
    html:root:not(#az-f) :is(.ac-final__icon, .fm-main .fm-cta__icon, .ak-cta__icon) { display: none; }
    html:root:not(#az-f) :is(.ac-final__actions, .fm-main .fm-cta__actions, .ak-cta__actions) {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
    html:root:not(#az-f) :is(.ac-final__actions .ac-btn, .fm-main .fm-cta__actions .fm-btn, .ak-cta__actions .ak-btn) {
        flex: 1 1 140px;
        width: auto;
        min-height: 44px;
        padding: 0 14px;
        font-size: 14.5px;
    }
}
