/*
 * Cartes thématiques — les cartes-liens de Kahel (Home Hero), en bloc autonome.
 * Chargée par Blocs Creator sur les seules pages qui portent le bloc.
 */

.kahel-cartes-section {
	padding-top: var(--wp--custom--editorial--section-padding-y);
	padding-bottom: var(--wp--custom--editorial--section-padding-y);
}

/* Juste sous le héros d'accueil, les cartes en sont la suite : même fond, pas de coupure. */
.kahel-home-hero + .kahel-cartes-section {
	margin-block-start: 0;
	padding-top: 0;
	padding-bottom: clamp(56px, 8vw, 110px);
}

.kahel-cartes-section .kahel-cartes-entete {
	margin-bottom: clamp(28px, 4vw, 48px);
}

.kahel-cartes-section .kahel-cartes-titre {
	max-width: 16ch;
	margin: 0;
}

/* Une grille, et le quinconce de Kahel sur les colonnes paires. */
.kahel-cartes-section .kahel-home-topics {
	display: grid;
	grid-template-columns: repeat(var(--kahel-colonnes, 4), minmax(0, 1fr));
	gap: var(--wp--custom--home--topic-gap);
	align-items: start;
}

.kahel-cartes-section.is-quinconce .kahel-home-topic-col:nth-child(even) {
	margin-top: var(--wp--custom--home--topic-stagger);
}

.kahel-cartes-section .kahel-home-topic {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--50);
	min-height: var(--wp--custom--home--topic-min-height);
	padding: var(--wp--custom--home--topic-padding);
	border: 1px solid rgba(36, 23, 15, 0.08);
	border-radius: var(--wp--custom--radius--default);
	box-shadow: var(--wp--preset--shadow--card);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.kahel-cartes-section .kahel-home-topic.has-cream-color {
	color: var(--wp--preset--color--cream);
}

.kahel-cartes-section a.kahel-home-topic:hover,
.kahel-cartes-section a.kahel-home-topic:focus-visible {
	text-decoration: none;
}

.kahel-cartes-section .kahel-home-topic-top {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	justify-content: space-between;
	width: 100%;
}

.kahel-cartes-section .kahel-home-topic-number {
	margin: 0;
	font-size: 0.78rem;
	font-weight: var(--wp--custom--weight--strong);
	letter-spacing: 0.12em;
}

.kahel-cartes-section .kahel-home-topic-icon {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin: 0;
	border: 2px solid currentColor;
	border-radius: 16px;
	font-size: 1.35rem;
	font-weight: var(--wp--custom--weight--strong);
	line-height: 1;
	transition: transform var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease);
}

.kahel-cartes-section .kahel-home-topic-icon .kahel-picto {
	width: 24px;
	height: 24px;
}

.kahel-cartes-section .kahel-home-topic:hover .kahel-home-topic-icon {
	transform: rotate(-8deg) scale(1.06);
}

/* Les accents de Kahel, carte par carte, d'après la couleur. */
.kahel-cartes-section .kahel-home-topic.is-ink .kahel-home-topic-number {
	color: var(--wp--preset--color--orange);
}

.kahel-cartes-section .kahel-home-topic.is-cream .kahel-home-topic-icon {
	border-color: var(--wp--preset--color--orange);
	background: var(--wp--preset--color--orange);
}

.kahel-cartes-section .kahel-home-topic.is-apricot .kahel-home-topic-icon {
	color: var(--wp--preset--color--orange-deep);
}

.kahel-cartes-section .kahel-home-topic-title {
	margin: 0 0 6px;
}

.kahel-cartes-section .kahel-home-topic-copy {
	max-width: 24ch;
	margin: 0;
}

/* La petite information de la carte : horaire, date, âge… en étiquette. */
.kahel-cartes-section .kahel-home-topic-info {
	display: inline-flex;
	align-items: center;
	margin: 14px 0 0;
	padding: 5px 11px;
	border-radius: 999px;
	background: color-mix(in srgb, currentColor 12%, transparent);
	font-size: 0.76rem;
	font-weight: var(--wp--custom--weight--strong);
	letter-spacing: 0.02em;
	line-height: 1.2;
}

@media (max-width: 900px) {
	.kahel-cartes-section .kahel-home-topics {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.kahel-cartes-section.is-quinconce .kahel-home-topic-col:nth-child(even) {
		margin-top: 28px;
	}
}

@media (max-width: 560px) {
	.kahel-cartes-section .kahel-home-topics {
		grid-template-columns: 1fr;
	}

	.kahel-cartes-section.is-quinconce .kahel-home-topic-col:nth-child(even) {
		margin-top: 0;
	}
}
