/* ==========================================================================
   Agence Bethauv — Modèle d'article (thème enfant hello-elementor-child)
   Chargé uniquement sur les articles (is_singular('post')) depuis functions.php.
   Couleurs : on pointe vers les couleurs globales Elementor (kit 263),
   avec la valeur de la charte en repli.
   ========================================================================== */

.bv-article {
	--bv-primaire: var(--e-global-color-primary, #163172);
	--bv-texte: var(--e-global-color-text, #2F5972);
	--bv-accent: var(--e-global-color-accent, #0141DA);
	--bv-orange: var(--e-global-color-ab615f5, #DD7744);
	--bv-glacier: var(--e-global-color-c1glaci, #D5F5FF);
	--bv-gris: var(--e-global-color-8530541, #F1F1F2);
	--bv-bordure: var(--e-global-color-c3borde, #DFDFDF);
	--bv-blanc: #FFFFFF;

	--bv-lecture: 42rem;   /* colonne de lecture : ~70 caractères */
	--bv-large: 60rem;     /* image à la une, encadrés larges */
	--bv-rayon: 0.75rem;

	font-family: "Maven Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--bv-texte);
	/* Le fond général du site (body) est bleu marine : le modèle pose son propre fond blanc. */
	background: var(--bv-blanc);
	display: block;
	padding-bottom: 1px; /* évite que la marge des articles liés « sorte » du fond blanc */
	font-size: 1.125rem;
	line-height: 1.7;
}

.bv-article *,
.bv-article *::before,
.bv-article *::after { box-sizing: border-box; }

/* Neutralise les styles globaux du kit Elementor sur les éléments HTML
   (.elementor-kit-263 a / img / h1) à l'intérieur du modèle d'article. */
.bv-article a { font-size: inherit; font-weight: inherit; }
.bv-article img,
.bv-article img:hover { opacity: 1; }

/* ---------- En-tête ---------- */
.bv-article .bv-entete {
	background: linear-gradient(180deg, var(--bv-glacier) 0%, var(--bv-blanc) 100%);
	padding: 2.5rem 1rem 0;
}
.bv-article .bv-entete__inner {
	max-width: var(--bv-large);
	margin: 0 auto;
	text-align: center;
}
.bv-article .bv-ariane {
	font-size: 0.9375rem;
	margin: 0 0 1.5rem;
}
.bv-article .bv-ariane ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0.5rem; }
.bv-article .bv-ariane li + li::before { content: "›"; margin-right: 0.5rem; color: var(--bv-texte); }
.bv-article .bv-ariane a { color: var(--bv-accent); }
.bv-article .bv-ariane [aria-current] { color: var(--bv-texte); }

.bv-article .bv-categorie {
	display: inline-block;
	background: var(--bv-primaire);
	color: var(--bv-blanc);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 0.3rem 0.85rem;
	border-radius: 2rem;
	text-decoration: none;
	margin-bottom: 1rem;
}
.bv-article .bv-categorie:hover { background: var(--bv-accent); color: var(--bv-blanc); }

.bv-article .bv-titre {
	color: var(--bv-primaire);
	font-size: clamp(2rem, 1.35rem + 2.6vw, 2.875rem);
	line-height: 1.2;
	font-weight: 700;
	margin: 0 auto 1rem;
	max-width: 48rem;
	text-wrap: balance;
}
.bv-article .bv-chapo {
	font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
	line-height: 1.6;
	max-width: var(--bv-lecture);
	margin: 0 auto 1.25rem;
}
.bv-article .bv-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.25rem 1.25rem;
	font-size: 0.9375rem;
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}
.bv-article .bv-meta li { display: inline-flex; align-items: center; gap: 0.4rem; }
.bv-article .bv-meta svg { width: 1.1em; height: 1.1em; flex: none; }

.bv-article .bv-une {
	max-width: var(--bv-large);
	margin: 0 auto;
}
.bv-article .bv-une img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--bv-rayon);
	background: var(--bv-gris);
}

/* ---------- Corps ---------- */
.bv-article .bv-corps {
	max-width: calc(var(--bv-lecture) + 2rem);
	margin: 0 auto;
	padding: 2.5rem 1rem 1rem;
}
.bv-article .bv-corps > * { margin-top: 0; margin-bottom: 1.25em; }

.bv-article .bv-corps h2 {
	color: var(--bv-primaire);
	font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
	line-height: 1.3;
	font-weight: 700;
	margin: 2.5em 0 0.75em;
	padding-top: 0.6em;
	border-top: 3px solid var(--bv-glacier);
	position: relative;
	scroll-margin-top: 6rem;
}
.bv-article .bv-corps h2::before {
	content: "";
	position: absolute;
	top: -3px; left: 0;
	width: 3rem; height: 3px;
	background: var(--bv-orange);
}
.bv-article .bv-corps h3 {
	color: var(--bv-primaire);
	font-size: 1.25rem;
	line-height: 1.4;
	font-weight: 600;
	margin: 1.75em 0 0.5em;
}
.bv-article .bv-corps h2 + h3 { margin-top: 0.75em; }

.bv-article .bv-corps p { margin: 0 0 1.25em; }
.bv-article .bv-corps strong { color: var(--bv-primaire); font-weight: 700; }

.bv-article .bv-corps a {
	color: var(--bv-accent);
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}
.bv-article .bv-corps a:hover { text-decoration-thickness: 2px; }

.bv-article .bv-corps ul,
.bv-article .bv-corps ol { padding-left: 1.5rem; margin: 0 0 1.5em; }
.bv-article .bv-corps li { margin-bottom: 0.5em; padding-left: 0.25rem; }
.bv-article .bv-corps ul li::marker { color: var(--bv-orange); font-size: 1.1em; }
.bv-article .bv-corps ol li::marker { color: var(--bv-primaire); font-weight: 700; }

.bv-article .bv-corps figure { margin: 2rem 0; }
.bv-article .bv-corps figure img { display: block; max-width: 100%; height: auto; border-radius: var(--bv-rayon); }
.bv-article .bv-corps figcaption { font-size: 0.9375rem; margin-top: 0.5rem; text-align: center; }

/* Citation */
.bv-article .bv-corps blockquote {
	margin: 2rem 0;
	padding: 0.5rem 0 0.5rem 1.5rem;
	border-left: 4px solid var(--bv-accent);
	font-size: 1.25rem;
	font-style: italic;
	color: var(--bv-primaire);
}
.bv-article .bv-corps blockquote p:last-child { margin-bottom: 0; }
.bv-article .bv-corps blockquote cite { display: block; font-size: 0.9375rem; font-style: normal; margin-top: 0.5rem; color: var(--bv-texte); }

/* Encadré (style de bloc « Encadré » sur Paragraphe ou Groupe) */
.bv-article .bv-corps .is-style-encadre {
	background: var(--bv-glacier);
	border-left: 4px solid var(--bv-accent);
	border-radius: 0 var(--bv-rayon) var(--bv-rayon) 0;
	padding: 1.25rem 1.5rem;
	margin: 2rem 0;
}
.bv-article .bv-corps .is-style-encadre > :last-child { margin-bottom: 0; }

/* Chiffres clés (Groupe avec la classe « chiffres-cles ») */
.bv-article .bv-corps :is(.chiffres-cles, .is-style-chiffres-cles) {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 2rem 0;
}
.bv-article .bv-corps :is(.chiffres-cles, .is-style-chiffres-cles) > p {
	flex: 1 1 10rem;
	margin: 0;
	background: var(--bv-primaire);
	color: var(--bv-blanc);
	border-radius: var(--bv-rayon);
	padding: 1.25rem 1rem;
	text-align: center;
	font-size: 1rem;
	line-height: 1.4;
}
.bv-article .bv-corps :is(.chiffres-cles, .is-style-chiffres-cles) > p strong {
	display: block;
	color: var(--bv-blanc);
	font-size: 2rem;
	line-height: 1.15;
	margin-bottom: 0.35rem;
}

/* Accordéon natif (bloc Détails) */
.bv-article .bv-corps details {
	border: 1px solid var(--bv-bordure);
	border-radius: var(--bv-rayon);
	margin: 0 0 0.75rem;
	background: var(--bv-blanc);
}
.bv-article .bv-corps details > summary {
	cursor: pointer;
	padding: 1rem 1.25rem;
	font-weight: 600;
	color: var(--bv-primaire);
	list-style-position: inside;
}
.bv-article .bv-corps details > summary::marker { color: var(--bv-accent); }
.bv-article .bv-corps details[open] > summary { border-bottom: 1px solid var(--bv-bordure); }
.bv-article .bv-corps details > :not(summary) { padding: 0 1.25rem; }
.bv-article .bv-corps details > :nth-child(2) { margin-top: 1rem; }

/* Tableaux */
.bv-article .bv-corps table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.bv-article .bv-corps th, .bv-corps td { border: 1px solid var(--bv-bordure); padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; }
.bv-article .bv-corps th { background: var(--bv-gris); color: var(--bv-primaire); }

/* Boutons (bloc Boutons) */
.bv-article .bv-corps .wp-block-button__link {
	display: inline-block;
	background: var(--bv-accent);
	color: var(--bv-blanc);
	text-decoration: none;
	font-weight: 600;
	padding: 0.8rem 1.5rem;
	border-radius: 2rem;
}
.bv-article .bv-corps .wp-block-button__link:hover { background: var(--bv-primaire); }

/* Sommaire (généré automatiquement si l'article a au moins 3 intertitres) */
.bv-article .bv-corps .bv-sommaire {
	border: 0;
	background: var(--bv-gris);
	border-radius: var(--bv-rayon);
	padding: 0 1.25rem;
	margin: 0 0 2.5rem;
}
.bv-article .bv-corps .bv-sommaire[open] > summary,
.bv-article .bv-corps .bv-sommaire > summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--bv-primaire);
	padding: 1rem 0;
	border: 0;
}
.bv-article .bv-corps .bv-sommaire > ol { margin: 0 0 1.25rem; padding: 0 0 0 1.25rem; font-size: 1rem; }
.bv-article .bv-sommaire li { margin-bottom: 0.35rem; }
.bv-article .bv-sommaire a { color: var(--bv-texte); text-decoration: none; }
.bv-article .bv-sommaire a:hover { color: var(--bv-accent); text-decoration: underline; }

/* ---------- Fin d'article ---------- */
.bv-article .bv-cta {
	max-width: var(--bv-large);
	margin: 3rem auto;
	padding: 2.5rem 1.5rem;
	background: var(--bv-primaire);
	color: var(--bv-blanc);
	border-radius: var(--bv-rayon);
	text-align: center;
}
.bv-article .bv-cta h2 {
	color: var(--bv-blanc);
	font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
	line-height: 1.3;
	margin: 0 0 0.75rem;
	border: 0;
	padding: 0;
}
.bv-article .bv-cta h2::before { display: none; }
.bv-article .bv-cta p { margin: 0 auto 1.5rem; max-width: 36rem; }
.bv-article .bv-cta a {
	display: inline-block;
	background: var(--bv-blanc);
	color: var(--bv-primaire);
	font-weight: 700;
	text-decoration: none;
	padding: 0.85rem 1.75rem;
	border-radius: 2rem;
}
.bv-article .bv-cta a:hover { background: var(--bv-glacier); }

.bv-article .bv-lies {
	max-width: var(--bv-large);
	margin: 0 auto 4rem;
	padding: 0 1rem;
}
.bv-article .bv-lies > h2 {
	color: var(--bv-primaire);
	font-size: 1.5rem;
	margin: 0 0 1.25rem;
}
.bv-article .bv-lies ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 1.5rem;
}
.bv-article .bv-carte {
	position: relative;
	background: var(--bv-blanc);
	border: 1px solid var(--bv-bordure);
	border-radius: var(--bv-rayon);
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.bv-article .bv-carte img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bv-gris); }
.bv-article .bv-carte__texte { padding: 1rem 1.25rem 1.25rem; }
.bv-article .bv-carte h3 { font-size: 1.125rem; line-height: 1.4; margin: 0 0 0.5rem; }
.bv-article .bv-carte h3 a { color: var(--bv-primaire); text-decoration: none; }
.bv-article .bv-carte h3 a::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.bv-article .bv-carte:hover { border-color: var(--bv-accent); }
.bv-article .bv-carte:hover h3 a { text-decoration: underline; }
.bv-article .bv-carte time { font-size: 0.9375rem; }

/* ---------- Accessibilité ---------- */
.bv-article a:focus-visible,
.bv-article summary:focus-visible {
	outline: 3px solid var(--bv-orange);
	outline-offset: 3px;
	border-radius: 2px;
}

@media (prefers-reduced-motion: no-preference) {
	html:has(.bv-article) { scroll-behavior: smooth; }
}

@media (max-width: 40rem) {
	.bv-entete { padding-top: 1.5rem; }
	.bv-corps { padding-top: 1.75rem; }
	.bv-cta { border-radius: 0; }
}

/* Sources en fin d'article : texte plus petit que le corps (18 px) */
.bv-article .bv-corps .bv-sources {
  margin-top: 2.5em;
  font-size: max(0.875rem, 14px); /* jamais moins de 14 px, y compris sur mobile */
  line-height: 1.5;
}

.bv-article .bv-corps .bv-sources p,
.bv-article .bv-corps .bv-sources ul,
.bv-article .bv-corps .bv-sources li {
  font-size: inherit;
  line-height: inherit;
  margin-bottom: 0.4em;
}

.bv-article .bv-corps .bv-sources p:first-child {
  font-weight: 600;
}

/* Les URL longues passent à la ligne au lieu de déborder sur mobile */
.bv-article .bv-corps .bv-sources a {
  overflow-wrap: break-word;
}