/* =============================================================================
   MAIN CSS — chargé en asynchrone. Tout ce qui n'est pas au premier écran.
   ⚠️ Aucun hex : tokens uniquement (tools/check-hex.sh).
   ============================================================================= */

/* --- Contenu éditorial (pages hors Elementor, articles) --------------------- */
.entry__title { margin-bottom: var(--sp-8); }
.entry__meta { margin-top: calc(var(--sp-6) * -1); margin-bottom: var(--sp-8); color: var(--fg-soft); font-size: var(--fs-sm); }
.entry__media { margin-bottom: var(--sp-8); }
.entry__media img { border-radius: var(--r-md); }

.editorial { max-width: 46rem; }
.editorial > * + * { margin-top: var(--sp-4); }
.editorial h2, .editorial h3 { margin-top: var(--sp-12); }
.editorial h2 { font-size: var(--fs-h3); font-weight: var(--fw-medium); }
.editorial ul, .editorial ol { padding-left: 1.25em; }
.editorial li + li { margin-top: var(--sp-2); }
.editorial ul li::marker { color: var(--accent-text); }
.editorial a { color: inherit; text-decoration-color: var(--brand); text-decoration-thickness: 2px; }
.editorial blockquote { padding-left: var(--sp-6); border-left: 3px solid var(--brand); font-size: var(--fs-lead); }
.editorial img { border-radius: var(--r-md); }
.editorial table { width: 100%; border-collapse: collapse; }
.editorial th, .editorial td { padding: var(--sp-3); border-bottom: 1px solid var(--line); text-align: left; }

/* --- Listes d'articles / résultats ---------------------------------------- */
.post-list { display: grid; gap: 0; margin-top: var(--sp-8); padding: 0; list-style: none; border-top: 1px solid var(--line); }
.post-list__item { padding-block: var(--sp-6); border-bottom: 1px solid var(--line); }
.post-list__title { margin-bottom: var(--sp-2); font-size: var(--fs-lead); }
.post-list__title a { text-decoration: none; }
.post-list__title a:hover { color: var(--accent-text); }

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-8); }
.pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding-inline: var(--sp-3);
	border-radius: var(--r-sm);
	text-decoration: none;
}
.pagination .page-numbers.current { background-color: var(--btn-bg); color: var(--btn-fg); }

/* --- Recherche & 404 ------------------------------------------------------ */
.search-form { display: flex; flex-wrap: wrap; gap: var(--sp-3); max-width: 40rem; margin-block: var(--sp-8); }
.search-form input[type='search'] {
	flex: 1 1 14rem;
	min-height: 3rem;
	padding: 0 var(--sp-4);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	background: var(--bg);
}
.search-results__count { margin-top: var(--sp-2); color: var(--fg-soft); }
.error-404 { text-align: left; }
.error-404__code { font-size: var(--fs-hero); font-weight: var(--fw-medium); line-height: 1; color: var(--accent-text); }
.error-404__text { max-width: 40rem; margin-top: var(--sp-4); }

/* --- Apparition au défilement : voir critical.css, section « MOUVEMENT ». */

/* --- Elementor : quelques remises à plat ----------------------------------- */
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }
.js-reveal .reveal--side { transform: translateX(-1rem); }

/* =============================================================================
   CONTENEURS ELEMENTOR — classes posées par le bouton « Créer la page
   d'accueil » (et utilisables à la main : Avancé → Classes CSS).
   ⚠️ Par VARIABLES --padding-* : c'est ainsi qu'Elementor applique la marge
   des conteneurs ; écrire `padding` directement serait écrasé par sa feuille.
   ============================================================================= */
.e-con.section {
	--padding-top: clamp(3rem, 7vw, 6rem);
	--padding-bottom: clamp(3rem, 7vw, 6rem);
	--padding-left: var(--gutter);
	--padding-right: var(--gutter);
}
/* Fond photo d'une section sombre (« Vos besoins d'innovation ») : l'image se
   règle dans Elementor (Style → Arrière-plan), le voile garde le texte lisible. */
.bq-fond-photo { position: relative; isolation: isolate; background-size: cover; background-position: center; }
/* Parallaxe (0.7.11) : la photo reste fixe pendant que la section défile,
   le panneau de verre liquide glisse par-dessus. Grand écran à la souris
   uniquement (iOS ignore « fixed » et le mouvement réduit est respecté). */
@media (min-width: 64em) and (hover: hover) and (prefers-reduced-motion: no-preference) {
	.elementor .e-con.bq-fond-photo { background-attachment: fixed; }
}
.bq-fond-photo::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background-color: color-mix(in srgb, var(--dark) 55%, transparent);
}
/* Liste « Vos besoins d'innovation » en grand (maquette : 22 px, filets
   blancs, premier énoncé aligné sur le haut de la photo). */
.bq-liste-grand .bq-liste { font-size: clamp(1rem, .8rem + .55vw, 1.25rem); font-weight: var(--fw-medium); line-height: 1.2; letter-spacing: -.005em; }
.bq-liste-grand .bq-liste--filets .bq-liste__item { padding-block: clamp(1rem, 1.9vw, 1.75rem); border-bottom-color: color-mix(in srgb, var(--paper) 55%, transparent); }
.bq-liste-grand .bq-liste--filets .bq-liste__item:first-child { padding-top: 0; }

/* Panneau vitré (maquette 0.7.6 : coins 20 px, fond blanc 10 % flouté). */
.e-con.bq-glass {
	--padding-top: clamp(1.5rem, 4vw, 3.5rem);
	--padding-bottom: clamp(1.5rem, 4vw, 3.5rem);
	--padding-left: clamp(1.25rem, 4vw, 3.5rem);
	--padding-right: clamp(1.25rem, 4vw, 3.5rem);
	border: 1px solid var(--line);
	border-radius: 1.25rem;
	background-color: color-mix(in srgb, var(--paper) 10%, transparent);
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);
}
/* Photos de contenu : coins 10 px de la charte.
   ⚠️ `.elementor` en tête : la feuille d'Elementor remet `border-radius: 0`
   sur `.elementor img`, à spécificité égale et chargée après nous. */
.elementor .bq-photo img,
.elementor .bq-photo a { display: block; width: 100%; border-radius: var(--r-md); object-fit: cover; }
/* Le cadre arrondi est porté par le CONTENEUR, pas seulement par l'image :
   l'effet « respiration » au défilement agrandit l'image (scale), qui
   déborde alors de son conteneur — sans ce rognage, les coins redevenaient
   carrés tant que l'animation n'était pas terminée. */
.elementor .bq-photo,
.elementor .bq-photo .elementor-widget-container { border-radius: 1.25rem; overflow: clip; }
.elementor .bq-photo img { border-radius: 1.25rem; }
.bq-photo-large > .elementor-widget { width: min(100%, 36rem); }
/* Liste « Pourquoi » : colonne étroite centrée, comme la maquette (750 px). */
.bq-etroit { width: min(100%, 47rem); margin-inline: auto; }

/* --- VERRE LIQUIDE (0.7.9) — reflets, liseré lumineux, réfraction ---------- */
.e-con.bq-glass {
	border-color: color-mix(in srgb, var(--paper) 28%, transparent);
	background-color: color-mix(in srgb, var(--paper) 8%, transparent);
	-webkit-backdrop-filter: blur(10px) saturate(125%);
	backdrop-filter: blur(10px) saturate(125%);
	box-shadow:
		inset 0 1px 0 color-mix(in srgb, var(--paper) 45%, transparent),
		inset 1px 0 0 color-mix(in srgb, var(--paper) 22%, transparent),
		inset 0 -1px 0 color-mix(in srgb, var(--paper) 10%, transparent),
		inset 0 0 40px color-mix(in srgb, var(--paper) 7%, transparent),
		0 30px 60px -30px color-mix(in srgb, var(--ink) 55%, transparent);
	overflow: hidden;
}
/* Reflet spéculaire : une lueur oblique qui accroche le haut à gauche. */
.e-con.bq-glass::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	border-radius: inherit;
	pointer-events: none;
	background:
		radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--paper) 16%, transparent), transparent 55%),
		linear-gradient(135deg, color-mix(in srgb, var(--paper) 10%, transparent) 0%, transparent 35%, transparent 70%, color-mix(in srgb, var(--paper) 6%, transparent) 100%);
}
.e-con.bq-glass > * { position: relative; z-index: 1; }
/* Chromium : vraie réfraction sur les bords (filtre SVG #bq-liquid, footer.php). */
.has-liquid .e-con.bq-glass {
	-webkit-backdrop-filter: url(#bq-liquid) blur(3px) saturate(125%);
	backdrop-filter: url(#bq-liquid) blur(3px) saturate(125%);
}

/* Titre bicolore INVERSÉ (classe Elementor « bq-titre-inverse ») : première
   ligne verte, seconde anthracite — « Une plateforme intégrée » (maquette). */
.bq-titre-inverse .bq-titre { color: var(--accent-text); }
.bq-titre-inverse .bq-titre__accent { color: var(--fg); }

/* --- LARGEUR MAX DE PAGE (0.7.15) -------------------------------------------
   La maquette est dessinée sur 1440 px. Au-delà, les blocs « cadrés » (hero,
   en-tête, encart vert, pied de page, bande de ronds) ne s'étirent plus sur
   tout l'écran : ils plafonnent à 1440 px (1394 px visibles, comme la
   maquette) et se centrent. Les fonds de section restent pleine largeur. */
:root { --page-max: 90rem; }
/* 0.7.16 : le hero (plein écran) et l'en-tête posé dessus restent en
   pleine largeur — seule la photo gagne en impact, pas le contenu. */
body .bq-encart {
	width: min(100% - 2 * var(--frame), var(--page-max) - 2 * var(--frame));
	margin-inline: auto;
}
body:not(.has-overlay-header) .site-header:not(.is-scrolled) {
	width: min(100% - 2 * var(--frame), var(--page-max) - 2 * var(--frame));
	margin-inline: auto;
}
/* Bande de ronds (0.7.19) : PLEINE LARGEUR, longs fondus sur les deux bords
   (les ronds apparaissent/disparaissent dans l'anthracite au lieu d'être
   coupés net), glisser-déposer à la souris ou au doigt (main.js §7). La
   bande du bas (bouton pause) n'est pas fondue. */
body .bq-chiffres-bloc--defile {
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fondu), #000 calc(100% - var(--fondu)), transparent 100%), linear-gradient(#000, #000);
	mask-image: linear-gradient(90deg, transparent 0, #000 var(--fondu), #000 calc(100% - var(--fondu)), transparent 100%), linear-gradient(#000, #000);
	-webkit-mask-size: 100% calc(100% - 3.25rem), 100% 3.25rem;
	mask-size: 100% calc(100% - 3.25rem), 100% 3.25rem;
	-webkit-mask-position: 0 0, 0 100%;
	mask-position: 0 0, 0 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	--fondu: clamp(3rem, 14vw, 22rem);
}
body .bq-chiffres-bloc { --rond: clamp(12.5rem, 25vw, 24rem); }
/* Glisser : curseur main, pas de sélection ni de « fantôme » d'image. */
.bq-marquee.is-js { cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.bq-marquee.is-js.is-dragging { cursor: grabbing; }
.bq-marquee.is-js img { -webkit-user-drag: none; pointer-events: none; }
.bq-marquee.is-js .bq-marquee__track { animation: none !important; will-change: transform; }
/* Légendes : retours à la ligne de la maquette, sans écrasement. */
.bq-chiffres__legende { max-width: 88%; }

/* --- RAYONS HARMONISÉS (0.7.17) ---------------------------------------------
   Un seul rayon pour tous les blocs : --r-md = 20 px (hero, en-tête, encart,
   pied de page, cartes, panneau vitré, photos). Les visuels posés DANS un
   bloc arrondi prennent un rayon intérieur plus petit (--r-in = 12 px) pour
   suivre la courbe. Boutons et pastilles gardent --r-sm (5 px). */
.e-con.bq-glass { border-radius: var(--r-md); }
.elementor .bq-photo,
.elementor .bq-photo .elementor-widget-container,
.elementor .bq-photo img { border-radius: var(--r-md); }
body .bq-carte .bq-carte__media,
body .bq-encart .bq-encart__media { border-radius: var(--r-in); }

/* 0.7.22 — Bande de ronds : bouton pause masqué (réapparaît au focus clavier,
   WCAG 2.2.2), plus d'espace réservé dessous, fondu sur toute la hauteur. */
body .bq-chiffres-bloc--defile {
	padding-bottom: 0;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fondu), #000 calc(100% - var(--fondu)), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 var(--fondu), #000 calc(100% - var(--fondu)), transparent 100%);
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
}
body .bq-chiffres-bloc--defile .bq-marquee__pause:not(:focus-visible) {
	position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
body .bq-chiffres-bloc--defile .bq-marquee__pause:focus-visible { -webkit-mask: none; bottom: .5rem; }

/* 0.7.23 — Pied de page : fond PLEINE LARGEUR (même cadre que le hero : petit
   retrait et coins arrondis), contenu centré à 1260 px max. Le hero ouvre la
   page, le pied la ferme : deux « serre-livres » identiques. */
body .site-footer { width: auto; margin-inline: var(--frame); }
body .site-footer > * { max-width: 78.75rem; margin-inline: auto; }

/* --- 0.7.25 : ESPACEMENTS VERTICAUX — correction d'un DOUBLE padding --------
   Sur les sections « boîte » d'Elementor, la classe .section posait 96 px sur
   le conteneur ET Elementor 96 px sur son .e-con-inner : 192 px entre chaque
   section au lieu des ~100 px de la maquette. Le padding vertical n'est plus
   porté que par l'intérieur (réglable section par section dans Elementor). */
.e-con.section:has(> .e-con-inner) { padding-block: 0; }

/* =============================================================================
   0.7.26 — FLUIDITÉ + ANIMATIONS « DERNIÈRE LIGNE DROITE »
   Règle d'or : on n'anime QUE transform et opacity, pilotés par le défilement
   (animation-timeline) → calculé par la carte graphique, hors du fil
   principal : aucune saccade, même pendant un défilement rapide.
   Navigateurs sans animations liées au scroll (Firefox) : page statique,
   propre. Mouvement réduit : rien ne bouge.
   ========================================================================== */

/* 1. « Vos besoins » : la parallaxe ne repose plus sur background-attachment:
      fixed (qui redessinait TOUTE la section à chaque image de défilement,
      sous un panneau de verre flouté = saccades). La photo devient un calque
      qui glisse via transform. */
@media (min-width: 64em) and (hover: hover) and (prefers-reduced-motion: no-preference) {
	.elementor .e-con.bq-fond-photo { background-attachment: scroll; }
}
@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.elementor .e-con.bq-fond-photo { overflow: clip; }
		.elementor .e-con.bq-fond-photo::after {
			content: '';
			position: absolute;
			inset: -14% 0;
			z-index: -2;
			background-image: inherit;
			background-size: cover;
			background-position: center;
			pointer-events: none;
			will-change: transform;
			animation: bq-fond-parallaxe linear both;
			animation-timeline: view();
			animation-range: cover 0% cover 100%;
		}
		@keyframes bq-fond-parallaxe { from { transform: translate3d(0, -10%, 0); } to { transform: translate3d(0, 10%, 0); } }

		/* 2. Hero : en descendant, titres et textes s'éloignent plus vite que la
		      page et s'effacent (profondeur). */
		.bq-hero__titles,
		.bq-hero__foot {
			animation: bq-hero-sortie linear both;
			animation-timeline: scroll(root);
			animation-range: 0 85vh;
		}
		.bq-hero__foot { animation-name: bq-hero-sortie-bas; }
		@keyframes bq-hero-sortie     { to { transform: translate3d(0, -14vh, 0); opacity: 0; } }
		@keyframes bq-hero-sortie-bas { to { transform: translate3d(0, -6vh, 0); opacity: 0; } }

		/* 3. Photos en parallaxe croisée (classes Elementor bq-px-haut /
		      bq-px-bas) : deux photos voisines glissent en sens opposés. */
		.elementor .bq-px-haut,
		.elementor .bq-px-bas { animation: bq-px-haut linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
		.elementor .bq-px-bas { animation-name: bq-px-bas; }
		@keyframes bq-px-haut { from { transform: translate3d(0, 2.5rem, 0); } to { transform: translate3d(0, -2.5rem, 0); } }
		@keyframes bq-px-bas  { from { transform: translate3d(0, -2rem, 0); } to { transform: translate3d(0, 2rem, 0); } }

		/* 4-6 (encart, pied, panneau) : remplacés en 0.7.33 par les apparitions
		   de reveal.js (déclenchées une fois, au temps, et non liées au scroll). */
	}
}

/* 7. Boutons « magnétiques » (main.js §8) : ils suivent légèrement la souris.
      Propriété translate séparée : n'interfère pas avec l'effet au clic. */
.btn { transition: transform .2s var(--ease), box-shadow .2s var(--ease), translate .45s cubic-bezier(.22, 1, .36, 1), background-color .3s ease, color .3s ease; }
.btn.is-aimant { transition-duration: .2s, .2s, .12s, .3s, .3s; }


/* =============================================================================
   0.7.27 — PAGES SECONDAIRES : même en-tête que l'accueil.
   Plus de bandeau anthracite : logo à gauche, pilule de navigation centrée,
   loupe + Contact à droite. Le fond étant clair, le logo passe en anthracite,
   la pilule devient pleine et la loupe blanche reçoit un fin contour.
   La barre figée au défilement (.is-scrolled) reste celle de l'accueil.
   ========================================================================== */
body:not(.has-overlay-header) .site-header:not(.is-scrolled) {
	width: auto;
	max-width: none;
	margin: var(--frame) var(--frame) 0;
	background-color: transparent;
	box-shadow: none;
}
body:not(.has-overlay-header) .site-header:not(.is-scrolled) .site-header__logo { color: var(--dark); }
body:not(.has-overlay-header) .site-header:not(.is-scrolled) .site-nav__list { background-color: var(--dark); }
body:not(.has-overlay-header) .site-header:not(.is-scrolled) .site-header__search { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dark) 18%, transparent); }
body:not(.has-overlay-header) .site-header:not(.is-scrolled) .site-header__burger { background-color: var(--dark); color: #fff; }


/* =============================================================================
   0.7.29 — RESPONSIVE (passe finale)
   ========================================================================== */
/* « Pourquoi BioAqtiv ? » sous 64em : titre AU-DESSUS des cartes, cartes en
   pleine largeur (côte à côte, les cartes étaient trop étroites en tablette). */
@media (max-width: 63.99em) {
	:is(.e-con, .e-con-inner):has(> .bq-sticky-col) { --flex-direction: column; flex-direction: column !important; align-items: stretch !important; }
	:is(.e-con, .e-con-inner):has(> .bq-sticky-col) > .e-con { --width: 100%; width: 100% !important; max-width: 100% !important; }
	.bq-sticky-col { position: static; }
}

/* Badge Carnot : sa marge négative (débord voulu sur grand écran) le faisait
   sortir de la page entre 1100 et 1400 px → défilement horizontal. */
@media (max-width: 90em) {
	.e-con:has(> .elementor-widget-bioaqtiv-badge) { margin-right: 0 !important; }
}
/* Filet de sécurité : jamais de défilement horizontal (clip ne casse pas les
   éléments « sticky », contrairement à overflow: hidden). */
html, body { overflow-x: clip; }
