/* =========================================================================
   3Event — page Réalisations
   ⚠️ Pas de maquette Figma. Idée de Clémence transmise par Lisa le
   16/09/2026 : capture posée dans le fichier (nœud 493:375, sous le frame
   436:1251) — titre, flèche descendante, pastilles de filtres, grandes cartes
   photo à contour orange. Les valeurs ci-dessous viennent du design system du
   site (tokens de app.css), pas d'un relevé : il n'y a rien à relever.
   Chargé uniquement sur cette page (functions.php, tev_is_page_realisations).

   ⚠️ COUPLAGE ASSUMÉ : la bannière et l'introduction réutilisent les
   composants `.tev-anim-hero` / `.tev-anim-intro` de la page Animations
   (assets/css/animations.css), qui est donc chargée en dépendance. C'est la
   consigne de Lisa — réutiliser les sections existantes plutôt que de les
   recopier. Si ces classes sont un jour renommées, les deux pages suivent
   ensemble.
   ========================================================================= */

/* --- Grille --------------------------------------------------------------
   La section remonte SOUS la diagonale de la bande orange de l'introduction et
   porte le bord oblique complémentaire. Sans ça, le blanc du body apparaît en
   biseau entre les deux : la découpe de la bande laisse un vide que rien ne
   remplit (signalé par Lisa le 16/09/2026 — très visible ici, le fond suivant
   étant bleu franc alors qu'il est presque blanc sur la page Animations).
   Même traitement que `.tev-fiches` dans animations.css. */
.tev-reals {
	position: relative; background: var(--tev-blue); color: var(--tev-cream);
	margin-top: calc(var(--tev-slant) * -1);
	clip-path: polygon(0 var(--tev-slant), 100% 0, 100% 100%, 0 100%);
	padding-block: calc(clamp(64px, 7.5vw, 108px) + var(--tev-slant)) clamp(64px, 7.5vw, 108px);
	overflow: clip;
}
.tev-reals__inner { position: relative; z-index: 2; }

.tev-reals__head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 36px; }
.tev-reals__title { color: var(--tev-cream); }
/* La flèche descendante de la capture : le tracé des boutons, pivoté. */
.tev-reals__fleche { display: block; color: var(--tev-orange); }
.tev-reals__fleche svg { width: 26px; height: 23px; transform: rotate(90deg); }

.tev-reals__filtres { justify-content: center; row-gap: 12px; margin-bottom: clamp(40px, 4.4vw, 60px); }
/* Au repos toutes les pastilles sont identiques : la pastille pleine de la
   capture est l'état ACTIF, pas un état par défaut. */
.tev-reals__filtres .tev-pill {
	background: transparent; border-color: rgba(251, 251, 251, .55); color: var(--tev-cream);
	transition: background-color .3s var(--tev-ease), color .3s var(--tev-ease), border-color .3s var(--tev-ease);
}
.tev-reals__filtres .tev-pill:hover { border-color: var(--tev-cream); }
.tev-reals__filtres .tev-pill.is-active {
	background: var(--tev-orange); border-color: var(--tev-orange); color: var(--tev-cream);
}

.tev-reals__list {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(24px, 2.8vw, 40px);
}
.tev-real.is-collapsed { display: none; }

/* 🛑 La typographie incrustée sur la carte suit la largeur de la CARTE, pas
   celle du viewport. Mesuré le 16/09/2026 : à la bascule 2 → 1 colonne (768 px),
   la carte saute de 373 à 704 px au moment précis où le viewport rétrécit —
   un `clamp()` en `vw` fait donc l'inverse de ce qu'il faut, il donne sa plus
   petite valeur à la plus grande carte. Les unités `cqi` suivent la carte.
   Chaque propriété est déclarée D'ABORD en `vw` : un navigateur sans
   `container-type` ignore la ligne `cqi` et garde le repli. */
.tev-real { container-type: inline-size; }

/* --- Carte --------------------------------------------------------------- */
.tev-real__carte {
	position: relative; display: block; width: 100%; padding: 0; text-align: left;
	aspect-ratio: 620 / 430;
	border: 3px solid var(--tev-orange); border-radius: var(--tev-radius-img);
	border-width: clamp(2px, .55cqi, 3px);
	overflow: hidden; background: var(--tev-blue);
	transition: transform .35s var(--tev-ease), box-shadow .35s var(--tev-ease);
}
.tev-real__carte:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(15, 24, 55, .34); }

.tev-real__photo { position: absolute; inset: 0; display: block; }
.tev-real__photo img { width: 100%; height: 100%; object-fit: cover; }
.tev-real__carte:hover .tev-real__photo img { transform: scale(1.03); }
.tev-real__photo img { transition: transform .6s var(--tev-ease); }

/* Voile : le texte doit rester lisible quelle que soit la photo fournie par
   le client — sans lui, un visuel clair rend le titre blanc illisible. */
.tev-real__voile {
	position: absolute; inset: 0; display: block;
	background: linear-gradient(180deg, rgba(10, 16, 44, .10) 0%, rgba(10, 16, 44, .46) 52%, rgba(10, 16, 44, .78) 100%);
}

.tev-real__contenu {
	position: absolute; inset: auto 0 0; display: flex; flex-direction: column; align-items: center;
	text-align: center;
	gap: 8px; padding: 0 clamp(16px, 2vw, 28px) clamp(20px, 2.4vw, 32px);
	gap: clamp(5px, 1.4cqi, 9px); padding: 0 clamp(14px, 4cqi, 30px) clamp(16px, 4.4cqi, 32px);
}
.tev-real__nom {
	font-family: var(--tev-font-title); line-height: 1.12; color: var(--tev-white);
	font-size: clamp(20px, 2vw, 28px);
	font-size: clamp(18px, 4.6cqi, 28px);
}
.tev-real__sous {
	line-height: 1.3; color: rgba(255, 255, 255, .88);
	font-size: clamp(13px, 1.1vw, 15px);
	font-size: clamp(12px, 2.6cqi, 16px);
}
.tev-real__reperes {
	line-height: 1.3; letter-spacing: .02em; color: rgba(255, 255, 255, .72);
	font-size: clamp(11px, .9vw, 13px);
	font-size: clamp(10.5px, 2.1cqi, 13px);
	/* Trois repères plus un nom de commune longue tiennent rarement sur une
	   ligne dans une carte étroite ; l'équilibrage évite le mot orphelin. */
	text-wrap: balance;
}

.tev-real__cta {
	display: inline-flex; align-items: center; border-radius: var(--tev-radius);
	background: var(--tev-white); color: var(--tev-blue);
	font-weight: 700; text-transform: uppercase;
	transition: background-color .3s var(--tev-ease), color .3s var(--tev-ease);
	gap: 12px; margin-top: 10px; padding: 6px 6px 6px 20px; font-size: 14px; line-height: 17px;
	gap: clamp(8px, 2.2cqi, 14px); margin-top: clamp(6px, 1.8cqi, 12px);
	padding: clamp(5px, 1.2cqi, 7px) clamp(5px, 1.2cqi, 7px) clamp(5px, 1.2cqi, 7px) clamp(14px, 3.6cqi, 22px);
	font-size: clamp(11px, 2.4cqi, 14px); line-height: 1.2;
}
.tev-real__cta-rond {
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%; background: var(--tev-orange); color: var(--tev-white);
	transition: transform .3s var(--tev-ease); flex: 0 0 auto;
	width: 34px; height: 34px;
	width: clamp(26px, 6.4cqi, 36px); height: clamp(26px, 6.4cqi, 36px);
}
.tev-real__cta-rond svg { width: 62%; height: auto; }
.tev-real__carte:hover .tev-real__cta-rond { transform: translateX(3px); }

/* Une carte qui occupe toute la largeur (une seule colonne sur tablette) n'a
   pas besoin d'être aussi haute : à 704 px de large, le 620/430 donnait 528 px
   de hauteur pour 154 px de texte, soit une photo qui s'étire pour rien.
   Sous les 300 px de large, l'inverse : il faut de la hauteur pour que les
   quatre lignes de texte respirent au-dessus du bas de carte. */
@container (min-width: 620px) { .tev-real__carte { aspect-ratio: 620 / 360; } }
@container (max-width: 330px)  { .tev-real__carte { aspect-ratio: 5 / 4; } }

/* Logo du client : blanchi, comme sur la capture. */
.tev-real__logo {
	position: absolute; display: block;
	right: clamp(14px, 1.6vw, 22px); bottom: clamp(14px, 1.6vw, 22px); width: clamp(64px, 7vw, 104px);
	right: clamp(10px, 3cqi, 22px); bottom: clamp(10px, 3cqi, 22px); width: clamp(52px, 15cqi, 104px);
}
.tev-real__logo img { width: 100%; height: auto; filter: brightness(0) invert(1); opacity: .9; }

.tev-reals__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: clamp(40px, 4.4vw, 64px); }
.tev-reals__vide, .tev-reals__empty { text-align: center; color: rgba(251, 251, 251, .8); padding-block: 24px; }

/* --- Fiche détaillée (popup) ---------------------------------------------
   Même mécanique que la popup des fiches d'animation : rendue dans la page,
   démasquée par son ID. Le panneau est plus haut ici, le récit faisant
   plusieurs paragraphes. */
/* Même fondu que la popup des animations (Thomas, 22/09/2026). */
.tev-real-popup {
	position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px;
	opacity: 0; transition: opacity .28s var(--tev-ease);
}
.tev-real-popup.is-open { opacity: 1; }
.tev-real-popup__panel { transform: translateY(14px) scale(.985); transition: transform .34s var(--tev-ease); }
.tev-real-popup.is-open .tev-real-popup__panel { transform: none; }
.tev-real-popup[hidden] { display: none; }
.tev-real-popup__backdrop { position: absolute; inset: 0; background: rgba(15, 24, 55, .78); }
.tev-real-popup__panel {
	position: relative; width: min(1080px, 100%); max-height: 88vh; overflow-y: auto;
	background: var(--tev-cream); color: var(--tev-blue);
	border-radius: var(--tev-radius); padding: 56px clamp(28px, 3.6vw, 56px);
	box-shadow: 0 30px 80px rgba(10, 16, 44, .45);
}
.tev-real-popup__close {
	position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%;
	display: grid; place-items: center; background: rgba(59, 85, 199, .10); color: var(--tev-blue);
	transition: background-color .3s var(--tev-ease), color .3s var(--tev-ease);
}
.tev-real-popup__close:hover { background: var(--tev-orange); color: var(--tev-cream); }
.tev-real-popup__close svg { width: 12px; height: 12px; }

.tev-real-popup__tete { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 32px; }
.tev-real-popup__type { border-color: var(--tev-orange); color: var(--tev-orange); }
.tev-real-popup__title {
	font-family: var(--tev-font-title); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.12;
	text-transform: uppercase;
}
.tev-real-popup__reperes { font-size: 14px; line-height: 20px; color: var(--tev-grey); }
.tev-real-popup__accroche {
	font-family: var(--tev-font-title); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.32;
	color: var(--tev-orange); max-width: 46ch;
}

.tev-real-popup__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 3.2vw, 48px); align-items: start; }
.tev-real-popup__grid--seul { grid-template-columns: minmax(0, 1fr); max-width: 72ch; }
.tev-real-popup__recit p { font-size: 15px; line-height: 24px; color: var(--tev-grey); margin-bottom: 14px; }
.tev-real-popup__recit p:last-child { margin-bottom: 0; }
.tev-real-popup__bloc { margin-top: 28px; }
.tev-real-popup__label {
	font-family: var(--tev-font-title); font-size: 15px; line-height: 20px; text-transform: uppercase;
	margin-bottom: 10px;
}
.tev-real-popup__roles .tev-pill { background: transparent; border-color: rgba(59, 85, 199, .35); color: var(--tev-blue); }

.tev-real-popup__aside { position: sticky; top: 0; display: flex; flex-direction: column; gap: 20px; }
.tev-real-popup__photos { position: relative; border-radius: var(--tev-radius-img); overflow: hidden; aspect-ratio: 523 / 380; }
.tev-real-popup__photos-track { display: flex; height: 100%; transition: transform .45s var(--tev-ease); }
.tev-real-popup__photos-track img { width: 100%; height: 100%; object-fit: cover; flex: 0 0 100%; }
.tev-real-popup__photos-nav { position: absolute; bottom: 12px; right: 12px; display: flex; gap: 8px; }
.tev-real-popup__photos-nav .tev-arrow { width: 36px; height: 36px; }
.tev-real-popup__photos-nav svg { width: 14px; height: 12px; }

/* --- adaptations ---------------------------------------------------------- */
@media (max-width: 1024px) {
	.tev-real-popup__grid { grid-template-columns: 1fr; }
	/* ⚠️ Le panneau devient une colonne : un `position: sticky` y collerait la
	   colonne photo au haut du panneau pendant tout le défilement du récit. */
	.tev-real-popup__aside { position: static; }
	.tev-real-popup__panel { padding: 48px 28px; }
}

@media (max-width: 768px) {
	.tev-reals__list { grid-template-columns: 1fr; }
	/* ⚠️ Pas de `aspect-ratio` ici : la proportion de la carte dépend de la
	   LARGEUR DE LA CARTE, pas de celle de l'écran, et c'est le bloc
	   `@container` plus haut qui la décide. Une règle media posée après
	   l'écrasait — la carte gardait 528 px de haut à 768 px alors que le
	   conteneur demandait 409. */
	.tev-reals__filtres { justify-content: flex-start; }
	.tev-real-popup { padding: 12px; }
	.tev-real-popup__panel { padding: 40px 20px; max-height: 94vh; border-radius: 22px; }
	.tev-real-popup__close { top: 12px; right: 12px; }
	/* Le récit fait plus du double de la hauteur visible sur téléphone
	   (mesuré : 1 862 px pour 846 px à 360 px de large). Interligne et marges
	   resserrés pour raccourcir la course sans tasser la lecture. */
	.tev-real-popup__tete { margin-bottom: 24px; gap: 10px; }
	.tev-real-popup__recit p { font-size: 14.5px; line-height: 22px; margin-bottom: 12px; }
	.tev-real-popup__bloc { margin-top: 22px; }
	.tev-real-popup__roles .tev-pill { font-size: 11px; padding: 6px 10px; }
}

@media (max-width: 600px) {
	/* Mesuré le 16/09/2026 : à 360 px les cinq pastilles tenaient sur QUATRE
	   lignes — une barre de filtres plus haute que le titre qu'elle sert.
	   Resserrées, elles tiennent sur deux. */
	.tev-reals__filtres { gap: 7px; }
	.tev-reals__filtres .tev-pill { font-size: 11px; padding: 6px 11px; }
}

@media (max-width: 480px) {
	/* Le bouton et les repères se disputent la largeur sous le titre : les
	   repères passent au-dessus du bouton et le bouton reste entier. */
	.tev-real__cta { padding-left: 16px; font-size: 12px; gap: 10px; }
	.tev-real__cta-rond { width: 30px; height: 30px; }
	.tev-real__logo { width: 60px; }
}

@media (prefers-reduced-motion: reduce) {
	.tev-real__carte, .tev-real__photo img, .tev-real__cta-rond { transition: none; }
}

/* Blocage du défilement pendant l'ouverture de la fiche. La règle existe déjà
   dans animations.css (chargée en dépendance) : elle est reposée ici pour que
   la page ne dépende pas de l'ordre de chargement des deux feuilles. */
html.tev-no-scroll { overflow: hidden; }
