/* ============================================================
   MOBILE — ajustements spécifiques < 768px
   Fichier dédié aux retouches mobile au fil de l'eau (logo/baseline,
   repositionnement du toggle, menu slide-in…), en plus des règles
   déjà présentes dans les fichiers par composant (header.css, etc.).
   Tout le fichier est scopé sous 768px, aucun effet desktop/tablette.
   ============================================================ */
@media (max-width: 767px) {

    /* ============================================================
       TOPBAR — logo + baseline réduits pour laisser la place au toggle
       ============================================================ */
    .site-header {
        min-height: auto;
    }

    .header-topbar__inner {
        padding-block: 8px;
    }

    .header-topbar__logo-wrap {
        gap: 2px;
    }

    .header-topbar__logo img {
        width: 150px;
    }

    .header-topbar__tagline {
        font-size: 0.68rem;
    }

    .header-topbar__right {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    /* Toggle menu mobile — masqué par défaut en desktop (header.css) */
    .header-topbar__toggle {
        display: flex;
    }

    /* Bandeau nav noir supprimé en entier — ne reste que la topbar verte.
       Contenu repris dans le menu slide-in (voir plus bas). */
    .header-nav {
        display: none;
    }

    /* ============================================================
       MENU SLIDE-IN — panneau ouvert par .header-topbar__toggle
       (template-parts/header/header-mobile-menu.php)
       ============================================================ */
    body.r21-mobile-menu-open {
        overflow: hidden;
    }

    .r21-mobile-menu {
        position: fixed;
        inset: 0;
        z-index: 1100;
    }

    .r21-mobile-menu[hidden] {
        display: none;
    }

    .r21-mobile-menu__overlay {
        position: absolute;
        inset: 0;
        background: rgba(33, 31, 31, 0.72);
        animation: r21-mobile-menu-fade 0.15s ease;
    }

    .r21-mobile-menu__panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 82%;
        max-width: 320px;
        display: flex;
        flex-direction: column;
        background: var(--color-dark);
        padding: 20px;
        overflow-y: auto;
        animation: r21-mobile-menu-slide-in 0.22s ease;
    }

    @keyframes r21-mobile-menu-fade {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    @keyframes r21-mobile-menu-slide-in {
        from { transform: translateX(100%); }
        to   { transform: translateX(0); }
    }

    .r21-mobile-menu__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 24px;
    }

    .r21-mobile-menu__logo img {
        width: 190px;
        height: auto;
    }

    .r21-mobile-menu__close {
        background: none;
        border: none;
        color: var(--color-white);
        font-size: 1.2rem;
        padding: 6px;
    }

    .r21-mobile-menu__nav {
        list-style: none;
        margin: 0 0 24px;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    .r21-mobile-menu__nav > li > a {
        display: block;
        padding: 4px;
        color: var(--color-white);
        font-family: var(--font-body);
        font-size: 1.1rem;
        font-weight: 500;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .r21-mobile-menu__nav > li.current-menu-item > a,
    .r21-mobile-menu__nav > li.current-menu-ancestor > a {
        color: var(--color-primary);
    }

    /* .btn--subscribe est masqué globalement sur mobile (header.css,
       CTA retiré de la topbar) : on le réaffiche explicitement ici,
       le seul contexte mobile où ce CTA doit rester visible. */
    .r21-mobile-menu__cta {
        display: inline-block;
        /* margin-top: auto; */
        /* justify-content: center; */
        /* text-align: center; */
        white-space: normal;
        text-align: center;
        line-height: 1.3em;
        font-size: 1.15em;
    }

    /* ============================================================
       CAROUSEL "À LA UNE" (home.css)
       ============================================================ */
    .carousel__img {
        height: 210px;
    }

    /* ============================================================
       POST-CARD (home.css) — empilé : photo pleine largeur au-dessus
       du titre/résumé, au lieu du côte-à-côte desktop
       ============================================================ */
    .post-card {
        flex-direction: column;
    }

    .post-card__img-link {
        width: 100%;
    }

    .post-card__img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    /* ============================================================
       SOLUTIONS LAYOUT (solutions.css) — sidebar après le contenu
       (le breakpoint 1023px place .col-sidebar avant .col-main)
       ============================================================ */
    .solutions-layout {
        grid-template-areas:
            "main"
            "sidebar";
    }
}
