/* WKAD — Hero rééquilibré et fonds pleine largeur, v0.1.6.
   Structure observée : body.wrapper-static sans sidebar > .site-grid >
   .container-component centré > main > article > #wkad-main > #wkad-dispositif.
   Aucun script, défilement forcé ou masquage horizontal global.
   Charger après wkad.home et wkad.video. */

.wkad-home .wkad-home-section.wkad-home-hero {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-block: clamp(.875rem, 1.5vw, 1.5rem);
  padding-inline: clamp(1rem, 2.5vw, 3rem);
  background: #edf5f3;
}

.wkad-home .wkad-home-hero .wkad-home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(.875rem, 1.5vw, 1.5rem);
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
}
.wkad-home .wkad-home-hero .wkad-home-hero-panel {
  min-width: 0;
  padding: clamp(1.25rem, 2.25vw, 2.5rem);
}

/* La largeur du conteneur de grille est la largeur de page disponible, hors
   scrollbar. Le hero et sa grille sortent seuls de la colonne centrale.
   Les deux gardes sont communes : un navigateur sans :has() ou cqw conserve
   le hero contenu dans sa colonne ; cqw ne peut pas retomber sur le viewport. */
@supports (container-type: inline-size) and (width: 1cqw) and selector(:has(*)) {
  body.site.wrapper-static:not(.has-sidebar-left):not(.has-sidebar-right) > .site-grid:has(#wkad-main .wkad-home-hero) {
    container-type: inline-size;
    container-name: wkad-page-width;
  }

  @container wkad-page-width (min-width: 0px) {
    body.site.wrapper-static:not(.has-sidebar-left):not(.has-sidebar-right) .wkad-home .wkad-home-section.wkad-home-hero {
      width: 100cqw;
      max-width: none;
      margin-inline: calc((100% - 100cqw) / 2);
    }
  }
}

/* Le fichier PNG transparent est affiché entier, sans filtre ni recadrage.
   Son format est borné, afin que le logo ne dicte plus la hauteur du hero.
   Les unités rem suivent le réglage de taille des caractères du navigateur. */
.wkad-home .wkad-home-hero .wkad-home-hero-brand {
  display: block;
  align-self: center;
  width: clamp(14rem, 20vw, 18rem);
  max-width: 100%;
  margin: 0 auto 1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 0;
}
.wkad-home .wkad-home-hero img.wkad-home-hero-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: contain;
}

/* Le titre reprend sa place après le logo. Toutes les lignes, les trois
   avantages et le lien restent visibles, y compris avec agrandissement du texte.
   La hauteur découle du contenu : ni hauteur fixe ni texte tronqué. */
.wkad-home .wkad-home-hero .wkad-home-hero-panel h1 {
  margin-block: 0 1.25rem;
  font-size: clamp(2rem, calc(1.25rem + 1.5vw), 3rem);
  line-height: 1.16;
  text-wrap: balance;
}
.wkad-home .wkad-home-hero .wkad-home-hero-benefits {
  gap: .65rem;
  margin-block: 0 1.25rem;
  padding-block: 1rem;
  font-size: 1.0625rem;
  line-height: 1.55;
}

/* Cassiopeia ajoute 1em au <main>. Seulement l’accueil possède ce hero.
   Les messages système et les positions de modules restent disponibles. */
@supports selector(:has(*)) {
  body.site .container-component > main:has(#wkad-main .wkad-home-hero) {
    margin-block-start: 0;
  }
}

/* Le pseudo-élément agrandit uniquement le fond. Le bloc, ses marges internes,
   le titre, le carrousel et les cartes gardent leurs dimensions actuelles. */
.wkad-home #wkad-actualites,
.wkad-home .wkad-home-contact {
  position: relative;
  isolation: isolate;
}
@supports (container-type: inline-size) and (width: 1cqw) and selector(:has(*)) {
  @container wkad-page-width (min-width: 0px) {
    body.site.wrapper-static:not(.has-sidebar-left):not(.has-sidebar-right) .wkad-home #wkad-actualites::before,
    body.site.wrapper-static:not(.has-sidebar-left):not(.has-sidebar-right) .wkad-home .wkad-home-contact::before {
      content: "";
      position: absolute;
      inset-block: 0;
      left: 50%;
      right: auto;
      width: 100cqw;
      transform: translateX(-50%);
      z-index: -1;
      pointer-events: none;
      background: inherit;
    }
  }
}

@media (max-width: 61.99rem) {
  .wkad-home .wkad-home-hero .wkad-home-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .wkad-home .wkad-home-hero .wkad-home-hero-brand {
    width: 14rem;
  }
  /* En colonne, l'affiche conserve une place confortable sans un grand panneau
     vide. L'état de lecture conserve les dimensions minimales du lecteur. */
  .wkad-home .wkad-home-hero .wkad-video:not([data-wkad-video-state="active"]) {
    min-height: clamp(18rem, 52vw, 26rem);
  }
}

@media print {
  .wkad-home .wkad-home-section.wkad-home-hero {
    width: auto !important;
    margin-inline: 0 !important;
    padding: 1rem;
  }
  .wkad-home .wkad-home-hero .wkad-home-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .wkad-home .wkad-home-hero .wkad-home-hero-brand { width: 10rem; margin-inline: auto; }
  .wkad-home #wkad-actualites::before,
  .wkad-home .wkad-home-contact::before { display: none; }
}
