/*
 * Page Actualités et pages de catégorie : bandeau bleu nuit (titre + introduction), article à la
 * une qui remonte sur le bandeau, filtres Métiers / Secteurs, grille de planches de plan.
 * Les planches elles-mêmes (image bichromie, repères de coupe, cartouche) viennent de news.css.
 */

/* ---------- Mise en page : sections collées, sans marge entre elles ---------- */
.wp-site-blocks > .cp-actu-main,
.cp-actu-page { margin-block: 0; }
.cp-actu-page > *,
.cp-actu-main > * { margin-block: 0 !important; }

/* ---------- Bandeau ---------- */
.cp-actu-band {
	position: relative;
	padding-block: clamp(56px, 7vw, 96px) clamp(120px, 12vw, 170px);
	overflow: clip;
	background: var(--wp--preset--color--navy, #000033);
	color: #fff;
}
.cp-actu-band--archive { padding-bottom: clamp(56px, 6vw, 88px); }
/* Avec la vidéo (page Actualités) : le bandeau remonte sous l'en-tête, transparent à cet endroit (header.css). */
body:not(.editor-styles-wrapper) .cp-actu-page > .cp-actu-band:has(.cp-actu-band__video) {
	margin-top: calc(-1 * (var(--cp-top-h, 40px) + var(--cp-bar-h, 76px))) !important;
	padding-top: calc(var(--cp-top-h, 40px) + var(--cp-bar-h, 76px) + clamp(56px, 7vw, 96px));
}
.cp-actu-band::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
	background-size: 48px 48px;
	pointer-events: none;
}
/*
 * Vidéo de fond du bandeau (page Actualités) : un bloc YouTube dans le contenu de la page, rendu
 * en image fixe par functions.php puis remplacé par la vidéo en boucle après l'accord aux cookies
 * (footer.js). Voile bleu nuit pour la lisibilité du titre, trame par-dessus, texte au-dessus.
 */
.cp-actu-band { isolation: isolate; }
.cp-actu-band::before { z-index: 1; }
div.cp-actu-band__video {
	position: absolute;
	inset: 0;
	z-index: 0;
	max-width: none !important;
	margin: 0 !important;
	overflow: hidden;
	container-type: size;
	background: var(--wp--preset--color--navy, #000033);
}
.cp-actu-band__poster,
div.cp-actu-band__video iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: max(100cqw, 177.78cqh);
	height: max(100cqh, 56.25cqw);
	transform: translate(-50%, -50%);
	border: 0;
	object-fit: cover;
	pointer-events: none;
}
div.cp-actu-band__video iframe { opacity: 0; transition: opacity .8s ease; }
div.cp-actu-band__video.is-playing iframe { opacity: 1; }
/*
 * Vidéo presque à nu (choix client : pas de grille, un très léger voile bleu). Sans rien, le texte blanc descend à 1,25:1 sur
 * le ciel de la vidéo : une ombre douce portée par les lettres seules le garde lisible.
 */
.cp-actu-band:has(.cp-actu-band__video)::before { display: none; }
/* Très léger voile bleu (demande client), uniforme. */
div.cp-actu-band__video::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 51, .25); }
.cp-actu-band:has(.cp-actu-band__video) .cp-actu-band__lead { color: #fff; }
.cp-actu-band:has(.cp-actu-band__video) .cp-actu-band__title,
.cp-actu-band:has(.cp-actu-band__video) .cp-actu-band__lead {
	/* Mesuré au canevas sur l'image de la vidéo : minimum 6,6:1 (titre), 4,7:1 (intro). */
	text-shadow: 0 0 10px rgba(0, 0, 30, .7), 0 0 24px rgba(0, 0, 30, .6), 0 0 48px rgba(0, 0, 30, .45);
}
.editor-styles-wrapper figure.cp-actu-band__video { position: relative; max-width: 520px; margin-bottom: 24px !important; }

.cp-actu-band__in {
	z-index: 2;
	position: relative;
	display: grid;
	gap: 18px;
	box-sizing: border-box;
	width: 100%;
	max-width: 1400px;
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 48px);
}
.cp-actu-band__in > * { margin: 0 !important; }
.cp-actu-band .cp-actu-band__title,
.cp-actu-band h1 { color: #fff; font-size: clamp(40px, 5.2vw, 76px); line-height: 1.02; font-weight: 700; letter-spacing: -.015em; }
.cp-actu-band .cp-actu-band__lead,
.cp-actu-band__lead p { color: #D7DAEA; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; }
.cp-actu-band__lead p { margin: 0; }
.cp-actu-band a { color: #fff; text-decoration-color: var(--wp--preset--color--orange, #FF9900); }

/* ---------- Liste (le bloc porte aussi .cp-news : fond brume et planches) ---------- */
.cp-news.cp-actu {
	/* flow-root : la marge haute des filtres ne doit pas sortir du fond brume (bande blanche). */
	display: flow-root;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	padding-top: 0;
	padding-bottom: clamp(72px, 9vw, 120px);
}
.cp-news.cp-actu > * {
	box-sizing: border-box;
	width: 100%;
	max-width: 1400px;
	margin-inline: auto !important;
	padding-inline: clamp(16px, 4vw, 48px);
}
.cp-news.cp-actu--cat { padding-top: clamp(40px, 5vw, 64px); }
.cp-actu [hidden] { display: none !important; }

/* À la une : remonte sur le bandeau, image à gauche, texte à droite. */
.cp-news .cp-actu__une { position: relative; margin-top: clamp(-120px, -9vw, -80px) !important; }
.cp-actu__une .cp-news__sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr auto; }
.cp-actu__une .cp-news__fig { grid-row: 1 / 3; margin: 22px 0 22px 22px; }
.cp-actu__une .cp-news__img { height: 100%; min-height: 360px; aspect-ratio: auto; }
.cp-actu__une .cp-news__body { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 3.4vw, 52px); }
.cp-news .cp-actu__une .cp-news__title { font-size: clamp(24px, 2vw, 30px); line-height: 1.12; }
.cp-news .cp-actu__une .cp-news__excerpt { margin-top: 18px; font-size: 17px; }
.cp-actu__une .cp-news__tb { margin-left: 22px; }

/* Filtres. */
.cp-news .cp-actu__filters { display: grid; gap: 14px; margin-top: clamp(48px, 6vw, 80px) !important; margin-bottom: clamp(28px, 3.4vw, 44px) !important; }
.cp-news.cp-actu--cat .cp-actu__filters { margin-top: 0 !important; }
.cp-actu__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cp-actu__label { min-width: 88px; margin-right: 6px; color: var(--wp--preset--color--navy, #000033); font-size: 14px; font-weight: 700; }
.cp-actu__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 8px 14px;
	border: 1px solid #D9DCE6;
	border-radius: 8px;
	background: #fff;
	color: var(--wp--preset--color--navy, #000033);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .2s, border-color .2s, color .2s;
}
.cp-actu__chip span { color: #555B6B; font-size: 13px; font-variant-numeric: tabular-nums; }
.cp-actu__chip:hover { border-color: var(--wp--preset--color--navy, #000033); }
.cp-actu__chip[aria-current] { border-color: var(--wp--preset--color--navy, #000033); background: var(--wp--preset--color--navy, #000033); color: #fff; }
.cp-actu__chip[aria-current] span { color: #C9CCE0; }
.cp-actu__chip:focus-visible { outline: 2px solid var(--wp--preset--color--orange, #FF9900); outline-offset: 2px; }
.cp-news .cp-actu__count { margin-bottom: 18px !important; color: #555B6B; font-size: 15px; }

/* Grille. */
.cp-news .cp-actu__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 36px); margin-block: 0 !important; padding-block: 0; list-style: none; }
.cp-actu__more { display: flex; justify-content: center; }
.cp-actu__morebtn {
	margin-top: clamp(36px, 4vw, 56px);
	min-height: 50px;
	padding: 14px 26px;
	border: 0;
	border-radius: 8px;
	background: var(--wp--preset--color--navy, #000033);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.cp-actu__morebtn:hover { background: var(--wp--preset--color--orange, #FF9900); color: var(--wp--preset--color--navy, #000033); }
.cp-actu__morebtn:focus-visible { outline: 2px solid var(--wp--preset--color--orange, #FF9900); outline-offset: 3px; }
.cp-actu__empty { padding-block: 48px; }

/* Tablette : 2 colonnes de planches verticales (news.css met l'image à gauche sous 1000 px). */
@media (max-width: 1000px) {
	.cp-news .cp-actu__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cp-news.cp-actu .cp-news__sheet { display: flex; }
	.cp-news.cp-actu .cp-news__fig { grid-row: auto; margin: 18px 18px 0; }
	.cp-news.cp-actu .cp-news__img { height: auto; min-height: 0; aspect-ratio: 3 / 2; }
	.cp-news.cp-actu .cp-actu__une .cp-news__img { aspect-ratio: 16 / 9; }
	.cp-news.cp-actu .cp-actu__une .cp-news__body { padding: 24px 22px 28px; }
	.cp-actu__une .cp-news__tb { margin-left: 0; }
}
/* Téléphone : 1 colonne ; chaque famille de filtres devient une rangée qui glisse au doigt. */
@media (max-width: 600px) {
	.cp-news .cp-actu__grid { grid-template-columns: minmax(0, 1fr); }
	.cp-news.cp-actu .cp-news__fig { margin: 14px 14px 0; }
	.cp-actu__row { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
	.cp-actu__row::-webkit-scrollbar { display: none; }
	.cp-actu__chip { flex: 0 0 auto; white-space: nowrap; }
	.cp-actu__label { flex: 0 0 auto; min-width: 0; margin-right: 4px; }
}
@media (prefers-reduced-motion: reduce) {
	.cp-actu__chip,
	.cp-actu__morebtn { transition: none; }
}
