/**
 * Hero « projet à la une » — page /nos-projets-soutenus/ (plugin WPDashboard).
 * Feuille COMMUNE aux deux mises en page ; les règles propres à chacune sont dans
 *   - helebor-hero--plein.css  (photo plein cadre, texte posé dessus)
 *   - helebor-hero--split.css  (panneau de couleur à gauche, photo à droite)
 * La mise en page est choisie dans Projets › Projet à la une (voir docs/HERO.md).
 *
 * Structure (pattern wp-dashboard/hero-projet-a-la-une) :
 *   .helebor-hero (Query Loop, 1 résultat)
 *     └ .helebor-hero__cover (Cover « image mise en avant »)
 *         ├ .helebor-hero__h1     H1 de la page (masqué visuellement, lu par les lecteurs d'écran)
 *         └ .helebor-hero__projet
 *             ├ .helebor-hero__meta   .helebor-hero__eyebrow · .helebor-hero__etat · .helebor-hero__categories · .helebor-hero__date
 *             ├ .helebor-hero__titre
 *             └ .helebor-hero__extrait (extrait + lien « Découvrir le projet »)
 *
 * Direction artistique : charte Helebor (Outline › Charte graphique). Polices et styles de texte :
 * ceux du site — classes globales Greenshift (Content-12-R, Content-16-R) posées dans le pattern
 * + presets de police du thème (--wp--preset--font-family--noto-serif / noto-sans).
 *
 * Le header est fixe et transparent (variante « fonce » = texte blanc) : le voile de l'image
 * assombrit le haut pour qu'il reste lisible. Les réglages de voile du Cover dans l'éditeur sont
 * volontairement remplacés par les dégradés des feuilles de mise en page.
 *
 * @package WPDashboard
 */

.helebor-hero {
	--hero-voile: 17, 31, 54;      /* Bleu 800 assombri (RGB) : voile de l'image */
	--hero-jaune: #fbbb48;         /* Jaune 800 */
	--hero-gutter: clamp(1.25rem, 5vw, 4rem);

	/*
	 * Réglages d'apparence : valeurs par défaut. Ils sont surchargés par un <style> inline
	 * généré par le plugin à partir de « Projets › Projet à la une »
	 * (voir FeaturedProjectHero::build_inline_css()).
	 */
	--hero-card-bg: #27456e;       /* panneau (mise en page « Panneau bleu ») */
	--hero-card-fg: #fff;
	--hero-card-excerpt: #fff;
	--hero-card-soft: rgba(255, 255, 255, 0.85);
	--hero-card-eyebrow: #fbbb48;
	--hero-btn-bg: #fff;
	--hero-btn-fg: #000;
	--hero-btn-hover-bg: #fbbb48;
	--hero-btn-hover-fg: #000;
	--hero-card-focus: #fff;
	--hero-voile-k: 1;             /* multiplicateur du voile : 0.75 léger · 1 normal · 1.3 fort */

	/* Polices : celles du thème (theme.json), identiques au reste du site. */
	--hero-font-serif: var(--wp--preset--font-family--noto-serif, "Noto Serif", serif);
	--hero-font-sans: var(--wp--preset--font-family--noto-sans, "Noto Sans", sans-serif);
	margin-block: 0;
}

/* Le Query Loop n'affiche qu'un projet : on neutralise la liste. */
.helebor-hero .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
}

.helebor-hero .wp-block-post-template > li {
	margin: 0;
	padding: 0;
}

/* ---------- Cover plein écran ---------- */
.helebor-hero .helebor-hero__cover {
	align-items: stretch; /* le conteneur interne occupe toute la hauteur */
}

.helebor-hero .helebor-hero__cover .wp-block-cover__background {
	opacity: 1; /* le voile est entièrement défini par les feuilles de mise en page */
}

.helebor-hero .helebor-hero__cover .wp-block-cover__inner-container {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	justify-content: flex-end; /* contenu en bas */
	color: #fff;
}

/* ---------- H1 de la page : masqué visuellement (SEO / lecteurs d'écran) ---------- */
.helebor-hero .helebor-hero__h1 {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Dans l'éditeur, le H1 reste visible (discret) pour pouvoir le modifier. */
.editor-styles-wrapper .helebor-hero .helebor-hero__h1 {
	position: static;
	width: auto;
	height: auto;
	margin: 0 0 1rem;
	padding: 0.25rem 0.5rem;
	overflow: visible;
	clip: auto;
	clip-path: none;
	white-space: normal;
	outline: 1px dashed rgba(255, 255, 255, 0.6);
	font-size: 0.875rem;
}

/* ---------- Projet (dynamique) ---------- */
.helebor-hero .helebor-hero__projet {
	box-sizing: border-box;
	font-family: var(--hero-font-sans);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.25rem;
}

/* Ligne d'infos : « Projet à la une » · état · catégories · date. */
.helebor-hero .helebor-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.375rem 0.875rem;
}

.helebor-hero .helebor-hero__eyebrow {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
}

/* État (etiquette_projet) : même badge que .showcase-badge de la liste des projets. */
.helebor-hero .helebor-hero__etat {
	margin: 0;
}

.helebor-hero .helebor-hero__etat a {
	display: inline-block;
	padding: 4px 10px;
	border: 1px solid rgba(124, 45, 18, 0.3);
	border-radius: 4px;
	background: #fcf2ed; /* Corail 100 */
	color: #7c2d12;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

/* Catégories (categorie_projet) et date : méta 13 px. */
.helebor-hero .helebor-hero__categories,
.helebor-hero .helebor-hero__date {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.6;
}

.helebor-hero .helebor-hero__categories a {
	color: inherit;
	text-decoration: none;
}

.helebor-hero .helebor-hero__categories a:hover,
.helebor-hero .helebor-hero__categories a:focus-visible {
	text-decoration: underline;
}

/* Titre du projet : Noto Serif léger (hérité du thème), serré comme les titres de la charte. */
.helebor-hero .helebor-hero__titre {
	margin: 0;
	font-family: var(--hero-font-serif);
	font-weight: 300;
	line-height: 1.1;
	letter-spacing: -0.03em;
}

.helebor-hero .helebor-hero__titre a {
	color: inherit;
	text-decoration: none;
}

.helebor-hero .helebor-hero__titre a:hover,
.helebor-hero .helebor-hero__titre a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Extrait + lien « Découvrir le projet » (more-link natif du bloc Extrait). */
.helebor-hero .helebor-hero__extrait {
	margin: 0;
	line-height: 1.5;
}

.helebor-hero .helebor-hero__extrait .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.helebor-hero .helebor-hero__extrait .wp-block-post-excerpt__more-text {
	margin: 1.5rem 0 0;
}

/* Bouton : angles de 10 px comme « Faire un don » (couleurs : feuilles de mise en page). */
.helebor-hero .helebor-hero__extrait .wp-block-post-excerpt__more-link {
	display: inline-block;
	padding: 0.9375rem 1.75rem;
	font-family: var(--hero-font-sans);
	border-radius: 10px;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
	.helebor-hero .helebor-hero__extrait .wp-block-post-excerpt__more-link {
		transition: none;
	}
}
