/*
 * Hero de l'accueil : slides empilées, révélées par un balayage laser.
 * Le hero remplit l'écran sous l'en-tête (bandeau + barre + éventuelle barre d'admin).
 * Les règles d'empilement sont limitées au site public : dans l'éditeur, les slides
 * s'affichent l'une sous l'autre pour être modifiées.
 */

.cp-hero {
	--cp-sweep: 1100ms;
	--cp-dwell: 7000ms;
	--cp-hero-ease: cubic-bezier(.2, .7, .2, 1);
	position: relative;
	margin: 0 !important;
	background: var(--wp--preset--color--navy, #000033);
	color: #fff;
	isolation: isolate;
}
.cp-hero,
.cp-hero *,
.cp-hero *::before,
.cp-hero *::after { box-sizing: border-box; }
/* Accueil : les sections sont les blocs du contenu de la page, collées les unes aux autres. */
.wp-site-blocks > .cp-main { margin-block-start: 0; }
.cp-main > .cp-home,
.cp-main > .cp-home > * { margin-block: 0 !important; }

/*
 * Trait de cote entre deux sections : filet d'1 px (ombre intérieure, aucun décalage) et segment orange
 * de 48 px calé sur le bord gauche du contenu (largeur 1 400 px, marges globales). Le filet prend la
 * teinte de la section sur laquelle il est posé : bleu nuit léger sur fond clair, blanc léger sur fond sombre.
 */
.cp-home > * + * { position: relative; box-shadow: inset 0 1px 0 rgba(0, 0, 51, .10); }
.cp-home > .cp-scan,
.cp-home > .cp-pledge,
.cp-home > .cp-tour { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.cp-home > * + *::after {
	content: "";
	position: absolute;
	top: -1px;
	left: max(var(--wp--style--root--padding-left, 16px), calc((100% - 1400px) / 2));
	z-index: 5;
	width: 48px;
	height: 3px;
	background: var(--wp--preset--color--orange, #FF9900);
	pointer-events: none;
}

body:not(.editor-styles-wrapper) .cp-hero {
	height: calc(100svh - var(--wp-admin--admin-bar--height, 0px) - var(--cp-top-h, 40px) - var(--cp-bar-h, 76px));
	min-height: max(600px, var(--cp-hero-need, 0px));
	overflow: hidden;
}

/* ---------- Slides ---------- */
body:not(.editor-styles-wrapper) .cp-slide { position: absolute; inset: 0; margin: 0 !important; visibility: hidden; }
body:not(.editor-styles-wrapper) .cp-slide:first-child { visibility: visible; }
.cp-hero.is-ready .cp-slide:first-child:not(.is-active):not(.is-leaving) { visibility: hidden; }
.cp-slide.is-active,
.cp-slide.is-leaving { visibility: visible !important; }
.cp-slide.is-active { z-index: 2; }
.cp-slide.is-leaving { z-index: 1; }

.cp-slide__img { position: absolute; inset: 0; margin: 0 !important; overflow: hidden; }
.cp-slide__img img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); }
.cp-slide.is-active .cp-slide__img img { animation: cp-drift calc(var(--cp-dwell) + var(--cp-sweep)) linear forwards; }
@keyframes cp-drift { from { transform: scale(1.02); } to { transform: scale(1.08); } }

/*
 * Dégradé de la production (demande client du 02/10), relevé sur ses images d'en-tête : bleu nuit #01012C
 * plein jusqu'à 35 % de la largeur puis fondu jusqu'à 65 % ; bande pleine en haut (11 %) fondue jusqu'à 36 % ;
 * fondu du bas de 68 % au plein, sous la bande H1 + onglets. Téléphone : voile du bas (texte posé en bas).
 */
.cp-slide__img::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, #01012C 0%, #01012C 35%, rgba(1, 1, 44, .92) 40%, rgba(1, 1, 44, .78) 45%, rgba(1, 1, 44, .58) 50%, rgba(1, 1, 44, .38) 55%, rgba(1, 1, 44, .2) 60%, rgba(1, 1, 44, .07) 65%, rgba(1, 1, 44, 0) 70%),
		linear-gradient(180deg, #01012C 0%, #01012C 11%, rgba(1, 1, 44, .9) 15%, rgba(1, 1, 44, .7) 20%, rgba(1, 1, 44, .45) 25%, rgba(1, 1, 44, .2) 30%, rgba(1, 1, 44, 0) 36%, rgba(1, 1, 44, 0) 68%, rgba(1, 1, 44, .3) 75%, rgba(1, 1, 44, .5) 80%, rgba(1, 1, 44, .68) 85%, rgba(1, 1, 44, .86) 90%, rgba(1, 1, 44, .96) 95%, #01012C 100%);
}
.cp-slide__text { text-shadow: 0 1px 2px rgba(0, 0, 30, .45), 0 2px 18px rgba(0, 0, 30, .35); }
/* L'ombre sert à lire les titres sur la photo ; les boutons ont leur propre fond, sans ombre. */
.cp-slide__text .wp-block-button__link { text-shadow: none; }

/* Balayage laser : la slide entrante se dévoile derrière la ligne. */
.cp-slide.is-entering { clip-path: inset(0 100% 0 0); animation: cp-reveal var(--cp-sweep) var(--cp-hero-ease) forwards; }
@keyframes cp-reveal { to { clip-path: inset(0 0 0 0); } }
.cp-laser {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 3;
	width: 2px;
	background: var(--wp--preset--color--orange, #FF9900);
	box-shadow: 0 0 12px 2px rgba(255, 153, 0, .85), 0 0 40px 8px rgba(255, 153, 0, .35);
	opacity: 0;
	pointer-events: none;
}
.cp-laser::before { content: ""; position: absolute; top: 0; bottom: 0; right: 2px; width: 140px; background: linear-gradient(90deg, rgba(255, 153, 0, 0), rgba(255, 153, 0, .16)); }
.cp-laser.is-running { animation: cp-sweep var(--cp-sweep) var(--cp-hero-ease) forwards; }
@keyframes cp-sweep { 0% { opacity: 1; transform: translateX(0); } 92% { opacity: 1; } 100% { opacity: 0; transform: translateX(calc(100vw - 2px)); } }

/* ---------- Texte ---------- */
.cp-slide__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 100%;
	max-width: 1400px;
	margin: 0 auto !important;
	/* Place de la bande basse, mesurée par hero.js (repli : 132 px). */
	padding: 0 clamp(16px, 3vw, 40px) max(132px, calc(var(--cp-band-h, 100px) + 32px));
}
.cp-slide__text { display: grid; gap: 22px; max-width: 80%; margin: 0 !important; }
.cp-slide__text > * { margin: 0 !important; }
.cp-slide__label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.cp-hero .cp-slide__title {
	font-size: clamp(34px, 4.1vw, 62px);
	line-height: 1.08;
	font-weight: 700;
	letter-spacing: -.01em;
	color: #fff;
	text-wrap: balance;
}
.cp-slide__lead { max-width: 58ch; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: #DADCF0; }
.cp-slide__cta { gap: 14px; margin-top: 6px !important; }
.cp-slide__cta .wp-block-button__link { padding: 14px 22px; font-size: 16.5px; white-space: nowrap; transition: background-color .2s, transform .2s, border-color .2s; }
.cp-slide__cta .wp-block-button:not(.is-style-outline) .wp-block-button__link { display: inline-flex; align-items: center; gap: 10px; }
.cp-slide__cta .wp-block-button:not(.is-style-outline) .wp-block-button__link::after {
	content: "";
	width: 16px;
	height: 16px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform .2s var(--cp-hero-ease);
}
.cp-slide__cta .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { transform: translateY(-1px); }
.cp-slide__cta .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover::after { transform: translateX(3px); }
.cp-slide__cta .is-style-outline .wp-block-button__link { border: 1.5px solid rgba(255, 255, 255, .55); background: transparent; color: #fff; }
.cp-slide__cta .is-style-outline .wp-block-button__link:hover { border-color: #fff; background: rgba(255, 255, 255, .08); color: #fff; }

/* Entrée du texte, une fois la zone dévoilée. */
.cp-slide.is-active .cp-slide__text > * { animation: cp-rise .7s var(--cp-hero-ease) both; }
.cp-slide.is-active .cp-slide__title { animation-delay: .35s; }
.cp-slide.is-active .cp-slide__lead { animation-delay: .5s; }
.cp-slide.is-active .cp-slide__cta { animation-delay: .65s; }
@keyframes cp-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Bande basse : H1 fixe à gauche, onglets à droite ---------- */
body:not(.editor-styles-wrapper) .cp-hero__band {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	margin: 0 !important;
}
.cp-hero__band {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 32px;
	max-width: 1400px;
	margin-inline: auto;
	padding: 0 clamp(16px, 3vw, 40px) 30px;
}
.cp-hero__band > * { margin: 0 !important; }
/* Titre sans bridage de largeur : il prend la colonne laissée par les onglets (2 lignes maxi, demande client). */
.cp-hero .cp-hero__h1 { font-size: clamp(15px, 1.1vw, 17px); font-weight: 600; line-height: 1.4; color: #C9CBE0; }

.cp-hero__tabs,
.cp-hero__tablist { display: flex; align-items: stretch; gap: 6px; }
/* La liste d'onglets occupe toute la bande, le bouton pause reste à sa droite. */
.cp-hero__tablist { flex: 1 1 auto; min-width: 0; }
.cp-hero__tab {
	position: relative;
	display: grid;
	gap: 10px;
	min-width: 170px;
	padding: 14px 4px 0;
	border: 0;
	background: none;
	text-align: left;
	font: 600 15px/1.3 var(--wp--preset--font-family--titillium, sans-serif);
	color: rgba(255, 255, 255, .62);
	cursor: pointer;
	transition: color .2s;
}
.cp-hero__tab::before { content: ""; order: -1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .22); }
.cp-hero__tab .cp-fill { position: absolute; left: 4px; right: 4px; top: 14px; height: 3px; border-radius: 2px; background: var(--wp--preset--color--orange, #FF9900); transform: scaleX(0); transform-origin: left; }
.cp-hero__tab[aria-selected="true"] { color: #fff; }
.cp-hero__tab[aria-selected="true"] .cp-fill { animation: cp-fill var(--cp-dwell) linear forwards; }
.cp-hero.is-paused .cp-hero__tab[aria-selected="true"] .cp-fill { animation-play-state: paused; }
@keyframes cp-fill { to { transform: scaleX(1); } }
.cp-hero__tab:hover { color: #fff; }
.cp-hero__tab .cp-num { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--wp--preset--color--orange, #FF9900); }
.cp-hero__pause {
	display: grid;
	place-items: center;
	align-self: end;
	width: 40px;
	height: 40px;
	margin-left: 10px;
	padding: 0;
	border: 1.5px solid rgba(255, 255, 255, .4);
	border-radius: 50%;
	background: none;
	color: #fff;
	cursor: pointer;
	transition: border-color .2s;
}
.cp-hero__pause:hover { border-color: #fff; }
.cp-hero__pause svg { width: 14px; height: 14px; }
.cp-hero :focus-visible { outline: 2px solid var(--wp--preset--color--orange, #FF9900); outline-offset: 3px; border-radius: 4px; }

/* ---------- Éditeur : slides l'une sous l'autre, lisibles et modifiables ---------- */
.editor-styles-wrapper .cp-slide { position: relative; min-height: 460px; margin: 0 0 12px !important; overflow: hidden; }
.editor-styles-wrapper .cp-slide__img { position: absolute; }
.editor-styles-wrapper .cp-slide__body { padding-block: 48px; }
.editor-styles-wrapper .cp-slide__label { position: static !important; width: auto; height: auto; clip: auto; justify-self: start; padding: 2px 10px; border-radius: 8px; background: rgba(255, 255, 255, .15); font-size: 13px; }
.editor-styles-wrapper .cp-hero__band { padding-block: 24px; }

/* ---------- Points de rupture ---------- */
@media (max-width: 1279px) {
	.cp-slide__text { max-width: 100%; }
	.cp-hero__band { grid-template-columns: 1fr; }
	.cp-hero__tab { flex: 1; min-width: 0; }
}
@media (max-width: 760px) {
	body:not(.editor-styles-wrapper) .cp-hero { min-height: max(560px, var(--cp-hero-need, 0px)); }
	.cp-slide__body { justify-content: flex-end; padding-bottom: calc(var(--cp-band-h, 134px) + 32px); }
	.cp-slide__img::after { background: linear-gradient(0deg, rgba(0, 0, 51, .95) 0%, rgba(0, 0, 51, .84) 45%, rgba(0, 0, 51, .3) 78%, rgba(0, 0, 51, .2) 100%); }
	.cp-hero .cp-slide__title { font-size: 29px; line-height: 1.12; }
	.cp-slide__text { gap: 18px; }
	.cp-hero__tab { gap: 0; padding-top: 10px; font-size: 0; }
	.cp-hero__tab .cp-num { display: none; }
	.cp-hero__tab .cp-fill { top: 10px; }
	.cp-hero .cp-hero__h1 { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.cp-slide.is-entering,
	.cp-laser.is-running,
	.cp-slide.is-active .cp-slide__img img,
	.cp-slide.is-active .cp-slide__text > * { animation: none !important; }
	.cp-slide.is-entering { clip-path: none; }
	.cp-hero__tab[aria-selected="true"] .cp-fill { animation: none; transform: scaleX(1); }
}
