/* =====================================================================
   Ajustements communs et affichage mobile / tablette.
   Chargé EN DERNIER sur toutes les pages : il corrige les anciennes
   feuilles de style (hauteurs fixes, largeurs en pixels…).
   ===================================================================== */

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; width: 100%; }

/* Titre principal de page (h1/h2 « Mot gold ») */
.titre-page {
    display: block;
    width: 100%;
    margin: 0;
    padding: 1rem;
    text-align: center;
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--c-bleu);
}

/* ---------- Accueil et Contact ---------- */
.Accueil {
    position: relative;
    z-index: 0;
    height: min(78vh, 720px);
    min-height: 320px;
    background-size: cover;
    background-position: center;
}

.TxtAcc {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 92%;
    margin: 0;
    transform: translate(-50%, -50%);
    font-size: clamp(1.3rem, 3vw, 2.6rem);
    line-height: 1.3;
}

.ContenuAcceuil { gap: 30px; padding: 0 12px; }

.txt {
    height: auto;
    min-height: 0;
    padding-bottom: 1.2rem;
    margin: 1rem 0;
}

.txt h2 { font-size: clamp(1.2rem, 2.4vw, 1.55rem); }

.LstSec .list .Nom, .LstLyc h3 {
    padding: 1rem 1rem .2rem;
    text-align: center;
    font-family: 'Titillium Web', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.LstSec .list .Nom { color: var(--c-gold); }
.txt p { overflow-wrap: anywhere; padding: 0 10px; }
.txt a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.Position { padding: 1.5rem 12px 2.5rem; }
.pst2 { height: auto; max-width: 1100px; }
.pst2 iframe { display: block; width: 100%; height: 400px; border: 0; }
.pst2 .contenu-externe { min-height: 300px; }
[hidden] { display: none !important; }

/* ---------- Page Formation ---------- */
.blog-slider { width: 100%; max-width: 900px; }

.blog-slider__title { font-size: clamp(1.1rem, 2.2vw, 1.5rem); }

.tableau-resultats {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-collapse: collapse;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 18px;
    color: #10303d;
}

.tableau-resultats caption {
    padding-bottom: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--c-bleu-fonce);
}

.tableau-resultats th,
.tableau-resultats td { padding: 12px 10px; text-align: center; border-bottom: 1px solid #ddd; }
.tableau-resultats thead th { background: var(--c-bleu-fonce); color: #fff; font-weight: 600; }
.tableau-resultats tbody tr:nth-child(odd) { background: #f1f8fb; }
.tableau-resultats tfoot th, .tableau-resultats tfoot td { font-weight: 700; background: #e3f2f7; }

.resultat .texte { width: 100%; }
.resultat .ligne { align-items: center; justify-content: center; flex-wrap: wrap; }
.resultat .ligne .colonne { flex: 1 1 280px; max-width: 420px; gap: 12px; color: #10303d; }

.resultat .colonne h3 {
    display: block;
    color: var(--c-bleu-fonce);
    font-size: 22px;
    text-align: center;
}

.resultat .taux { font-size: 22px; text-transform: none; color: #10303d; }
.resultat .taux .gold { font-size: 36px; font-weight: 700; }

.barres { display: flex; flex-direction: column; gap: 10px; }
.barre { display: grid; grid-template-columns: 50px 1fr 60px; align-items: center; gap: 10px; font-weight: 700; }
.jauge { height: 18px; border-radius: 9px; background: #e6e6e6; overflow: hidden; }
.jauge span { display: block; height: 100%; border-radius: 9px; background: #2e9e4f; }

.referentiel .cartes .carte .desc { align-items: center; gap: 15px; }
.referentiel .cartes .carte .desc .right { width: auto; padding: 10px 16px; text-align: center; }

.admission .candid .bouton {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 6px;
    background: var(--c-lightblue);
    color: #fff;
    font-weight: 600;
}

.forme ul { padding-left: 0; }

/* ---------- Page Section ---------- */
.globsalle { width: 100%; max-width: 1700px; }
.globsalle .info {
    display: block;
    text-align: center;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 22px;
    font-weight: 600;
    text-transform: none;
    color: var(--c-bleu);
}

.sallededie {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 1.5rem 0;
}

.salle { width: 100%; max-width: none; overflow: hidden; }
.salle:hover { transform: none; }
.salle .ima { border-radius: 10px 10px 0 0; }
.salle .texte { min-height: 0; flex: 1; font-size: clamp(1.1rem, 1.8vw, 1.45rem); text-transform: none; }

.promotions { width: 100%; max-width: 1300px; padding: 1rem 0 2rem; }

.intro-promos {
    max-width: 800px;
    margin: 0 auto 25px;
    font-weight: 400;
    text-transform: none;
    color: #444;
}

.grille-promos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.promo {
    overflow: hidden;
    border-radius: 10px;
    background: var(--c-bleu);
    box-shadow: var(--s-shadow);
}

.promo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #0b4f6c; }

.promo figcaption {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    text-align: center;
    color: #10303d;
}

.promo figcaption strong { font-family: 'Josefin Sans', sans-serif; font-size: 24px; font-weight: 700; color: #0b3b50; }

.frais { width: 100%; max-width: 900px; max-height: none; margin: 1rem auto 2rem; gap: 14px; }
.frais h2 { color: #fff; font-family: 'Josefin Sans', sans-serif; font-size: 28px; font-weight: 700; text-align: center; }
.frais .frais-texte { display: block; width: auto; color: #10303d; font-size: 19px; line-height: 1.6; text-transform: none; font-weight: 400; }
.frais-texte .reste { display: inline-block; margin-top: 8px; font-size: 22px; font-weight: 700; color: #b00020; }
.globale .frais .pdf { display: block; width: 100%; height: 600px; border-radius: 6px; background: #fff; }
.frais .telecharger {
    display: inline-block;
    align-self: center;
    padding: 10px 18px;
    border-radius: 6px;
    background: var(--c-bleu-fonce);
    color: #fff;
    font-weight: 600;
    text-transform: none;
}
.frais .telecharger span { font-weight: 400; opacity: .85; }

/* ---------- Page Poursuites d'études ---------- */
.poursuite { min-height: 0; padding: 1rem 0; }
.poursuite .ligne2 .case { min-height: 0; }
.poursuite .ligne2 .case h2 { color: #10303d; font-size: 24px; font-weight: 700; }

.ecoles {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    width: 100%;
}

.ecoles li { flex-direction: column; text-align: center; }
.ecoles img { width: 150px; height: 150px; object-fit: contain; padding: .8rem; border-radius: 8px; background: #fff; }
.ecoles p { color: #10303d; text-transform: none; }

.metiers { padding: 1rem 0 2rem; }
.metiers .ligne { justify-content: center; width: 100%; }
.metiers .case { min-height: 0; max-width: 700px; color: #10303d; }
.metiers .case h3 {
    display: block;
    padding: .5rem;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: #0b3b50;
}
.metiers .case ul { line-height: 1.6; padding-left: 1rem; }
.metiers .case li { list-style: disc; margin-left: 1rem; }

/* ---------- Mentions légales / CGU ---------- */
.globale > h1 { font-size: clamp(2rem, 6vw, 4rem); margin: 2rem 1rem 1rem; }
.cadre { text-align: left; color: #10303d; letter-spacing: normal; line-height: 1.6; font-size: 17px; }
.cadre h2 { margin: 28px 0 10px; font-size: 22px; font-weight: 700; color: #0b3b50; }
.cadre p { text-align: left; text-transform: none; font-weight: 400; margin-bottom: 10px; }
.cadre a, .cadre .lien-bouton { color: #0b3b50; text-decoration: underline; }
.cadre .lien-bouton { background: none; font: inherit; cursor: pointer; }
.liste-donnees { margin: 0 0 12px 1.2rem; }
.liste-donnees li { list-style: disc; margin-bottom: 8px; }

/* =====================================================================
   Tablettes
   ===================================================================== */
@media (max-width: 900px) {
    .spe, .former .ligne, .referentiel, .resultat .ligne { flex-direction: column; align-items: center; }
    .forme, .admission, .ref { width: 92%; }
    .frais { width: 94%; }
    .globale .frais .pdf { height: 480px; }
}

/* =====================================================================
   Téléphones
   ===================================================================== */
@media (max-width: 600px) {
    .Accueil { height: 60vh; min-height: 280px; }
    .pst2 iframe { height: 300px; }

    .blog-slider { padding: 20px 15px; }

    .tableau-resultats { font-size: 15px; }
    .tableau-resultats th, .tableau-resultats td { padding: 10px 4px; }
    .resultat .titrecase { font-size: 19px; }

    .referentiel .cartes .carte .desc { flex-direction: column; }
    .referentiel .cartes .carte .desc .right { width: 100%; }

    .frais-texte { font-size: 17px; }
    /* Sur petit écran, le PDF intégré est peu lisible : on garde seulement le lien */
    .globale .frais .pdf { display: none; }

    .cadre { width: 94%; padding: 1rem; font-size: 16px; }
    .evenement { padding: .8rem; }
}

/* Bouton « Consulter le référentiel » */
.referentiel .cartes .carte .desc a.right { color: #fff; font-weight: 600; }
.referentiel .cartes .carte .desc a.right:hover { background: var(--c-bleu-fonce); }

/* Cartes des salles : même hauteur, texte lisible (contraste renforcé) */
.sallededie { align-items: stretch; }
.salle .texte { color: #0b3b50; font-weight: 700; }

/* Titres de la page Formation : le texte et la partie dorée restent sur la même ligne */
.domaine h2, .contenu h2, .refglo h2, .former h2, .resul h2, .admiti h2, .admission h2,
.forme h3, .specialite h3, .referentiel .cartes .carte h4 {
    display: block;
    text-align: center;
    line-height: 1.3;
}
.referentiel .cartes .carte h4 .ligne { display: inline; }
.domaine h2, .contenu h2, .refglo h2, .former h2, .resul h2, .admiti h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.admission h2 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
.specialite { min-height: 0; }
.spe p, .admission p, .referentiel .cartes .carte .desc { font-size: 17px; line-height: 1.5; }
.forme li { font-size: 18px; line-height: 1.6; }
.resultat { min-height: 0; padding-bottom: 1.5rem; }

@media (max-width: 768px) {
    /* Diaporama « Domaines » : image au-dessus, titre dessous, sans décalage */
    .blog-slider { height: auto; min-height: 0; margin: 10px auto 20px; padding: 15px; }
    .blog-slider__item { flex-direction: column; }
    .blog-slider__img { width: 100%; height: 220px; transform: none; }
    .blog-slider__content { margin-top: 0; padding: 50px 10px 10px; }
    .blog-slider__pagination { top: 245px; }
    .spe p, .admission p, .referentiel .cartes .carte .desc { font-size: 16px; }
    .forme { padding: 1rem; }
    .forme li { font-size: 16px; }
}
.admission h2 .gold { display: inline; }
@media (max-width: 900px) {
    .resultat .ligne { gap: 25px; }
    .resultat .ligne .colonne { flex: none; width: 100%; }
}

/* Pages Mentions légales / Politique de confidentialité */
.cadre h3 { margin: 18px 0 6px; font-size: 18px; font-weight: 700; color: #0b3b50; }
.cadre code { background: rgba(255, 255, 255, .5); padding: 0 4px; border-radius: 3px; }
.cadre .maj { margin-top: 30px; font-size: 14px; opacity: .8; }

/* Encadré « ZOOM sur les métiers de la cybersécurité » (page Poursuites d'études) */
.metiers .ligne { flex-wrap: wrap; align-items: stretch; gap: 25px; }
.metiers .case-zoom { display: flex; flex-direction: row; gap: 22px; align-items: center; max-width: 760px; }
.zoom-couverture { flex: 0 0 170px; }
.zoom-couverture img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
    transition: transform .25s;
}
.zoom-couverture:hover img, .zoom-couverture:focus-visible img { transform: scale(1.04); }
.zoom-texte { display: flex; flex-direction: column; gap: 10px; }
.zoom-texte h3 { padding: 0 !important; text-align: left !important; }
.zoom-texte p { text-align: left; text-transform: none; font-weight: 400; line-height: 1.5; color: #10303d; }
.zoom-texte .telecharger {
    align-self: flex-start;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--c-bleu-fonce);
    color: #fff;
    font-weight: 600;
}
.zoom-texte .telecharger:hover { background: var(--c-lightblue); }
.zoom-texte .telecharger span { font-weight: 400; opacity: .85; }
.zoom-texte .source { font-size: 14px; opacity: .8; }

@media (max-width: 600px) {
    .metiers .case-zoom { flex-direction: column; text-align: center; }
    .zoom-couverture { flex-basis: auto; width: 160px; }
    .zoom-texte h3, .zoom-texte p { text-align: center !important; }
    .zoom-texte .telecharger { align-self: center; }
}
.salle .carrousel { aspect-ratio: 4 / 3; }
.salle .ima { height: auto; flex: 0 0 auto; }
.salle .texte { padding: 1rem 1.2rem; }
