/**
 * Engagement — progression, partage, newsletter, suggestions, retour haut.
 */

/* ── Barre de progression ── */
.reading-progress {
	position: fixed;
	top: 0;
	inset-inline: 0;
	z-index: 9998;
	height: 3px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease;
	background: transparent;
}

.reading-progress.is-active {
	opacity: 1;
}

.reading-progress__bar {
	display: block;
	height: 100%;
	width: 0;
	background: linear-gradient(
		90deg,
		var(--news-red, #e60000) 0%,
		var(--news-gold, #ffcc00) 55%,
		var(--news-gold-bright, #ffd700) 100%
	);
	box-shadow: 0 0 8px rgba(var(--news-gold-rgb, 255, 204, 0), 0.45);
	transition: width 0.08s linear;
	transform-origin: right center;
}

/* ── Badge temps de lecture ── */
.reading-time-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
	padding: 5px 12px;
	font-size: max(0.75rem, var(--type-meta));
	font-weight: 700;
	line-height: 1.3;
	color: var(--news-charcoal, #1a1a1a);
	background: linear-gradient(135deg, rgba(var(--news-gold-rgb, 255, 204, 0), 0.18) 0%, rgba(var(--news-gold-rgb, 255, 204, 0), 0.08) 100%);
	border: 1px solid rgba(var(--news-gold-rgb, 255, 204, 0), 0.45);
	border-radius: var(--news-radius-pill, 999px);
}

.reading-time-badge svg {
	flex-shrink: 0;
	opacity: 0.75;
}

/* ── Partage optimisé (desktop) ── */
body.single-lachtv .entry-share--enhanced {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	padding: 12px 14px;
	background: var(--news-canvas, #f5f6f8);
	border: 1px solid var(--news-border-subtle, #eef0f4);
	border-radius: var(--news-radius-sm, 8px);
}

body.single-lachtv .entry-share__heading {
	margin: 0;
	font-size: max(0.8125rem, var(--type-meta));
	font-weight: 700;
	color: var(--news-muted, #5c6670);
	white-space: nowrap;
}

body.single-lachtv .entry-share--enhanced .entry-share__list {
	flex: 1;
	justify-content: flex-start;
	gap: 8px;
}

body.single-lachtv .entry-share--enhanced .entry-share__btn {
	width: 40px;
	height: 40px;
	border-radius: var(--news-radius-sm, 8px);
}

body.single-lachtv .entry-share--enhanced .entry-share__btn--whatsapp {
	width: auto;
	min-width: 40px;
	padding-inline: 14px;
	gap: 6px;
	font-size: 0.8125rem;
	font-weight: 700;
	background: #25d366;
	border-color: #25d366;
	color: #fff;
}

body.single-lachtv .entry-share--enhanced .entry-share__btn--whatsapp .entry-share__btn-label {
	display: inline;
}

.entry-share__btn-label {
	display: none;
}

/* ── Partage sticky mobile ── */
.entry-share-sticky {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 9990;
	display: flex;
	align-items: stretch;
	gap: 0;
	padding: 0;
	background: var(--news-charcoal, #1a1a1a);
	border-top: 2px solid var(--news-gold, #ffcc00);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
	transform: translateY(100%);
	transition: transform 0.3s var(--news-ease, cubic-bezier(0.22, 1, 0.36, 1));
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.entry-share-sticky.is-visible {
	transform: translateY(0);
}

.entry-share-sticky[hidden] {
	display: none !important;
}

.entry-share-sticky__btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 48px;
	padding: 10px 8px;
	font-size: 0.8125rem;
	font-weight: 700;
	color: #fff;
	text-decoration: none;
	background: transparent;
	border: none;
	border-inline-start: 1px solid rgba(255, 255, 255, 0.12);
	cursor: pointer;
	transition: background 0.2s ease;
}

.entry-share-sticky__btn:first-child {
	border-inline-start: none;
}

.entry-share-sticky__btn--whatsapp {
	flex: 1.4;
	background: #128c7e;
}

.entry-share-sticky__btn--whatsapp:hover,
.entry-share-sticky__btn--whatsapp:focus-visible {
	background: #0d7268;
	color: #fff;
}

.entry-share-sticky__btn--copy.is-copied {
	background: var(--news-gold, #ffcc00);
	color: var(--news-charcoal, #1a1a1a);
}

/* ── Newsletter fin d'article ── */
.article-newsletter {
	margin: clamp(24px, 4vw, 36px) 0 clamp(20px, 3vw, 28px);
	padding: 0;
}

.article-newsletter__inner {
	display: flex;
	align-items: flex-start;
	gap: clamp(14px, 2.5vw, 20px);
	padding: clamp(18px, 3vw, 24px);
	background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 55%, #1a1a1a 100%);
	border: 1px solid rgba(var(--news-gold-rgb, 255, 204, 0), 0.35);
	border-radius: var(--news-radius-md, 12px);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
	position: relative;
	overflow: hidden;
}

.article-newsletter__inner::before {
	content: "";
	position: absolute;
	top: 0;
	inset-inline: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--news-red, #e60000), var(--news-gold, #ffcc00));
}

.article-newsletter__icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(var(--news-gold-rgb, 255, 204, 0), 0.15);
	border: 1px solid rgba(var(--news-gold-rgb, 255, 204, 0), 0.4);
	color: var(--news-gold, #ffcc00);
}

.article-newsletter__title {
	margin: 0 0 6px;
	font-size: clamp(1.0625rem, 3vw, 1.25rem);
	font-weight: 800;
	line-height: 1.35;
	color: #fff;
}

.article-newsletter__desc {
	margin: 0 0 14px;
	font-size: var(--type-small);
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.72);
}

.article-newsletter__form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}

.article-newsletter__input {
	flex: 1 1 180px;
	min-width: 0;
	padding: 11px 14px;
	font-size: 0.9375rem;
	font-family: inherit;
	color: var(--news-ink);
	background: #fff;
	border: 2px solid transparent;
	border-radius: var(--news-radius-sm, 8px);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-newsletter__input:focus-visible {
	outline: var(--a11y-focus-ring, 3px solid var(--news-gold, #ffcc00)) !important;
	outline-offset: 2px;
	border-color: var(--news-gold, #ffcc00);
	box-shadow: 0 0 0 3px rgba(var(--news-gold-rgb, 255, 204, 0), 0.25);
}

.article-newsletter__btn {
	flex: 0 0 auto;
	padding: 11px 20px;
	font-size: 0.9375rem;
	font-weight: 800;
	font-family: inherit;
	color: var(--news-charcoal, #1a1a1a);
	background: linear-gradient(180deg, var(--news-gold-bright, #ffd700) 0%, var(--news-gold, #ffcc00) 100%);
	border: none;
	border-radius: var(--news-radius-sm, 8px);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-newsletter__btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(var(--news-gold-rgb, 255, 204, 0), 0.4);
}

.article-newsletter__note {
	margin: 0;
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.5);
}

/* ── Suggestions articles enrichies ── */
body.single-lachtv .related-posts--engagement .related-posts__subtitle {
	margin: 4px 0 0;
	font-size: max(0.8125rem, var(--type-meta));
	font-weight: 500;
	color: var(--news-muted, #5c6670);
}

body.single-lachtv .related-post--mosaic .related-post__meta {
	position: absolute;
	inset-inline: 0;
	bottom: 2.75em;
	top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 0 10px;
	pointer-events: none;
	z-index: 2;
}

body.single-lachtv .related-post--mosaic .related-post__cat {
	display: inline-block;
	padding: 2px 7px;
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--news-charcoal, #1a1a1a);
	background: var(--news-gold, #ffcc00);
	border-radius: 4px;
}

body.single-lachtv .related-post--mosaic .related-post__reading {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 2px 7px;
	font-size: 0.6875rem;
	font-weight: 600;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 4px;
}

body.single-lachtv .related-post--mosaic .related-post__title {
	padding-top: 0;
	font-size: clamp(0.8125rem, 2.2vw, 0.875rem);
}

/* ── Footer newsletter premium ── */
.site-footer.site-footer--harmonized .footer-top-col--newsletter {
	position: relative;
}

.site-footer.site-footer--harmonized .footer-top-col--newsletter::before {
	content: "✉";
	position: absolute;
	top: 0;
	inset-inline-end: 0;
	font-size: 2.5rem;
	opacity: 0.08;
	pointer-events: none;
}

.site-footer.site-footer--harmonized .footer-top-col--newsletter .footer-top-title {
	font-size: clamp(1.125rem, 2.5vw, 1.3125rem);
	font-weight: 800;
}

.site-footer.site-footer--harmonized .footer-newsletter-btn {
	font-weight: 800;
	letter-spacing: 0.02em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ── Retour en haut amélioré ── */
.site-footer.site-footer--harmonized .footer-back-top {
	inset-inline-end: max(16px, env(safe-area-inset-right, 16px));
	bottom: max(20px, env(safe-area-inset-bottom, 20px));
	width: 46px;
	height: 46px;
	background: var(--news-charcoal, #1a1a1a);
	border: 2px solid var(--news-gold, #ffcc00);
	color: var(--news-gold, #ffcc00);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body.has-reading-progress .site-footer.site-footer--harmonized .footer-back-top {
	bottom: max(20px, env(safe-area-inset-bottom, 20px));
}

@media (max-width: 768px) {
	body.has-sticky-share .site-footer.site-footer--harmonized .footer-back-top.is-visible {
		bottom: calc(56px + env(safe-area-inset-bottom, 0px));
	}

	body.single-lachtv .entry-share--enhanced {
		display: none;
	}

	.article-newsletter__inner {
		flex-direction: column;
		align-items: stretch;
	}

	.article-newsletter__icon {
		width: 44px;
		height: 44px;
	}

	.article-newsletter__form {
		flex-direction: column;
	}

	.article-newsletter__btn {
		width: 100%;
	}

	body.single-lachtv .related-posts__grid--mosaic {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	body.single-lachtv .related-posts__grid--mosaic {
		grid-template-columns: 1fr;
	}
}

body.dark-mode .reading-time-badge {
	color: var(--news-ink, #fafafa);
	background: rgba(var(--news-gold-rgb, 255, 204, 0), 0.12);
}

body.dark-mode.single-lachtv .entry-share--enhanced {
	background: rgba(255, 255, 255, 0.04);
	border-color: var(--news-border);
}

@media (prefers-reduced-motion: reduce) {
	.reading-progress__bar,
	.entry-share-sticky {
		transition: none !important;
	}
}
