/**
 * Portfolio (maquette Portfolio, dernières règles) : page Marine, intro sans fond en haut à gauche,
 * cards photo à places fixes (motif bento 4 × 3), filtres dans l'intro (décision de Damien du
 * 09/11/2026), 7 réalisations par écran puis 8, écran incomplet en grille libre.
 */

/* ------------------------------------------------------------------ */
/* Intro                                                              */
/* ------------------------------------------------------------------ */

.up-pf-intro {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 1rem;
	color: var(--wp--preset--color--blanc);
}

.up-pf-intro > .up-fil {
	margin-bottom: auto;
}

.up-pf-intro-bas {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.up-pf-intro-bas > * {
	margin: 0;
}

.up-pf-intro .up-pf-h1 {
	font-size: var(--wp--preset--font-size--titre-portfolio);
	line-height: 1.02;
	color: var(--wp--preset--color--blanc);
}

.up-pf-intro p {
	font-size: var(--wp--preset--font-size--texte-compact);
	line-height: 1.55;
	color: var(--wp--preset--color--fond);
}

/* Filtres : pilules Texte sur Marine, la sélection en Blanc ; survol Cyan (exception Marine validée). */
.up-pf-filtres {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	padding-top: 0.25rem;
}

.up-pf-filtre {
	display: inline-flex;
	align-items: center;
	min-height: 1.75rem;
	padding: 0 0.75rem;
	border-radius: var(--wp--custom--rayon--pilule);
	background: var(--wp--preset--color--texte);
	color: var(--wp--preset--color--fond);
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--legende);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.25s, color 0.25s;
}

/* Écran tactile : pilules plus hautes, faciles à toucher au pouce (audit du 19/11/2026). */
@media (pointer: coarse) {
	.up-pf-filtre {
		min-height: 2.25rem;
		padding: 0 0.875rem;
	}
}

.up-pf-filtre:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--cyan);
}

.up-pf-filtre:focus-visible {
	outline: 2px solid var(--wp--preset--color--cyan);
	outline-offset: 2px;
}

.up-pf-filtre[aria-pressed="true"] {
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--marine);
}

/* Après un filtre : plus d'arrivée de page rejouée (cards déplacées), l'intro et les filtres ne bougent plus. */
.up-portfolio.is-filtre .up-grille > * {
	animation: none;
}

/* ------------------------------------------------------------------ */
/* Cards                                                              */
/* ------------------------------------------------------------------ */

/* La card est le lien ; visuel plein cadre, voile, légende calée en bas, flèche blanche (socle). */
.up-card.up-pf-carte {
	overflow: hidden;
	background: var(--wp--preset--color--texte);
	color: var(--wp--preset--color--blanc);
	text-decoration: none;
}

.up-pf-carte:focus-visible {
	outline: 2px solid var(--wp--preset--color--cyan);
	outline-offset: 3px;
}

.up-pf-visuel {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: inherit;
	overflow: hidden;
}

/* Photo de réalisation : remplit la card (cards de tailles variables, comme la maquette). */
.up-pf-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 0.9s var(--wp--custom--transition--douce);
}

.up-pf-carte:is(:hover, :focus-visible) .up-pf-img {
	scale: 1.06;
}

/* Sans visuel : le nom du client, en attendant l'image. */
.up-pf-provisoire {
	padding: var(--wp--custom--pad);
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--titre-card);
	font-weight: 700;
	line-height: 1.05;
	text-align: center;
	color: var(--wp--preset--color--brume);
}

/* Voile : dépasse d'1 px, aucun liseré au bord arrondi (règle du 06/11/2026). */
.up-pf-voile {
	position: absolute;
	inset: -1px;
	background: var(--wp--preset--gradient--voile-hero);
	opacity: 0.85;
	transition: opacity 0.4s;
	pointer-events: none;
}

.up-pf-carte:is(:hover, :focus-visible) .up-pf-voile {
	opacity: 1;
}

.up-pf-legende {
	position: absolute;
	right: var(--wp--custom--pad);
	bottom: var(--wp--custom--pad);
	left: var(--wp--custom--pad);
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.up-pf-sur {
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--mini);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--fond);
}

.up-pf-titre {
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--titre-realisation);
	font-weight: 700;
	line-height: 1.1;
}

@media (prefers-reduced-motion: reduce) {
	.up-pf-img {
		transition: none;
	}

	.up-pf-carte:is(:hover, :focus-visible) .up-pf-img {
		scale: none;
	}
}

/* ------------------------------------------------------------------ */
/* Grille                                                             */
/* ------------------------------------------------------------------ */

@media (min-width: 1024px) and (pointer: fine), (min-width: 1024px) and (min-height: 820px) {
	.up-portfolio {
		display: flex;
		flex-direction: column;
		flex: 1;
		min-height: 0;
	}

	/* Jamais de card écrasée : légende et flèche y tiennent toujours (la grille défile en interne en dernier recours). */
	.up-card.up-pf-carte {
		min-height: var(--wp--custom--portfolio--carte-min);
	}

	.up-pf {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-template-rows: repeat(3, minmax(min-content, 1fr));
	}

	/* Titre fluide : 37 px à 1440 × 970 (2,57 vw = 3,81 svh). */
	.up-pf-intro .up-pf-h1 {
		font-size: clamp(calc(var(--wp--preset--font-size--titre-portfolio) * 0.8), min(2.57vw, 3.81svh), var(--wp--preset--font-size--titre-portfolio));
	}

	.up-pf--premier > .up-pf-intro {
		grid-column: 1;
		grid-row: 1;
	}

	/*
	 * Place de chaque card : motif bento selon le nombre de cards de l'écran (upc_pf_motifs(), posé
	 * en --pf-col / --pf-row par le serveur et par le filtre). 7 cards = motif de la maquette.
	 */
	.up-pf > .up-pf-carte {
		grid-column: var(--pf-col, auto);
		grid-row: var(--pf-row, auto);
	}
}

@media (max-width: 1023px), (min-width: 1024px) and (pointer: coarse) and (max-height: 819px) {
	/* Mobile : cards carrées, une colonne, dans l'ordre. */
	.up-card.up-pf-carte {
		aspect-ratio: 1 / 1;
	}
}

/* ------------------------------------------------------------------ */
/* Popup fiche projet (maquette pj-box)                               */
/* ------------------------------------------------------------------ */

/*
 * <dialog> natif sur toute la fenêtre, voile Marine (le Portfolio reste deviné derrière). Pas de flou :
 * recalculé sur tout l'écran à chaque image, il faisait saccader la montée (retour de Damien du 09/11/2026).
 * La fenêtre blanche monte du bas à l'ouverture et y redescend à la fermeture (demande de Damien
 * du 09/11/2026). Aucune ombre sur fond Marine (skill).
 */
.up-pop {
	position: fixed;
	inset: 0;
	z-index: 90;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: var(--wp--custom--marge);
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--texte);
	overflow: hidden;
}

.up-pop[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.up-pop::backdrop {
	background: color-mix(in srgb, var(--wp--preset--color--marine) 90%, transparent);
}

/* Sans JavaScript (adresse directe), la popup est ouverte sans voile natif : fond Marine plein. */
.up-pop[open]:not(:modal) {
	background: var(--wp--preset--color--marine);
}

html.up-pop-ouverte {
	overflow: hidden;
}

.up-pop-boite {
	position: relative;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
	width: min(77.5rem, 100%);
	height: min(100%, 46rem);
	border-radius: var(--wp--custom--rayon--card);
	background: var(--wp--preset--color--blanc);
	overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
	/*
	 * Montée (view.js, Web Animations) : la fenêtre est d'abord dessinée invisible à sa place
	 * (is-prep, deux images), puis monte du bas. Sans cette préparation, le premier dessin de la
	 * fenêtre et de son image tombait pendant l'animation, qui sautait (retour de Damien du 09/11/2026).
	 * Calque à part pendant le mouvement seulement (la fenêtre n'est pas une card : pas de survol).
	 */
	.up-pop[open]:not(.is-posee) .up-pop-boite {
		will-change: translate;
	}

	.up-pop.is-prep .up-pop-boite {
		opacity: 0.001;
	}

	.up-pop.is-prep::backdrop {
		opacity: 0;
	}

	.up-pop.is-sortie .up-pop-boite {
		animation: up-pop-descend 0.45s var(--wp--custom--ecrans--courbe) both;
	}

	.up-pop.is-sortie::backdrop {
		animation: up-pop-voile 0.45s ease reverse both;
	}
}

@keyframes up-pop-descend {
	to {
		translate: 0 100svh;
	}
}

@keyframes up-pop-voile {
	from {
		opacity: 0;
	}
}

/* Fermer : 44 px, sans fond, Marine ; survol Outremer. */
.up-pop-fermer {
	position: absolute;
	top: 0.625rem;
	right: 0.625rem;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--menu-mobile--cible);
	height: var(--wp--custom--menu-mobile--cible);
	color: var(--wp--preset--color--marine);
	transition: color 0.25s;
}

.up-pop-fermer svg {
	width: var(--wp--custom--icone--fermer);
	height: var(--wp--custom--icone--fermer);
}

.up-pop-fermer:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--outremer);
}

/* Visuels : remplissent la colonne, jusqu'aux coins de la fenêtre. */
.up-pop-media {
	display: flex;
	min-width: 0;
	min-height: 0;
}

.up-pop-media > * {
	flex: 1;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
}

/* Texte calé en bas (skill), défile seul si la fenêtre est trop basse. */
.up-pop-txt {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.75rem;
	min-height: 0;
	padding: 3.5rem var(--wp--custom--pad) var(--wp--custom--pad);
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--brume) transparent;
}

.up-pop-txt > * {
	margin: 0;
}

.up-pop-sur,
.up-pop-k {
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--mini);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.up-pop-sur {
	color: var(--wp--preset--color--outremer);
}

.up-pop-k {
	color: var(--wp--preset--color--ardoise);
}

.up-pop-titre {
	margin: 0;
	font-size: var(--wp--preset--font-size--titre-bloc);
	line-height: 1.1;
	letter-spacing: -0.014em;
	color: var(--wp--preset--color--marine);
}

.up-pop-desc {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.up-pop-desc p {
	margin: 0;
	font-size: var(--wp--preset--font-size--sous-texte);
	line-height: 1.55;
	color: var(--wp--preset--color--ardoise);
}

.up-pop-article {
	align-self: flex-start;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--texte-etape);
	font-weight: 700;
	color: var(--wp--preset--color--outremer);
	text-decoration: none;
}

.up-pop-article:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--marine);
}

/* Fiche : deux colonnes, pictogramme Bleu, intitulé puis valeur (maquette pj-fiche). */
.up-pop-infos {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 1rem 0;
	border-top: 1px solid var(--wp--preset--color--fond);
}

.up-pop-infos > div {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 0.8rem;
	align-items: center;
}

.up-pop-infos svg {
	grid-row: span 2;
	width: var(--wp--custom--icone--fermer);
	height: var(--wp--custom--icone--fermer);
	color: var(--wp--preset--color--bleu);
}

.up-pop-infos dt {
	font-size: var(--wp--preset--font-size--etiquette);
	color: var(--wp--preset--color--ardoise);
}

.up-pop-infos dd {
	margin: 0;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--texte-etape);
	font-weight: 700;
	color: var(--wp--preset--color--marine);
}

/* Livrables : coche seule Outremer, texte Marine (maquette pj-liv). */
.up-pop-liste ul {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0.375rem 0 0;
	padding: 0;
	list-style: none;
}

.up-pop-liste li {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--texte-etape);
	font-weight: 700;
	color: var(--wp--preset--color--marine);
}

.up-pop-liste li::before {
	content: "";
	flex: none;
	width: var(--wp--custom--icone--coche);
	height: var(--wp--custom--icone--coche);
	background: var(--wp--preset--color--outremer);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%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 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Flèches projet précédent / suivant (40 px, sans fond) et « Un projet similaire ? ». */
.up-pop-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.625rem 0;
	padding-top: 0.25rem;
}

.up-pop-fleche {
	display: inline-flex;
	color: var(--wp--preset--color--texte);
	transition: color 0.25s;
}

.up-pop-fleche svg {
	width: var(--wp--custom--carte--fleche);
	height: var(--wp--custom--carte--fleche);
}

.up-pop-fleche:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--outremer);
}

/* Le bouton garde ses 70 px de chaque côté (skill) : s'il ne tient pas à côté des flèches, il passe
   dessous, sur toute la largeur. */
.up-pop-cta.wp-block-buttons {
	flex: 1 1 auto;
	justify-content: flex-end;
	margin: 0 0 0 0.25rem;
}

.up-pop-cta .wp-block-button,
.up-pop-cta .wp-block-button__link {
	width: 100%;
}

/*
 * La fenêtre de la fiche est blanche sur une page Marine : ses boutons prennent le style sur fond clair
 * (dégradé Bouton, texte blanc ; survol contour et texte Outremer), pas celui des pages foncées.
 */
.theme-dark .up-pop-boite:not(.up-pop--video) .wp-block-button:not(.is-style-secondaire) .wp-block-button__link {
	background: var(--wp--preset--gradient--bouton);
	color: var(--wp--preset--color--blanc);
	box-shadow: none;
}

.theme-dark .up-pop-boite:not(.up-pop--video) .wp-block-button:not(.is-style-secondaire) .wp-block-button__link:is(:hover, :focus-visible) {
	background: transparent;
	color: var(--wp--preset--color--outremer);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--outremer);
}

/* Mobile : panneau qui monte du bas, pleine largeur, coins du haut arrondis, défile en entier. */
@media (max-width: 1023px), (min-width: 1024px) and (pointer: coarse) and (max-height: 819px) {
	.up-pop {
		padding: 0;
	}

	.up-pop[open] {
		align-items: flex-end;
	}

	.up-pop-boite {
		grid-template-columns: minmax(0, 1fr);
		width: 100%;
		height: auto;
		max-height: 92svh;
		padding-top: 3.5rem;
		border-radius: var(--wp--custom--rayon--card) var(--wp--custom--rayon--card) 0 0;
		overflow-y: auto;
	}

	.up-pop-media > * {
		aspect-ratio: 4 / 5;
	}

	.up-pop-txt {
		padding-top: var(--wp--custom--pad);
		overflow: visible;
	}
}

/* ------------------------------------------------------------------ */
/* Popup vidéo (maquette vd-ov)                                       */
/* ------------------------------------------------------------------ */

/* Plein écran Marine : le voile devient opaque, la « fenêtre » n'a plus de fond. */
.up-pop:has(.up-pop--video)::backdrop {
	background: var(--wp--preset--color--marine);
}

/* Même cadre que la fiche projet (largeur et hauteur), pour que la croix soit au même endroit. */
.up-pop-boite.up-pop--video {
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(77.5rem, 100%);
	height: min(100%, 46rem);
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--blanc);
	overflow: visible;
}

.up-pop--video .up-pop-fermer {
	color: var(--wp--preset--color--blanc);
}

.up-pop--video .up-pop-fermer:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--cyan);
}

/* Largeur : la vidéo 16:9 et ses infos tiennent dans la hauteur de la fenêtre (230 px pour le reste). */
.up-pop-video {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	/* La vidéo 16:9 et ses infos tiennent dans le cadre (230 px réservés aux infos et à la croix). */
	width: min(75rem, calc((min(100svh - 2 * var(--wp--custom--marge), 46rem) - 14.375rem) * 16 / 9), 100%);
}

.up-pop-lecteur {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--wp--custom--rayon--card);
	background: var(--wp--preset--gradient--duo);
	overflow: hidden;
}

.up-pop-lecteur iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.up-pop-lire {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--blanc);
	cursor: pointer;
}

.up-pop-lire:disabled {
	cursor: default;
}

.up-pop-lire-ic {
	width: var(--wp--custom--video--lecture);
	height: var(--wp--custom--video--lecture);
	transition: scale 0.35s var(--wp--custom--transition--douce);
}

.up-pop-lire:not(:disabled):is(:hover, :focus-visible) .up-pop-lire-ic {
	scale: 1.08;
}

.up-pop-lire:focus-visible {
	outline: 2px solid var(--wp--preset--color--cyan);
	outline-offset: -6px;
}

.up-pop-lire-txt {
	font-size: var(--wp--preset--font-size--legende);
}

.up-pop-meta {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
}

.up-pop-meta > div:first-child {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}

.up-pop--video .up-pop-sur {
	color: var(--wp--preset--color--cyan);
}

.up-pop--video .up-pop-titre {
	font-size: var(--wp--preset--font-size--titre-card);
	color: var(--wp--preset--color--blanc);
}

.up-pop-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.875rem;
}

.up-pop--video .up-pop-nav {
	padding: 0;
}

.up-pop--video .up-pop-fleche {
	color: var(--wp--preset--color--blanc);
}

.up-pop--video .up-pop-fleche:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--cyan);
}

.up-pop--video .up-pop-cta.wp-block-buttons {
	flex: none;
	gap: 0.875rem;
	margin: 0;
}

@media (max-width: 1023px), (min-width: 1024px) and (pointer: coarse) and (max-height: 819px) {
	.up-pop:has(.up-pop--video)[open] {
		align-items: center;
		padding: var(--wp--custom--marge);
	}

	.up-pop-boite.up-pop--video {
		height: auto;
		max-height: 100%;
		padding-top: 3.5rem;
		border-radius: 0;
		overflow-y: auto;
	}

	.up-pop-video {
		width: 100%;
	}

	.up-pop-lecteur {
		border-radius: var(--wp--custom--rayon--interne);
	}

	.up-pop-meta,
	.up-pop-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.up-pop--video .up-pop-nav {
		justify-content: space-between;
	}

	.up-pop--video .up-pop-cta.wp-block-buttons {
		flex-direction: column;
	}

	.up-pop--video .up-pop-cta .wp-block-button,
	.up-pop--video .up-pop-cta .wp-block-button__link {
		width: 100%;
	}
}

/* ------------------------------------------------------------------ */
/* Popup étude de cas (maquette cs-box et cx-grid, classes cx-)       */
/* ------------------------------------------------------------------ */

/*
 * Fond Marine plein. La fenêtre a la même hauteur que les popups classiques (min(100 %, 46 rem),
 * posée au centre, tous les coins arrondis) : demande de Damien du 10/11/2026.
 */
.up-pop:has(.up-pop--etude)::backdrop {
	background: var(--wp--preset--color--marine);
}

.up-pop-boite.up-pop--etude {
	display: flex;
	flex-direction: column;
}

/* Barre fixe : « Étude de cas », client, flèches entre études, fermer. */
.cx-bar {
	display: flex;
	flex: none;
	align-items: center;
	gap: 0.875rem;
	padding: 0.875rem 1.125rem 0.875rem var(--wp--custom--pad);
}

.cx-bar-k,
.cx-lab,
.cx-k {
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--etiquette);
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ardoise);
}

.cx-bar b {
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--titre-etape);
	color: var(--wp--preset--color--marine);
}

.cx-bar-r {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin-left: auto;
}

.up-pop--etude .up-pop-fermer {
	position: static;
}

/* Flèches entre études : même taille d'icône et même zone de clic que la croix (demande de Damien du 12/11/2026). */
.cx-bar-r .up-pop-fleche {
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--menu-mobile--cible);
	height: var(--wp--custom--menu-mobile--cible);
}

.cx-bar-r .up-pop-fleche svg {
	width: var(--wp--custom--icone--fermer);
	height: var(--wp--custom--icone--fermer);
}

/* Le panneau défile en interne, la barre reste. */
.cx-defile {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--brume) transparent;
}

.cx-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--wp--custom--gap);
	padding: var(--wp--custom--pad);
}

.cx-grid > * {
	min-width: 0;
	margin: 0;
}

.cx-case,
.cx-intro,
.cx-fiche,
.cx-palette,
.cx-demarche,
.cx-missions,
.cx-carte {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--gap);
	min-height: 0;
	padding: var(--wp--custom--pad);
	border-radius: var(--wp--custom--rayon--card);
}

/*
 * Haut : diaporama pleine largeur, 20 % moins haut que le 16:9 d'origine (20:9, demande de Damien du
 * 10/11/2026), client calé en bas à gauche. Le visuel remplit tout le hero, quel que soit son format.
 * Voile Marine très léger, seulement au coin du texte (preset « voile-etude ») : l'image reste vue avant tout.
 */
.cx-top {
	position: relative;
	display: grid;
	grid-column: 1 / -1;
	border-radius: var(--wp--custom--rayon--card);
	overflow: hidden;
}

.cx-top > * {
	grid-area: 1 / 1;
}

.cx-top .up-diaporama {
	aspect-ratio: 20 / 9;
	border-radius: var(--wp--custom--rayon--card);
}

.cx-top::after {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: 2;
	background: var(--wp--preset--gradient--voile-etude);
	pointer-events: none;
}

/* Quel que soit son format, le visuel remplit tout le hero. */
.cx-top .up-dia-img {
	object-fit: cover;
}

.cx-top .up-dia-points {
	right: var(--wp--custom--pad);
	left: auto;
}

.cx-intro {
	z-index: 3;
	align-self: end;
	justify-content: flex-end;
	width: 35%;
	color: var(--wp--preset--color--blanc);
	pointer-events: none;
}

.cx-intro > * {
	margin: 0;
}

.cx-top .cx-k {
	color: var(--wp--preset--color--cyan);
}

.cx-h {
	font-size: var(--wp--preset--font-size--titre-page);
	line-height: 1.02;
	color: var(--wp--preset--color--blanc);
}

.cx-p {
	font-size: var(--wp--preset--font-size--texte);
	line-height: 1.55;
	color: var(--wp--preset--color--fond);
}

/* Fiche en bandeau : cinq informations, filets Fond dessus et dessous. */
.cx-fiche {
	grid-column: 1 / -1;
	border-radius: 0;
	border-block: 1px solid var(--wp--preset--color--fond);
}

.cx-faits {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.875rem 0.75rem;
	margin: 0;
}

.cx-faits > div {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 0.75rem;
	align-items: center;
}

.cx-faits svg {
	grid-row: span 2;
	width: var(--wp--custom--icone--fermer);
	height: var(--wp--custom--icone--fermer);
	color: var(--wp--preset--color--bleu);
}

.cx-faits dt {
	font-size: var(--wp--preset--font-size--etiquette);
	color: var(--wp--preset--color--ardoise);
}

.cx-faits dd {
	margin: 0;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--texte);
	font-weight: 700;
	color: var(--wp--preset--color--marine);
}

/* Logos, symbole, typographies : les fichiers du client affichés tels quels, jamais recadrés. */
.cx-logos {
	display: grid;
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: var(--wp--custom--gap);
}

.cx-case {
	align-items: center;
	justify-content: center;
	text-align: center;
}

.cx-logo--clair {
	background: var(--wp--preset--color--fond);
}

.cx-symbole {
	aspect-ratio: 1 / 1;
	align-self: start;
	background: var(--wp--preset--color--marine);
	color: var(--wp--preset--color--fond);
}

.cx-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cx-vide {
	font-size: var(--wp--preset--font-size--legende);
	color: var(--wp--preset--color--ardoise);
}

.cx-symbole .cx-vide {
	color: var(--wp--preset--color--fond);
}

.cx-typo {
	flex-direction: row;
	justify-content: flex-start;
	gap: var(--wp--custom--pad);
	background: var(--wp--preset--color--blanc);
	box-shadow: var(--wp--preset--shadow--unique);
	text-align: left;
}

.cx-aa {
	flex: none;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--prix-fiche);
	font-weight: 700;
	line-height: 0.85;
	letter-spacing: -0.04em;
	color: var(--wp--preset--color--marine);
}

.cx-typo-noms {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}

.cx-typo-noms b {
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--titre-etape);
	color: var(--wp--preset--color--marine);
}

.cx-typo-noms em {
	font-size: var(--wp--preset--font-size--legende);
	font-style: normal;
	color: var(--wp--preset--color--ardoise);
}

.cx-alpha {
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--texte-etape);
	font-weight: 500;
	line-height: 1.45;
	word-break: break-all;
}

/* Palette : 5 pastilles rondes, sans titre ni code (maquette). */
.cx-palette {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	align-items: center;
	justify-items: center;
}

/*
 * Pastille : un seul calque (fond rond), pas de liseré en box-shadow par-dessus : deux calques sur
 * le même bord arrondi le rendaient crénelé (retour de Damien du 09/11/2026). Seules les couleurs
 * très claires reçoivent un contour, en vraie bordure dessinée avec le fond.
 */
.cx-pastille {
	display: block;
	box-sizing: border-box;
	width: 80%;
	max-width: 6rem;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background: var(--cx-c);
}

.cx-pastille--claire {
	border: 1px solid var(--wp--preset--color--brume);
}

/* La démarche : texte de la réalisation, sans fond, en colonnes. */
.cx-demarche {
	justify-content: flex-start;
	gap: 1.25rem;
}

.cx-cols {
	column-gap: var(--wp--custom--pad);
	font-size: var(--wp--preset--font-size--texte-lecture);
	line-height: 1.65;
}

.cx-cols > * {
	margin: 0 0 0.875rem;
	break-inside: avoid;
}

.cx-cols :is(h2, h3, h4) {
	font-size: var(--wp--preset--font-size--titre-bloc);
	color: var(--wp--preset--color--marine);
}

/* Missions : card Marine, étiquette et coches Cyan, texte blanc. */
.cx-missions {
	justify-content: space-between;
	background: var(--wp--preset--color--marine);
	color: var(--wp--preset--color--blanc);
}

.cx-missions .cx-lab {
	color: var(--wp--preset--color--cyan);
}

.cx-missions ul {
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cx-missions li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--titre-prestation);
	font-weight: 700;
}

.cx-missions li::before {
	content: "";
	flex: none;
	width: var(--wp--custom--icone--coche);
	height: var(--wp--custom--icone--coche);
	background: var(--wp--preset--color--cyan);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%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 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* « Étude suivante » (blanche) et CTA (Signature) : cards cliquables comme sur les autres pages. */
.cx-carte {
	top: 0;
	justify-content: flex-end;
	gap: 0.375rem;
	text-decoration: none;
	transition: top var(--wp--custom--carte--duree) var(--wp--custom--transition--douce);
}

.cx-carte::after {
	content: "";
	position: absolute;
	top: var(--wp--custom--pad);
	right: var(--wp--custom--pad);
	width: var(--wp--custom--carte--fleche);
	height: var(--wp--custom--carte--fleche);
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7'/%3E%3Cpath d='M8 7h9v9'/%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 24 24' fill='none' stroke='currentColor' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7'/%3E%3Cpath d='M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.2s;
}

.cx-carte:is(:hover, :focus-visible) {
	top: var(--wp--custom--carte--montee);
}

.cx-carte:is(:hover, :focus-visible)::after {
	transform: translate(2px, -2px);
}

.cx-carte:focus-visible {
	outline: 2px solid var(--wp--preset--color--outremer);
	outline-offset: 3px;
}

.cx-carte-titre {
	padding-right: calc(var(--wp--custom--carte--fleche) + 0.5rem);
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: var(--wp--preset--font-size--titre-bloc);
	font-weight: 700;
	line-height: 1.02;
}

.cx-carte-sous {
	font-size: var(--wp--preset--font-size--sous-texte);
	line-height: 1.45;
	color: var(--wp--preset--color--ardoise);
}

.cx-suivante {
	background: var(--wp--preset--color--blanc);
	box-shadow: var(--wp--preset--shadow--unique);
	color: var(--wp--preset--color--marine);
}

.cx-cta {
	background: var(--wp--preset--gradient--signature);
	color: var(--wp--preset--color--blanc);
}

@media (prefers-reduced-motion: reduce) {
	.cx-carte:is(:hover, :focus-visible) {
		top: 0;
	}
}

/* Desktop : la grille de la maquette, deux écrans au plus, rangées jamais sous 170 px. */
@media (min-width: 1024px) and (pointer: fine), (min-width: 1024px) and (min-height: 820px) {
	.cx-grid {
		grid-template-rows: auto auto;
		grid-auto-rows: minmax(10.625rem, auto);
	}

	.cx-fiche { grid-column: 1 / 13; grid-row: 2; }
	.cx-logos { grid-column: 1 / 6; grid-row: 3 / 5; }
	.cx-symbole { grid-column: 6 / 9; grid-row: 3; }
	.cx-typo { grid-column: 9 / 13; grid-row: 3; }
	.cx-palette { grid-column: 6 / 13; grid-row: 4; }
	.cx-demarche { grid-column: 1 / 10; grid-row: 5 / 9; }
	.cx-missions { grid-column: 10 / 13; grid-row: 5 / 7; }
	.cx-suivante { grid-column: 10 / 13; grid-row: 7; }
	.cx-cta { grid-column: 10 / 13; grid-row: 8; }

	.cx-cols {
		column-count: 3;
	}

	/* Le bloc typo ne fait pas grandir sa rangée : l'alphabet se coupe proprement. */
	.cx-typo {
		height: 0;
		min-height: 100%;
		overflow: hidden;
	}

	.cx-h {
		font-size: clamp(var(--wp--preset--font-size--titre-contact-mobile), min(3.06vw, 4.54svh), var(--wp--preset--font-size--titre-page));
	}
}

@media (min-width: 1024px) and (max-width: 1180px) and (pointer: fine), (min-width: 1024px) and (max-width: 1180px) and (min-height: 820px) {
	.cx-cols {
		column-count: 2;
	}
}

/*
 * Desktop : la fenêtre part du même haut que les autres popups (centrée à 46 rem), mais sa hauteur est celle
 * de tout son contenu : elle sort par le bas de l'écran et c'est la page entière qui défile (demande de Damien
 * du 12/11/2026). La barre (Étude de cas, flèches, fermer) reste collée en haut pendant le défilement.
 */
@media (min-width: 1024px) and (pointer: fine), (min-width: 1024px) and (min-height: 820px) {
	.up-pop:has(.up-pop--etude) {
		--up-pop-h: min(calc(100svh - 2 * var(--wp--custom--marge)), 46rem);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: var(--wp--preset--color--brume) transparent;
	}

	.up-pop:has(.up-pop--etude)[open] {
		align-items: flex-start;
		padding-top: calc((100svh - var(--up-pop-h)) / 2);
		padding-bottom: var(--wp--custom--marge);
	}

	.up-pop-boite.up-pop--etude {
		height: auto;
		min-height: var(--up-pop-h);
		overflow: clip;
	}

	.up-pop--etude .cx-defile {
		flex: none;
		overflow: visible;
	}

	.up-pop--etude .cx-bar {
		position: sticky;
		/* Le défilement commence sous le padding de la popup : on remonte la barre jusqu'au bord de l'écran. */
		top: calc(-1 * (100svh - var(--up-pop-h)) / 2);
		z-index: 5;
		background: var(--wp--preset--color--blanc);
	}
}

/* Mobile : panneau plein écran, une colonne, client sous le diaporama sans voile. */
@media (max-width: 1023px), (min-width: 1024px) and (pointer: coarse) and (max-height: 819px) {
	.up-pop:has(.up-pop--etude)[open] {
		padding: 0;
	}

	.up-pop-boite.up-pop--etude {
		height: 100%;
		max-height: none;
		padding-top: 0;
		border-radius: 0;
		overflow: hidden;
	}

	.cx-bar {
		padding: 0.625rem 0.5rem 0.625rem 1rem;
	}

	.cx-bar b {
		display: none;
	}

	.cx-grid {
		grid-template-columns: minmax(0, 1fr);
		padding: 1rem;
	}

	.cx-grid > * {
		grid-column: 1 / -1;
	}

	.cx-top {
		overflow: visible;
	}

	.cx-top > * {
		grid-area: auto;
	}

	.cx-top::after {
		content: none;
	}

	.cx-top .up-diaporama {
		aspect-ratio: 4 / 3;
	}

	.cx-intro {
		width: auto;
		padding-inline: 0;
		color: var(--wp--preset--color--texte);
	}

	.cx-top .cx-k {
		color: var(--wp--preset--color--outremer);
	}

	.cx-h {
		color: var(--wp--preset--color--marine);
	}

	.cx-p {
		color: var(--wp--preset--color--ardoise);
	}

	.cx-faits {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cx-logos {
		grid-template-rows: none;
	}

	.cx-logo {
		aspect-ratio: 4 / 3;
	}

	.cx-typo {
		flex-direction: column;
		align-items: flex-start;
	}

	.cx-carte {
		min-height: calc((100vw - 2rem) / 2);
	}
}
