/* Christmas mode -- loaded only by inc/christmas.php, from the
   WPS-julemockups design (2026-11-26). Every rule is scoped under
   body.np-christmas and every image lives in assets/images/christmas/, so
   reverting the MR removes all of it.

   1. Main-page heroes (homepage, Funksjoner, Rådgivning, Ressurser,
      Kontakt oss): falling snow dots + a snowdrift edge.
   2. «Bytt enkelt til Workplace Safety» (.ws-home-showcase): hanging
      baubles (julekuler), beside the text on wide screens, above it below.
   3. Footer (every page): wavy snowdrift top edge. */

/* --- 1. Main-page heroes ---------------------------------------------------
   Only pages tagged body.np-xmas-hero in inc/christmas.php: homepage,
   Funksjoner, Rådgivning, Ressurser, Kontakt oss (nb + en). The white and
   sage hero variants are skipped (white snow would not show there). */
.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage) {
	position: relative;
}

.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage)::before,
.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage)::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	z-index: 0;
	pointer-events: none;
}

/* Snow dots across the whole hero, falling slowly. Two layers: near dots
   (400px tile, ~17px/s) fall faster than the sparser far layer (380px
   tile, ~8px/s), for a bit of depth. Each layer moves a whole number of
   tiles per 48s loop, so the loop is seamless. CSS only, no JavaScript. */
.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage)::before {
	top: 0;
	bottom: 0;
	background:
		url("../images/christmas/snow-dots.svg") 0 0 / 400px 400px repeat,
		url("../images/christmas/snow-dots.svg") 170px 90px / 380px 380px repeat;
	animation: np-xmas-snowfall 48s linear infinite;
}

@keyframes np-xmas-snowfall {
	from { background-position: 0 0, 170px 90px; }
	to   { background-position: 0 800px, 170px 470px; }
}

/* Visitors who ask for less motion get the still snow from the mockup. */
@media (prefers-reduced-motion: reduce) {
	.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage)::before {
		animation: none;
	}
}

/* Snowdrift along the bottom edge. The SVG is used as a mask so the drift
   takes the colour of the section below: white by default, light grey
   when the next section is .ws-section--alt (Funksjoner). */
.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage)::after {
	bottom: -1px;
	height: 40px;
	background-color: #ffffff;
	-webkit-mask: url("../images/christmas/drift-white.svg") center bottom / 100% 100% no-repeat;
	mask: url("../images/christmas/drift-white.svg") center bottom / 100% 100% no-repeat;
}

.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage):has(+ .ws-section--alt)::after {
	background-color: var(--surface-alt, #f2f4f2);
}

/* Text and photo above the dots and the drift (the photo overhangs it). */
.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage) .ws-pagehero__inner {
	position: relative;
	z-index: 1;
}

/* The breadcrumb (a «‹ Back» pill on phones) is see-through too. */
.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage) .np-crumbs ol {
	background: var(--primary-deep, #004a4a);
}

/* The outline («ghost») button is see-through, so the snow showed inside
   it. Fill it with the hero teal; hover keeps its usual lighter tint. */
.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage) .ws-btn--ghost {
	background: var(--primary-deep, #004a4a);
}

.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage) .ws-btn--ghost:hover {
	background:
		linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)),
		var(--primary-deep, #004a4a);
}

/* --- 2. Hanging baubles on the showcase section ----------------------------- */
.np-christmas .ws-home-showcase {
	position: relative;
}

.np-christmas .ws-home-showcase::before,
.np-christmas .ws-home-showcase::after {
	content: "";
	position: absolute;
	top: 0;
	width: 220px;
	height: 330px;
	background: center top / contain no-repeat;
	pointer-events: none;
}

.np-christmas .ws-home-showcase::before {
	left: max(16px, calc(50% - 600px));
	background-image: url("../images/christmas/baubles-left.svg");
}

.np-christmas .ws-home-showcase::after {
	right: max(16px, calc(50% - 600px));
	background-image: url("../images/christmas/baubles-right.svg");
}

.np-christmas .ws-home-showcase > .ws-section__inner {
	position: relative;
	z-index: 1;
}

/* Under 1280px there is no room beside the text: hang them above it.
   Tablet (641-1279px) gets mid-size baubles, phone (<=640px) small ones. */
@media (max-width: 1279px) {
	.np-christmas .ws-home-showcase {
		padding-top: 230px;
	}

	.np-christmas .ws-home-showcase::before,
	.np-christmas .ws-home-showcase::after {
		width: 140px;
		height: 210px;
	}

	.np-christmas .ws-home-showcase::before { left: 8%; }
	.np-christmas .ws-home-showcase::after  { right: 8%; }
}

@media (max-width: 640px) {
	.np-christmas .ws-home-showcase {
		padding-top: 170px;
	}

	.np-christmas .ws-home-showcase::before,
	.np-christmas .ws-home-showcase::after {
		width: 100px;
		height: 150px;
	}

	.np-christmas .ws-home-showcase::before { left: 4%; }
	.np-christmas .ws-home-showcase::after  { right: 4%; }
}

/* --- 3. Footer: snowdrift edge ------------------------------------------- */
.np-christmas .ws-footer {
	position: relative;
}

.np-christmas .ws-footer::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -47px;
	height: 48px;
	background: url("../images/christmas/drift-footer.svg") center bottom / 100% 100% no-repeat;
	pointer-events: none;
}

@media print {
	.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage)::before,
	.np-christmas.np-xmas-hero .ws-pagehero:not(.ws-pagehero--white):not(.ws-pagehero--sage)::after,
	.np-christmas .ws-home-showcase::before,
	.np-christmas .ws-home-showcase::after,
	.np-christmas .ws-footer::before {
		display: none;
	}
}
