/* XMAS_CSS_VERSION: 1.3.0 */
/* =========================================================
   Christmas theme - Homepage only (loaded via functions.php switch)
   Disable by setting $xmas_enabled = false in functions.php
   ========================================================= */

/* Decorations use position: fixed on ::before / ::after,
   always pinned to viewport top/bottom, do not scroll with page */
body.christmas-mode {
	position: relative;
	height: auto;
}

/* Top garland + festive glow:
   fixed to viewport top, shifted up 65px so overflow is clipped by browser;
   z-index:3 — below sticky nav (z-index:2000) and logo, above banner content;
   pointer-events:none so nav clicks still work */
body.christmas-mode::before {
	content: "";
	position: fixed;
	top: -65px;
	left: 0;
	right: 0;
	height: 560px;
	pointer-events: none;
	z-index: 3;
	background:
		url('images/garland-top.png') repeat-x left top / auto 240px,
		url('images/santa-left.png') no-repeat 0 250px / 222px 280px,
		radial-gradient(1200px 380px at 50% -10%, rgba(150, 24, 34, 0.16), transparent 62%),
		radial-gradient(680px 280px at 0% 0%, rgba(24, 74, 44, 0.14), transparent 65%),
		radial-gradient(680px 280px at 100% 0%, rgba(24, 74, 44, 0.14), transparent 65%);
}

/* Snowflakes rendered by magic-snowflakes library (snowflakes.min.js),
   z-index controlled via library param */

/* Bottom snow bar + Christmas tree:
   fixed to viewport bottom; snow-bottom2.png is a seamlessly tiled mirror strip;
   tree sits on top of the snow surface (~95px above viewport bottom) */
body.christmas-mode::after {
	content: "";
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 420px;
	pointer-events: none;
	z-index: 99991;
	background:
		url('images/snow-bottom2.png?v=2') repeat-x left bottom / auto 160px,
		url('images/tree.png') no-repeat right 20px bottom 65px / 180px 235px;
}

/* Mobile: scale down decorations */
@media (max-width: 767px) {
	body.christmas-mode::before {
		background:
			url('images/garland-top.png') repeat-x left top / auto 130px,
			url('images/santa-left.png') no-repeat 0 180px / 135px 170px,
			radial-gradient(1200px 380px at 50% -10%, rgba(150, 24, 34, 0.16), transparent 62%),
			radial-gradient(680px 280px at 0% 0%, rgba(24, 74, 44, 0.14), transparent 65%),
			radial-gradient(680px 280px at 100% 0%, rgba(24, 74, 44, 0.14), transparent 65%);
	}
	body.christmas-mode::after {
		background:
			url('images/snow-bottom2.png') repeat-x left bottom / auto 90px,
			url('images/tree.png') no-repeat right 10px bottom 45px / 110px 144px;
	}
}

/* Hero banner dual-image auto swap:
   ::before overlays xmas banner on top of the original background (pure CSS, no JS),
   cross-fade via opacity animation — 12s cycle, ~1s transition each side */
body.christmas-mode #page-header .header-wrapper .background-inner::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('images/xmas-banner2.jpg?v=2') no-repeat center center / cover;
	animation: xmasBannerSwap 12s ease-in-out infinite;
	will-change: opacity;
	z-index: 1;
}

@keyframes xmasBannerSwap {
	0%, 42% {
		opacity: 1;   /* xmas banner visible */
	}
	50%, 92% {
		opacity: 0;   /* original banner visible */
	}
	100% {
		opacity: 1;   /* fade back to xmas */
	}
}

/* Title/subtitle and scroll-down arrow sync with banner swap:
   hidden (opacity:0) when xmas banner shows, restored (opacity:1) on original,
   matches 12s ::before cycle for smooth cross-fade */
body.christmas-mode #page-header .row-header .vc_custom_heading_wrap,
body.christmas-mode #page-header .header-scrolldown {
	animation: xmasBannerText 12s ease-in-out infinite;
	will-change: opacity;
}

@keyframes xmasBannerText {
	0%, 42% {
		opacity: 0;   /* xmas banner → hide original text */
		visibility: hidden;
	}
	50%, 92% {
		opacity: 1;   /* original banner → show original text */
		visibility: visible;
	}
	100% {
		opacity: 0;   /* fade back to xmas */
		visibility: hidden;
	}
}
