/* ===========================================================================
   WESTPORTS — Ajustements responsive (LOT 06 / LOT 67)

   Approche mobile-first : les fichiers précédents décrivent le mobile, ce
   fichier ne porte que les ajustements nécessaires aux points de rupture
   imposés : 390, 430, 768, 1024, 1440, 1920.
   =========================================================================== */

/* --- Header compact : la place manque avant 768 px ------------------------
   Le CTA « Request support » est déjà présent dans le menu et dans la barre
   d'action mobile : on le retire de l'en-tête pour garder le burger visible. */
@media (max-width: 767px) {
    .wp-header__actions .wp-btn {
        display: none;
    }

    .wp-header__inner {
        gap: var(--wp-space-3);
    }

    .wp-logo__sub {
        letter-spacing: 0.18em;
    }
}

@media (max-width: 389px) {
    .wp-lang {
        display: none; /* repris dans le menu mobile */
    }
}

/* --- ≤ 430 px : iPhone 14/15 Pro Max et équivalents ---------------------- */
@media (max-width: 430px) {
    .wp-hero {
        min-height: 92svh;
    }

    .wp-hero__actions .wp-btn {
        flex: 1 1 100%;
    }

    .wp-hero__meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--wp-space-4) var(--wp-space-3);
    }

    .wp-cta {
        border-radius: var(--wp-radius-lg);
        padding: var(--wp-space-6) var(--wp-space-5);
    }

    .wp-timeline__item {
        grid-template-columns: 40px 1fr;
        gap: var(--wp-space-3);
    }

    .wp-timeline__marker {
        width: 40px;
        height: 40px;
    }

    .wp-timeline__item::before {
        left: 19px;
        top: 30px;
    }

    .wp-lightbox__nav {
        width: 40px;
        height: 40px;
    }
}

/* --- ≤ 389 px : petits écrans (iPhone SE) -------------------------------- */
@media (max-width: 389px) {
    :root {
        --wp-gutter: 1.125rem;
    }

    .wp-logo__text {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }

    .wp-mobilebar__item {
        font-size: 0.5625rem;
    }
}

/* --- ≥ 768 px : tablette portrait ---------------------------------------- */
@media (min-width: 768px) {
    .wp-gallery {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    }

    /* Première image de galerie mise en avant. */
    .wp-gallery--feature > :first-child {
        grid-column: span 2;
        grid-row: span 2;
    }

    .wp-footer__bottom {
        flex-wrap: nowrap;
    }
}

/* --- ≥ 1024 px : tablette paysage et petits portables -------------------- */
@media (min-width: 1024px) {
    .wp-section-head {
        margin-bottom: var(--wp-space-9);
    }

    .wp-hero__content {
        gap: var(--wp-space-6);
    }

    /* Grille éditoriale décalée : le visuel déborde légèrement de la colonne. */
    .wp-offset-media {
        margin-right: calc(-1 * var(--wp-space-8));
    }

    .wp-split--reverse .wp-offset-media {
        margin-right: 0;
        margin-left: calc(-1 * var(--wp-space-8));
    }
}

/* --- ≥ 1440 px : desktop de référence ------------------------------------ */
@media (min-width: 1440px) {
    :root {
        --wp-section-y: 8rem;
    }

    .wp-cards--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* --- ≥ 1920 px : grands écrans ------------------------------------------- */
@media (min-width: 1920px) {
    :root {
        --wp-container: 1440px;
        --wp-gutter: 4rem;
    }

    .wp-hero__title {
        font-size: 5.25rem;
    }
}

/* --- Orientation paysage sur mobile : le hero plein écran est trop haut -- */
@media (max-height: 520px) and (orientation: landscape) {
    .wp-hero {
        min-height: auto;
        padding-block: calc(var(--wp-header-height) + var(--wp-space-6)) var(--wp-space-7);
    }

    .wp-hero__meta {
        display: none;
    }
}

/* --- Pointeur grossier : cibles tactiles élargies ------------------------ */
@media (pointer: coarse) {
    .wp-nav__link,
    .wp-footer__list a,
    .wp-breadcrumb a {
        padding-block: var(--wp-space-2);
    }

    .wp-card:hover {
        transform: none;
    }
}

/* --- Impression ----------------------------------------------------------- */
@media print {
    .wp-header,
    .wp-drawer,
    .wp-mobilebar,
    .wp-whatsapp-float,
    .wp-scroll-hint,
    .wp-toasts,
    .wp-hero__media,
    .wp-cta {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    .wp-section {
        padding-block: 1.5rem;
        break-inside: avoid;
    }

    a[href^='http']::after {
        content: ' (' attr(href) ')';
        font-size: 9pt;
        color: #555;
    }
}

/* --- Contraste élevé ------------------------------------------------------ */
@media (prefers-contrast: more) {
    :root {
        --wp-text-muted: var(--wp-ink);
        --wp-border: rgba(16, 23, 31, 0.32);
        --wp-border-strong: rgba(16, 23, 31, 0.5);
    }

    :root[data-theme='dark'] {
        --wp-text-muted: #ffffff;
        --wp-border: rgba(255, 255, 255, 0.36);
        --wp-border-strong: rgba(255, 255, 255, 0.56);
    }

    /* Le voile du bandeau se renforce dans les deux registres : c'est le
       contraste du texte sur l'image qui est en jeu, pas sa teinte. */
    .wp-hero__overlay {
        background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.88) 60%, rgba(255, 255, 255, 0.8) 100%);
    }

    :root[data-theme='dark'] .wp-hero__overlay,
    .wp-hero--media-dark .wp-hero__overlay {
        background: linear-gradient(to top, rgba(4, 16, 28, 0.97) 0%, rgba(4, 16, 28, 0.82) 60%, rgba(4, 16, 28, 0.7) 100%);
    }
}
