/*!
 * POC — Titres animés
 * Version: 1.1.0
 * Thème cible : Modins (Gavias).
 *
 * Règles tenues : racine confinée, aucun élément hors flux, min-width: 0
 * sur tous les descendants, aucune unité vw, aucune marge négative.
 */

/* =====================================================================
   1. VARIABLES
   ===================================================================== */
.poc-tt {
	--poc-tt-align: center;
	--poc-tt-max: 720px;
	--poc-tt-pad-x: 0px;

	--poc-tt-st-color: #7c0f0d;
	--poc-tt-st-bg: #fceae9;
	--poc-tt-st-bd: #f7cbca;
	--poc-tt-st-py: 8px;
	--poc-tt-st-px: 18px;
	--poc-tt-st-gap: 18px;

	--poc-tt-ti-color: #4e4e4c;
	--poc-tt-accent: #a21a18;
	--poc-tt-accent2: #f38c8b;
	--poc-tt-ti-gap: 16px;

	--poc-tt-sst-color: #76766f;
	--poc-tt-sst-max: 100%;

	--poc-tt-fi-color: #a21a18;
	--poc-tt-fi-larg: 96px;
	--poc-tt-fi-gap: 18px;

	--poc-tt-duree: 760ms;
	--poc-tt-stagger: 55ms;
	--poc-tt-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* =====================================================================
   2. GARDES — thème Modins
   `:where()` ne compte pas dans la spécificité : la garde pèse (0,1,0),
   assez pour battre le thème (0,0,1) sans écraser les composants.
   ===================================================================== */
.poc-tt,
.poc-tt * {
	box-sizing: border-box;
	min-width: 0;
}

.poc-tt [hidden] {
	display: none !important;
}

.poc-tt :where(h1, h2, h3, h4, h5, h6, p) {
	margin: 0;
	padding: 0;
	letter-spacing: normal;
}

/* Les textes saisis ne subissent aucune casse imposée par le thème. */
.poc-tt .poc-tt__surtitre,
.poc-tt .poc-tt__titre,
.poc-tt .poc-tt__soustitre {
	text-transform: none;
}

/* Modins : svg { height: auto } décale les icônes. */
.poc-tt svg {
	height: auto;
	vertical-align: middle;
}

/* =====================================================================
   3. STRUCTURE
   ===================================================================== */
.poc-tt {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: clip;
	padding-left: var(--poc-tt-pad-x);
	padding-right: var(--poc-tt-pad-x);
	text-align: var(--poc-tt-align);
}

.poc-tt__in {
	width: 100%;
	max-width: var(--poc-tt-max);
	/* Centré quand l'alignement l'est, collé au bord sinon. */
	margin-inline: auto;
}

.poc-tt[style*='--poc-tt-align'] .poc-tt__in {
	margin-inline: auto;
}

/* =====================================================================
   4. SUR-TITRE
   ===================================================================== */
.poc-tt .poc-tt__surtitre {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	margin-bottom: var(--poc-tt-st-gap);
	color: var(--poc-tt-st-color);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.08em;
	overflow-wrap: anywhere;
}

/* Style 1 — pastille arrondie */
.poc-tt--st-pastille .poc-tt__surtitre {
	padding: var(--poc-tt-st-py) var(--poc-tt-st-px);
	border: 1px solid var(--poc-tt-st-bd);
	border-radius: 999px;
	background: var(--poc-tt-st-bg);
}

/* Styles 2 et 3 — filets rouges */
.poc-tt .poc-tt__filet-st {
	display: inline-block;
	width: 26px;
	height: 2px;
	flex: 0 0 auto;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--poc-tt-accent2), var(--poc-tt-accent));
}

.poc-tt .poc-tt__filet-st--avant {
	margin-right: 12px !important;
}

.poc-tt .poc-tt__filet-st--apres {
	margin-left: 12px !important;
	background: linear-gradient(90deg, var(--poc-tt-accent), var(--poc-tt-accent2));
}

/* Le premier filet du style « encadré » est décoratif et masqué. */
.poc-tt--st-encadre .poc-tt__surtitre > .poc-tt__filet-st:first-child:not([class*='--']) {
	display: none;
}

/* Icône du sur-titre */
.poc-tt .poc-tt__st-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25em;
	height: 1.25em;
	flex: 0 0 auto;
	margin-right: 9px !important;
	font-size: 1.05em;
	color: var(--poc-tt-accent);
}

.poc-tt .poc-tt__st-ico i,
.poc-tt .poc-tt__st-ico i::before,
.poc-tt .poc-tt__st-ico svg {
	line-height: 1 !important;
	vertical-align: middle;
	display: block;
}

.poc-tt .poc-tt__st-ico svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.poc-tt .poc-tt__st-txt {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* =====================================================================
   5. TITRE
   ===================================================================== */
.poc-tt .poc-tt__titre {
	color: var(--poc-tt-ti-color);
	font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.9rem);
	line-height: 1.14;
	font-weight: 800;
	letter-spacing: -0.015em;
	margin-bottom: var(--poc-tt-ti-gap);
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.poc-tt .poc-tt__accent,
.poc-tt .poc-tt__mot--accent .poc-tt__mot-in {
	position: relative;
	color: var(--poc-tt-accent);
}

/*
 * Le trait sous les mots en valeur se dessine de gauche à droite une fois
 * le bloc entré dans l'écran. C'est le geste signature du plugin.
 */
.poc-tt--trait .poc-tt__accent::after,
.poc-tt--trait .poc-tt__mot--accent .poc-tt__mot-in::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -0.04em;
	height: 0.072em;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--poc-tt-accent2), var(--poc-tt-accent));
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 820ms var(--poc-tt-ease) 520ms;
}

.poc-tt.is-in.poc-tt--trait .poc-tt__accent::after,
.poc-tt.is-in.poc-tt--trait .poc-tt__mot--accent .poc-tt__mot-in::after {
	transform: scaleX(1);
}

/* Découpe mot à mot */
.poc-tt .poc-tt__mot {
	display: inline-block;
	overflow: hidden;
	vertical-align: bottom;
	padding-bottom: 0.14em;
	margin-bottom: -0.14em;
}

.poc-tt .poc-tt__mot-in {
	display: inline-block;
	will-change: transform, opacity;
}

/* =====================================================================
   6. SÉPARATEUR
   ===================================================================== */
.poc-tt .poc-tt__filet {
	display: block;
	width: var(--poc-tt-fi-larg);
	max-width: 100%;
	margin-top: 0;
	margin-bottom: var(--poc-tt-fi-gap);
	color: var(--poc-tt-fi-color);
}

/* L'alignement du séparateur suit celui du bloc. */
.poc-tt .poc-tt__filet {
	margin-inline: auto;
}

.poc-tt[style*='left'] .poc-tt__filet {
	margin-inline: 0 auto;
}

.poc-tt .poc-tt__filet--trait {
	height: 3px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--poc-tt-accent2), var(--poc-tt-fi-color), var(--poc-tt-accent2));
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 720ms var(--poc-tt-ease) 320ms;
}

.poc-tt.is-in .poc-tt__filet--trait {
	transform: scaleX(1);
}

/* Ligne de toit : deux pans et un faîtage, en clin d'œil au métier. */
.poc-tt .poc-tt__filet--toit svg {
	display: block;
	width: 100%;
	height: auto;
}

.poc-tt .poc-tt__filet--toit path {
	stroke-dasharray: 190;
	stroke-dashoffset: 190;
	transition: stroke-dashoffset 1000ms var(--poc-tt-ease) 300ms;
}

.poc-tt.is-in .poc-tt__filet--toit path {
	stroke-dashoffset: 0;
}

/* =====================================================================
   7. SOUS-TITRE
   ===================================================================== */
.poc-tt .poc-tt__soustitre {
	max-width: var(--poc-tt-sst-max);
	margin-inline: auto;
	color: var(--poc-tt-sst-color);
	font-size: clamp(0.98rem, 0.94rem + 0.2vw, 1.1rem);
	line-height: 1.68;
	overflow-wrap: anywhere;
	text-wrap: pretty;
}

.poc-tt[style*='left'] .poc-tt__soustitre {
	margin-inline: 0 auto;
}

/* =====================================================================
   8. ANIMATIONS
   Rien n'est masqué tant que le script n'a pas confirmé sa présence :
   sans JavaScript, le contenu reste parfaitement lisible.
   ===================================================================== */
.poc-tt.is-pret [data-reveal] {
	opacity: 0;
	transform: translate3d(0, 18px, 0);
	transition: opacity var(--poc-tt-duree) var(--poc-tt-ease),
		transform var(--poc-tt-duree) var(--poc-tt-ease);
}

.poc-tt.is-pret.is-in [data-reveal] {
	opacity: 1;
	transform: none;
}

.poc-tt.is-pret.is-in .poc-tt__titre[data-reveal] {
	transition-delay: 90ms;
}

.poc-tt.is-pret.is-in .poc-tt__filet[data-reveal] {
	transition-delay: 180ms;
}

.poc-tt.is-pret.is-in .poc-tt__soustitre[data-reveal] {
	transition-delay: 260ms;
}

/* --- Mot par mot --- */
.poc-tt--anim-mots.is-pret .poc-tt__titre[data-reveal] {
	opacity: 1;
	transform: none;
	transition: none;
}

.poc-tt--anim-mots.is-pret .poc-tt__mot-in {
	opacity: 0;
	transform: translate3d(0, 105%, 0);
	transition: transform var(--poc-tt-duree) var(--poc-tt-ease),
		opacity calc(var(--poc-tt-duree) * 0.6) linear;
	transition-delay: calc(var(--i, 0) * var(--poc-tt-stagger) + 120ms);
}

.poc-tt--anim-mots.is-pret.is-in .poc-tt__mot-in {
	opacity: 1;
	transform: none;
}

/* --- Révélation par masque --- */
.poc-tt--anim-masque.is-pret .poc-tt__titre[data-reveal] {
	opacity: 1;
	transform: none;
	transition: none;
	clip-path: inset(0 100% 0 0);
	transition: clip-path var(--poc-tt-duree) var(--poc-tt-ease) 120ms;
}

.poc-tt--anim-masque.is-pret.is-in .poc-tt__titre[data-reveal] {
	clip-path: inset(0 0 0 0);
}

/* --- Aucune animation --- */
.poc-tt--anim-aucune.is-pret [data-reveal],
.poc-tt--anim-aucune.is-pret .poc-tt__mot-in {
	opacity: 1;
	transform: none;
	transition: none;
	clip-path: none;
}

/* =====================================================================
   9. RESPONSIVE
   ===================================================================== */
@media (max-width: 767px) {
	.poc-tt {
		--poc-tt-pad-x: 12px;
		--poc-tt-st-gap: 14px;
		--poc-tt-ti-gap: 14px;
	}

	.poc-tt .poc-tt__surtitre {
		font-size: 12px;
		letter-spacing: 0.06em;
	}

	.poc-tt .poc-tt__titre {
		line-height: 1.2;
	}

	/* Les filets latéraux mangent la place sur petit écran. */
	.poc-tt--st-encadre .poc-tt__filet-st {
		width: 16px;
	}
}

@media (max-width: 400px) {
	.poc-tt--st-encadre .poc-tt__filet-st--apres {
		display: none;
	}
}

/* =====================================================================
   11. DESIGNS DE BLOC (v1.1.0)
   Huit habillages de la racine. Tout reste confiné : le seul élément
   positionné (filigrane du design Chapitre) est enfermé par un
   overflow: hidden posé sur la racine du design concerné.
   ===================================================================== */

/* --- 02 Perle : bandeau teinté --- */
.poc-tt--dz-perle {
	background: var(--poc-tt-dz-bg, #fbf3f3);
	border-radius: 18px;
	padding: 34px 28px;
}

/* --- 03 Ardoise : bloc gris, texte blanc --- */
.poc-tt--dz-ardoise {
	--poc-tt-ti-color: #ffffff;
	--poc-tt-sst-color: #e6c1c0;
	--poc-tt-accent: #f38c8b;
	--poc-tt-st-color: #f38c8b;
	--poc-tt-st-bg: rgba(255, 255, 255, 0.08);
	--poc-tt-st-bd: rgba(255, 255, 255, 0.18);
	--poc-tt-fi-color: #f38c8b;

	background: var(--poc-tt-dz-bg, #4e4e4c);
	border-radius: 18px;
	padding: 40px 30px;
}

/* --- 04 Contour rouge --- */
.poc-tt--dz-contour {
	background: var(--poc-tt-dz-bg, #ffffff);
	border: 1px solid var(--poc-tt-dz-bd, #f7cbca);
	border-radius: 18px;
	padding: 34px 28px;
}

/* --- 05 Liseré : barre rouge à gauche, texte calé à gauche --- */
.poc-tt--dz-lisere {
	--poc-tt-align: left;

	border-left: 4px solid var(--poc-tt-dz-bd, #a21a18);
	padding: 12px 0 12px 26px;
}

.poc-tt--dz-lisere .poc-tt__in {
	margin-left: 0;
}

/* --- 06 Éclat : l'accent est surligné au marqueur --- */
.poc-tt--dz-eclat .poc-tt__accent,
.poc-tt--dz-eclat .poc-tt__mot--accent .poc-tt__mot-in {
	color: var(--poc-tt-ti-color);
	background-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 56%, rgba(243, 140, 139, 0.55) 56%);
	background-repeat: no-repeat;
	border-radius: 4px;
	padding: 0 0.08em;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

/* --- 07 Chapitre : grand numéro en filigrane --- */
.poc-tt--dz-chapitre {
	position: relative;
	overflow: hidden;
	padding: 30px 24px 6px;
}

.poc-tt__chapitre {
	position: absolute;
	top: 0;
	right: 8px;
	font-family: inherit;
	font-size: 116px;
	font-weight: 800;
	line-height: 0.9;
	letter-spacing: -0.02em;
	color: var(--poc-tt-dz-num, #f6e1e1);
	pointer-events: none;
	user-select: none;
	z-index: 0;
}

.poc-tt--dz-chapitre .poc-tt__surtitre,
.poc-tt--dz-chapitre .poc-tt__titre,
.poc-tt--dz-chapitre .poc-tt__soustitre,
.poc-tt--dz-chapitre .poc-tt__filet {
	position: relative;
	z-index: 1;
}

/* --- 08 Médaillon : icône ronde en tête --- */
.poc-tt__med {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 18px;
	border-radius: 50%;
	background: var(--poc-tt-dz-bg, #fceae9);
	border: 1px solid var(--poc-tt-dz-bd, #f7cbca);
	color: var(--poc-tt-accent);
	font-size: 26px;
}

.poc-tt--dz-ardoise .poc-tt__med {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.18);
}

/* --- Petits écrans --- */
@media (max-width: 767px) {
	.poc-tt--dz-perle,
	.poc-tt--dz-contour {
		padding: 26px 18px;
		border-radius: 14px;
	}

	.poc-tt--dz-ardoise {
		padding: 30px 20px;
		border-radius: 14px;
	}

	.poc-tt--dz-lisere {
		padding-left: 18px;
	}

	.poc-tt__chapitre {
		font-size: 76px;
		right: 4px;
	}

	.poc-tt__med {
		width: 54px;
		height: 54px;
		font-size: 22px;
	}
}

/* =====================================================================
   10. ACCESSIBILITÉ
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
	.poc-tt *,
	.poc-tt *::before,
	.poc-tt *::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}

	.poc-tt.is-pret [data-reveal],
	.poc-tt.is-pret .poc-tt__mot-in {
		opacity: 1 !important;
		transform: none !important;
		clip-path: none !important;
	}

	.poc-tt .poc-tt__filet--toit path {
		stroke-dashoffset: 0;
	}

	.poc-tt .poc-tt__filet--trait {
		transform: scaleX(1);
	}
}
