/* =====================================================================
   AFI ESCA — Correctifs responsive (page d'accueil + composants communs)
   Caractère Adv. & Com. — audit du 15/10/2026
   ---------------------------------------------------------------------
   Le CSS du thème « afiesca » est injecté en dernier dans le <head> par
   dist/style.bundle.js. Chaque sélecteur ci-dessous est préfixé par
   « body » : il est donc plus spécifique que la règle du thème qu'il
   remplace et gagne quel que soit l'ordre de chargement.
   Installation, au choix :
     1. à la fin du SCSS source du thème, puis recompiler (recommandé) ;
     2. ou Apparence › Personnaliser › CSS additionnel.
   Les quelques !important répondent à des !important ou à des sélecteurs
   plus forts du thème.
   Breakpoints repris du thème : 479 / 599 / 899 / 1279 / 1439.
   ===================================================================== */


/* ---------------------------------------------------------------------
   0. GARDE-FOUS GLOBAUX
   --------------------------------------------------------------------- */
html,
body {
  overflow-x: clip; /* coupe les débordements latéraux sans casser position:sticky */
}


/* ---------------------------------------------------------------------
   1. NAVIGATION
   Problème : entre 900 et 1279 px (et jusqu'à ~1440 px), le menu desktop
   est conservé alors qu'il ne tient pas : les libellés passent sur 2 lignes
   (« CONT / ACT », « AFI / ESCA »), le champ de recherche chevauche le logo.
   Solution : burger jusqu'à 1279 px, menu desktop resserré de 1280 à 1439 px.
   --------------------------------------------------------------------- */
@media screen and (min-width: 900px) and (max-width: 1279px) {
  body .header .col-g { width: 50%; }
  body .header .col-d { width: 50%; }

  body .header .col-d .secondary-navigation,
  body .header .col-d .primary-navigation { display: none; }

  body .header .col-d .hamburger-menu {
    display: block;
    width: 40px;
    margin-left: auto;
    margin-right: 0;
  }

  body .megamenu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    background-color: #b52b43;
    color: #fff;
    transform-origin: right center;
    transform: translateX(100%);
    transition: transform 300ms ease-in;
  }
  body .megamenu.active-menu { transform: translateX(0); opacity: 1; }

  body .megamenu .primary-navigation { position: absolute; bottom: 10vh; left: 10vw; }
  body .megamenu .primary-navigation ul { list-style: none; }
  body .megamenu .primary-navigation ul li a { font-weight: 300; font-size: 2.5rem; }
  body .megamenu .primary-navigation ul li .sub-menu { display: none; }
  body .megamenu .primary-navigation ul li + li { margin-top: 30px; }

  body .fixed { position: fixed; z-index: 16; }
}

@media screen and (min-width: 1280px) and (max-width: 1439px) {
  body .header .primary-navigation #menu-navigation-principale,
  body .header .primary-navigation #menu-navigation-principale-neerlandais {
    gap: 28px;
  }
  body .header .primary-navigation #menu-navigation-principale li,
  body .header .primary-navigation #menu-navigation-principale-neerlandais li {
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  body .header .col-d .secondary-navigation .menu-top-header_menu-container ul li,
  body .header .col-d .secondary-navigation .menu-top-header_menu-neerlandais-container ul li {
    letter-spacing: 4px;
    white-space: nowrap;
  }
  body .header .col-d .secondary-navigation .menu-top-header_menu-container ul li + li::before,
  body .header .col-d .secondary-navigation .menu-top-header_menu-neerlandais-container ul li + li::before {
    padding: 0 14px;
  }
}


/* ---------------------------------------------------------------------
   2. HERO (slider)
   --------------------------------------------------------------------- */
@media screen and (min-width: 900px) and (max-width: 1279px) {
  /* Le titre déborde sur les cartes « Assurer son prêt… » */
  body #hero-container h1 {
    font-size: clamp(2.6rem, 5vw, 3.8rem);
    line-height: 1.1;
  }
}

@media screen and (max-width: 899px) {
  /* Les flèches sont posées sur le titre : on les descend en bas à droite,
     au-dessus des cartes qui chevauchent le bas du hero.
     !important nécessaire : le thème positionne déjà « right » avec un
     sélecteur plus fort. */
  body #hero-container .swiper-button-prev,
  body #hero-container .swiper-button-next {
    top: auto !important;
    bottom: 90px !important;
    left: auto !important;
    margin-top: 0 !important;
    width: 44px;
    height: 44px;
  }
  body #hero-container .swiper-button-prev { right: 72px !important; }
  body #hero-container .swiper-button-next { right: 16px !important; }
}


/* ---------------------------------------------------------------------
   3. CARTES « ASSURER SON PRÊT… » (section #aboutus)
   900–1279 px : les titres se coupent au milieu des mots
   (« immobilie / r », « tempéra / ment »).
   --------------------------------------------------------------------- */
@media screen and (min-width: 900px) and (max-width: 1279px) {
  body #aboutus .container .grid h4 {
    font-size: 1.15rem;
    line-height: 1.2;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
  }
}


/* ---------------------------------------------------------------------
   4. TYPOGRAPHIE MOBILE / TABLETTE
   Texte justifié en colonne étroite = « rivières » de blancs.
   overflow-wrap:anywhere (≤479 px) coupe les titres au milieu des mots.
   --------------------------------------------------------------------- */
@media screen and (max-width: 899px) {
  body #aboutus p,
  body #mot_president p:not(:has(em)),
  body #disclaimer p,
  body #statistique p,
  body #section-cta-contact p,
  body #disclaimer_banner p,
  body #actualites p,
  body #contact p {
    text-align: left !important;
    hyphens: auto;
  }

  /* Lien « cliquez ici » blanc sur fond clair = invisible */
  body #aboutus .main-content .col-d a {
    color: #b52b43;
    text-decoration: underline;
  }
}

@media screen and (max-width: 599px) {
  body h2 {
    font-size: clamp(2rem, 8.5vw, 2.6rem);
    line-height: 1.15;
  }
}

@media screen and (max-width: 479px) {
  body h2 {
    overflow-wrap: break-word; /* au lieu de « anywhere » */
    hyphens: auto;
  }
}


/* ---------------------------------------------------------------------
   5. SECTION « À PROPOS » (#aboutus) — mobile
   Image décalée hors écran (margin-left:-15vw) et trop petite.
   --------------------------------------------------------------------- */
@media screen and (max-width: 899px) {
  body #aboutus .main-content .col-g img {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    height: 320px;
    object-fit: cover;
    bottom: 0;
  }
  body #section_nosproduits { padding-top: 80px; }
  body #section_nosproduits .list-btn a {
    letter-spacing: 2px;
    line-height: 1.4;
  }
}


/* ---------------------------------------------------------------------
   6. MOT DU PRÉSIDENT (#mot_president) — mobile
   Bloc image de 700 px + marge forcée de 180 px = ~900 px de vide.
   --------------------------------------------------------------------- */
@media screen and (max-width: 899px) {
  body #mot_president .container .col-g .block_img {
    min-height: 0;
    max-height: none;
    height: 360px;
  }
  body #mot_president .columns .col-g img {
    margin-left: 0;
    left: 0;
  }
  body #mot_president .container .columns .col-d {
    margin-top: 40px !important; /* le thème impose 180px !important */
    margin-bottom: 60px;
  }
  body #mot_president .columns .col-d h3 { margin-top: 0; }

  body #confiance { padding: 80px 0; }
}


/* ---------------------------------------------------------------------
   7. « DÉJÀ ASSURÉ AUPRÈS DE LA BANQUE ? » (#disclaimer)
   + cartes produits et stats (#statistique)
   Mobile : la boîte bleue est en absolute, plus haute (666 px) que sa
   section (600 px) → elle passe sous la 1re carte produit.
   Cause : #statistique { margin-top:-600px; padding-top:500px }.
   --------------------------------------------------------------------- */
@media screen and (max-width: 899px) {
  body #disclaimer { top: 0; }
  body #disclaimer .container { height: auto; }
  body #disclaimer .container img {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
  }
  body #disclaimer .container .box-content {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    max-width: none;
    margin: -60px 16px 0;
    padding: 30px 24px;
  }

  body #statistique { margin-top: 0; padding-top: 60px; }
  body #statistique .container .col-g { padding-top: 0; }

  /* Cartes produits : l'icône mange 1/4 de la largeur → on empile */
  body #statistique .container .col-g .product_front {
    flex-direction: column;
    gap: 12px;
    padding: 24px;
  }
  body #statistique .container .col-g .product_front .txt { width: 100%; }
  body #statistique .container .col-g .product_front .txt h4 { line-height: 1.3; }
}

@media screen and (min-width: 900px) and (max-width: 1279px) {
  body #disclaimer .container .box-content {
    width: min(460px, 50%);
    padding: 40px;
  }
}


/* ---------------------------------------------------------------------
   8. « DEVENIR CLIENT » (#section-cta-contact)
   900–1279 px : la colonne de texte tombe à ~80 px utiles
   (« Deve / nir / clien / t ») et la boîte recouvre la section Actualités.
   Mobile : 350 px de marge + 350 px de padding = ~700 px de vide.
   --------------------------------------------------------------------- */
@media screen and (min-width: 900px) and (max-width: 1279px) {
  body #section-cta-contact .container {
    width: calc(100% - 60px);
    max-width: 1100px;
    padding: 50px 0;
  }
  body #section-cta-contact .container .bloc_img { width: 45%; }
  body #section-cta-contact .container .content_section-cta {
    width: 60%;
    padding: 40px 40px 40px 80px;
  }
}

@media screen and (max-width: 899px) {
  body #section-cta-contact { margin-bottom: 0; padding-bottom: 60px; }
  body #disclaimer_banner { padding-top: 60px; }
}


/* ---------------------------------------------------------------------
   9. « DEVENIR PARTENAIRE » (#disclaimer_banner) — mobile
   Le bouton « Nous rejoindre » (absolute) chevauche texte et photo.
   --------------------------------------------------------------------- */
@media screen and (max-width: 899px) {
  body #disclaimer_banner .container .cold .cta {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    display: inline-block;
    margin: 20px 0 20px 30px;
  }
}


/* ---------------------------------------------------------------------
   10. ACTUALITÉS (#actualites)
   Mobile : le wrapper animé (.from-left) ne prend que 50 % → titre
   coupé en « L'actuali / té », « Belgiqu / e ».
   Vignettes : margin-top:-100px rogne le visuel ; elles débordent en tablette.
   --------------------------------------------------------------------- */
@media screen and (max-width: 899px) {
  body #actualites .container .intro_actu > * { width: 100%; }

  /* Vignette affichée entière (les visuels contiennent du texte : pas de recadrage) */
  body #actualites .container .grid_articles .card_article .home-thumbnail {
    height: auto;
    max-height: none;
  }
  body #actualites .container .grid_articles .card_article .home-thumbnail img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-top: 0;
  }
  body #actualites .container .view_more { margin-top: 60px; }
}


/* ---------------------------------------------------------------------
   11. FORMULAIRE DE CONTACT — mobile
   Champs en 2 colonnes de 165 px : trop étroit au doigt.
   --------------------------------------------------------------------- */
@media screen and (max-width: 599px) {
  body .wpcf7-form .moitier,
  body .contact-form .moitier {
    width: 100%;
    float: none;
  }
}
