/* ==========================================================================
   REVIVRE — thème : jetons de design, base, coque de l'application, éléments communs.
   Les valeurs se modifient dans Elementor > Réglages du site :
   - Couleurs globales / Polices globales (couleurs et familles de police)
   - onglet « REVIVRE » (structure, arrondis, ombres, échelle typographique)
   ========================================================================== */

/* --- Jetons (déclarés sur body pour lire les variables globales d'Elementor) --- */
body {
	--rv-nuit: var(--e-global-color-primary, #172B4D);
	--rv-action: var(--e-global-color-accent, #3563F5);
	--rv-txt: var(--e-global-color-text, #2A3444);
	--rv-sec: var(--e-global-color-secondary, #6B7280);
	--rv-fond: var(--e-global-color-rvfond, #F6F8FC);
	--rv-surf: var(--e-global-color-rvsurf, #FFFFFF);
	--rv-bord: var(--e-global-color-rvbord, #E4E9F2);
	--rv-pale: var(--e-global-color-rvpale, #EEF3FF);
	--rv-action-h: var(--e-global-color-rvactionh, #2A52D6);
	--rv-ok: var(--e-global-color-rvok, #21865B);
	--rv-okp: var(--e-global-color-rvokp, #E7F5EE);
	--rv-warn: var(--e-global-color-rvwarn, #B7791F);
	--rv-warnp: var(--e-global-color-rvwarnp, #FFF6E5);
	--rv-err: var(--e-global-color-rverr, #B93838);
	--rv-errp: var(--e-global-color-rverrp, #FBEAEA);
	--rv-hero1: var(--e-global-color-rvhero1, #172B4D);
	--rv-hero2: var(--e-global-color-rvhero2, #2B4BB0);

	--rv-font: var(--e-global-typography-text-font-family, "Inter"), system-ui, -apple-system, "Segoe UI", sans-serif;
	--rv-font-h: var(--e-global-typography-primary-font-family, "Inter"), system-ui, -apple-system, "Segoe UI", sans-serif;

	--rv-fs-cap: 13px;
	--rv-fs-sm: 14px;
	--rv-fs-ui: 15px;
	--rv-fs-body: 16px;
	--rv-fs-lead: clamp(16px, .25vw + 15px, 18px);
	--rv-fs-h3: clamp(16px, .2vw + 15px, 18px);
	--rv-fs-h2: clamp(19px, .4vw + 17px, 22px);
	--rv-fs-h1: clamp(26px, 1vw + 22px, 34px);
	--rv-fs-display: clamp(30px, 3vw + 17px, 48px);

	--rv-r: 14px;          /* cartes */
	--rv-r-btn: 12px;      /* boutons */
	--rv-r-field: 12px;    /* champs */
	--rv-r-ico: 12px;      /* pastilles d'icône */
	--rv-r-hero: 22px;     /* bandeaux */
	--rv-r-pill: 999px;    /* étiquettes, filtres */
	--rv-sh: 0 1px 2px rgba(23, 43, 77, .05), 0 4px 16px rgba(23, 43, 77, .05);
	--rv-t: 180ms;

	--rv-head-h: 64px;
	--rv-side-w: 248px;
	--rv-bn-h: 64px;
	--rv-max: 1240px;
	--rv-pad-x: 40px;
	--rv-pad-y: 32px;
	--rv-gap: 20px;
	--rv-foot-gap: 56px;
	--rv-admin-bar: 0px;
}
body.admin-bar { --rv-admin-bar: 32px; }
@media (max-width: 782px) { body.admin-bar { --rv-admin-bar: 46px; } }

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
body {
	margin: 0;
	font-family: var(--rv-font);
	font-size: var(--rv-fs-body);
	line-height: 1.55;
	color: var(--rv-txt);
	background: var(--rv-fond);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--rv-nuit); font-family: var(--rv-font-h); line-height: 1.3; }
h1 { font-size: var(--rv-fs-h1); line-height: 1.2; }
h2 { font-size: var(--rv-fs-h2); }
h3, h4 { font-size: var(--rv-fs-h3); line-height: 1.35; }
p, ul, ol, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--rv-action); outline-offset: 2px; border-radius: 8px; }
.rv-skip { position: absolute; left: -999px; top: 8px; z-index: 999; background: #fff; padding: 8px 12px; border-radius: 8px; }
.rv-skip:focus { left: 8px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* --- Coque de l'application --- */
.rv-top {
	position: fixed; left: 0; right: 0; top: var(--rv-admin-bar);
	height: var(--rv-head-h);
	background: var(--rv-surf);
	border-bottom: 1px solid var(--rv-bord);
	z-index: 30;
	display: flex; align-items: center;
}
.rv-top > * { flex: 1; min-width: 0; height: 100%; }
.rv-top .elementor, .rv-top .elementor > .e-con { height: 100%; }
.rv-side {
	position: fixed; left: 0; bottom: 0;
	top: calc(var(--rv-admin-bar) + var(--rv-head-h));
	width: var(--rv-side-w);
	background: var(--rv-surf);
	border-right: 1px solid var(--rv-bord);
	overflow-y: auto;
	z-index: 20;
}
.rv-main {
	margin: var(--rv-head-h) 0 0 max(var(--rv-side-w), calc(50vw - (var(--rv-max) - var(--rv-side-w)) / 2));
	padding: var(--rv-pad-y) var(--rv-pad-x);
	max-width: var(--rv-max);
	min-height: calc(100vh - var(--rv-head-h) - var(--rv-admin-bar));
	display: flex; flex-direction: column;
}
.rv-no-side .rv-main { margin-left: auto; margin-right: auto; width: 100%; }
.rv-content { flex: 1 0 auto; min-width: 0; }
.rv-foot { margin-top: var(--rv-foot-gap); flex-shrink: 0; }
.rv-bn { display: none; }

@media (max-width: 860px) {
	.rv-side { display: none; }
	.rv-main { margin: var(--rv-head-h) 0 0; padding: 20px 16px 24px; min-height: calc(100vh - var(--rv-head-h) - var(--rv-admin-bar)); }
	.rv-has-bn .rv-main { margin-bottom: var(--rv-bn-h); min-height: calc(100vh - var(--rv-head-h) - var(--rv-bn-h) - var(--rv-admin-bar)); }
	.rv-has-bn .rv-bn {
		display: flex; position: fixed; left: 0; right: 0; bottom: 0;
		height: var(--rv-bn-h);
		background: var(--rv-surf);
		border-top: 1px solid var(--rv-bord);
		z-index: 30;
	}
	.rv-bn > * { flex: 1; min-width: 0; }
	.rv-bn .elementor, .rv-bn .elementor > .e-con { height: 100%; }
}

/* Contenu Elementor dans la coque : pas de marges parasites */
.rv-main .elementor-section-wrap, .rv-main > .rv-content > .elementor { width: 100%; }

/* --- Éléments communs --- */
.rv-h1 { font-size: var(--rv-fs-h1); font-weight: 700; letter-spacing: -.01em; color: var(--rv-nuit); }
.rv-h3 { font-size: var(--rv-fs-h3); }
.rv-sub { color: var(--rv-sec); margin-top: 6px; font-size: var(--rv-fs-body); }
.rv-sm { font-size: var(--rv-fs-sm); color: var(--rv-sec); }
.rv-card { background: var(--rv-surf); border: 1px solid var(--rv-bord); border-radius: var(--rv-r); box-shadow: var(--rv-sh); }
.rv-pad { padding: 24px; }
.rv-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 20px;
	border-radius: var(--rv-r-btn); border: 1px solid transparent;
	font-weight: 600; font-size: var(--rv-fs-ui); line-height: 1.2;
	cursor: pointer; background: none; white-space: nowrap; text-decoration: none;
	transition: background var(--rv-t), border-color var(--rv-t), color var(--rv-t), opacity var(--rv-t);
}
.rv-btn--pri { background: var(--rv-action); color: #fff; }
.rv-btn--pri:hover { background: var(--rv-action-h); color: #fff; }
.rv-btn--sec { background: var(--rv-surf); color: var(--rv-nuit); border-color: var(--rv-bord); }
.rv-btn--sec:hover { border-color: var(--rv-action); }
.rv-btn--light { background: #fff; color: var(--rv-nuit); }
.rv-btn--ghost { border-color: rgba(255, 255, 255, .45); color: #fff; }
.rv-btn--ghost:hover { border-color: #fff; }
.rv-btn--s { min-height: 36px; padding: 0 14px; font-size: var(--rv-fs-sm); }
.rv-btn--block { width: 100%; }
.rv-btn[disabled], .rv-btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.rv-tag {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: var(--rv-fs-cap); font-weight: 500; line-height: 1.5;
	padding: 3px 10px; border-radius: var(--rv-r-pill);
	background: var(--rv-pale); color: var(--rv-action);
}
.rv-tag--ok { background: var(--rv-okp); color: var(--rv-ok); }
.rv-tag--light { background: rgba(255, 255, 255, .18); color: #fff; }
.rv-ico {
	width: 42px; height: 42px; border-radius: var(--rv-r-ico);
	display: inline-grid; place-items: center; flex: none;
	background: var(--rv-pale); color: var(--rv-action); font-size: 20px;
}
.rv-ico svg { width: 1em; height: 1em; fill: currentColor; }
.rv-lnk { color: var(--rv-action); font-weight: 600; font-size: var(--rv-fs-ui); display: inline-flex; align-items: center; gap: 4px; }
.rv-lnk:hover { text-decoration: underline; text-underline-offset: 3px; }
.rv-list { overflow: hidden; }
.rv-item {
	display: flex; gap: 14px; align-items: center; width: 100%; text-align: left;
	background: none; border: 0; border-top: 1px solid var(--rv-bord);
	padding: 14px 20px; cursor: pointer; transition: background var(--rv-t); color: inherit;
}
.rv-item:first-child { border-top: 0; }
.rv-item:hover, .rv-item.is-on { background: var(--rv-pale); }
.rv-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rv-item__body strong { color: var(--rv-nuit); }
.rv-item > .rvi:last-child { color: var(--rv-sec); }
.rv-empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--rv-sec); }
.rv-empty .rv-ico { width: 56px; height: 56px; font-size: 26px; }
.rv-note { background: var(--rv-warnp); border: 1px solid #F3D9A4; border-radius: 12px; padding: 14px 16px; font-size: var(--rv-fs-ui); }
.rv-note--ok { background: var(--rv-okp); border-color: #BFE3D0; }
.rv-note--err { background: var(--rv-errp); border-color: #EBC2C2; }

/* Contenu WordPress classique */
.rv-entry { font-size: var(--rv-fs-lead); line-height: 1.75; }
.rv-entry > * + * { margin-top: 14px; }
.rv-entry h2 { margin-top: 32px; }
.rv-entry a { color: var(--rv-action); text-decoration: underline; }
.rv-article .rv-h1 { margin-bottom: 20px; }

/* Secours sans extension */
.rv-fallback-bar { display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.rv-fallback-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--rv-nuit); }
.rv-fallback-logo__img { width: 34px; height: 34px; border-radius: 10px; }
.rv-fallback-menu, .rv-fallback-bn { list-style: none; margin: 0; padding: 16px 12px; }
.rv-fallback-menu a { display: flex; height: 44px; align-items: center; padding: 0 14px; border-radius: 12px; font-weight: 500; }
.rv-fallback-menu a:hover, .rv-fallback-menu .current-menu-item > a { background: var(--rv-pale); color: var(--rv-action); }
.rv-fallback-bn { display: flex; padding: 0; width: 100%; }
.rv-fallback-bn li { flex: 1; display: grid; place-items: center; font-size: var(--rv-fs-cap); }
.rv-fallback-foot { padding-top: 28px; border-top: 1px solid var(--rv-bord); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; font-size: var(--rv-fs-sm); color: var(--rv-sec); }
.rv-fallback-foot ul { list-style: none; padding: 0; display: flex; gap: 16px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
