/* Vianočná výzdoba (Christmas.php, xmas.js). Only while it is on. Nothing here takes a click, a focus or room. */

.pg-xmas-garland,
.pg-xmas-cap,
.pg-xmas-snow {
	pointer-events: none;
	user-select: none;
}

.pg-xmas-garland__svg { display: block; overflow: visible; }

/* ---------- Garland beside the open side cart, on its inner edge ---------- */
.pg-xmas-garland.is-side {
	position: fixed;
	top: var(--pg-lock-top, 0px);
	bottom: 0;
	right: calc(var(--pg-xmas-dw, 400px) - 6px); /* the clips 6 px over the edge of the drawer */
	z-index: var(--pg-z-drawer, 99999);
	width: var(--pg-xmas-thick, 60px);
	opacity: 0;
	transform: translateX(calc(var(--pg-xmas-dw, 400px) + 100%));
	transition: transform 0.35s var(--pg-ease, ease), opacity 0.2s linear 0.15s;
}
.pg-xmas-garland.is-side.is-open {
	opacity: 1;
	transform: none;
	transition: transform 0.35s var(--pg-ease, ease), opacity 0.15s linear;
}

/* ---------- Across the cart under its header (a phone: the cart is as wide as the window) ---------- */
.pg-xmas-garland.is-across {
	position: absolute;
	left: 0;
	right: 0;
	z-index: var(--pg-z-raised, 1);
	height: var(--pg-xmas-thick, 50px);
	margin-top: -6px;
	display: none;
}
.pg-xmas-garland.is-across.is-open { display: block; }

/* ---------- Over the top edge of the slides of the home page ---------- */
.pg-xmas-garland.is-top {
	position: absolute;
	top: -8px;
	left: 0;
	right: 0;
	z-index: var(--pg-z-raised, 1);
	height: var(--pg-xmas-thick, 56px);
}

/* The halo of a bulb breathes; one in a dozen flickers like an old filament. */
.pg-xmas-halo {
	animation: pg-xmas-breathe 3.4s ease-in-out infinite alternate;
	transform-box: fill-box;
	transform-origin: center;
}
.pg-xmas-halo.is-flicker { animation-name: pg-xmas-flicker; animation-timing-function: steps(1, end); animation-direction: normal; }

@keyframes pg-xmas-breathe {
	from { opacity: 0.55; }
	to   { opacity: 1; }
}
@keyframes pg-xmas-flicker {
	0%, 61%, 66%, 100% { opacity: 1; }
	62%, 65%           { opacity: 0.25; }
	83%                { opacity: 0.6; }
}

/* ---------- Snow ---------- */
.pg-xmas-snow.is-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}
.pg-xmas-snow.is-burst {
	position: fixed;
	z-index: calc(var(--pg-z-dialog, 100000) + 1);
}

/* ---------- Caps of snow ---------- */
.pg-xmas-cap {
	position: absolute;
	z-index: 1;
	display: block;
	line-height: 0;
	filter: drop-shadow(0 1px 1px rgba(23, 48, 34, 0.22));
}
.pg-xmas-cap svg { display: block; overflow: visible; }
.pg-xmas-cap[hidden] { display: none; }

.pg-xmas-flake {
	position: absolute;
	top: 60%;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 2px rgba(23, 48, 34, 0.35);
	animation: pg-xmas-fall 1s ease-in forwards;
}
@keyframes pg-xmas-fall {
	from { transform: translate(0, 0); opacity: 1; }
	to   { transform: translate(var(--dx, 0), var(--dy, 40px)); opacity: 0; }
}

/* Reduced motion: lights and caps stay, nothing moves (xmas.js draws no snow and sheds no flakes). */
@media (prefers-reduced-motion: reduce) {
	.pg-xmas-halo { animation: none; opacity: 0.85; }
	.pg-xmas-garland.is-side { transition: none; }
}

/* Print: no decoration on paper. */
@media print {
	.pg-xmas-garland, .pg-xmas-cap, .pg-xmas-snow { display: none !important; }
}
