﻿/**
 * Footer smart — mobile harmonisé sur tout le site.
 * Supprime l'espace blanc sous le footer, conserve le bouton retour haut.
 */

@media (max-width: 768px) {
	body,
	body.home,
	body.single,
	body.archive,
	body.search,
	body.page,
	body.category,
	body.single-lachtv {
		padding-bottom: 0 !important;
	}

	#page,
	.site-content {
		padding-bottom: 0 !important;
	}

	.site-footer.site-footer--harmonized {
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
	}

	.site-footer.site-footer--harmonized .footer-bottom {
		padding-bottom: max(20px, calc(14px + env(safe-area-inset-bottom, 0px))) !important;
	}

	/* Bouton retour haut — flottant, centré, sans bande blanche */
	.site-footer.site-footer--harmonized .footer-back-top {
		position: fixed !important;
		left: 50% !important;
		right: auto !important;
		inset-inline: auto !important;
		inset-inline-end: auto !important;
		transform: translateX(-50%) !important;
		bottom: max(16px, env(safe-area-inset-bottom, 12px)) !important;
		width: 48px !important;
		height: 48px !important;
		min-width: 48px !important;
		min-height: 48px !important;
		z-index: 999 !important;
		border: 2px solid rgba(0, 0, 0, 0.12);
		box-shadow:
			0 4px 18px rgba(255, 204, 0, 0.45),
			0 2px 10px rgba(0, 0, 0, 0.35) !important;
	}

	.site-footer.site-footer--harmonized .footer-back-top:hover {
		transform: translateX(-50%) translateY(-3px) !important;
	}

	.site-footer.site-footer--harmonized .footer-back-top.is-visible {
		opacity: 1 !important;
		visibility: visible !important;
	}
}

@media (min-width: 769px) {
	.site-footer.site-footer--harmonized .footer-back-top {
		inset-inline-end: clamp(16px, 3vw, 24px);
		bottom: clamp(16px, 3vw, 24px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-footer.site-footer--harmonized .footer-back-top {
		transition: opacity 0.15s ease, visibility 0.15s ease !important;
	}

	.site-footer.site-footer--harmonized .footer-back-top:hover {
		transform: translateX(-50%) !important;
	}
}
