/*
 * Héros d'accueil — Kahel · Home Hero, avec image facultative.
 * Les cartes thématiques sont un bloc à part : blocs/cartes.css.
 * Chargée par Blocs Creator sur les seules pages qui portent le bloc.
 */

.kahel-home-hero {
	position: relative;
	padding-bottom: clamp(56px, 8vw, 110px);
	overflow: hidden;
	isolation: isolate;
	background:
		radial-gradient(circle at 82% 18%, rgba(244, 122, 31, 0.11), transparent 28%),
		linear-gradient(180deg, #fff9f3 0%, var(--wp--preset--color--base) 100%);
}

/* Le halo suit doucement le pointeur (assets/js/animations.js pose --kahel-mx/--kahel-my). */
.kahel-home-hero-glow {
	position: absolute;
	max-width: none;
	z-index: -1;
	width: min(70vw, 820px);
	aspect-ratio: 1;
	left: var(--kahel-mx, 82%);
	top: var(--kahel-my, 18%);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(244, 122, 31, 0.16) 0%, rgba(255, 208, 166, 0.12) 32%, transparent 64%);
	transform: translate(-50%, -50%);
	pointer-events: none;
	transition: left 1.2s var(--wp--custom--motion--ease), top 1.2s var(--wp--custom--motion--ease);
	animation: kahel-halo-respire 9s var(--wp--custom--motion--ease-soft) infinite alternate;
}

.kahel-home-hero .kahel-home-hero-inner {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--home--hero-inner-gap);
	padding-top: var(--wp--custom--home--hero-inner-padding-top);
}

.kahel-home-hero .kahel-home-hero-copy {
	max-width: var(--wp--custom--home--hero-copy-max);
}

.kahel-home-hero .kahel-home-title {
	max-width: 920px;
	margin: 0;
}

.kahel-home-hero .kahel-home-lead {
	max-width: var(--wp--custom--home--hero-lead-max);
	margin: var(--wp--custom--home--hero-lead-margin-top) 0 0;
}

/* Avec une image : le texte à gauche, l'image à droite. */
.kahel-home-hero.has-visuel .kahel-home-hero-inner {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: clamp(28px, 5vw, 72px);
	align-items: center;
}

.kahel-home-hero.has-visuel .kahel-hero-visuel {
	aspect-ratio: 4 / 5;
	max-height: 72vh;
	margin-inline-start: auto;
}

/* Une photo en paysage : les deux colonnes s'équilibrent, le cadre s'allonge. */
.kahel-home-hero.is-visuel-paysage .kahel-home-hero-inner {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.kahel-home-hero.is-visuel-paysage .kahel-hero-visuel {
	aspect-ratio: 3 / 2;
	max-height: none;
}

/* Suivi des cartes thématiques, le héros leur laisse la place. */
.kahel-home-hero:has(+ .kahel-cartes-section) {
	padding-bottom: clamp(28px, 4vw, 48px);
}

@keyframes kahel-halo-respire {
	from {
		scale: 1;
		opacity: 0.85;
	}

	to {
		scale: 1.12;
		opacity: 1;
	}
}

@media (max-width: 900px) {
	.kahel-home-hero.has-visuel .kahel-home-hero-inner {
		grid-template-columns: 1fr;
	}

	/* Le portrait garde sa forme, sans prendre plus que l'écran. */
	.kahel-home-hero.has-visuel .kahel-hero-visuel {
		max-height: 72svh;
	}

	.kahel-home-hero.is-visuel-paysage .kahel-hero-visuel {
		aspect-ratio: 3 / 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kahel-home-hero-glow {
		animation: none;
		transition: none;
	}
}
