/**
 * Identité visuelle ANS — v0.7.2
 *
 * Cette couche reprend le vocabulaire graphique officiel :
 * - motif gris « bg-drop » ;
 * - formes gouttes bleues et roses ;
 * - composition éditoriale plus aérée ;
 * - suppression des cercles et demi-cercles décoratifs de l'ancien POC ;
 * - alternance gauche/droite des motifs gris sur l'accueil.
 */

:root {
	--ans-drop-gray-svg: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 456 440'%3E%3Cpath fill='%23F2F3F7' d='m0 0 1.72 29.48c.57 8.2 3.96 15.84 9.69 21.57l35.07 35.07c23.06 23.05 60.74 22.7 84.15-.71 23.48-23.47 23.83-61.02.78-84.07L130.07 0H0zm226.22 0-10.88 10.89-22.41 22.41c44.4-10.75 87.75.5 116.32 19.16 42.99 28.15 82.94 26.24 116.31-7.14C438.55 32.33 446.87 16.5 450.52 0h-224.3zm10.65 72.36c-18.21-.69-35.24 6.54-50.59 21.89-28.71 28.71-29.63 74.32-2.12 101.83 27.5 27.5 73.11 26.58 101.82-2.12l71.84-71.85 18.32-18.31c-36.28 8.84-71.63-.35-94.9-15.56-15.34-10.02-30.22-15.35-44.37-15.88zm218.7 28.18c-89.49 38.53-134.69 140.36-100.93 232.93 18.18 49.84 55.67 86.97 100.93 106.39V100.54z'/%3E%3C/svg%3E");
	--ans-drop-blue-svg: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 85 91'%3E%3Cpath fill='%231D71B8' d='M42.364 90.817h-.003C19.235 90.817.488 72.088.488 48.984V.198C3.762 3.84 10.336 6.94 23.68 7.15h18.684c23.126 0 41.872 18.73 41.872 41.834 0 23.104-18.746 41.833-41.872 41.833'/%3E%3C/svg%3E");
	--ans-drop-pink-svg: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 153'%3E%3Cpath fill='%23D20050' d='M69.996 152.198h.005c38.616 0 69.919-31.274 69.919-69.853V.88c-5.467 6.081-16.443 11.259-38.726 11.61H69.996C31.38 12.49.076 43.762.076 82.344c0 38.579 31.304 69.853 69.92 69.853'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
 * Motif global sur les pages intérieures
 * ----------------------------------------------------------------------- */
body:not(.home) .wp-site-blocks > main {
	position: relative;
	isolation: isolate;
	overflow: clip;
}

body:not(.home) .wp-site-blocks > main::before {
	position: absolute;
	z-index: 0;
	top: 0;
	left: 0;
	width: clamp(22rem, 34vw, 34.125rem);
	height: clamp(21rem, 33vw, 33rem);
	background-image: var(--ans-drop-gray-svg);
	background-position: top left;
	background-repeat: no-repeat;
	background-size: contain;
	content: "";
	pointer-events: none;
	transform: scaleX(-1);
	transform-origin: center;
}

body:not(.home) .wp-site-blocks > main > * {
	position: relative;
	z-index: 1;
}

/* --------------------------------------------------------------------------
 * Accueil — refonte du bandeau historique enregistré dans WordPress
 * ----------------------------------------------------------------------- */
.home .bandeau-ans {
	position: relative;
	isolation: isolate;
	min-height: clamp(35rem, 43vw, 42rem);
	padding: clamp(3rem, 5vw, 5rem) clamp(1.5rem, 5vw, 6rem);
	background: var(--ans-white);
}

/* --------------------------------------------------------------------------
 * Accueil — alternance des motifs gris ANS
 *
 * Classes à appliquer aux groupes principaux de la page d'accueil :
 * - ans-home-pattern-section ans-drops-left
 * - ans-home-pattern-section ans-drops-right
 *
 * Le bandeau, .ans-home-sections et .ans-home-news disposent également
 * d'une orientation par défaut afin de conserver la compatibilité avec
 * la structure actuelle de l'accueil.
 * ----------------------------------------------------------------------- */
.home :is(
	.bandeau-ans,
	.ans-home-sections,
	.ans-home-news,
	.ans-home-pattern-section
) {
	position: relative;
	isolation: isolate;
	overflow: clip;
}

.home :is(
	.bandeau-ans,
	.ans-home-sections,
	.ans-home-news,
	.ans-home-pattern-section
)::before {
	position: absolute;
	z-index: 0;
	top: 0;
	width: clamp(20rem, 34vw, 34.125rem);
	height: clamp(19rem, 33vw, 33rem);
	border: 0;
	border-radius: 0;
	background-image: var(--ans-drop-gray-svg);
	background-position: top left;
	background-repeat: no-repeat;
	background-size: contain;
	content: "";
	opacity: 0.82;
	pointer-events: none;
	transform-origin: center;
}

.home :is(
	.bandeau-ans,
	.ans-home-sections,
	.ans-home-news,
	.ans-home-pattern-section
) > * {
	position: relative;
	z-index: 1;
}

/* Orientation par défaut des sections déjà fournies par le thème. */
.home .bandeau-ans::before,
.home .ans-home-news::before {
	right: auto;
	left: 0;
	transform: scaleX(-1);
}

.home .ans-home-sections::before {
	right: 0;
	left: auto;
	transform: none;
}

/* Orientation explicite : ces classes priment sur les valeurs par défaut. */
.home .ans-home-pattern-section.ans-drops-left::before,
.home :is(.bandeau-ans, .ans-home-sections, .ans-home-news).ans-drops-left::before {
	right: auto;
	left: 0;
	transform: scaleX(-1);
}

.home .ans-home-pattern-section.ans-drops-right::before,
.home :is(.bandeau-ans, .ans-home-sections, .ans-home-news).ans-drops-right::before {
	right: 0;
	left: auto;
	transform: none;
}

.home .bandeau-ans::after {
	z-index: 4;
	right: clamp(1rem, 3vw, 3.5rem);
	bottom: clamp(1rem, 3vw, 2.75rem);
	width: clamp(5.5rem, 7vw, 8rem);
	height: clamp(6rem, 7.5vw, 8.75rem);
	border-radius: 0;
	background-color: transparent;
	background-image: var(--ans-drop-pink-svg);
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
}

.home .bandeau-ans > .wp-block-group.is-layout-grid,
.home .bandeau-ans > .wp-block-group.wp-block-group-is-layout-grid,
.home .bandeau-ans-interieur {
	display: grid !important;
	align-items: center !important;
	grid-template-columns: minmax(0, 42%) minmax(0, 58%) !important;
	gap: clamp(2rem, 4vw, 5rem) !important;
	width: min(100%, 112rem);
	min-height: clamp(29rem, 36vw, 35rem) !important;
	margin-inline: auto;
}

.home .bandeau-ans > .wp-block-group.is-layout-grid > .wp-block-group:first-child,
.home .bandeau-ans > .wp-block-group.wp-block-group-is-layout-grid > .wp-block-group:first-child,
.home .bandeau-ans-interieur > :first-child {
	position: relative;
	z-index: 5;
	width: 100%;
	max-width: 44rem;
	padding-inline-start: clamp(0rem, 2vw, 2rem);
}

.home .bandeau-ans .bonjour-utilisateur,
.home .bandeau-ans > .wp-block-group.is-layout-grid > .wp-block-group:first-child > p:first-child,
.home .bandeau-ans > .wp-block-group.wp-block-group-is-layout-grid > .wp-block-group:first-child > p:first-child {
	margin: 0 0 1.25rem !important;
	color: var(--ans-pink);
	font-size: clamp(1rem, 0.95rem + 0.28vw, 1.25rem);
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1.2;
}

.home .bandeau-ans :is(h1, h2, .wp-block-heading) {
	max-width: 43rem;
	margin: 0 0 1.35rem !important;
	color: var(--ans-navy);
	font-size: clamp(2.5rem, 2rem + 1.55vw, 4.15rem) !important;
	font-weight: 800 !important;
	line-height: 1.04 !important;
	letter-spacing: -0.015em;
}

.home .bandeau-ans p.bandeau-ans-contenu,
.home .bandeau-ans :where(.wp-block-group.bandeau-ans-contenu, div.bandeau-ans-contenu, section.bandeau-ans-contenu) p {
	max-width: 41rem;
	margin: 0 0 1.7rem;
	color: #55608a;
	font-size: clamp(1.05rem, 1rem + 0.2vw, 1.2rem);
	line-height: 1.62;
}

.home .bandeau-ans .wp-block-buttons {
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.home .bandeau-ans .wp-block-button__link {
	min-height: 3.25rem;
	padding: 0.85rem 1.6rem;
	border-width: 2px;
	box-shadow: none;
}

.home .bandeau-ans-image {
	position: relative !important;
	z-index: 2;
	inset: auto !important;
	width: 100% !important;
	height: clamp(28rem, 35vw, 35rem) !important;
	margin: 0 !important;
	overflow: visible;
	border-radius: 0;
}

.home .bandeau-ans-image img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 48% 48% 48% 0;
	object-fit: cover;
	object-position: center;
	box-shadow: 0 1.75rem 4.5rem rgba(52, 56, 82, 0.14);
}

.home .bandeau-ans-image::before {
	z-index: 3;
	top: 19%;
	left: -1.3rem;
	width: clamp(4.7rem, 6vw, 6.7rem);
	height: clamp(5rem, 6.4vw, 7.1rem);
	border-radius: 0;
	background-color: transparent;
	background-image: var(--ans-drop-blue-svg);
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
}

/* --------------------------------------------------------------------------
 * Sections complémentaires d'accueil
 * ----------------------------------------------------------------------- */
.ans-home-sections {
	position: relative;
	isolation: isolate;
	overflow: clip;
	padding: clamp(4rem, 7vw, 7rem) clamp(1.25rem, 5vw, 5rem);
	background: var(--ans-white);
}

.ans-home-intro {
	max-width: 48rem;
	margin: 0 auto clamp(2.5rem, 5vw, 4.5rem);
	text-align: center;
}

.ans-home-intro .ans-eyebrow {
	margin-bottom: 0.75rem;
	color: var(--ans-pink);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ans-home-intro h2 {
	margin-bottom: 1rem;
	color: var(--ans-navy);
	font-size: clamp(2rem, 1.7rem + 1.3vw, 3.25rem);
	line-height: 1.08;
}

.ans-home-card-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(1rem, 2vw, 1.5rem);
	max-width: 92rem;
	margin-inline: auto;
}

.ans-home-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 19rem;
	padding: clamp(1.5rem, 2vw, 2rem);
	overflow: hidden;
	border: 1px solid var(--ans-border);
	border-radius: 1.25rem;
	background: var(--ans-white);
	box-shadow: 0 0.85rem 2.5rem rgba(52, 56, 82, 0.08);
	transition: transform var(--ans-transition-fast), box-shadow var(--ans-transition-fast);
}

.ans-home-card::before {
	width: 3.4rem;
	height: 3.7rem;
	margin-bottom: 1.3rem;
	background-image: var(--ans-drop-blue-svg);
	background-repeat: no-repeat;
	background-size: contain;
	content: "";
}

.ans-home-card:nth-child(even)::before {
	background-image: var(--ans-drop-pink-svg);
}

.ans-home-card:hover,
.ans-home-card:focus-within {
	transform: translateY(-0.25rem);
	box-shadow: 0 1.4rem 3.4rem rgba(52, 56, 82, 0.13);
}

.ans-home-card h3 {
	margin: 0 0 0.75rem;
	color: var(--ans-navy);
	font-size: clamp(1.35rem, 1.2rem + 0.4vw, 1.7rem);
	line-height: 1.15;
}

.ans-home-card p {
	margin: 0 0 1.4rem;
	color: #5d668c;
	font-size: 1rem;
	line-height: 1.55;
}

.ans-home-card .wp-block-button,
.ans-home-card .wp-block-buttons {
	margin-top: auto;
}

.ans-home-card .wp-block-button__link {
	padding: 0;
	border: 0;
	background: transparent !important;
	color: var(--ans-blue) !important;
	font-weight: 800;
	text-align: left;
}

.ans-home-card .wp-block-button__link::after {
	content: "  →";
}

.ans-home-news {
	position: relative;
	padding: clamp(4rem, 7vw, 7rem) clamp(1.25rem, 5vw, 5rem);
	background: var(--ans-light);
}

.ans-home-news .wp-block-query {
	max-width: 92rem;
	margin-inline: auto;
}

.ans-home-news .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1rem, 2vw, 1.5rem);
}

.ans-home-news .wp-block-post {
	padding: 1.5rem;
	border: 1px solid var(--ans-border);
	border-radius: 1.25rem;
	background: var(--ans-white);
	box-shadow: 0 0.75rem 2rem rgba(52, 56, 82, 0.07);
}

.ans-home-news .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 0.85rem;
	object-fit: cover;
}

.ans-home-news .wp-block-post-title {
	margin-top: 1rem;
	font-size: 1.45rem !important;
	line-height: 1.2 !important;
}

.ans-home-news .wp-block-post-date {
	color: var(--ans-text);
	font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
 * Responsive
 * ----------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.home .bandeau-ans > .wp-block-group.is-layout-grid,
	.home .bandeau-ans > .wp-block-group.wp-block-group-is-layout-grid,
	.home .bandeau-ans-interieur {
		grid-template-columns: minmax(0, 48%) minmax(0, 52%) !important;
		gap: 2rem !important;
	}

	.ans-home-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	body:not(.home) .wp-site-blocks > main::before {
		width: 16rem;
		height: 15.5rem;
		opacity: 0.7;
	}

	.home .bandeau-ans {
		min-height: 0;
		padding: 2rem 1rem 2.8rem;
	}

	.home :is(
		.bandeau-ans,
		.ans-home-sections,
		.ans-home-news,
		.ans-home-pattern-section
	)::before {
		width: 18rem;
		height: 17.5rem;
		opacity: 0.65;
	}

	.home .bandeau-ans::before,
	.home .ans-home-news::before,
	.home .ans-home-pattern-section.ans-drops-left::before,
	.home :is(.bandeau-ans, .ans-home-sections, .ans-home-news).ans-drops-left::before {
		left: -3rem;
	}

	.home .ans-home-sections::before,
	.home .ans-home-pattern-section.ans-drops-right::before,
	.home :is(.bandeau-ans, .ans-home-sections, .ans-home-news).ans-drops-right::before {
		right: -3rem;
	}

	.home .bandeau-ans::after {
		right: -0.9rem;
		bottom: 0.5rem;
		width: 5rem;
		height: 5.5rem;
	}

	.home .bandeau-ans > .wp-block-group.is-layout-grid,
	.home .bandeau-ans > .wp-block-group.wp-block-group-is-layout-grid,
	.home .bandeau-ans-interieur {
		display: flex !important;
		align-items: stretch !important;
		flex-direction: column !important;
		gap: 1.4rem !important;
		width: 100%;
		min-height: 0 !important;
	}

	.home .bandeau-ans > .wp-block-group.is-layout-grid > .wp-block-group:first-child,
	.home .bandeau-ans > .wp-block-group.wp-block-group-is-layout-grid > .wp-block-group:first-child,
	.home .bandeau-ans-interieur > :first-child {
		order: 1;
		max-width: none;
		padding-inline: 0;
	}

	.home .bandeau-ans :is(h1, h2, .wp-block-heading) {
		font-size: clamp(2.15rem, 10vw, 2.9rem) !important;
	}

	.home .bandeau-ans-image {
		order: 2;
		height: auto !important;
		aspect-ratio: 16 / 10;
	}

	.home .bandeau-ans-image img {
		border-radius: 42% 42% 42% 0;
		box-shadow: 0 1rem 2.5rem rgba(52, 56, 82, 0.12);
	}

	.home .bandeau-ans-image::before {
		top: 16%;
		left: -0.35rem;
		width: 3.8rem;
		height: 4.1rem;
	}

	.ans-home-sections,
	.ans-home-news {
		padding: 3.5rem 1rem;
	}

	.ans-home-card-grid,
	.ans-home-news .wp-block-post-template {
		grid-template-columns: 1fr;
	}

	.ans-home-card {
		min-height: 0;
	}
}
