/**
 * Bannière consentement cookies — RTL, confiance, accessibilité.
 */

.cookie-consent {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 100010;
	padding: 0 max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-bottom, 0px));
	pointer-events: none;
	opacity: 0;
	transform: translateY(100%);
	transition:
		transform 0.35s var(--news-ease, cubic-bezier(0.22, 1, 0.36, 1)),
		opacity 0.3s ease;
}

.cookie-consent.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.cookie-consent[hidden]:not(.is-visible) {
	display: none !important;
}

.cookie-consent__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 18px;
	padding: 16px 18px;
	background: linear-gradient(180deg, #1a1a1a 0%, #111 100%);
	border: 1px solid rgba(var(--news-gold-rgb, 255, 204, 0), 0.35);
	border-radius: var(--news-radius-md, 12px) var(--news-radius-md, 12px) 0 0;
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.22);
}

.cookie-consent__icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(var(--news-gold-rgb, 255, 204, 0), 0.12);
	border: 1px solid rgba(var(--news-gold-rgb, 255, 204, 0), 0.35);
	color: var(--news-gold, #ffcc00);
}

.cookie-consent__content {
	flex: 1 1 220px;
	min-width: 0;
}

.cookie-consent__title {
	margin: 0 0 4px;
	font-size: clamp(0.9375rem, 2.4vw, 1.0625rem);
	font-weight: 800;
	line-height: 1.35;
	color: #fff;
}

.cookie-consent__text {
	margin: 0;
	font-size: max(0.8125rem, var(--type-small));
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.78);
}

.cookie-consent__link {
	display: inline-block;
	margin-inline-start: 6px;
	font-weight: 700;
	color: var(--news-gold, #ffcc00);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cookie-consent__link:hover {
	color: #fff;
}

.cookie-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 0 0 auto;
}

.cookie-consent__btn {
	min-height: 44px;
	padding: 10px 18px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.2;
	border-radius: var(--news-radius-sm, 8px);
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cookie-consent__btn--accept {
	background: linear-gradient(180deg, var(--news-gold-bright, #ffd700) 0%, var(--news-gold, #ffcc00) 100%);
	color: var(--news-charcoal, #1a1a1a);
	border: none;
	box-shadow: 0 2px 10px rgba(var(--news-gold-rgb, 255, 204, 0), 0.35);
}

.cookie-consent__btn--accept:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(var(--news-gold-rgb, 255, 204, 0), 0.45);
}

.cookie-consent__btn--reject {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.35);
}

.cookie-consent__btn--reject:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.55);
}

.cookie-consent__btn:focus-visible {
	outline: 3px solid var(--news-gold, #ffcc00);
	outline-offset: 2px;
}

/* Bouton rouvrir les préférences */
.cookie-consent-settings {
	position: fixed;
	inset-inline-start: max(12px, env(safe-area-inset-left, 12px));
	bottom: max(16px, env(safe-area-inset-bottom, 16px));
	z-index: 100005;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 12px;
	font-family: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--news-charcoal, #1a1a1a);
	background: var(--news-gold, #ffcc00);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--news-radius-pill, 999px);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cookie-consent-settings.is-visible {
	display: inline-flex;
}

.cookie-consent-settings[hidden]:not(.is-visible) {
	display: none !important;
}

.cookie-consent-settings:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.cookie-consent-settings:focus-visible {
	outline: 3px solid var(--news-gold, #ffcc00);
	outline-offset: 2px;
}

body.has-cookie-consent-open .entry-share-sticky.is-visible ~ *,
body.has-cookie-consent-open .footer-back-top.is-visible {
	/* back-top géré via JS offset si besoin */
}

@media (max-width: 768px) {
	body.has-cookie-consent-open.has-sticky-share .cookie-consent {
		bottom: 56px;
		padding-bottom: 0;
	}

	body.has-cookie-consent-open .cookie-consent-settings {
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}

	body.has-cookie-consent-open.has-sticky-share .cookie-consent-settings {
		bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	}

	.cookie-consent__inner {
		flex-direction: column;
		align-items: stretch;
		border-radius: var(--news-radius-md, 12px);
	}

	.cookie-consent__actions {
		flex-direction: column;
		width: 100%;
	}

	.cookie-consent__btn {
		width: 100%;
		justify-content: center;
		display: inline-flex;
		align-items: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cookie-consent {
		transition: none;
	}
}
