/* CFPC — Accueil plein écran
   L'image occupe tout l'écran ; l'en-tête du site est posé dessus, transparent.
   Dès que l'on descend (classe cfpc-ape-haut retirée), l'en-tête retrouve ses couleurs. */

:root {
	--cfpc-ape-marine: #182649;
	--cfpc-ape-magenta: #C8006D;
	--cfpc-ape-barre: var(--wp-admin--admin-bar--height, 0px);
}

/* ---------- Bandeau plein écran ---------- */

.cfpc-ape {
	position: relative;
	z-index: 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: calc(var(--cfpc-ape-hauteur, 100) * 1vh - var(--cfpc-ape-barre));
	min-height: calc(var(--cfpc-ape-hauteur, 100) * 1svh - var(--cfpc-ape-barre));
	margin: calc(-1 * var(--cfpc-ape-h, 0px)) 0 0;
	padding: calc(var(--cfpc-ape-h, 0px) + 2rem) clamp(1.25rem, 5vw, 4rem) 5.5rem;
	overflow: hidden;
	color: #fff;
	background: var(--cfpc-ape-marine);
	isolation: isolate;
}

.cfpc-ape__fond {
	position: absolute;
	inset: 0;
	z-index: -1;
}
.cfpc-ape__fond img,
.cfpc-ape__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
/* Voile : plus soutenu en haut (menu) et en bas à gauche (texte). */
.cfpc-ape__fond::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(24, 38, 73, .75) 0, rgba(24, 38, 73, 0) 11rem),
		linear-gradient(90deg, rgba(24, 38, 73, calc(var(--cfpc-ape-voile, .45) + .15)) 0, rgba(24, 38, 73, var(--cfpc-ape-voile, .45)) 55%, rgba(24, 38, 73, calc(var(--cfpc-ape-voile, .45) - .15)) 100%);
}

.cfpc-ape__contenu {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
}
.cfpc-ape__titre {
	max-width: 16ch;
	margin: 0 0 1rem;
	font-family: inherit;
	font-size: clamp(2.3rem, 6vw, 4.6rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -.01em;
	color: #fff;
	text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.cfpc-ape__sous-titre {
	max-width: 42rem;
	margin: 0 0 2rem;
	font-size: clamp(1.05rem, 1.8vw, 1.3rem);
	line-height: 1.5;
	color: #fff;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
}
.cfpc-ape__boutons {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1rem;
	margin: 0;
}
.cfpc-ape .cfpc-ape__bouton {
	display: inline-block;
	padding: .85em 1.6em;
	border: 2px solid transparent;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .2s, color .2s, border-color .2s;
}
.cfpc-ape .cfpc-ape__bouton--plein { background: var(--cfpc-ape-magenta); color: #fff; }
.cfpc-ape .cfpc-ape__bouton--plein:hover,
.cfpc-ape .cfpc-ape__bouton--plein:focus-visible { background: #fff; color: var(--cfpc-ape-magenta); }
.cfpc-ape .cfpc-ape__bouton--contour { border-color: #fff; color: #fff; background: rgba(24, 38, 73, .25); }
.cfpc-ape .cfpc-ape__bouton--contour:hover,
.cfpc-ape .cfpc-ape__bouton--contour:focus-visible { background: #fff; color: var(--cfpc-ape-marine); }
.cfpc-ape a:focus-visible { outline: 3px solid #FFFF00; outline-offset: 3px; }

.cfpc-ape__fleche {
	position: absolute;
	left: 50%;
	bottom: 1.25rem;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	margin-left: -1.5rem;
	border-radius: 50%;
	color: #fff;
	background: rgba(24, 38, 73, .35);
	animation: cfpc-ape-rebond 2.4s ease-in-out infinite;
}
.cfpc-ape__fleche:hover { background: rgba(24, 38, 73, .6); color: #fff; }
@keyframes cfpc-ape-rebond {
	0%, 60%, 100% { transform: translateY(0); }
	30% { transform: translateY(6px); }
}
.cfpc-ape .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.cfpc-ape-suite { scroll-margin-top: var(--cfpc-ape-h, 0px); outline: 0; }

/* Pages intérieures : bandeau moins haut, titre un peu plus petit, contenu en bas de l'image */
.cfpc-ape--page { justify-content: flex-end; padding-bottom: clamp(2rem, 6vh, 4rem); min-height: max(22rem, calc(var(--cfpc-ape-hauteur, 70) * 1svh - var(--cfpc-ape-barre))); }
.cfpc-ape--page .cfpc-ape__titre { max-width: 22ch; font-size: clamp(2rem, 4.6vw, 3.6rem); }

/* Fil d'Ariane posé sur l'image */
.cfpc-ape__fil { margin: 0 0 .9rem; font-size: .9rem; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.cfpc-ape__fil *, .cfpc-ape__fil a { color: #fff !important; background: none !important; border: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }
.cfpc-ape__fil a { text-decoration: underline; text-underline-offset: 3px; }
.cfpc-ape__fil .cfpc-fil { font-size: 13px; color: #fff; }
.cfpc-ape__fil li + li::before { color: #fff !important; opacity: .8; }
.cfpc-ape__fil ol, .cfpc-ape__fil ul { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }

/* Image d'origine retirée plus bas dans la page */
.cfpc-ape-masque { display: none !important; }

/* ---------- L'en-tête, posé sur l'image ---------- */

body.cfpc-ape-accueil :is(.elementor-location-header, header.site-header, #masthead) {
	position: relative;
	z-index: 1000;
}
/* En-tête sans « sticky » Elementor : on le garde quand même en haut de l'écran. */
body.cfpc-ape-accueil.cfpc-ape-collant :is(.elementor-location-header, header.site-header, #masthead) {
	position: sticky;
	top: var(--cfpc-ape-barre);
}

/* Transitions douces au passage d'un état à l'autre */
body.cfpc-ape-accueil :is(.elementor-location-header, header.site-header, #masthead),
body.cfpc-ape-accueil :is(.elementor-location-header, header.site-header, #masthead) :is(.elementor-section, .elementor-column, .elementor-widget-wrap, .e-con, .e-con-inner, a, .elementor-icon, .elementor-menu-toggle, svg, img) {
	transition: background-color .35s ease, color .35s ease, fill .35s ease, filter .35s ease, box-shadow .35s ease, border-color .35s ease;
}

/* Fonds transparents tant que l'on est en haut de la page */
body.cfpc-ape-haut :is(.elementor-location-header, header.site-header, #masthead),
body.cfpc-ape-haut :is(.elementor-location-header, header.site-header, #masthead) :is(.elementor-section, .elementor-container, .elementor-column, .elementor-column-wrap, .elementor-widget-wrap, .e-con, .e-con-inner, .elementor-sticky--active, .elementor-widget-nav-menu .elementor-widget-container, nav.elementor-nav-menu--main, .site-header__inner, .header-inner) {
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	border-color: rgba(255, 255, 255, .25) !important;
}
body.cfpc-ape-haut :is(.elementor-location-header, header.site-header, #masthead) :is(.elementor-background-overlay, .elementor-section::before, .e-con::before) {
	opacity: 0 !important;
}
/* La ligne du fil d'Ariane n'a pas sa place sur l'image */
body.cfpc-ape-accueil :is(.elementor-location-header, header.site-header, #masthead) :is(.cfpc-fil, .cfpc-fil-ariane, .cfpc-breadcrumb, [class*="fil-ariane"]) {
	display: none !important;
}
/* … ni la bande qui le contient (sur l'image, le fil d'Ariane est affiché dans le bandeau) */
body.cfpc-ape-accueil :is(.elementor-location-header, header.site-header, #masthead) :is(.elementor-section, .e-con):has(.cfpc-fil):not(:has(.elementor-nav-menu, .elementor-widget-nav-menu, nav:not(.cfpc-fil))) {
	display: none !important;
}

/* Textes, liens et icônes en blanc (hors sous-menus, menu mobile déplié, boutons et champ de recherche) */
body.cfpc-ape-haut :is(.elementor-location-header, header.site-header, #masthead) :is(a, .elementor-heading-title, .elementor-icon, .elementor-menu-toggle, .elementor-search-form__toggle, .elementor-icon-list-text, .elementor-icon-list-icon, p, span, i):not(.elementor-button, .elementor-button *, .btn, .button, .wp-element-button):not(.sub-menu *, .elementor-nav-menu--dropdown *, .elementor-search-form__container *, .elementor-search-form--full-screen *, .dialog-widget *) {
	color: #fff !important;
	fill: #fff !important;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
body.cfpc-ape-haut :is(.elementor-location-header, header.site-header, #masthead) :is(.elementor-icon, .elementor-menu-toggle, .elementor-search-form__toggle, .elementor-icon-list-icon) svg:not(.sub-menu *, .elementor-nav-menu--dropdown *) {
	fill: #fff !important;
	color: #fff !important;
}
body.cfpc-ape-haut :is(.elementor-location-header, header.site-header, #masthead) .elementor-menu-toggle {
	background-color: transparent !important;
}
/* Soulignement des liens du menu au survol : en blanc aussi */
body.cfpc-ape-haut :is(.elementor-location-header, header.site-header, #masthead) .elementor-nav-menu--main .elementor-item::before,
body.cfpc-ape-haut :is(.elementor-location-header, header.site-header, #masthead) .elementor-nav-menu--main .elementor-item::after {
	background-color: #fff !important;
}

/* Logo en blanc sur l'image (seulement s'il a un fond transparent : vérifié par accueil.js) */
body.cfpc-ape-haut.cfpc-ape-logo-blanc.cfpc-ape-logo-ok :is(.elementor-location-header, header.site-header, #masthead) :is(.elementor-widget-theme-site-logo img, .custom-logo, .site-logo img, .logo img, a[rel="home"] img) {
	filter: brightness(0) invert(1) drop-shadow(0 1px 4px rgba(0, 0, 0, .3));
}

/* ---------- Petits écrans, impression, animations ---------- */

@media (max-width: 600px) {
	.cfpc-ape { padding-bottom: 6rem; justify-content: flex-end; }
	.cfpc-ape__fond::after {
		background:
			linear-gradient(180deg, rgba(24, 38, 73, .75) 0, rgba(24, 38, 73, 0) 8rem),
			linear-gradient(0deg, rgba(24, 38, 73, calc(var(--cfpc-ape-voile, .45) + .25)) 0, rgba(24, 38, 73, var(--cfpc-ape-voile, .45)) 60%);
	}
	.cfpc-ape .cfpc-ape__bouton { flex: 1 1 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	.cfpc-ape__fleche { animation: none; }
	body.cfpc-ape-accueil :is(.elementor-location-header, header.site-header, #masthead),
	body.cfpc-ape-accueil :is(.elementor-location-header, header.site-header, #masthead) * { transition: none !important; }
}

@media print {
	.cfpc-ape { min-height: 0; margin: 0; padding: 1rem 0; color: #000; background: none; }
	.cfpc-ape__fond, .cfpc-ape__fleche, .cfpc-ape__boutons { display: none; }
	.cfpc-ape__titre, .cfpc-ape__sous-titre { color: #000; text-shadow: none; }
}
