/* =========================================================
   BI-WÔRI — Couche de compatibilité Elementor
   Neutralise les réglages par défaut d'Elementor pour que
   les conteneurs et widgets reprennent exactement la maquette.
   ========================================================= */

body.bw-site {
  --kit-widget-spacing: 0px;
  --widgets-spacing: 0px 0px;
  --widgets-spacing-row: 0px;
  --widgets-spacing-column: 0px;
  --container-default-padding-top: 0px;
  --container-default-padding-right: 0px;
  --container-default-padding-bottom: 0px;
  --container-default-padding-left: 0px;
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
}

/*
 * Conteneurs : Elementor écrit pour chacun « --display:flex » avec une
 * spécificité (0,3,0). Cette règle (0,3,1) rétablit le flux normal ;
 * les classes de mise en page (.cards, .split, .stats…) fixent ensuite
 * leur propre display (grid / flex) directement.
 */
body.bw-site .elementor .elementor-element.e-con {
  --display: block;
  --gap: 0px;
  --row-gap: 0px;
  --column-gap: 0px;
  --padding-top: 0px;
  --padding-right: 0px;
  --padding-bottom: 0px;
  --padding-left: 0px;
  --margin-top: 0px;
  --margin-right: 0px;
  --margin-bottom: 0px;
  --margin-left: 0px;
  --width: 100%;
  --flex-direction: row;
  --flex-wrap: wrap;
  --container-widget-width: auto;
  --container-widget-flex-grow: 0;
}

/* Largeur de contenu de 1200 px, y compris sur les conteneurs de premier niveau */
body.bw-site .elementor .e-con.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
}

/* Widgets : pas d'espacement automatique entre eux, largeur naturelle dans les rangées */
body.bw-site .elementor-widget:not(:last-child) { margin-block-end: 0; }
body.bw-site .elementor .e-con.btn-row > .elementor-widget { width: auto; max-width: 100%; flex: 0 0 auto; }

/* Titres : Elementor impose interligne 1 et marge 0 ; la typographie du site prime */
body.bw-site h1.elementor-heading-title,
body.bw-site h2.elementor-heading-title,
body.bw-site h3.elementor-heading-title { line-height: 1.2; margin: 0 0 .6em; padding: 0; }
body.bw-site .card h3.elementor-heading-title { margin-bottom: 10px; }
body.bw-site .elementor-heading-title a { color: inherit; }

/* Boutons Elementor habillés comme les boutons de la maquette */
.bw-btn .elementor-button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: .92rem; font-family: var(--font-head);
  border: 2px solid transparent; line-height: 1.2;
  background: transparent; color: var(--ink);
  transition: transform .15s ease, background .15s ease, color .15s ease;
  text-decoration: none;
}
.bw-btn .elementor-button:hover { transform: translateY(-1px); }
.bw-btn .elementor-button-content-wrapper { display: inline-flex; align-items: center; gap: 8px; }
.bw-btn:not(.bw-no-arrow) .elementor-button-text::after { content: " ›"; font-size: 1.2em; line-height: 0; }
.bw-btn-primary .elementor-button, .bw-btn-primary .elementor-button:visited { background: var(--ocre); color: #fff; }
.bw-btn-primary .elementor-button:hover, .bw-btn-primary .elementor-button:focus { background: var(--ocre-dark); color: #fff; }
.bw-btn-light .elementor-button, .bw-btn-light .elementor-button:visited, .bw-btn-light .elementor-button:hover { background: #fff; color: var(--ink); }
.bw-btn-outline-light .elementor-button, .bw-btn-outline-light .elementor-button:visited { border-color: rgba(255,255,255,.75); color: #fff; }
.bw-btn-outline-light .elementor-button:hover { background: rgba(255,255,255,.1); color: #fff; }
.bw-btn-outline .elementor-button, .bw-btn-outline .elementor-button:visited { border-color: var(--ink); color: var(--ink); }
.bw-btn-outline .elementor-button:hover { background: var(--ink); color: #fff; }

/* Accessibilité : lien d'évitement du thème */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  clip: auto; width: auto; height: auto; margin: 0; padding: 12px 18px; z-index: 1000;
  background: #fff; color: var(--ink); left: 12px; top: 12px; border-radius: 8px;
}

/* Emplacements photo (widget Image) et vidéo (widget Vidéo) */
body.bw-site .bw-media {
  display: flex; min-height: 220px; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2);
}
body.bw-site .bw-media .elementor-widget-container { display: flex; width: 100%; }
body.bw-site .bw-media img {
  width: 100%; max-width: none; height: auto; align-self: stretch;
  object-fit: cover; border-radius: 0; display: block;
}
body.bw-site .bw-media-dark { background: rgba(255,255,255,.06); }
body.bw-site .hero-grid .bw-media { min-height: 340px; }
body.bw-site .split .bw-media { min-height: 320px; }
body.bw-site .card .bw-media { min-height: 150px; margin: -8px -6px 20px; }
body.bw-site .cta-banner .bw-media { border-radius: 0; min-height: 100%; }
body.bw-site .gallery .bw-media { min-height: 180px; }
body.bw-site .gallery .bw-media.big { grid-column: span 2; grid-row: span 2; }
body.bw-site .bw-media.elementor-widget-video { display: block; background: #000; }
@media (max-width: 900px) {
  body.bw-site .split .bw-media, body.bw-site .hero-grid .bw-media { min-height: 240px; }
  body.bw-site .cta-banner .bw-media { min-height: 220px; }
}
@media (max-width: 560px) {
  body.bw-site .gallery .bw-media.big { grid-column: auto; grid-row: auto; }
}

/* Onglet simple du menu (sans sous-menu) */
.main-nav .nav-direct {
  font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--ink);
  padding: 10px 14px; text-decoration: none; border-bottom: 2px solid transparent;
}
.main-nav .nav-direct:hover { color: var(--ocre-dark); text-decoration: none; }
.main-nav .nav-direct.is-current { color: var(--ocre-dark); border-color: var(--ocre); }

/* Portfolio : galeries et vidéos */
body.bw-site .gallery.bw-portfolio { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
body.bw-site .gallery.bw-portfolio .bw-media { min-height: 0; aspect-ratio: 4 / 3; cursor: zoom-in; }
/* Photo cliquable : le lien d'agrandissement doit remplir le cadre */
body.bw-site .bw-media > a,
body.bw-site .bw-media .elementor-widget-container > a { display: flex; width: 100%; align-self: stretch; }
body.bw-site .bw-media a > img { width: 100%; height: 100%; object-fit: cover; }
body.bw-site .cards.bw-videos { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
body.bw-site .bw-video-item { background: var(--surface); border-radius: var(--radius); padding: 14px; }
body.bw-site .bw-video { border-radius: 10px; overflow: hidden; background: #000; }
body.bw-site .bw-video-item .num { display: block; margin-top: 10px; }

/* Boutons natifs de la navigation */
.nav-item, .m-acc > button, .mobile-close, .burger, .tab { font-family: var(--font-head); }
.nav-item:hover, .nav-item:focus { background: none; color: var(--ink); }
