/* Lapierre 1.15.9 — Mise en page fluide et typographie Inter, sur tout le site public.
 * Ne modifie pas l'administration WordPress ni les dimensions des médias.
 */
:root {
    --clg-site-font: 'Inter', Arial, Helvetica, sans-serif;
    --clg-site-gutter: clamp(14px, 1.65vw, 34px);
}

/* Toutes les zones textuelles (y compris encadres, widgets, blocs Gutenberg,
 * formulaires, carrousels et pied de page). Les glyphes d'icones, SVG et
 * composants a police pictographique doivent conserver leurs propres fontes.
 */
body,
body button, body input, body select, body textarea,
body :is(h1, h2, h3, h4, h5, h6, p, a, div, span, li, label,
         blockquote, figcaption, caption, th, td, summary, legend,
         strong, em, small, time, cite):not(.dashicons):not(.ab-icon):not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not([class^="fa-"]):not([class*=" fa-"]):not(.material-icons):not(.genericon) {
    font-family: var(--clg-site-font) !important;
}

/* La barre de menu est deja elargie par menu-icons.css.
 * Elargir aussi le bandeau, les articles, les pages, les blocs, les widgets
 * et le pied de page sans fixer une largeur en pixels.
 */
@media screen and (min-width: 768px) {
    body .site .u-wrapper,
    body .u-wrapper {
        box-sizing: border-box;
        width: 100% !important;
        max-width: none !important;
        padding-left: var(--clg-site-gutter) !important;
        padding-right: var(--clg-site-gutter) !important;
    }

    /* PressBook limite aussi la largeur du contenu et des articles selon
     * le modele no-sidebar / single-sidebar / double-sidebar. */
    body .site-content,
    body .content-area,
    body .site-main,
    body .entry-content,
    body .wp-block-post-content {
        box-sizing: border-box;
        max-width: none !important;
    }

    /* Sans colonne laterale, le contenu occupe toute la largeur disponible. */
    body.no-sidebar .site-main,
    body.no-sidebar .content-area,
    body.page-template-full-width .site-main,
    body.page-template-full-width .content-area {
        width: 100% !important;
    }

    /* Avec colonnes laterales, les conserver sans forcer 100% sur l'article. */
    body.single-sidebar .site-main,
    body.double-sidebar .site-main,
    body.single-sidebar .content-area,
    body.double-sidebar .content-area {
        min-width: 0;
    }

    /* Blocs de pleine largeur Gutenberg et conteneurs de contenu du theme. */
    body .site-content .alignwide,
    body .site-content .wp-block-post-content > .wp-block-group,
    body .site-content .entry-content > .wp-block-group,
    body .site-content .entry-content > .wp-block-columns {
        max-width: 100% !important;
    }
}

/* Sur telephone, conserver la structure responsive originale et proteger
 * les bordures du texte ; evite tout defilement horizontal ajoute par nous. */
@media screen and (max-width: 767px) {
    body .site .u-wrapper,
    body .u-wrapper {
        box-sizing: border-box;
        max-width: 100%;
    }
}


/* 1.15.9 : retrouver une vraie gouttière entre la colonne latérale et
 * l'article. Le thème laisse « margin-right: auto » sur la colonne gauche ;
 * lorsque l'article est devenu fluide (1.15.8), cette marge peut tomber à 0.
 * Ne rien forcer sur les écrans où PressBook empile ses colonnes.
 */
@media screen and (min-width: 1024px) {
    body.single-sidebar .pb-content-sidebar {
        column-gap: clamp(18px, 1.6vw, 30px);
    }
    body.single-sidebar .pb-content-sidebar > .c-sidebar-left {
        margin-right: 0 !important;
    }
    body.single-sidebar .pb-content-sidebar > .c-sidebar-right {
        margin-left: 0 !important;
    }
    body.single-sidebar .pb-content-sidebar > .site-main {
        flex: 1 1 0;
        min-width: 0;
        max-width: none !important;
    }
}

/* Centrage des coordonnées du collège dans la colonne latérale gauche.
 * Le widget Gutenberg #block-19, vérifié dans la sauvegarde du site Lapierre,
 * contient des groupes contraints à 200px et justifiés à gauche. On recentre
 * leurs marges sans modifier les dimensions, le texte ni les couleurs.
 * Les autres widgets et les contenus des autres pages restent inchangés.
 */
#secondary-left #block-19 {
    text-align: center;
}
#secondary-left #block-19 .wp-block-group,
#secondary-left #block-19 .wp-block-pullquote {
    margin-left: auto !important;
    margin-right: auto !important;
}


/* 1.16.0 — Accueil Lapierre : centrer uniquement le grand logo de la
 * page, son titre « ACCUEIL » et son texte de bienvenue dans la colonne
 * principale. Ne pas toucher au logo de l’en-tête, au carrousel d’actualités,
 * aux autres images ni aux articles affichés plus bas.
 * WordPress : page d’accueil statique #2, vignette mise en avant #10761.
 */
body.page-id-2 #post-2 > .post-thumbnail,
body.page-id-2 #post-2 > .entry-thumbnail,
body.page-id-2 #post-2 > .featured-image,
body.page-id-2 #post-2 > .entry-header .post-thumbnail {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
}
body.page-id-2 #post-2 > .post-thumbnail a,
body.page-id-2 #post-2 > .entry-thumbnail a,
body.page-id-2 #post-2 > .entry-header .post-thumbnail a {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
}
body.page-id-2 #post-2 > .post-thumbnail img,
body.page-id-2 #post-2 > .entry-thumbnail img,
body.page-id-2 #post-2 > .entry-header img.wp-post-image,
body.page-id-2 #post-2 > :not(.entry-content) img.wp-post-image,
body.page-id-2 #post-2 > img.wp-post-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}
body.page-id-2 #post-2 > .entry-header,
body.page-id-2 #post-2 > .entry-header .entry-title,
body.page-id-2 #post-2 > .entry-title {
    width: 100%;
    text-align: center !important;
}
/* 1.16.1 : dans PressBook, .entry-content n'est pas forcément enfant
 * direct de #post-2. Le premier paragraphe du contenu de la page statique
 * est le message « Bienvenue », après le groupe Gutenberg d'introduction.
 * Cibler ce paragraphe seulement, sans centrer le contenu qui suit. */
body.home.page-id-2 #post-2 .entry-content > p:first-of-type,
body.home.page-id-2 .site-main .entry-content > p:first-of-type,
body.page-id-2 #post-2 .entry-content > .wp-block-group + p {
    text-align: center !important;
}
