* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

.identite-site {
    display: inline-flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 1.5rem;

    text-decoration: none;
}

.logo-site {
    width: 42px;
    height: 42px;

    flex-shrink: 0;
}

.texte-logo {
    display: flex;
    flex-direction: column;

    line-height: 1.05;
}

.sous-titre-logo {
    color: #5d6470;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.identite-site:hover {
    opacity: .85;
}

.identite-site:focus-visible {
    outline: 2px solid #1f5fa8;
    outline-offset: 4px;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #333333;
    background-color: #fafafa;
    line-height: 1.6;
}

.entete {
    background-color: #eef6ff;
}

.barre-navigation {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.nom-site {
    color: #1f5fa8;
    font-size: 1.55rem;
    font-weight: 700;
}

.introduction {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 48px;
    text-align: center;
}

.introduction h1 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 2.2rem;
    line-height: 1.2;
    color: #1f2937;
}

.introduction p {
    max-width: 700px;
    margin: 0 auto 32px;
    font-size: 1.1rem;
}

.recherche label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    text-align: left;
}

.recherche input {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}

.section-rubriques {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
}

.section-rubriques h2 {
    margin-top: 0;
    margin-bottom: 32px;
    font-size: 1.8rem;
    color: #1f2937;
}

.grille-vignettes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.vignette {
    display: block;
    overflow: hidden;
    color: #222222;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease,
                box-shadow 0.2s ease;
}

.vignette img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.titre-vignette {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: bold;
}

.vignette:hover,
.vignette:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    text-decoration: underline;
}

.pied-page {
    padding: 40px 24px;
    background-color: #eef6ff;
    text-align: center;
}

.pied-page nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.pied-page a {
    color: #2467b2;
    text-decoration: none;

}

.pied-page p {
    margin-bottom: 0;
    font-size: 0.9rem;
}



/* =======================================================
   EN-TÊTE DES PAGES DE RUBRIQUE
======================================================= */

.entete-rubrique {
    background-color: #f3f8fe;
}

.conteneur-rubrique {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px 28px;
}

.entete-rubrique h1 {
    margin: 0 0 12px;
    font-size: 2.4rem;
    line-height: 1.2;
    color: #1f2937;
    text-align: center;
}

.description-rubrique {
    max-width: 700px;
    margin: 0 auto;
    color: #555555;
    font-size: 1.05rem;
    text-align: center;
}

/* =======================================================
   NAVIGATION DE LA RUBRIQUE
======================================================= */

.navigation-rubrique {
    margin-top: 36px;
}

.navigation-rubrique nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.navigation-rubrique a {
    padding: 8px 14px;
    color: #2467b2;
    background-color: #eef6ff;
    border: 1px solid #d8e7f8;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 0.2s ease,
            color 0.2s ease;
}

.navigation-rubrique a:hover {
    background-color: #2467b2;
    color: #ffffff;
}

.navigation-rubrique h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =======================================================
   CONTENU DES PAGES DE RUBRIQUE
======================================================= */

.contenu-rubrique {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

.theme {
    margin-top: 48px;
    scroll-margin-top: 32px;
}

.retour-themes {
    display: inline-block;
    margin-top: 24px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.retour-themes:hover {
    color: #2467b2;
    text-decoration: underline;
}

.entete-theme {
    padding-bottom: 12px;
    border-bottom: 1px solid #dfe3e8;
    margin-bottom: 24px;
}

.entete-theme h2 {
    margin: 0;
    font-size: 1.45rem;
    color: #1f2937;
}

.carte-ressource {
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 140px;
    color: #333333;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease,
            box-shadow 0.2s ease;

}

.carte-entete {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.carte-titre {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.carte-titre > img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.fleche-carte {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.carte-ressource h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
    color: #1f2937;
}

.texte-type-ressource {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.carte-ressource p {
    flex-grow: 1;
    margin: 0;
    color: #666666;
    font-size: 0.95rem;
}

.carte-ressource:hover,
.carte-ressource:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
}

.grille-ressources {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.liens-ressource {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.liens-ressource a {
    color: #2467b2;
    font-weight: bold;
    text-decoration: none;
}

.liens-ressource a:hover {
    text-decoration: underline;
}

.carte-ressource:focus-visible,
.vignette:focus-visible,
.retour-themes:focus-visible,
.pied-page a:focus-visible,
.navigation-rubrique a:focus-visible,
.liens-ressource a:focus-visible {    
    outline: 3px solid #2467b2;
    outline-offset: 3px;
}


/* =======================================================
   CONTENU DES PAGES DU FOOTER
======================================================= */

.page-texte {
    max-width: 850px;
    margin: 0 auto;
}

.page-texte h1 {
    margin-bottom: 2rem;
}

.page-texte h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.page-texte p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
}


/* =======================================================
   CONTENU PAGE 404
======================================================= */

.page-404 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;

    max-width: 1100px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.illustration-404 {
    width: 280px;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}

.contenu-404 {
    max-width: 420px;
    transform: translateY(20px);
}

@media (max-width: 768px) {

    .page-404 {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .illustration-404 {
        width: 220px;
    }

    .contenu-404 {
        transform: none;
    }
}



.bouton-retour {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon);
    text-decoration: none;
    font-weight: 600;
    color: var(--couleur-principale);
    transition: background-color 0.2s ease;
}

.bouton-retour:hover,
.bouton-retour:focus-visible {
    background-color: var(--couleur-fond-secondaire);
}


@media (max-width: 900px) {
    .introduction h1 {
        font-size: 1.9rem;
    }

    .grille-vignettes {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grille-vignettes {
        grid-template-columns: 1fr;
    }

    .grille-ressources {
        grid-template-columns: 1fr;
    }

    .logo-site {
        width: 38px;
        height: 38px;
    }

    .nom-site {
        font-size: 1.2rem;
    }

    .sous-titre-logo {
        font-size: 0.62rem;
        letter-spacing: 0.1em;
    }

}


@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .identite-site,
    .vignette,
    .carte-ressource,
    .navigation-rubrique a,
    .retour-themes {
        transition: none;
    }
}


/* =======================================================
FENÊTRE MODALE (mot de passe)
======================================================= */

.fenetre-modale {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background-color: rgba(0, 0, 0, 0.45);
}

.contenu-modale {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.20);
}

.contenu-modale h2 {
    margin-top: 0;
}

.contenu-modale label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: bold;
}

.contenu-modale input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.boutons-modale {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.boutons-modale button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

#annuler {
    background-color: #e5e7eb;
}

#valider {
    color: white;
    background-color: #2467b2;
}

.message-erreur {
    min-height: 1.2em;
    margin-top: 8px;

    color: #c62828;
    font-size: 0.9rem;
}