/* ═════════════════════════════════════════════════════════════════════
   BB® Switzerland — Thème clair + switcher
   Base de police du site = 10 px (thème Beaver Builder) → tailles en px.
   Toutes les surcharges sont préfixées html[data-theme="light"] pour passer
   devant les styles du thème parent, des layouts Beaver Builder et de Tailwind.
   ═════════════════════════════════════════════════════════════════════ */

/* ─── Jetons ─── */
:root {
  --bb-bg: #2B2C2D;
  --bb-bg-deep: #1F2022;
  --bb-surface: #1F2022;
  --bb-text: #FFFFFF;
  --bb-text-2: rgba(255, 255, 255, .78);
  --bb-muted: rgba(255, 255, 255, .55);
  --bb-border: rgba(255, 255, 255, .14);
  --bb-pill-bg: #3A3B3D;
  --bb-pill-on-bg: #FFFFFF;
  --bb-pill-on-text: #1E1F20;
}
html[data-theme="light"] {
  --bb-bg: #FFFFFF;
  --bb-bg-deep: #E8E7E6;
  --bb-surface: #FFFFFF;
  --bb-text: #1E1F20;
  --bb-text-2: rgba(30, 31, 32, .74);
  --bb-muted: rgba(30, 31, 32, .5);
  --bb-border: rgba(30, 31, 32, .12);
  --bb-pill-bg: #FFFFFF;
  --bb-pill-on-bg: #1E1F20;
  --bb-pill-on-text: #FFFFFF;
  --bb-pill-hover-bg: #E8E7E6;
  --bb-pill-hover-text: #1E1F20;
  --bb-pill-flip-base: .08s;
  --bb-pill-flip-on: .12s;
  color-scheme: light;
}

/* ─── Transitions de bascule ─── */
html.bb-vt-theme::view-transition-old(root),
html.bb-vt-theme::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
html.bb-vt-theme::view-transition-old(root) { z-index: 1; }
html.bb-vt-theme::view-transition-new(root) { z-index: 2; }
html.bb-vt-theme [style*="view-transition-name"] { view-transition-name: none !important; }
html.bb-theme-fade *,
html.bb-theme-fade *::before,
html.bb-theme-fade *::after {
  transition: background-color .5s ease, color .5s ease, border-color .5s ease, fill .5s ease !important;
}

/* ═══ Switcher ═══ */
html body button.bb-theme-toggle {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 999px;
  vertical-align: middle;
}
html body button.bb-theme-toggle:hover,
html body button.bb-theme-toggle:focus { background: none; border: 0; box-shadow: none; }
html body button.bb-theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.bb-theme-toggle__track {
  position: relative;
  display: block;
  width: 66px;
  height: 36px;
  border-radius: 999px;
  background: rgba(43, 44, 45, .5);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: background-color .5s ease, box-shadow .5s ease;
}
.bb-theme-toggle__ghost {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  color: #fff;
  opacity: .45;
  transition: opacity .4s ease, color .5s ease;
}
.bb-theme-toggle__ghost svg { display: block; width: 100%; height: 100%; }
.bb-theme-toggle__ghost--moon { left: 11px; }
.bb-theme-toggle__ghost--sun { right: 11px; }
.bb-theme-toggle__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: #2B2C2D;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  transform: translateX(0);
  transition: transform .55s cubic-bezier(.68, -0.35, .32, 1.35), background-color .5s ease, color .5s ease;
}
.bb-theme-toggle__morph { width: 18px; height: 18px; overflow: visible; }
.bb-theme-toggle__core,
.bb-theme-toggle__cut,
.bb-theme-toggle__rays {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .6s cubic-bezier(.68, -0.35, .32, 1.35), opacity .35s ease;
}
/* sombre : lune (croissant) */
.bb-theme-toggle__core { transform: scale(1); }
.bb-theme-toggle__cut { transform: translate(0, 0); }
.bb-theme-toggle__rays { opacity: 0; transform: rotate(-90deg) scale(.4); }
.bb-theme-toggle:hover .bb-theme-toggle__thumb { box-shadow: 0 3px 12px rgba(0, 0, 0, .35); }
html:not([data-theme="light"]) .bb-theme-toggle__ghost--moon { opacity: 0; }

/* clair : soleil */
html[data-theme="light"] .bb-theme-toggle__track {
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(30, 31, 32, .1), 0 1px 2px rgba(30, 31, 32, .06);
}
html[data-theme="light"] .bb-theme-toggle__ghost { color: #1E1F20; }
html[data-theme="light"] .bb-theme-toggle__ghost--sun { opacity: 0; }
html[data-theme="light"] .bb-theme-toggle__thumb {
  transform: translateX(30px);
  background: #1E1F20;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(30, 31, 32, .25);
}
html[data-theme="light"] .bb-theme-toggle__core { transform: scale(.55); }
html[data-theme="light"] .bb-theme-toggle__cut { transform: translate(10px, -10px); }
html[data-theme="light"] .bb-theme-toggle__rays { opacity: 1; transform: rotate(0) scale(1); }

@media (prefers-reduced-motion: reduce) {
  .bb-theme-toggle__thumb, .bb-theme-toggle__core, .bb-theme-toggle__cut, .bb-theme-toggle__rays { transition: none; }
}
@media (max-width: 767px) {
  html body button.bb-theme-toggle { margin-right: 8px; }
  .bb-theme-toggle__track { width: 58px; height: 32px; }
  .bb-theme-toggle__thumb { width: 24px; height: 24px; }
  html[data-theme="light"] .bb-theme-toggle__thumb { transform: translateX(26px); }
  .bb-theme-toggle__morph { width: 16px; height: 16px; }
}

/* ═════════════════════════════════════════════════════════════════════
   THÈME CLAIR — surcharges globales
   ═════════════════════════════════════════════════════════════════════ */

html[data-theme="light"] body,
html[data-theme="light"] .fl-page,
html[data-theme="light"] #fl-main-content,
html[data-theme="light"] .fl-page-content,
html[data-theme="light"] footer {
  background-color: var(--bb-bg);
  color: var(--bb-text);
}
html[data-theme="light"] body { background: var(--bb-bg); }

/* Couleurs Tailwind arbitraires du thème sombre */
html[data-theme="light"] .bg-\[\#2B2C2D\],
html[data-theme="light"] .bg-\[\#2b2c2d\],
html[data-theme="light"] .bg-\[\#2B2B2B\],
html[data-theme="light"] .bg-\[\#2b2b2b\] { background-color: var(--bb-bg); }
html[data-theme="light"] .bg-\[\#1F2022\],
html[data-theme="light"] .bg-\[\#1f2022\],
html[data-theme="light"] .bg-\[\#1F2124\],
html[data-theme="light"] .bg-\[\#1f2124\] { background-color: var(--bb-surface); }

/* Typographie de marque */
html[data-theme="light"] .bb-text-hero,
html[data-theme="light"] .bb-text-title,
html[data-theme="light"] .bb-text-section,
html[data-theme="light"] .bb-text-lead,
html[data-theme="light"] .bb-text-body,
html[data-theme="light"] .text-white {
  color: var(--bb-text);
}
html[data-theme="light"] .border-white { border-color: var(--bb-border); }

/* Exceptions : texte posé sur image / aplat de couleur → reste blanc */
html[data-theme="light"] :is(.bb-use-case-item, .bb-pgrid__item, .bb-marquee, .bb-keep-dark, .bb-svc-stage) :is(.text-white, .bb-text-lead, .bb-text-hero, .bb-text-title, h1, h2, h3, h4, p, span) {
  color: #fff;
}

/* Logos blancs → sombres */
html[data-theme="light"] img[src*="Logo_BB_White"] { filter: invert(1) brightness(.12); }

/* ─── Header : même nav qu'en sombre (pilule givrée flottante, header transparent),
       couleurs inversées : pilule claire, texte anthracite, survol en pastille anthracite ─── */
html[data-theme="light"] header nav {
  background: rgba(255, 255, 255, .5);
  box-shadow: none;
}
html[data-theme="light"] header nav a,
html[data-theme="light"] header nav span,
html[data-theme="light"] header nav i,
html[data-theme="light"] header nav button { color: var(--bb-text); }
html[data-theme="light"] header nav .hover\:bg-white:hover { background-color: #2B2C2D !important; }
html[data-theme="light"] header nav .hover\:bg-white:hover,
html[data-theme="light"] header nav .hover\:bg-white:hover * { color: #FFFFFF !important; }
html[data-theme="light"] header .submenu { background: rgba(43, 44, 45, .5); }
html[data-theme="light"] header .submenu a,
html[data-theme="light"] header .submenu a :is(span, i) { color: #FFFFFF; }
html[data-theme="light"] header .submenu a:hover { color: #1E1F20; }

/* ─── Sélecteur de langue Weglot ─── */
html[data-theme="light"] .weglot-dropdown .wgcurrent,
html[data-theme="light"] .weglot-dropdown .wgcurrent a,
html[data-theme="light"] .weglot-dropdown .wgcurrent span { color: var(--bb-text); }

/* Sections volontairement sombres même en thème clair (ex. pôles de la home) */
html[data-theme="light"] .bb-keep-dark {
  --bb-bg: #2B2B2B;
  --bb-bg-deep: #1F2022;
  --bb-surface: #1F2022;
  --bb-text: #FFFFFF;
  --bb-text-2: rgba(255, 255, 255, .78);
  --bb-muted: rgba(255, 255, 255, .55);
  --bb-border: rgba(255, 255, 255, .14);
  color-scheme: dark;
  color: #fff;
}

/* Logos de pôle clairs (gris / lime) illisibles sur fond clair → versions foncées */
html[data-theme="light"] img:is([src*="Strategie_Marketing.svg"], [src*="Strategie_Marketing-"]):not(.bb-keep-dark img) { filter: brightness(0) invert(.17); }


/* Logos blancs (clients, partenaires, témoignages) → version claire :
   inversion (blanc → noir) + multiply qui fait disparaître les éventuels fonds. */
html[data-theme="light"] .client-grid img,
html[data-theme="light"] .bb-clients img,
html[data-theme="light"] .bb-agence-notice-swiper img.object-contain,
html[data-theme="light"] .bb-partners-logos img:not([src*="Entreprise_Formatrice"]),
html[data-theme="light"] footer img.logo-image:not([src*="Entreprise_Formatrice"]) {
  filter: grayscale(1) invert(1) contrast(1.1);
  mix-blend-mode: multiply;
  opacity: .82;
}

/* Classes de fond du thème (SCSS) — certaines forcées en !important dans les gabarits */
html[data-theme="light"] .bb-bg-anthractie-light { background-color: var(--bb-bg) !important; }
html[data-theme="light"] .bb-bg-anthractie-dark { background-color: var(--bb-surface) !important; }
html[data-theme="light"] .bb-keep-dark.bb-bg-anthractie-light,
html[data-theme="light"] .bb-keep-dark .bb-bg-anthractie-light { background-color: #2B2B2B !important; }

/* Vidéos BiBi (fond noir intégré) → BiBi PNG sur fond blanc */
html[data-theme="light"] video.bb-bibi-video { display: none; }
html[data-theme="light"] .bb-bibi-light { display: block; }

/* Vie d'agence : labels en version inversée sur fond clair */
html[data-theme="light"] body.page-template-life_agence img.grayscale:not(.bb-keep-dark img):not([src*="Entreprise_Formatrice"]),
html[data-theme="light"] body.page-template-life_agence img.max-w-\[90px\]:not(.bb-keep-dark img),
html[data-theme="light"] body.page-template-life_agence .bb-partners img {
  filter: grayscale(1) invert(1) contrast(1.1);
  mix-blend-mode: multiply;
}

/* Pages pôle : élément actif sur aplat rose / bleu → texte blanc conservé */
html[data-theme="light"] :is(.accordion-item.graphisme-design, .accordion-item.photos-videos):is(:hover, .active) :is(.text-white, h2, p, span, i) { color: #fff; }
html[data-theme="light"] .accordion-item.digital-web:is(:hover, .active) * { color: #2B2C2D; }
/* Stratégie : le gris #E8E7E6 ne ressort pas sur fond clair → élément actif en anthracite */
html[data-theme="light"] .accordion-item.strategie-marketing:is(:hover, .active) { background-color: #2B2C2D !important; }
html[data-theme="light"] .accordion-item.strategie-marketing:is(:hover, .active) * { color: #FFFFFF !important; }
html[data-theme="light"] .accordion-item { border-color: var(--bb-border) !important; }

/* ─── Page Team (règles d'origine en !important) ─── */
html[data-theme="light"] body.page-template-team h2.leading-150,
html[data-theme="light"] body.page-template-team .team-members__header,
html[data-theme="light"] body.page-template-team .team-members__item { color: var(--bb-text) !important; }
html[data-theme="light"] body.page-template-team .bb-keep-dark h2.leading-150 { color: #fff !important; }
html[data-theme="light"] body.page-template-team .team-members__header,
html[data-theme="light"] body.page-template-team .team-members__header-row,
html[data-theme="light"] body.page-template-team .team-members__item { border-bottom-color: var(--bb-border) !important; }
html[data-theme="light"] body.page-template-team .team-members__item:hover,
html[data-theme="light"] body.page-template-team .team-members__item.is-active,
html[data-theme="light"] body.page-template-team .team-members__item:hover .team-members__name,
html[data-theme="light"] body.page-template-team .team-members__item.is-active .team-members__name { color: var(--row-text, #2B2C2D) !important; }
html[data-theme="light"] body.page-template-team .team-members__photo { background: var(--bb-bg-deep) !important; }
html[data-theme="light"] body.page-template-team .team-cards-sticky { background-color: var(--bb-bg); }

/* ─── Bases du thème parent (skin BB : body/h1-h6 en blanc) ─── */
html[data-theme="light"] :is(h1, h2, h3, h4, h5, h6),
html[data-theme="light"] :is(h1, h2, h3, h4, h5, h6) a,
html[data-theme="light"] .fl-rich-text :is(strong, b) { color: var(--bb-text); }

/* ─── Blog / BB Life ─── */
html[data-theme="light"] .bb-blog .bb-blog-tab-link,
html[data-theme="light"] .bb-blog #bbslife-topics .topic-date { color: var(--bb-text); }
html[data-theme="light"] .bb-blog #bbslife-topics .topic-title { color: var(--bb-text-2); }
/* Articles de fond : texte sombre ; au survol, couleur selon le fond qui monte (gris stratégie → anthracite) */
html[data-theme="light"] .bb-blog #bbslife-post :is(.post-title h5, .post-date, .post-time) { color: var(--bb-text); transition: color .3s ease; }
html[data-theme="light"] .bb-blog #bbslife-post .bbslife-post-container:is(:nth-child(4n+1), :nth-child(4n+2), :nth-child(4n+4)):hover :is(.post-title h5, .post-date, .post-time) { color: #FFFFFF; transition-delay: .25s; }
html[data-theme="light"] .bb-blog #bbslife-post .bbslife-post-container:nth-child(4n+3):hover :is(.post-title h5, .post-date, .post-time) { color: #2B2C2D; }
html[data-theme="light"] .bb-blog #bbslife-post .bbslife-post-container:nth-child(4n+4) .post-bg { background-color: #2B2C2D; }

/* Aplats de couleur des pôles (hero) : mêmes couleurs de texte qu'en thème sombre */
html[data-theme="light"] .main-color-bg :is(.text-white, p, h1, h2, span) { color: #FFFFFF; }
html[data-theme="light"] .main-color-bg p.digital-web { color: #2B2C2D; }
html[data-theme="light"] .main-color-bg:has(p.strategie-marketing) { background: #2B2C2D; }
html[data-theme="light"] .main-color-bg p.strategie-marketing { color: #FFFFFF; }
html[data-theme="light"] .main-color-bg:has(p.strategie-marketing) img { filter: brightness(0) invert(1); }
html[data-theme="light"] :is(.accordion-item.graphisme-design, .accordion-item.photos-videos):is(:hover, .active) { color: #FFFFFF; }

/* Agence : accordéon des pôles (en clair) — texte blanc conservé sur aplat rose / bleu */
html[data-theme="light"] .accordion-item:is(.hover\:bg-\[\#F31B8C\], .hover\:bg-\[\#3B83DD\]):hover :is(.text-white, a, span, i) { color: #FFFFFF; }
html[data-theme="light"] .divider.bg-\[\#F5F5F5\] { background-color: rgba(30, 31, 32, .28); }

/* ─── Stratégie (gris #E8E7E6 en sombre) : inversée en anthracite + texte blanc ─── */
html[data-theme="light"] :not(img).bg-\[\#E8E7E6\]:not(.bb-keep-dark *),
html[data-theme="light"] .hover\:bg-\[\#E8E7E6\]:hover:not(.bb-keep-dark *) { background-color: #2B2C2D !important; }
html[data-theme="light"] :not(img).bg-\[\#E8E7E6\]:not(.bb-keep-dark *) *,
html[data-theme="light"] .hover\:bg-\[\#E8E7E6\]:hover:not(.bb-keep-dark *) * { color: #FFFFFF !important; }
html[data-theme="light"] .hover\:bg-\[\#E8E7E6\]:hover:not(.bb-keep-dark *) img { filter: brightness(0) invert(1); }
html[data-theme="light"] :not(img).bg-\[\#E8E7E6\]:not(.bb-keep-dark *) img[src*="Strategie_Marketing_Black"] { filter: brightness(0) invert(1); }

/* Aplats bleu / rose (Tailwind) : texte blanc ; lime : anthracite */
html[data-theme="light"] :is(.bg-\[\#3B83DD\], .bg-\[\#3b83dd\], .bg-\[\#F31B8C\], .bg-\[\#f31b8c\]) :is(.text-white, h1, h2, h3, h4, p, span, a, li, i) { color: #FFFFFF; }
html[data-theme="light"] :is(.bg-\[\#E1ED63\], .bg-\[\#e1ed63\]) :is(.text-white, h1, h2, h3, h4, p, span, a, li, i) { color: #2B2C2D; }

/* Liens fléchés « Découvrez notre blog » */
html[data-theme="light"] .bb-agence-content .bb-blog-link:not(:hover),
html[data-theme="light"] .bb-agence-content .bb-blog-link:not(:hover) .bb-blog-link-text { color: var(--bb-text); }

/* Hero marquee des projets sur fond clair */
html[data-theme="light"] .bb-projects-hero { background: var(--bb-bg); }


/* Chat BiBi sur fond clair (Contact) : bulles lisibles — sur la bannière photo sombre, style d'origine conservé */
html[data-theme="light"] .bb-bibi:not(.bb-keep-dark .bb-bibi, .fl-row-bg-photo .bb-bibi, .fl-row-bg-video .bb-bibi, .fl-row-bg-gradient .bb-bibi) {
  --bb-bubble: #F3F3F3;
  --bb-bubble-user: #E8E7E6;
  --bb-text: #1E1F20;
  --bb-muted: rgba(30, 31, 32, .55);
}

/* Filtres projets : logos des pôles à 100 % sur fond clair (sauf pôle indisponible) */
html[data-theme="light"] .bb-pfilter button.bb-plogo:not([aria-disabled="true"]) { opacity: 1; }

/* Logos clients en SVG inline (fills blancs) : même version inversée que les <img> */
html[data-theme="light"] :is(.client-grid, .slider-section, .bb-clients) svg:not(.bb-keep-dark svg) {
  filter: grayscale(1) invert(1) contrast(1.1);
  opacity: .82;
}

/* Chevron du sélecteur de langue en sombre sur le header blanc */
html[data-theme="light"] body .country-selector.weglot-dropdown .wgcurrent { color: var(--bb-text); }

/* Menu des langues : carte blanche */
html[data-theme="light"] body .country-selector.weglot-dropdown ul {
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 12px 32px rgba(30, 31, 32, .12), inset 0 0 0 1px rgba(30, 31, 32, .06);
}
html[data-theme="light"] body .country-selector.weglot-dropdown ul li a { color: #1E1F20 !important; }
html[data-theme="light"] body .country-selector.weglot-dropdown ul li a:hover,
html[data-theme="light"] body .country-selector.weglot-dropdown ul li a:focus-visible { background-color: #F3F3F3 !important; }

/* Accueil : cartes empilées (effet wallet) — ombre légère au bord haut pour détacher chaque carte blanche */
html[data-theme="light"] body.page-template-home #fl-main-content section:not(:first-of-type):not(#antracite),
html[data-theme="light"] body.page-template-home #fl-main-content section > .rounded-t-\[50px\] {
  box-shadow: 0 -14px 34px -10px rgba(30, 31, 32, .14), 0 -1px 0 rgba(30, 31, 32, .04);
}

/* Logos clients SVG servis en <img> : silhouette sombre (desktop) / version inversée (slider mobile) */
html[data-theme="light"] .client-grid img.bb-client-logo { filter: brightness(0) invert(.12); mix-blend-mode: normal; opacity: .82; }
html[data-theme="light"] .slider-section img.bb-client-logo { filter: grayscale(1) invert(1) contrast(1.1); opacity: .82; }
