/**
 * Bloc « Logos partenaires » — charte Bilger (même carte que le bloc qualifications).
 * Statique (≤ 3 logos) : rangée centrée. Défilant (≥ 4) : boucle infinie, pause au survol.
 *
 * NB : sélecteurs d'images volontairement longs pour passer au-dessus de
 * « .site-layout-inner .site-main__article .entry-content img » (0,3,1) sans !important.
 */

.dgs-lp-section {
	position: relative;
	box-sizing: border-box;
	padding: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.dgs-lp-section,
.dgs-lp-section * {
	box-sizing: border-box;
}

/* Fond gris : pas de bande blanche sous le bandeau, il s'enchaîne avec la section suivante */
.dgs-lp-section--fond {
	padding-bottom: 0;
}

.dgs-lp-section--fond .dgs-lp-section__inner {
	padding-top: clamp(1.75rem, 3.5vw, 2.25rem);
	padding-bottom: clamp(1.75rem, 3.5vw, 2.25rem);
	background: #f8f9fc;
	border-radius: 12px;
}

.dgs-lp-section__title {
	margin: 0 0 0.75rem;
	font-family: var(--dgs-font-titres, sans-serif);
	font-size: var(--dgs-fs-section, clamp(1.5rem, 2.4vw, 2.1rem));
	font-weight: 600;
	line-height: 1.25;
	color: var(--dgs-c-titre, #1b2876);
	text-align: center;
}

.dgs-lp-section__intro {
	margin: 0 auto clamp(1.25rem, 2.5vw, 1.75rem);
	max-width: 44rem;
	font-family: var(--dgs-font-texte, sans-serif);
	font-size: var(--dgs-fs-texte-sm, 15px);
	font-weight: 300;
	line-height: 1.65;
	color: var(--dgs-c-texte, #696969);
	text-align: center;
}

.dgs-lp-section__intro p {
	margin: 0 0 0.5em;
	color: inherit;
}

.dgs-lp-section .dgs-lp-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: stretch;
	gap: 16px;
}

.dgs-lp-section--statique .dgs-lp-list {
	flex-wrap: wrap;
	justify-content: center;
}

.dgs-lp-section .dgs-lp-list .dgs-lp-item {
	--dgs-lp-h: 54px;
	margin: 0;
	flex: 0 0 auto;
	list-style: none;
}

.dgs-lp-section .dgs-lp-list .dgs-lp-item--sm { --dgs-lp-h: 40px; }
.dgs-lp-section .dgs-lp-list .dgs-lp-item--md { --dgs-lp-h: 54px; }
.dgs-lp-section .dgs-lp-list .dgs-lp-item--lg { --dgs-lp-h: 64px; }

.dgs-lp-section .dgs-lp-list .dgs-lp-item__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-width: 200px;
	min-height: 100px;
	padding: 18px 28px;
	background: #ffffff;
	border: 1px solid #eef0f6;
	border-radius: 10px;
	box-shadow: 0 4px 18px rgba(17, 24, 68, 0.06);
	text-decoration: none;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dgs-lp-section .dgs-lp-list .dgs-lp-item img.dgs-lp-item__img {
	display: block;
	width: auto;
	max-width: 100%;
	height: var(--dgs-lp-h);
	margin: 0;
	object-fit: contain;
}

.dgs-lp-section .dgs-lp-list a.dgs-lp-item__inner:hover,
.dgs-lp-section .dgs-lp-list a.dgs-lp-item__inner:focus-visible {
	box-shadow: 0 10px 24px rgba(17, 24, 68, 0.12);
	transform: translateY(-2px);
}

.dgs-lp-section .dgs-lp-list a.dgs-lp-item__inner:focus-visible {
	outline: 2px solid var(--dgs-c-titre, #1b2876);
	outline-offset: 2px;
}

/* ---------- Défilant ---------- */
.dgs-lp-marquee {
	overflow: hidden;
	padding: 6px 0 12px;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.dgs-lp-marquee__track {
	display: flex;
	gap: 16px;
	width: max-content;
	animation: dgs-lp-defile var(--dgs-lp-duree, 30s) linear infinite;
}

.dgs-lp-marquee:hover .dgs-lp-marquee__track,
.dgs-lp-marquee:focus-within .dgs-lp-marquee__track {
	animation-play-state: paused;
}

@keyframes dgs-lp-defile {
	from { transform: translateX(0); }
	to   { transform: translateX(calc(-50% - 8px)); }
}

@media (prefers-reduced-motion: reduce) {
	.dgs-lp-marquee {
		-webkit-mask-image: none;
		mask-image: none;
	}
	.dgs-lp-marquee__track {
		width: auto;
		animation: none;
	}
	.dgs-lp-marquee__track .dgs-lp-list {
		flex-wrap: wrap;
		justify-content: center;
	}
	.dgs-lp-marquee__track .dgs-lp-list[aria-hidden="true"] {
		display: none;
	}
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 39.9375em) {
	.dgs-lp-section .dgs-lp-list,
	.dgs-lp-marquee__track {
		gap: 12px;
	}

	.dgs-lp-section--statique .dgs-lp-list .dgs-lp-item {
		flex: 0 1 calc(50% - 6px);
	}

	.dgs-lp-section .dgs-lp-list .dgs-lp-item__inner {
		min-width: 150px;
		min-height: 84px;
		padding: 14px 16px;
	}

	.dgs-lp-section--statique .dgs-lp-list .dgs-lp-item__inner {
		min-width: 0;
	}

	.dgs-lp-section .dgs-lp-list .dgs-lp-item--sm { --dgs-lp-h: 30px; }
	.dgs-lp-section .dgs-lp-list .dgs-lp-item--md { --dgs-lp-h: 40px; }
	.dgs-lp-section .dgs-lp-list .dgs-lp-item--lg { --dgs-lp-h: 50px; }

	@keyframes dgs-lp-defile {
		from { transform: translateX(0); }
		to   { transform: translateX(calc(-50% - 6px)); }
	}
}

/* Message affiché dans l'éditeur tant qu'aucun logo n'est renseigné */
.dgs-lp-placeholder {
	margin: 0;
	padding: 1.25rem;
	background: #f8f9fc;
	border: 1px dashed #c9cfe4;
	border-radius: 10px;
	font-family: var(--dgs-font-texte, sans-serif);
	font-size: 15px;
	color: var(--dgs-c-texte, #696969);
	text-align: center;
}

.dgs-lp-section.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* Éditeur : vignettes du répéteur non recadrées */
.acf-field[data-name="lp_logos"] .acf-image-uploader .image-wrap {
	max-width: 150px;
}

.acf-field[data-name="lp_logos"] .acf-image-uploader .image-wrap img {
	width: auto;
	max-width: 150px;
	height: auto;
	max-height: 60px;
	object-fit: contain;
}
