/* Lud Cookies – styles de la bannière RGPD */

:root {
	--lc-primary: #1f6f5c;
	--lc-bg: #ffffff;
	--lc-text: #1e2327;
	--lc-muted: #5b6670;
	--lc-border: #e2e6ea;
	--lc-radius: 12px;
	--lc-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

/* ------------------------------------------------------------------ */
/* Bannière                                                            */
/* ------------------------------------------------------------------ */

.lc-banner {
	position: fixed;
	z-index: 99999;
	background: var(--lc-bg);
	color: var(--lc-text);
	box-shadow: var(--lc-shadow);
	font-size: 15px;
	line-height: 1.5;
}

.lc-banner[hidden],
.lc-reopen[hidden],
.lc-prefs[hidden],
.lc-btn[hidden] {
	display: none !important;
}

/* La bannière ne doit jamais dépasser l'écran : défilement interne au besoin */
.lc-banner-inner {
	max-height: calc(92vh - env(safe-area-inset-bottom, 0px));
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* Position : barre pleine largeur en bas */
.lc-pos-bar {
	left: 0;
	right: 0;
	bottom: 0;
	border-top: 3px solid var(--lc-primary);
}

.lc-pos-bar .lc-banner-inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 18px 20px;
	padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

/* Position : carte en bas à gauche */
.lc-pos-card {
	left: 20px;
	bottom: 20px;
	max-width: 420px;
	border-radius: var(--lc-radius);
	border: 1px solid var(--lc-border);
}

.lc-pos-card .lc-banner-inner {
	padding: 20px;
}

.lc-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	color: var(--lc-text);
}

.lc-text {
	margin: 0 0 14px;
	color: var(--lc-muted);
}

.lc-privacy-link {
	color: var(--lc-primary);
	text-decoration: underline;
	white-space: nowrap;
}

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

.lc-prefs {
	margin: 0 0 14px;
	border: 1px solid var(--lc-border);
	border-radius: var(--lc-radius);
	padding: 6px 14px;
	max-height: 45vh;
	overflow-y: auto;
	background: #fafbfc;
}

.lc-cat {
	padding: 10px 0;
	border-bottom: 1px solid var(--lc-border);
}

.lc-cat:last-child {
	border-bottom: none;
}

.lc-cat-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	cursor: pointer;
}

.lc-cat-toggle {
	width: 18px;
	height: 18px;
	accent-color: var(--lc-primary);
	margin: 0;
}

.lc-cat-required {
	font-size: 12px;
	font-weight: 500;
	color: var(--lc-primary);
	background: color-mix(in srgb, var(--lc-primary) 12%, white);
	border-radius: 999px;
	padding: 2px 10px;
}

@supports not (background: color-mix(in srgb, red 50%, white)) {
	.lc-cat-required {
		background: #eef4f2;
	}
}

.lc-cat-desc {
	margin: 6px 0 0 26px;
	font-size: 13px;
	color: var(--lc-muted);
}

/* ------------------------------------------------------------------ */
/* Boutons — Accepter et Refuser au même niveau (exigence UE)          */
/* ------------------------------------------------------------------ */

.lc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.lc-btn {
	appearance: none;
	border: 2px solid transparent;
	border-radius: 999px;
	padding: 10px 22px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease;
	line-height: 1.2;
}

.lc-btn:hover {
	filter: brightness(0.92);
}

.lc-btn:focus-visible {
	outline: 3px solid var(--lc-primary);
	outline-offset: 2px;
}

.lc-btn-primary {
	background: var(--lc-primary);
	color: #fff;
}

/* Le refus a le même poids visuel que l'acceptation */
.lc-btn-secondary {
	background: #3a434b;
	color: #fff;
}

.lc-btn-ghost {
	background: transparent;
	color: var(--lc-text);
	border-color: var(--lc-border);
}

/* ------------------------------------------------------------------ */
/* Bouton flottant de réouverture                                      */
/* ------------------------------------------------------------------ */

/* Résiste aux styles de boutons des thèmes (Twenty Twenty-One, etc.) */
.lc-reopen {
	position: fixed !important;
	left: 18px;
	bottom: 18px;
	z-index: 99998;
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	box-sizing: border-box;
	width: 52px;
	height: 52px !important;
	margin: 0 !important;
	padding: 0 0 0 13px !important;
	border: none !important;
	border-radius: 999px !important;
	background: var(--lc-primary) !important;
	color: #fff !important;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	overflow: hidden;
	white-space: nowrap;
	line-height: 1 !important;
	transition: width 0.25s ease, box-shadow 0.2s ease;
	animation: lc-pop-in 0.35s ease;
}

.lc-reopen-icon {
	flex: none;
	display: block;
	width: 26px;
	height: 26px;
}

.lc-reopen-label {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	opacity: 0;
	transition: opacity 0.2s ease 0.05s;
}

.lc-reopen:hover,
.lc-reopen:focus-visible {
	width: 190px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.lc-reopen:hover .lc-reopen-label,
.lc-reopen:focus-visible .lc-reopen-label {
	opacity: 1;
}

.lc-reopen:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

@keyframes lc-pop-in {
	from {
		transform: scale(0.5);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lc-reopen {
		animation: none;
		transition: none;
	}
}

/* Lien texte "Gérer mes cookies" (shortcode) */
.lc-link-open {
	appearance: none;
	background: none;
	border: none;
	padding: 0;
	color: var(--lc-primary);
	text-decoration: underline;
	cursor: pointer;
	font-size: inherit;
}

/* ------------------------------------------------------------------ */
/* Placeholder vidéo                                                   */
/* ------------------------------------------------------------------ */

.lc-media-placeholder {
	position: relative;
	background: #14181c;
	color: #e8ecef;
	border-radius: var(--lc-radius);
	aspect-ratio: 16 / 9;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	overflow: hidden;
	margin: 1em 0;
}

/* Fallback si aspect-ratio non supporté (vieux navigateurs) */
@supports not (aspect-ratio: 16 / 9) {
	.lc-media-placeholder {
		min-height: 320px;
	}
}

.lc-media-msg {
	max-width: 520px;
	padding: 24px;
}

.lc-media-msg p {
	color: #c4cdd4;
	margin: 0 0 16px;
	font-size: 14px;
}

.lc-media-msg .lc-link-open {
	display: inline-block;
	margin-top: 10px;
	color: #9fc7bc;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

/* Tablettes : boutons sur une ligne mais panneau de préférences plus bas */
@media (max-width: 900px) {
	.lc-prefs {
		max-height: 38vh;
	}
}

/* Mobiles */
@media (max-width: 600px) {
	.lc-banner {
		font-size: 14px;
	}

	.lc-pos-bar .lc-banner-inner {
		padding: 14px 16px;
		padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	}

	.lc-pos-card {
		left: 10px;
		right: 10px;
		bottom: 10px;
		max-width: none;
	}

	.lc-pos-card .lc-banner-inner {
		padding: 16px;
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}

	.lc-title {
		font-size: 16px;
		margin-bottom: 6px;
	}

	.lc-text {
		font-size: 13px;
		margin-bottom: 10px;
	}

	.lc-banner-inner {
		max-height: calc(82vh - env(safe-area-inset-bottom, 0px));
	}

	.lc-prefs {
		max-height: 30vh;
		padding: 4px 10px;
		margin-bottom: 10px;
	}

	.lc-cat-desc {
		font-size: 12px;
	}

	.lc-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	.lc-btn {
		width: 100%;
		text-align: center;
		padding: 12px 22px; /* cible tactile >= 44px */
	}

	/* La pastille ne doit pas gêner le pouce ni passer sous la barre iOS */
	.lc-reopen {
		left: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}
}

/* Petits écrans en paysage : la bannière reste basse, tout défile à l'intérieur */
@media (max-height: 500px) {
	.lc-banner-inner {
		max-height: 80vh;
	}

	.lc-prefs {
		max-height: 26vh;
	}
}
