/* ============================================================
   Consentement aux traceurs — bandeau et panneau de préférences.
   Couleurs du thème (variables --wp--preset--*), avec repli si le
   thème change. « Refuser » et « Accepter » partagent exactement le
   même style : aucun des deux n'est mis en avant (CNIL).
   ============================================================ */

.hameau-consentement,
.hameau-preferences {
	--hc-foret: var(--wp--preset--color--foret, #285c46);
	--hc-foret-hover: #224e3b;
	--hc-lin: var(--wp--preset--color--lin, #e4e2dd);
	--hc-papier: var(--wp--preset--color--papier, #faf9f6);
	--hc-texte: var(--wp--preset--color--texte, #3a4540);
	--hc-encre: var(--wp--preset--color--encre, #1f2a24);
	--hc-attenue: var(--wp--preset--color--texte-attenue, #6b6557);
	--hc-pin: var(--wp--preset--color--pin, #1f7354);
	--hc-sans: var(--wp--preset--font-family--sans, system-ui, sans-serif);
	--hc-serif: var(--wp--preset--font-family--serif, Georgia, serif);
	font-family: var(--hc-sans);
	color: var(--hc-texte);
}

/* ---- Bandeau ------------------------------------------------- */

.hameau-consentement {
	position: fixed;
	z-index: 1000;
	right: 1rem;
	bottom: max(1rem, env(safe-area-inset-bottom));
	left: 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	align-items: flex-end;
	justify-content: space-between;
	max-width: 1320px;
	margin: 0 auto;
	padding: 1.25rem 1.5rem;
	background: var(--hc-papier);
	border: 1px solid var(--hc-lin);
	border-radius: 18px;
	box-shadow: 0 16px 40px rgb(31 42 36 / 0.12);
}

.hameau-consentement[hidden] {
	display: none;
}

.hameau-consentement__contenu {
	flex: 1 1 32rem;
}

.hameau-consentement__titre,
.hameau-preferences__titre {
	margin: 0 0 0.35rem;
	font-family: var(--hc-serif);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--hc-encre);
}

.hameau-consentement__texte {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.55;
}

.hameau-consentement a,
.hameau-preferences a {
	color: var(--hc-pin);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hameau-consentement__actions,
.hameau-preferences__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	align-items: center;
}

/* Même style pour Accepter et Refuser. */
.hameau-consentement__bouton {
	min-height: 44px;
	padding: 0.6rem 1.25rem;
	font: 600 0.9375rem/1 var(--hc-sans);
	color: var(--hc-foret);
	background: transparent;
	border: 1.5px solid var(--hc-foret);
	border-radius: 999px;
	cursor: pointer;
}

.hameau-consentement__bouton:hover {
	background: var(--wp--preset--color--foret-50, #eef3f0);
}

.hameau-consentement__bouton--principal {
	color: var(--hc-lin);
	background: var(--hc-foret);
}

.hameau-consentement__bouton--principal:hover {
	background: var(--hc-foret-hover);
}

.hameau-consentement__lien {
	min-height: 44px;
	padding: 0.6rem 0.5rem;
	font: 500 0.9375rem/1 var(--hc-sans);
	color: var(--hc-pin);
	text-decoration: underline;
	text-underline-offset: 3px;
	background: none;
	border: 0;
	cursor: pointer;
}

.hameau-consentement :focus-visible,
.hameau-preferences :focus-visible {
	outline: 2px solid var(--hc-pin);
	outline-offset: 3px;
}

/* ---- Panneau de préférences ----------------------------------- */

.hameau-preferences {
	width: min(40rem, calc(100vw - 2rem));
	max-height: calc(100dvh - 2rem);
	padding: 0;
	background: var(--hc-papier);
	border: 1px solid var(--hc-lin);
	border-radius: 18px;
	box-shadow: 0 28px 70px rgb(31 42 36 / 0.16);
}

.hameau-preferences::backdrop {
	background: rgb(20 46 35 / 0.45);
}

.hameau-preferences__formulaire {
	position: relative;
	padding: 1.75rem 1.75rem 1.5rem;
	font-size: 0.9375rem;
	line-height: 1.55;
}

.hameau-preferences__formulaire > p {
	margin: 0 0 1rem;
}

.hameau-preferences__choix {
	display: flex;
	gap: 0.875rem;
	align-items: flex-start;
	padding: 1rem 0;
	border-top: 1px solid var(--hc-lin);
}

.hameau-preferences__choix input {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.15rem 0 0;
	accent-color: var(--hc-foret);
}

.hameau-preferences__choix label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	cursor: pointer;
}

.hameau-preferences__choix strong {
	color: var(--hc-encre);
}

.hameau-preferences__choix span {
	font-size: 0.875rem;
	color: var(--hc-attenue);
}

.hameau-preferences__politique {
	padding-top: 1rem;
	border-top: 1px solid var(--hc-lin);
}

.hameau-preferences__fermer {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--hc-encre);
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

.hameau-preferences__fermer:hover {
	background: var(--wp--preset--color--foret-50, #eef3f0);
}

@media (max-width: 599.98px) {

	.hameau-consentement {
		right: 0.5rem;
		left: 0.5rem;
		padding: 1rem 1.125rem;
	}

	.hameau-consentement__actions .hameau-consentement__bouton {
		flex: 1 1 8rem;
	}
}
