/*
 * Page d'accueil (chargée uniquement sur la page d'accueil).
 * Composition éditoriale : asymétries, photos qui débordent du conteneur, tailles variables,
 * et la signature graphique « fil » (courbes fines reliant des points) en fil rouge discret.
 * Sous 1024px, les compositions se simplifient : pas de superposition, pas de texte sur photo
 * sans voile.
 */

/* Les photos qui débordent jusqu'au bord de la fenêtre (100vw inclut la barre de défilement)
   ne doivent jamais créer de défilement horizontal. `clip` ne casse pas le header sticky. */
body.home {
	overflow-x: clip;
}

:root {
	--home-space: var(--section-space);
	--text-statement: clamp(2.125rem, 1.25rem + 3.9vw, 4.25rem); /* 34 → 68 : phrase-manifeste */
	--text-date-day: clamp(5rem, 2.9rem + 9.3vw, 9.5rem);        /* 80 → 152 : date de la plénière */
}

/* Signature graphique (template-parts/home/signature.php) */
.signature {
	position: absolute;
	z-index: 0;
	pointer-events: none;
	color: var(--color-gold-500);
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.home-hero {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--color-bg);
}

.home-hero__media {
	order: -1; /* mobile : photo d'abord */
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.home-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 60% 30%;
}

.home-hero__text {
	position: relative;
	z-index: 2;
	display: grid;
	gap: var(--space-4);
	padding-block: var(--space-6) var(--space-7);
}

.home-hero__title {
	max-width: 15ch;
	font-size: var(--text-h1);
	line-height: 1.06;
	letter-spacing: -0.02em;
}

.home-hero__lead {
	max-width: 40ch;
}

.home-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin: var(--space-3) 0 0;
}

.home-hero__signature {
	display: none;
}

/* Mobile : le propos d'abord (surtitre, titre, chapô, boutons), la photographie ensuite. */
@media (max-width: 47.9375em) {
	.home-hero__media {
		order: 0;
	}

	.home-hero__text {
		padding-block: var(--space-6);
	}
}

@media (min-width: 64em) {
	.home-hero {
		display: block;
	}

	.home-hero__container {
		display: flex;
		align-items: center;
		min-height: clamp(34rem, 42vw, 40rem);
	}

	/* Le texte s'arrête avant la photographie (qui commence à 43 % de la largeur). */
	.home-hero__text {
		max-width: min(34rem, 38vw);
		padding-block: var(--space-8) var(--space-9);
	}

	/* La photographie occupe ~57 % à droite, déborde jusqu'au bord de la fenêtre
	   et glisse légèrement sous le titre (bord gauche adouci). */
	.home-hero__media {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 1;
		width: 57%;
		aspect-ratio: auto;
		border-bottom-left-radius: var(--radius-lg);
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%);
		mask-image: linear-gradient(90deg, transparent 0, #000 9%);
	}

	/* Le fil passe au premier plan, à cheval sur le texte et la photographie. */
	.home-hero__signature {
		top: 1.5rem;
		left: calc(43% - 2rem);
		z-index: 2;
		display: block;
		width: 24rem;
		color: var(--color-gold-500);
	}

	.home-hero--no-media .home-hero__signature {
		left: auto;
		right: var(--gutter);
	}
}

/* ------------------------------------------------------------------ */
/* Manifeste                                                           */
/* ------------------------------------------------------------------ */

.home-manifesto {
	position: relative;
	padding-block: var(--home-space);
	background: var(--color-bg-soft);
}

.home-manifesto__body > p:first-child {
	max-width: none;
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-serif);
	font-size: var(--text-statement);
	font-optical-sizing: auto;
	font-weight: 500;
	line-height: 1.04;
	letter-spacing: -0.025em;
	text-wrap: balance;
}

.home-manifesto__body > :not(:first-child, ul) {
	max-width: 60ch;
	margin-top: var(--space-5);
	color: var(--color-text-muted);
	font-size: var(--text-lead);
}

/* Les piliers : de grands mots, suspendus au fil par des attaches de longueurs inégales.
   La signature (points reliés) structure la composition. */
.home-manifesto__body > ul {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-6) var(--space-5);
	margin: var(--space-7) 0 0;
	padding: 0;
	list-style: none;
}

.home-manifesto__body > ul > li {
	position: relative;
	color: var(--color-text-muted);
	font-size: var(--text-small);
	line-height: 1.5;
}

.home-manifesto__body > ul > li strong {
	display: block;
	margin-bottom: var(--space-2);
	color: var(--color-heading);
	font-family: var(--font-serif);
	font-size: var(--text-h3);
	font-optical-sizing: auto;
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.02em;
}

@media (min-width: 64em) {
	.home-manifesto__body > ul {
		--tether: 0rem;

		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--space-6);
		margin-top: var(--space-8);
	}

	/* Le fil */
	.home-manifesto__body > ul::before {
		content: "";
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
		height: 1px;
		background: linear-gradient(90deg, var(--color-gold-500) 0 75%, rgb(214 164 65 / 0.2) 100%);
	}

	.home-manifesto__body > ul > li {
		max-width: 17rem;
		padding-top: calc(var(--space-6) + var(--tether));
		font-size: var(--text-ui);
	}

	.home-manifesto__body > ul > li:nth-child(2) { --tether: 4.5rem; }
	.home-manifesto__body > ul > li:nth-child(3) { --tether: 1.5rem; }
	.home-manifesto__body > ul > li:nth-child(4) { --tether: 6rem; }

	/* Le point sur le fil */
	.home-manifesto__body > ul > li::before {
		content: "";
		position: absolute;
		top: -4px;
		left: 0;
		width: 9px;
		height: 9px;
		border-radius: 50%;
		background: var(--color-gold-500);
		box-shadow: 0 0 0 5px var(--color-bg-soft), 0 0 0 6px rgb(214 164 65 / 0.5);
	}

	/* L'attache, du point jusqu'au mot */
	.home-manifesto__body > ul > li::after {
		content: "";
		position: absolute;
		top: 10px;
		left: 4px;
		width: 1px;
		height: calc(var(--space-6) + var(--tether) - 18px);
		background: rgb(214 164 65 / 0.55);
	}

	.home-manifesto__body > ul > li strong {
		font-size: var(--text-h2);
	}
}

/* ------------------------------------------------------------------ */
/* Plénière : le prochain temps fort                                   */
/* ------------------------------------------------------------------ */

.home-plenary {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--color-blue-900);
	color: var(--color-on-dark-muted);
}

.home-plenary__grid {
	position: relative;
	z-index: 1;
	display: grid;
	gap: var(--space-5);
	padding-block: 0 var(--space-8);
}

.home-plenary__media {
	order: -1;
	margin: 0 calc(-1 * var(--gutter));
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.home-plenary__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.home-plenary__date {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 var(--space-3);
	margin: var(--space-5) 0 0;
	color: var(--color-gold-500);
	font-family: var(--font-serif);
	line-height: 0.9;
}

.home-plenary__day {
	font-size: var(--text-date-day);
	font-weight: var(--weight-display);
	letter-spacing: -0.04em;
}

.home-plenary__month {
	color: var(--color-white);
	font-size: var(--text-h2);
	font-weight: 400;
	text-transform: uppercase;
}

.home-plenary__year {
	color: var(--color-gold-100);
	font-family: var(--font-sans);
	font-size: var(--text-small);
	font-weight: var(--weight-semibold);
	letter-spacing: 0.3em;
}

.home-plenary__content {
	display: grid;
	gap: var(--space-4);
	max-width: 36rem;
}

.home-plenary .eyebrow {
	color: var(--color-gold-100);
}

.home-plenary__title {
	color: var(--color-white);
	font-size: var(--text-h2);
}

.home-plenary__lead {
	margin: 0;
	font-size: var(--text-lead);
	line-height: 1.55;
}

.home-plenary__facts {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3) var(--space-6);
	margin: var(--space-2) 0 0;
	padding: var(--space-4) 0 0;
	border-top: 1px solid rgb(250 248 242 / 0.18);
	color: var(--color-on-dark);
	list-style: none;
}

.home-plenary__facts li {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

.home-plenary__facts li span::first-letter {
	text-transform: uppercase;
}

.home-plenary__facts .icon {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	color: var(--color-gold-500);
}

.home-plenary__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin: var(--space-3) 0 0;
}

.home-plenary :focus-visible {
	outline-color: var(--color-focus-on-dark);
}

.home-plenary__signature {
	display: none;
}

@media (min-width: 64em) {
	.home-plenary {
		overflow: visible;
		margin-top: var(--space-9);
	}

	.home-plenary__grid {
		grid-template-columns: auto minmax(0, 1fr) minmax(0, 0.95fr);
		align-items: center;
		column-gap: var(--space-8);
		padding-block: var(--space-9);
	}

	/* La date, en colonne, est l'élément graphique du bloc. */
	.home-plenary__date {
		display: grid;
		align-self: start;
		justify-items: start;
		gap: var(--space-2);
		margin: 0;
	}

	/* La photo sort du bandeau par le haut et déborde jusqu'au bord droit. */
	.home-plenary__media {
		order: 0;
		align-self: stretch;
		margin: calc(-1 * var(--space-9) - var(--space-8)) calc(-1 * max(var(--gutter), (100vw - var(--width-container)) / 2)) 0 0;
		aspect-ratio: auto;
		border-radius: var(--radius-lg) 0 0 var(--radius-lg);
	}

	.home-plenary__signature {
		bottom: -2rem;
		left: -4rem;
		display: block;
		width: 26rem;
		opacity: 0.45;
	}
}

/* ------------------------------------------------------------------ */
/* Chantier prioritaire : Représentativité                             */
/* ------------------------------------------------------------------ */

.home-priority {
	position: relative;
	padding-block: var(--home-space) 0;
}

.home-priority__media {
	margin: 0;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.home-priority__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.home-priority__panel {
	position: relative;
	display: grid;
	gap: var(--space-4);
	padding-block: var(--space-6) 0;
}

/* Petit repère doré : la signature, en version ponctuelle */
.home-priority__panel::before {
	content: "";
	width: 3rem;
	height: 1px;
	background: var(--color-accent);
	box-shadow: 3rem 0 0 -0.5px rgb(214 164 65 / 0.35);
}

.home-priority__title {
	max-width: 18ch;
	font-size: var(--text-h2);
}

.home-priority__question {
	max-width: 32ch;
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-serif);
	font-size: var(--text-h4);
	font-style: italic;
	font-weight: 400;
	line-height: 1.4;
}

.home-priority .link-arrow {
	justify-self: start;
	margin-top: var(--space-2);
}

@media (min-width: 64em) {
	/* Grande image qui déborde à gauche, texte posé en décalé sur un panneau blanc. */
	.home-priority__media {
		width: 64%;
		aspect-ratio: auto;
		height: 32rem;
		border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
	}

	.home-priority__panel {
		width: 50%;
		margin: -16rem 0 0 auto;
		padding: var(--space-7) var(--space-7) var(--space-6);
		border-radius: var(--radius-lg);
		background: var(--color-bg);
	}

	.home-priority--no-media .home-priority__panel {
		width: auto;
		margin: 0;
		padding-inline: 0;
	}
}

/* ------------------------------------------------------------------ */
/* Baromètre                                                           */
/* ------------------------------------------------------------------ */

.home-barometer {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin-top: var(--home-space);
	padding-block: var(--home-space);
	background: var(--color-bg-alt);
}

/* Trame de points : la « voix » de chacun, très légère */
.home-barometer::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: radial-gradient(circle, rgb(18 49 90 / 0.14) 1px, transparent 1.6px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
	mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
}

.home-barometer__grid {
	position: relative;
	z-index: 1;
	display: grid;
	gap: var(--space-6);
}

.home-barometer__intro {
	display: grid;
	align-content: start;
	gap: var(--space-4);
}

.home-barometer__title {
	font-size: var(--text-h1);
	line-height: 1.05;
}

.home-barometer__text {
	max-width: 38ch;
	margin: 0;
	color: var(--color-text-muted);
	font-size: var(--text-lead);
	line-height: 1.55;
}

.home-barometer .link-arrow {
	justify-self: start;
}

.home-poll {
	display: grid;
	gap: var(--space-5);
}

.home-poll__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2) var(--space-4);
}

.home-poll__deadline {
	margin: 0;
	color: var(--color-text-muted);
	font-size: var(--text-small);
}

.home-poll__question {
	margin: 0;
	font-size: var(--text-h3);
	line-height: 1.2;
}

/* Aperçu des réponses, en lecture seule (le moteur de sondage viendra plus tard) :
   une liste éditoriale reliée par le fil, pas des contrôles de formulaire. */
.home-poll__choices {
	position: relative;
	display: grid;
	gap: var(--space-3);
	margin: 0;
	padding: 0 0 0 var(--space-6);
	list-style: none;
}

.home-poll__choices::before {
	content: "";
	position: absolute;
	top: 0.75rem;
	bottom: 0.75rem;
	left: 4px;
	width: 1px;
	background: rgb(214 164 65 / 0.6);
}

.home-poll__choices li {
	position: relative;
	color: var(--color-heading);
	font-family: var(--font-serif);
	font-size: var(--text-h4);
	font-weight: 400;
	line-height: 1.35;
}

.home-poll__choices li::before {
	content: "";
	position: absolute;
	top: 0.6em;
	left: calc(-1 * var(--space-6));
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--color-gold-500);
	box-shadow: 0 0 0 4px var(--color-bg-alt);
}

.home-poll__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3);
	padding-top: var(--space-2);
}

.home-poll--empty {
	align-content: center;
	color: var(--color-text-muted);
}

.home-barometer__signature {
	display: none;
}

@media (min-width: 64em) {
	.home-barometer__grid {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: start;
		column-gap: var(--space-8);
	}

	.home-poll {
		padding-left: var(--space-7);
		border-left: 1px solid var(--color-border-strong);
	}

	.home-barometer__signature {
		bottom: -4rem;
		left: -3rem;
		display: block;
		width: 22rem;
		opacity: 0.55;
		transform: rotate(180deg);
	}
}

/* ------------------------------------------------------------------ */
/* Actualités : une principale, deux secondaires                       */
/* ------------------------------------------------------------------ */

.home-news {
	padding-block: var(--home-space);
}

.home-news__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-3) var(--space-5);
	margin-bottom: var(--space-6);
}

.home-news__heading {
	font-size: var(--text-h2);
}

.home-news__grid {
	display: grid;
	gap: var(--space-6);
}

.home-news__item {
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
	align-items: start;
	gap: var(--space-4);
}

.home-news__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border-radius: var(--radius-sm);
	background: var(--color-bg-alt);
}

.home-news__media img,
.home-news__media .media-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms var(--ease-out);
}

.home-news__item:hover .home-news__media img {
	transform: scale(1.03);
}

.home-news__body {
	display: grid;
	align-content: start;
	gap: var(--space-2);
}

.home-news__body .meta {
	font-size: var(--text-xs);
}

.home-news__title {
	font-size: var(--text-card-title);
	line-height: 1.3;
}

.home-news__title a {
	color: inherit;
	text-decoration: none;
}

.home-news__title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

.home-news__excerpt {
	margin: 0;
	color: var(--color-text-muted);
}

.home-news__more {
	justify-self: start;
	font-size: var(--text-small);
}

.home-news__item--lead {
	grid-template-columns: 1fr;
}

.home-news__item--lead .home-news__media {
	aspect-ratio: 3 / 2;
	border-radius: var(--radius-md);
}

.home-news__item--lead .home-news__title {
	font-size: var(--text-h3);
	line-height: 1.2;
}

@media (min-width: 64em) {
	.home-news__grid {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		grid-template-rows: auto 1fr; /* les secondaires s'empilent en haut de la colonne */
		column-gap: var(--space-8);
		row-gap: 0;
	}

	.home-news__item--lead {
		grid-row: 1 / span 2;
	}

	.home-news__item:not(.home-news__item--lead) {
		grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
		align-self: start;
		padding-block: var(--space-5);
	}

	.home-news__item:not(.home-news__item--lead):nth-child(2) {
		padding-top: 0;
	}

	.home-news__item:not(.home-news__item--lead) + .home-news__item {
		border-top: 1px solid var(--color-border);
	}
}

/* ------------------------------------------------------------------ */
/* Appel final : rejoindre                                             */
/* ------------------------------------------------------------------ */

.home-join {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: var(--space-9);
	background: var(--color-blue-900);
	color: var(--color-on-dark-muted);
}

.home-join__media {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.home-join__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 35%;
}

.home-join__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgb(11 31 58 / 0.95) 0%, rgb(11 31 58 / 0.82) 42%, rgb(11 31 58 / 0.15) 80%, rgb(11 31 58 / 0) 100%);
}

@media (max-width: 47.9375em) {
	.home-join__media::after {
		background: rgb(11 31 58 / 0.86);
	}
}

.home-join__content {
	position: relative;
	z-index: 1;
	display: grid;
	gap: var(--space-4);
}

.home-join__content > * {
	max-width: 36rem;
	margin: 0;
}

.home-join__content > .home-join__title {
	max-width: 44rem;
}

.home-join__title {
	color: var(--color-white);
	font-size: var(--text-h1);
	line-height: 1.05;
}

.home-join__text {
	font-size: var(--text-lead);
	line-height: 1.55;
}

.home-join__content p:last-child {
	margin-top: var(--space-3);
}

.home-join :focus-visible {
	outline-color: var(--color-focus-on-dark);
}

.home-join__signature {
	bottom: -10rem;
	left: -7rem;
	z-index: -1;
	width: min(30rem, 70vw);
	opacity: 0.4;
}

.home-news__meta {
	margin: 0;
	color: var(--color-text-muted);
	font-size: var(--text-xs);
}

.home-news__meta a {
	color: inherit;
	text-decoration: none;
}

.home-news__meta a:hover {
	color: var(--color-link-hover);
	text-decoration: underline;
}

.home-news__item:not(.home-news__item--lead) .home-news__excerpt {
	font-size: var(--text-small);
	line-height: 1.5;
}
