/*
 * Page d'accueil (templates/front-page.html).
 */

/* ---------- Accroche ---------- */
.deft-home-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
	gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
	align-items: end;
}

.deft-home-hero-text {
	container-type: inline-size;
	display: grid;
	gap: var(--wp--preset--spacing--40);
	align-content: end;
}

.deft-home-hero-text > * {
	margin: 0;
}

/*
 * Taille calée sur la largeur de la colonne (cqi) : le mot le plus long
 * tient toujours sur une ligne. Si le titre change, revoir le coefficient :
 * environ 95 / (largeur du mot le plus long en em).
 */
.deft-home-title.deft-home-title {
	font-size: clamp(2rem, 17cqi, 6rem);
	overflow-wrap: break-word;
	font-weight: 700;
	line-height: 0.98;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.deft-mark {
	color: var(--wp--preset--color--accent);
	font-weight: 800;
}

.deft-lead {
	font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
	line-height: 1.45;
	max-width: 40ch;
}

.deft-home-hero-media,
.deft-home-hero-media .wp-block-post-template,
.deft-home-hero-media .wp-block-post {
	margin: 0;
	padding: 0;
	list-style: none;
}

.deft-home-hero-media .wp-block-post-featured-image {
	margin: 0;
}

.deft-home-hero-media .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	object-fit: cover;
	border-radius: 2px;
}

.deft-home-hero-caption {
	margin-top: 0.6rem;
	gap: 1rem;
}

.deft-home-hero-caption .wp-block-post-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.deft-home-hero-caption .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--muted);
}

.deft-home-hero-caption .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent);
}

/* ---------- Rubriques ---------- */
.deft-rubriques ul {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--wp--preset--color--border);
}

.deft-rubriques li {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.deft-rubriques li + li {
	border-left: 1px solid var(--wp--preset--color--border);
}

.deft-rubriques a {
	display: grid;
	gap: 4px;
	padding: 20px 16px;
	text-decoration: none;
	color: var(--wp--preset--color--foreground);
}

.deft-rubriques li:first-child a {
	padding-left: 0;
}

.deft-rubrique-name {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 1.0625rem;
	line-height: 1.1;
}

.deft-rubrique-count {
	font-size: var(--wp--preset--font-size--meta);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	font-variant-numeric: tabular-nums;
}

.deft-rubriques a:is(:hover, :focus-visible) .deft-rubrique-name {
	color: var(--wp--preset--color--accent);
}

/* ---------- Récemment ---------- */
.deft-section-head {
	margin-bottom: var(--wp--preset--spacing--40);
}

.deft-section-head h2 {
	margin: 0;
}

/* ---------- Bandeau Deft ---------- */
.deft-home-deft {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
	align-items: start;
	margin-top: var(--wp--preset--spacing--60);
	border-top: 1px solid var(--wp--preset--color--border);
}

.deft-home-deft-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 800;
	line-height: 1;
}

.deft-home-deft .deft-lead {
	margin-top: 0;
	max-width: 46ch;
}

.deft-home-deft .deft-eyebrow a {
	text-decoration: none;
	color: var(--wp--preset--color--foreground);
	border-bottom: 2px solid var(--wp--preset--color--accent);
	padding-bottom: 2px;
}

/* ---------- Petits écrans ---------- */
@media (max-width: 900px) {
	.deft-rubriques ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.deft-rubriques li + li {
		border-left: 0;
	}

	.deft-rubriques li:nth-child(even) {
		border-left: 1px solid var(--wp--preset--color--border);
	}

	.deft-rubriques li:nth-child(odd) a {
		padding-left: 0;
	}

	/* 8 publications : 2 colonnes pleines plutôt que 3 avec un trou. */
	.deft-home-recent .deft-archive:not([data-view="registre"]) .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.deft-home-hero,
	.deft-home-deft {
		grid-template-columns: 1fr;
	}
}

/* Titre de l'accroche découpé en mots (patterns/home-hero.php) ; animation dans motion.css. */
.deft-home-title .deft-mot {
	display: inline-block;
}
