/*
 * WebMain Cookies — bandeau, fenêtre de choix, contenus externes bloqués, liste des cookies.
 * Couleurs et polices en variables --wmc-* : le thème du site les relie à sa charte
 * (voir le composant « cookies » du thème), sinon valeurs neutres ci-dessous.
 * « Tout accepter » et « Tout refuser » ont la même apparence (recommandation CNIL).
 */

:where(.wmc, .wmc-panel, .wmc-float, .wmc-embed, .wmc-list) {
	--wmc-bg: #ffffff;
	--wmc-ink: #1f2937;
	--wmc-muted: #5b6474;
	--wmc-line: #dfe4ec;
	--wmc-soft: #f4f6fa;
	--wmc-accent: #0b3d91;
	--wmc-on-accent: #ffffff;
	--wmc-focus: #3b82f6;
	--wmc-radius: 14px;
	--wmc-font: system-ui, -apple-system, "Segoe UI", sans-serif;
	--wmc-font-title: var(--wmc-font);
	--wmc-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}

.wmc[hidden],
.wmc-embed.is-allowed .wmc-embed__notice {
	display: none;
}

/* Bandeau : en bas sur toute la largeur (par défaut), au centre, ou en coin. */
.wmc {
	position: fixed;
	z-index: 99990;
	right: 12px;
	bottom: 12px;
	left: 12px;
	font-family: var(--wmc-font);
	color: var(--wmc-ink);
}

.wmc__box {
	max-width: 1120px;
	margin: 0 auto;
	padding: 18px 20px;
	border: 1px solid var(--wmc-line);
	border-radius: var(--wmc-radius);
	background: var(--wmc-bg);
	box-shadow: var(--wmc-shadow);
}

.wmc--corner {
	left: auto;
	width: min(420px, 100% - 24px);
}

.wmc--center {
	top: 0;
	bottom: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
}

.wmc--center .wmc__box {
	max-width: 560px;
	pointer-events: auto;
}

.wmc__title {
	margin: 0 0 6px;
	font: 700 17px/1.3 var(--wmc-font-title);
	color: var(--wmc-ink);
}

.wmc__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--wmc-muted);
}

.wmc__link,
.wmc-link {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-weight: 600;
	color: var(--wmc-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.wmc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

/* Petit écran : « Tout refuser » et « Tout accepter » côte à côte, « Choisir » en dessous. */
.wmc__actions .wmc-btn {
	flex: 1 1 0;
}

.wmc .wmc__actions [data-wmc-action="open"] {
	flex-basis: 100%;
	order: 3;
}

.wmc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	border: 2px solid var(--wmc-accent);
	border-radius: 999px;
	background: var(--wmc-accent);
	font: 600 15px/1.2 var(--wmc-font);
	color: var(--wmc-on-accent);
	cursor: pointer;
	transition: filter .15s ease, background-color .15s ease;
}

.wmc-btn:hover {
	filter: brightness(1.12);
}

.wmc-btn--ghost {
	background: transparent;
	color: var(--wmc-accent);
}

.wmc-btn--ghost:hover {
	background: var(--wmc-soft);
	filter: none;
}

:is(.wmc, .wmc-panel, .wmc-float, .wmc-embed) :is(button, a):focus-visible,
.wmc-float:focus-visible {
	outline: 3px solid var(--wmc-focus);
	outline-offset: 2px;
}

/* Fenêtre de choix. */
.wmc-panel {
	width: min(560px, 100% - 24px);
	max-height: min(88vh, 760px);
	padding: 0;
	border: 0;
	border-radius: var(--wmc-radius);
	background: var(--wmc-bg);
	box-shadow: var(--wmc-shadow);
	font-family: var(--wmc-font);
	color: var(--wmc-ink);
}

.wmc-panel::backdrop {
	background: rgba(7, 20, 40, .55);
}

.wmc-panel__inner {
	padding: 22px;
}

.wmc-panel__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.wmc-panel__title {
	margin: 0;
	font: 700 20px/1.3 var(--wmc-font-title);
	color: var(--wmc-ink);
}

.wmc-panel__close {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	margin: -6px -6px 0 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wmc-ink);
	cursor: pointer;
}

.wmc-panel__close:hover {
	background: var(--wmc-soft);
}

.wmc-panel__text {
	margin: 8px 0 16px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--wmc-muted);
}

.wmc-cats {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wmc-cat {
	padding: 12px 14px;
	border: 1px solid var(--wmc-line);
	border-radius: 12px;
}

.wmc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.wmc-cat__label {
	font-weight: 700;
}

.wmc-cat__always {
	font-size: 13px;
	font-weight: 600;
	color: var(--wmc-muted);
}

.wmc-cat__desc {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--wmc-muted);
}

/* Interrupteur accessible (vraie case à cocher, role="switch"). */
.wmc-switch {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	cursor: pointer;
}

.wmc-switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.wmc-switch__track {
	position: relative;
	flex: none;
	width: 44px;
	height: 26px;
	border-radius: 999px;
	background: var(--wmc-line);
	transition: background-color .15s ease;
}

.wmc-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
	transition: transform .15s ease;
}

.wmc-switch input:checked + .wmc-switch__track {
	background: var(--wmc-accent);
}

.wmc-switch input:checked + .wmc-switch__track::after {
	transform: translateX(18px);
}

.wmc-switch input:focus-visible + .wmc-switch__track {
	outline: 3px solid var(--wmc-focus);
	outline-offset: 2px;
}

.wmc-panel__actions .wmc-btn {
	flex: 1 1 auto;
	white-space: nowrap;
}

.wmc-panel__id {
	margin: 14px 0 0;
	font-size: 12px;
	color: var(--wmc-muted);
	overflow-wrap: anywhere;
}

.wmc-panel__id[hidden] {
	display: none;
}

/* Bouton flottant (option) : en bas à gauche. */
.wmc-float {
	position: fixed;
	z-index: 99980;
	bottom: 16px;
	left: 16px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--wmc-line);
	border-radius: 50%;
	background: var(--wmc-bg);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
	color: var(--wmc-accent);
	cursor: pointer;
}

/* Contenu externe bloqué. */
.wmc-embed {
	position: relative;
	min-height: 220px;
	margin-block: 16px;
}

/* La vidéo (ou la carte) occupe la largeur du contenu, au format 16/9 : l'encart a toujours la place. */
.wmc-embed iframe {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--wmc-radius);
}

.wmc-embed iframe:not([src]) {
	visibility: hidden;
}

.wmc-embed__notice {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	gap: 10px;
	padding: 20px;
	border-radius: var(--wmc-radius);
	background: var(--wmc-soft);
	font-family: var(--wmc-font);
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
	color: var(--wmc-ink);
}

.wmc-embed__notice p {
	max-width: 52ch;
	margin: 0 auto;
}

.wmc-embed__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 14px;
}

.wmc-embed__actions .wmc-btn {
	flex: none;
}

/* Liste des cookies (code court). */
.wmc-list__title {
	margin: 24px 0 8px;
}

.wmc-list__scroll {
	overflow-x: auto;
}

.wmc-list__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.wmc-list__table th,
.wmc-list__table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--wmc-line);
	text-align: left;
	vertical-align: top;
}

.wmc-list__table th {
	font-weight: 700;
}

@media (min-width: 768px) {
	.wmc--bottom .wmc__box {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 4px 24px;
		align-items: center;
	}

	.wmc--bottom .wmc__title {
		grid-column: 1;
	}

	.wmc--bottom .wmc__text {
		grid-column: 1;
	}

	.wmc--bottom .wmc__actions {
		grid-column: 2;
		grid-row: 1 / span 2;
		flex-wrap: nowrap;
		margin-top: 0;
	}

	.wmc--bottom .wmc__actions .wmc-btn,
	.wmc--center .wmc__actions .wmc-btn {
		flex: none;
	}

	.wmc--bottom .wmc__actions [data-wmc-action="open"],
	.wmc--center .wmc__actions [data-wmc-action="open"] {
		flex-basis: auto;
		order: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wmc-btn,
	.wmc-switch__track,
	.wmc-switch__track::after {
		transition: none;
	}
}
