/* Fichier généré par assets/css/build.mjs — ne pas modifier : éditer assets/css/src/. */

/* ---- blocs/bloc-duos.css ---- */
/*
 * Bloc « Duos » (blocks/duos/, kdo/duos) : demi-panneaux de la disposition H du style panneau
 * (composants/panneau.css : .kdo-duos, .kdo-duo, .kdo-pastille-ronde), d'après la section
 * « Engagement social & solidaire » de l'accueil (reprise de blocs/engagement-social.css).
 *
 * Ce que le bloc ajoute au composant : la place des produits selon leur nombre et la disposition
 * choisie (dans la maquette, chaque demi-panneau avait les siennes : ADLCP = 4 en groupe, AFIPH =
 * 3 en groupe, démarche responsable = 3 en rangée), l'image en disque, et les emblèmes des
 * partenaires (maquette PARTENARIAT).
 */

/* Le demi-panneau remplit sa case de la grille, même avec un texte court (les marges
 * automatiques du panneau l'auraient réduit à la largeur de son contenu). */
.kdo-bloc--duos .kdo-duo {
	margin-inline: 0;
}

/* Sans visuel : le texte prend tout le demi-panneau. */
.kdo-bloc--duos .kdo-duo--aucun {
	grid-template-columns: minmax(0, 1fr);
}

/* ---------- Produits : du fond vers l'avant, en % du visuel ---------- */
.kdo-bloc--duos .kdo-duo__produit img {
	filter: url(#kdo-detourage) drop-shadow(0 0.6rem 0.7rem color-mix(in srgb, var(--wp--preset--color--navy) 22%, transparent));
}

/* En groupe : grands objets qui se chevauchent (coffrets, sacs). */
.kdo-bloc--duos .kdo-duo__visuel[data-composition="groupe"] {
	&[data-n="1"] .kdo-duo__produit { left: 12%; bottom: 4%; width: 76%; }

	&[data-n="2"] {
		& .kdo-duo__produit:nth-child(1) { left: 2%; bottom: 14%; width: 58%; }
		& .kdo-duo__produit:nth-child(2) { right: 0; bottom: 2%; width: 52%; }
	}

	/* AFIPH : coffret jardinage, coffret garni, coffret de crayons. */
	&[data-n="3"] {
		& .kdo-duo__produit:nth-child(1) { left: 4%; bottom: 18%; width: 58%; }
		& .kdo-duo__produit:nth-child(2) { right: 2%; bottom: 8%; width: 52%; }
		& .kdo-duo__produit:nth-child(3) { left: 18%; bottom: 0; width: 46%; }
	}

	/* ADLCP : sac à dos, coffret de peinture, bidon, casquette. */
	&[data-n="4"] {
		& .kdo-duo__produit:nth-child(1) { left: 6%; bottom: 10%; width: 72%; }
		& .kdo-duo__produit:nth-child(2) { left: -4%; bottom: 0; width: 58%; }
		& .kdo-duo__produit:nth-child(3) { right: 8%; bottom: 10%; width: 40%; }
		& .kdo-duo__produit:nth-child(4) { right: -4%; bottom: -2%; width: 56%; }
	}
}

/* En rangée : petits objets côte à côte, en escalier vers l'avant droit. */
.kdo-bloc--duos .kdo-duo__visuel[data-composition="rangee"] {
	&[data-n="1"] .kdo-duo__produit { left: 22%; bottom: 6%; width: 56%; }

	&[data-n="2"] {
		& .kdo-duo__produit:nth-child(1) { left: 12%; bottom: 10%; width: 42%; }
		& .kdo-duo__produit:nth-child(2) { right: 8%; bottom: 2%; width: 42%; }
	}

	/* Démarche responsable : sac shopping naturel, bidon bambou, bonnet recyclé. */
	&[data-n="3"] {
		& .kdo-duo__produit:nth-child(1) { left: 14%; bottom: 10%; width: 38%; }
		& .kdo-duo__produit:nth-child(2) { right: 18%; bottom: 6%; width: 34%; }
		& .kdo-duo__produit:nth-child(3) { right: 0; bottom: 0; width: 38%; }
	}

	&[data-n="4"] {
		& .kdo-duo__produit:nth-child(1) { left: 2%; bottom: 14%; width: 34%; }
		& .kdo-duo__produit:nth-child(2) { left: 24%; bottom: 10%; width: 34%; }
		& .kdo-duo__produit:nth-child(3) { right: 18%; bottom: 5%; width: 32%; }
		& .kdo-duo__produit:nth-child(4) { right: 0; bottom: 0; width: 32%; }
	}
}

/* ---------- Image découpée en disque, à la place du disque clair ---------- */
.kdo-bloc--duos .kdo-duo__photo {
	position: absolute;
	left: 8%;
	bottom: 4%;
	width: 84%;
	aspect-ratio: 1;
	margin: 0;
	overflow: hidden;
	border-radius: 50%;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--wp--preset--color--marque) 30%, transparent),
		0 1rem 2rem color-mix(in srgb, var(--wp--preset--color--navy) 18%, transparent);

	& img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	@media (max-width: 639px) {
		left: 50%;
		width: auto;
		height: 92%;
		translate: -50% 0;
	}
}

/* Rappel de l'éditeur, posé sur le visuel. */
.kdo-bloc--duos .kdo-duo__visuel > .kdo-panneau__a-remplir {
	position: absolute;
	inset: 25% 6%;
	min-height: 0;
}

/* ---------- Emblèmes des partenaires, en 3 × 2 sur la bande ----------
 * Tailles fixes en rem : des tuiles « conteneurs » dans un visuel lui-même conteneur, à
 * proportions fixes, faisaient boucler la mise en page (panneau entier non peint en mobile). */
.kdo-bloc--duos .kdo-duo--emblemes .kdo-duo__visuel {
	display: grid;
	align-content: center;
	container-type: normal;
	aspect-ratio: auto;
	padding-block: 1rem;

	&::before {
		display: none;
	}
}

.kdo-bloc--duos .kdo-partenaires {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Tuile de partenaire : logo officiel s'il existe, sinon le nom en texte stylé dans un disque
 * (vert, un sur deux en navy) ; libellé dessous. */
.kdo-bloc--duos .kdo-partenaire {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.7rem 0.3rem 0.55rem;
	border-radius: var(--wp--custom--rayon--carte);
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--carte);
	color: var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--titre);
	text-align: center;
	text-transform: uppercase;
}

.kdo-bloc--duos .kdo-partenaire__embleme {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 4rem;
	aspect-ratio: 1;
	margin-bottom: 0.45rem;
	border-radius: 50%;
	background: radial-gradient(circle at 32% 28%,
		color-mix(in srgb, var(--wp--preset--color--marque) 72%, var(--wp--preset--color--surface)) 0%,
		var(--wp--preset--color--marque) 62%);
	color: var(--wp--preset--color--surface);
}

.kdo-bloc--duos .kdo-partenaire:nth-child(even) .kdo-partenaire__embleme {
	background: radial-gradient(circle at 32% 28%,
		color-mix(in srgb, var(--wp--preset--color--navy) 72%, var(--wp--preset--color--surface)) 0%,
		var(--wp--preset--color--navy) 62%);
}

.kdo-bloc--duos .kdo-partenaire .kdo-partenaire__embleme.kdo-partenaire__embleme--logo {
	width: 100%;
	max-width: 5.5rem;
	background: none;

	& img {
		width: 100%;
		max-height: 100%;
		height: auto;
		object-fit: contain;
	}
}

.kdo-bloc--duos :is(.kdo-partenaire__sur, .kdo-partenaire__sous) {
	font-size: 0.45rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.15;
	opacity: 0.88;
}

.kdo-bloc--duos .kdo-partenaire__nom {
	font-size: 0.52rem;
	font-weight: 800;
	line-height: 1.02;
}

.kdo-bloc--duos .kdo-partenaire__nom--sigle {
	font-size: 0.95rem;
	line-height: 0.95;
}

.kdo-bloc--duos .kdo-partenaire__libelle {
	font-size: 0.62rem;
	font-weight: 700;
	line-height: 1.2;
}
