/*
 * Fiche réalisation (inc/fiche.php) : photo plein écran sous l'en-tête transparent (header.css),
 * cartouche de plan à cheval, mission, salle de projection sombre pour la visite 360° ou la vidéo,
 * chapitres (titre collé à gauche), galerie mosaïque avec visionneuse, autres réalisations.
 * Les cartes des autres réalisations viennent de carte-plan.css.
 */

.wp-site-blocks > .cp-pj-main { margin-block: 0; }
.cp-pj-main > * { margin-block: 0 !important; }
.cp-pj-main,
.cp-pj-main *,
.cp-pj-main *::before,
.cp-pj-main *::after { box-sizing: border-box; }
.cp-pj-main h1,
.cp-pj-main h2,
.cp-pj-main h3,
.cp-pj-main p,
.cp-pj-main ul,
.cp-pj-main dl,
.cp-pj-main dd { margin: 0; }
.cp-pj-wrap { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 40px); }
/* Taille tenue pour que les titres saisis restent sur 2 lignes dans leur demi-colonne. */
.cp-pj-h2 { color: var(--wp--preset--color--navy, #000033); font-size: clamp(26px, 2.4vw, 36px); line-height: 1.1; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.cp-pj-pin { flex: none; color: var(--wp--preset--color--orange, #FF9900); }

/* ---------- Haut de page photo (remonte sous l'en-tête transparent) ---------- */
.cp-pj-hero {
	--cp-pj-head: calc(var(--cp-top-h, 40px) + var(--cp-bar-h, 76px));
	position: relative;
	isolation: isolate;
	display: grid;
	align-items: end;
	min-height: min(92vh, 880px);
	margin-top: calc(-1 * var(--cp-pj-head)) !important;
	overflow: clip;
	background: var(--wp--preset--color--navy-2, #00012E);
	color: #fff;
}
.cp-pj-hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; animation: cp-pj-kb 18s ease-out both; }
@keyframes cp-pj-kb { from { transform: scale(1.08); } to { transform: scale(1); } }
/* Voile noir dense là où se trouve le texte (menu en haut, titre en bas), léger au milieu :
   mesuré au canevas, texte blanc ≥ 7:1 sur la photo d'exemple. */
.cp-pj-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .58) 11%, rgba(0, 0, 0, .2) 30%, rgba(0, 0, 0, .62) 52%, rgba(0, 0, 0, .82) 100%); }
.cp-pj-hero__in { padding-block: calc(var(--cp-pj-head) + 60px) clamp(150px, 13vw, 190px); }
.cp-pj-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 22px; color: #E7E9F4; font-size: 14px; font-weight: 600; }
.cp-pj-crumb a { color: #E7E9F4; text-decoration: none; }
.cp-pj-crumb a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--wp--preset--color--orange, #FF9900); }
.cp-pj-crumb a:focus-visible { outline: 2px solid var(--wp--preset--color--orange, #FF9900); outline-offset: 3px; border-radius: 4px; }
.cp-pj-crumb i { width: 5px; height: 5px; border-radius: 50%; background: var(--wp--preset--color--orange, #FF9900); }
.cp-pj-hero .cp-pj-hero__title { color: #fff; font-size: clamp(44px, 7.4vw, 112px); line-height: .98; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.cp-pj-hero__type { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 18px !important; color: #fff; font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; }
.cp-pj-hero__type span { display: inline-flex; align-items: center; gap: 8px; }
.cp-pj-hero__type .cp-pj-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .6); }

/* ---------- Cartouche de plan ---------- */
.cp-pj-tbwrap { position: relative; z-index: 5; margin-top: calc(-1 * clamp(84px, 7vw, 104px)) !important; }
/* Rangées qui se remplissent toujours (pas de case vide) ; filets portés par les cases, coupés au bord. */
.cp-pj-tb { display: flex; flex-wrap: wrap; overflow: hidden; border: 1px solid #DCE4F0; border-radius: 8px; background: #fff; box-shadow: 0 40px 80px -40px rgba(0, 0, 51, .45); }
.cp-pj-tb > div { flex: 1 1 170px; min-width: 0; margin: -1px 0 0 -1px; padding: 22px 24px; border-top: 1px solid #C9D3E3; border-left: 1px solid #C9D3E3; }
.cp-pj-tb dt { margin-bottom: 6px; color: #555B6B; font-size: 12px; font-weight: 600; line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; }
.cp-pj-tb dd { color: var(--wp--preset--color--navy, #000033); font-size: clamp(18px, 1.6vw, 22px); font-weight: 700; line-height: 1.2; }
.cp-pj-tb .cp-pj-tb__big { font-size: clamp(30px, 2.8vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; }
.cp-pj-tb dd small { display: block; margin-top: 4px; color: #555B6B; font-size: 14px; font-weight: 400; line-height: 1.4; }
.cp-pj-tb__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-pj-tb__chips .cp-plan__chip { background: #EDF2F9; font-size: 13px; }
.cp-pj-tbwrap > i { position: absolute; width: 16px; height: 16px; border: 0 solid var(--wp--preset--color--orange, #FF9900); }
.cp-pj-tbwrap > i:nth-of-type(1) { left: calc(clamp(16px, 3vw, 40px) - 8px); top: -8px; border-left-width: 2px; border-top-width: 2px; }
.cp-pj-tbwrap > i:nth-of-type(2) { right: calc(clamp(16px, 3vw, 40px) - 8px); top: -8px; border-right-width: 2px; border-top-width: 2px; }
.cp-pj-tbwrap > i:nth-of-type(3) { left: calc(clamp(16px, 3vw, 40px) - 8px); bottom: -8px; border-left-width: 2px; border-bottom-width: 2px; }
.cp-pj-tbwrap > i:nth-of-type(4) { right: calc(clamp(16px, 3vw, 40px) - 8px); bottom: -8px; border-right-width: 2px; border-bottom-width: 2px; }

/* ---------- Mission ---------- */
.cp-pj-mission { padding-block: clamp(72px, 8vw, 120px) clamp(72px, 8vw, 112px); background: #fff; }
.cp-pj-mission .cp-pj-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.cp-pj-mission__list { padding: 0; list-style: none; border-top: 1px solid #C9D3E3; }
.cp-pj-mission__list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 20px 0; border-bottom: 1px solid #C9D3E3; color: var(--wp--preset--color--ink, #0B0B1F); font-size: 19px; line-height: 28px; }
/* Tirets : trait de 2 px dessiné au milieu d'une case de 4 px. Avec un affichage à 125 ou 150 %,
   une case de 2 px vaut 2,5 ou 3 pixels réels et l'écran l'arrondit à 2 ou 3 selon la ligne (tirets
   plus ou moins gras) ; une case de 4 px vaut toujours un nombre entier de pixels réels, et le trait
   y est tracé de la même façon partout. */
.cp-pj-mission__list li::before { content: ""; width: 18px; height: 4px; margin-top: 12px; background: linear-gradient(transparent 1px, var(--wp--preset--color--orange, #FF9900) 1px, var(--wp--preset--color--orange, #FF9900) 3px, transparent 3px); }
.cp-pj-mission__addr { display: flex; gap: 10px; margin-top: 28px !important; color: #555B6B; font-size: 15px; line-height: 1.5; }
.cp-pj-mission__addr .cp-pj-pin { margin-top: 3px; }

/* ---------- Salle de projection : visite 360° ou vidéo, chargée au clic ---------- */
.cp-pj-proj { position: relative; padding-block: clamp(72px, 8vw, 120px); overflow: clip; background: var(--wp--preset--color--navy-2, #00012E); color: #fff; }
.cp-pj-proj::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 0%, rgba(28, 47, 143, .55), transparent 70%); pointer-events: none; }
.cp-pj-proj .cp-pj-wrap { position: relative; }
.cp-pj-proj__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 40px; margin-bottom: clamp(28px, 3vw, 44px); }
.cp-pj-proj .cp-pj-h2 { color: #fff; }
.cp-pj-proj__out { display: inline-flex; align-items: center; gap: 10px; padding-bottom: 2px; border-bottom: 2px solid var(--wp--preset--color--orange, #FF9900); color: #fff; font-weight: 700; text-decoration: none; }
.cp-pj-proj__out:focus-visible { outline: 2px solid var(--wp--preset--color--orange, #FF9900); outline-offset: 3px; }
.cp-pj-screen { position: relative; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; border-radius: 8px; background: #000; box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .8); }
.cp-pj-screen__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.cp-pj-screen::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(0, 0, 30, .2), rgba(0, 0, 30, .68)); pointer-events: none; }
.cp-pj-screen:hover .cp-pj-screen__img { transform: scale(1.04); }
.cp-pj-screen > i { position: absolute; z-index: 2; width: 22px; height: 22px; border: 0 solid rgba(255, 255, 255, .85); pointer-events: none; }
.cp-pj-screen > i:nth-of-type(1) { left: 18px; top: 18px; border-left-width: 2px; border-top-width: 2px; }
.cp-pj-screen > i:nth-of-type(2) { right: 18px; top: 18px; border-right-width: 2px; border-top-width: 2px; }
.cp-pj-screen > i:nth-of-type(3) { left: 18px; bottom: 18px; border-left-width: 2px; border-bottom-width: 2px; }
.cp-pj-screen > i:nth-of-type(4) { right: 18px; bottom: 18px; border-right-width: 2px; border-bottom-width: 2px; }
.cp-pj-play { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 18px; width: 100%; padding: 0; border: 0; background: none; color: #fff; font: inherit; text-align: center; cursor: pointer; }
.cp-pj-play:focus-visible { outline: 3px solid var(--wp--preset--color--orange, #FF9900); outline-offset: -8px; border-radius: 8px; }
.cp-pj-play__btn { display: grid; place-items: center; width: clamp(84px, 8vw, 112px); aspect-ratio: 1; border-radius: 50%; background: var(--wp--preset--color--orange, #FF9900); color: var(--wp--preset--color--navy, #000033); animation: cp-pj-pulse 2.4s cubic-bezier(.2, .7, .2, 1) infinite; }
@keyframes cp-pj-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 153, 0, .55); } 70% { box-shadow: 0 0 0 26px rgba(255, 153, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 153, 0, 0); } }
.cp-pj-play__btn svg { width: 36%; height: 36%; margin-left: 6%; }
.cp-pj-play__label { font-size: clamp(20px, 2vw, 26px); font-weight: 700; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.cp-pj-play__sub { color: #E1E4F2; font-size: 15px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.cp-pj-screen iframe { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; border: 0; }
.cp-pj-screen.is-loaded .cp-pj-play,
.cp-pj-screen.is-loaded > i,
.cp-pj-screen.is-loaded::after { display: none; }
.cp-pj-screen .cp-pj-ask { z-index: 5; border-radius: 8px; }
/* Encart d'accord aux cookies (vidéo YouTube) : dans le style de la salle de projection, l'image
   d'aperçu reste visible sous un voile sombre (l'encart clair du pied de page cachait tout). */
.cp-pj-screen .cp-consent__ask { gap: 16px; padding: 32px; background: rgba(0, 0, 20, .78); color: #fff; }
.cp-pj-screen .cp-consent__ask p { max-width: 40ch; color: #fff; font-size: clamp(17px, 1.5vw, 20px); font-weight: 600; line-height: 1.45; }
.cp-pj-screen .cp-consent__accept { min-height: 52px; padding: 14px 26px; background: var(--wp--preset--color--orange, #FF9900); color: var(--wp--preset--color--navy, #000033); }
.cp-pj-screen .cp-consent__accept:hover { background: #fff; color: var(--wp--preset--color--navy, #000033); }
.cp-pj-screen .cp-consent__accept:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cp-pj-screen .cp-consent__out { color: #E1E4F2; text-decoration-color: var(--wp--preset--color--orange, #FF9900); }
.cp-pj-screen .cp-consent__out:hover { color: #fff; }

/* ---------- Chapitres ---------- */
.cp-pj-chap { padding-block: clamp(64px, 7vw, 104px); }
/* Fonds clairs attribués par inc/fiche.php : jamais le même que la section précédente. */
.cp-pj-bg--white { background: #fff; }
.cp-pj-bg--mist { background: var(--wp--preset--color--mist, #F3F4F8); }
.cp-pj-chap .cp-pj-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.cp-pj-chap__head { position: sticky; top: calc(var(--cp-bar-h, 76px) + 28px); display: grid; gap: 16px; }
.cp-pj-chap__lead { color: var(--wp--preset--color--navy, #000033); font-size: clamp(18px, 1.5vw, 21px); font-weight: 600; line-height: 1.45; }
.cp-pj-chap__body { display: grid; gap: 19px; color: #1B1F3B; font-size: 18px; line-height: 30px; }
.cp-pj-chap__body > * { margin: 0; }
.cp-pj-chap__body h3 { color: var(--wp--preset--color--navy, #000033); font-size: 22px; line-height: 29px; font-weight: 700; }
.cp-pj-chap__body strong { color: var(--wp--preset--color--ink, #0B0B1F); font-weight: 600; }
.cp-pj-chap__body a { color: var(--wp--preset--color--navy, #000033); text-decoration: underline; text-decoration-color: var(--wp--preset--color--orange, #FF9900); text-underline-offset: 3px; }
.cp-pj-chap__body ul { display: grid; gap: 10px; padding: 0; list-style: none; }
.cp-pj-chap__body li { position: relative; padding-left: 26px; }
.cp-pj-chap__body li::before { content: ""; position: absolute; left: 0; top: 13px; width: 14px; height: 4px; background: linear-gradient(transparent 1px, var(--wp--preset--color--orange, #FF9900) 1px, var(--wp--preset--color--orange, #FF9900) 3px, transparent 3px); }
.cp-pj-chap__body img { max-width: 100%; height: auto; border-radius: 8px; }

/* ---------- Appel à l'action (à la moitié du texte, textes des encarts d'articles) ---------- */
.cp-pj-cta { padding-block: clamp(40px, 5vw, 64px); }
.cp-pj-cta__box { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px 40px; padding: clamp(28px, 3.4vw, 44px) clamp(24px, 4vw, 56px); border-radius: 8px; background: var(--wp--preset--color--navy, #000033); color: #fff; }
.cp-pj-cta__box > div { display: grid; gap: 8px; min-width: 0; }
.cp-pj-cta .cp-pj-cta__title { color: #fff; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; font-weight: 700; text-wrap: balance; }
.cp-pj-cta .cp-pj-cta__text { color: #D7DAEA; font-size: 17px; line-height: 1.5; }
.cp-pj-cta__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 14px 28px; border-radius: 8px; background: var(--wp--preset--color--orange, #FF9900); color: var(--wp--preset--color--navy, #000033); font-size: 16px; font-weight: 700; white-space: nowrap; text-decoration: none; transition: background-color .2s, color .2s; }
.cp-pj-cta__btn:hover { background: #fff; color: var(--wp--preset--color--navy, #000033); }
.cp-pj-cta__btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cp-pj-cta__box > i { position: absolute; width: 14px; height: 14px; border: 0 solid var(--wp--preset--color--orange, #FF9900); pointer-events: none; }
.cp-pj-cta__box > i:nth-of-type(1) { left: -7px; top: -7px; border-left-width: 2px; border-top-width: 2px; }
.cp-pj-cta__box > i:nth-of-type(2) { right: -7px; top: -7px; border-right-width: 2px; border-top-width: 2px; }
.cp-pj-cta__box > i:nth-of-type(3) { left: -7px; bottom: -7px; border-left-width: 2px; border-bottom-width: 2px; }
.cp-pj-cta__box > i:nth-of-type(4) { right: -7px; bottom: -7px; border-right-width: 2px; border-bottom-width: 2px; }

/* ---------- Galerie mosaïque (motifs qui remplissent la grille, inc/fiche.php) ---------- */
.cp-pj-gal { padding-block: clamp(72px, 8vw, 120px); background: var(--wp--preset--color--navy-2, #00012E); color: #fff; }
.cp-pj-gal__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 40px; margin-bottom: clamp(28px, 3vw, 44px); }
.cp-pj-gal .cp-pj-h2 { color: #fff; }
.cp-pj-gal__count { color: #C9CCE0; font-size: 15px; font-variant-numeric: tabular-nums; }
.cp-pj-mosaic { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: clamp(120px, 11vw, 170px); gap: 10px; margin: 0; padding: 0; list-style: none; }
.cp-pj-mosaic li { min-width: 0; margin: 0; grid-column: span 2; }
.cp-pj-mosaic .cp-pj-m--big { grid-column: span 3; grid-row: span 2; }
.cp-pj-mosaic .cp-pj-m--half { grid-column: span 3; }
.cp-pj-mosaic .cp-pj-m--full { grid-column: 1 / -1; grid-row: span 2; }
.cp-pj-mosaic button { position: relative; display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 8px; background: #0A0A45; cursor: zoom-in; }
.cp-pj-mosaic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.cp-pj-mosaic button:hover img { transform: scale(1.06); }
.cp-pj-mosaic button:focus-visible { outline: 3px solid var(--wp--preset--color--orange, #FF9900); outline-offset: 3px; }
dialog.cp-pj-lb { width: min(1400px, 96vw); max-width: none; max-height: 94vh; padding: 0; overflow: hidden; border: 0; border-radius: 8px; background: #000; color: #fff; }
dialog.cp-pj-lb::backdrop { background: rgba(0, 0, 20, .92); }
.cp-pj-lb figure { display: grid; place-items: center; margin: 0; }
.cp-pj-lb img { display: block; max-width: 100%; max-height: 86vh; object-fit: contain; }
.cp-pj-lb figcaption { padding: 10px 16px; color: #C9CCE0; font-size: 14px; font-variant-numeric: tabular-nums; }
.cp-pj-lb button { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.cp-pj-lb button:hover { background: var(--wp--preset--color--orange, #FF9900); color: var(--wp--preset--color--navy, #000033); }
.cp-pj-lb button:focus-visible { outline: 2px solid var(--wp--preset--color--orange, #FF9900); outline-offset: 2px; }
.cp-pj-lb__x { top: 12px; right: 12px; }
.cp-pj-lb__pv { left: 12px; top: calc(50% - 26px); }
.cp-pj-lb__nx { right: 12px; top: calc(50% - 26px); }

/* ---------- Autres réalisations ---------- */
.cp-pj-more { padding-block: clamp(72px, 8vw, 112px); }
.cp-pj-more__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 40px; margin-bottom: clamp(28px, 3vw, 44px); }
.cp-pj-more__all { display: inline-flex; align-items: center; gap: 10px; padding-bottom: 2px; border-bottom: 2px solid var(--wp--preset--color--orange, #FF9900); color: var(--wp--preset--color--navy, #000033); font-weight: 700; text-decoration: none; }
.cp-pj-more__all:focus-visible { outline: 2px solid var(--wp--preset--color--orange, #FF9900); outline-offset: 3px; }
.cp-pj-more__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.cp-pj-more__grid > .cp-plan { min-width: 0; }

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 900px) {
	.cp-pj-mission .cp-pj-wrap,
	.cp-pj-chap .cp-pj-wrap { grid-template-columns: minmax(0, 1fr); }
	.cp-pj-chap__head { position: static; }
	.cp-pj-more__grid { grid-template-columns: minmax(0, 1fr); }
	.cp-pj-cta__box { grid-template-columns: minmax(0, 1fr); }
	.cp-pj-cta__btn { justify-self: start; }
	/* Galerie : 2 colonnes égales, une photo seule en fin de liste prend toute la largeur. */
	.cp-pj-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(140px, 30vw, 220px); }
	.cp-pj-mosaic li,
	.cp-pj-mosaic .cp-pj-m--big,
	.cp-pj-mosaic .cp-pj-m--half,
	.cp-pj-mosaic .cp-pj-m--full { grid-column: span 1; grid-row: span 1; }
	.cp-pj-mosaic li:first-child,
	.cp-pj-mosaic li:last-child:nth-child(even) { grid-column: 1 / -1; grid-row: span 2; }
}
@media (max-width: 600px) {
	.cp-pj-hero { min-height: 88vh; }
	.cp-pj-tb > div { flex-basis: 140px; padding: 18px; }
	.cp-pj-lb__pv,
	.cp-pj-lb__nx { top: auto; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.cp-pj-hero__img,
	.cp-pj-play__btn { animation: none; }
	.cp-pj-screen__img,
	.cp-pj-mosaic img { transition: none; }
	.cp-pj-screen:hover .cp-pj-screen__img,
	.cp-pj-mosaic button:hover img { transform: none; }
}

/* Suite d'un chapitre coupé par la galerie ou l'appel à l'action : le texte reprend dans la même
   colonne, sans répéter le titre. */
.cp-pj-chap--suite { padding-top: clamp(48px, 5vw, 72px); }
@media (max-width: 900px) {
	.cp-pj-chap--suite .cp-pj-chap__head { display: none; }
}
