/* ─── CHRISTMAS MODE (JÓLASTILLING) ───────────────────
   Loaded only while Christmas mode is active (inc/seasonal.php).
   Everything is scoped under body.is-christmas; the glow and greeting
   only apply to the front page hero. */

/* ─── SNOW LAYERS ─────────────────────────────────────
   snow.js marks each dark area it snows on as a host.
   Cover blocks (hero images): video, dim overlay, glow, snow, content.
   Plain sections: own background, snow, content (snow sits behind
   cards and text, never on top of them). */

.is-christmas .saelk-snow,
.is-christmas .saelk-xmas-glow {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.is-christmas .saelk-snow-host--cover > .saelk-snow,
.is-christmas .saelk-snow-host--cover > .saelk-xmas-glow {
	z-index: 1;
}

.is-christmas .saelk-snow-host--cover > .wp-block-cover__inner-container {
	z-index: 2;
}

.is-christmas .saelk-snow-host--section {
	position: relative;
	isolation: isolate;
}

.is-christmas .saelk-snow-host--section > .saelk-snow {
	z-index: -1;
}

.is-christmas .saelk-snow {
	opacity: 0;
	transition: opacity 2.5s ease;
}

.is-christmas .saelk-snow.is-ready {
	opacity: 1;
}

/* ─── CANDLELIGHT GLOW ────────────────────────────────
   Amber light rising from the bottom centre of the hero, like a lit
   shop window, plus a soft vignette. The video stays fully visible. */

.is-christmas .saelk-xmas-glow {
	opacity: 0;
	transition: opacity 2s ease;
}

.is-christmas .saelk-xmas-glow.is-ready {
	opacity: 1;
}

.is-christmas-glow-deep .saelk-xmas-glow {
	background:
		radial-gradient(ellipse 80% 60% at 50% 112%, rgba(222, 158, 84, 0.42), rgba(198, 134, 66, 0) 74%),
		radial-gradient(ellipse 40% 30% at 18% 100%, rgba(198, 134, 66, 0.14), rgba(198, 134, 66, 0) 70%),
		radial-gradient(ellipse 40% 30% at 82% 100%, rgba(198, 134, 66, 0.14), rgba(198, 134, 66, 0) 70%),
		radial-gradient(ellipse 120% 90% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(10, 6, 2, 0.45) 100%);
}

/* ─── GREETING ────────────────────────────────────────
   "Gleðileg jól" in caramel Cormorant italic above the welcome line,
   with a fine gold rule underneath. A flex item of the hero group, so
   it picks up the group's existing spacing. The hero is the first
   cover block in the page content (the content starts with a stray
   paragraph, so :first-child cannot be used). */

.is-christmas.home .wp-block-post-content > .wp-block-cover:not(.wp-block-cover ~ .wp-block-cover) > .wp-block-cover__inner-container > .wp-block-group:first-child::before {
	content: "Gleðileg jól";
	display: block;
	padding-bottom: 14px;
	font-family: var(--wp--preset--font-family--cormorant-garamond), Georgia, serif;
	font-style: italic;
	font-weight: 400;
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	line-height: 1.1;
	letter-spacing: 0.04em;
	text-align: center;
	color: #D9A066;
	text-shadow: 0 0 18px rgba(198, 134, 66, 0.35);
	background: linear-gradient(90deg, rgba(198, 134, 66, 0), #C68642 50%, rgba(198, 134, 66, 0)) no-repeat center bottom / 120px 1px;
	animation: saelk-xmas-fade-in 1.8s ease both 0.4s;
}

@keyframes saelk-xmas-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.is-christmas.home .wp-block-post-content > .wp-block-cover:not(.wp-block-cover ~ .wp-block-cover) > .wp-block-cover__inner-container > .wp-block-group:first-child::before {
		animation: none;
	}
}

/* ─── MENU ITEM: "JÓLIN" ──────────────────────────────
   Added as the last menu item by inc/seasonal.php. The theme's nav
   colours use !important per header state, so these selectors carry
   .is-christmas for the extra specificity. */

.is-christmas .saelk-xmas-nav-item > .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	transition: color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.is-christmas .saelk-xmas-star {
	flex-shrink: 0;
}

/* Wine red: a deep red pill with cream text and a gold star. */
.is-christmas-raudur .site-header .saelk-xmas-nav-item > .wp-block-navigation-item__content,
.is-christmas-raudur .saelk-xmas-nav-item > .wp-block-navigation-item__content {
	color: #F7EBD9 !important;
	background: #7A1F27;
	padding: 6px 14px 6px 12px;
	border-radius: 999px;
	box-shadow: inset 0 0 0 1px rgba(217, 160, 102, 0.45);
}

.is-christmas-raudur .saelk-xmas-nav-item .saelk-xmas-star {
	color: #D9A066;
}

.is-christmas-raudur .site-header .saelk-xmas-nav-item > .wp-block-navigation-item__content:hover,
.is-christmas-raudur .saelk-xmas-nav-item > .wp-block-navigation-item__content:hover {
	color: #FFFFFF !important;
	background: #8E2630;
}

/* Breathing room between the previous item's dropdown arrow and the pill
   (they were 2px apart). Measured: the menu stays on one row with up to
   24px here at every width from 1230px up. */
.is-christmas .site-header .wp-block-navigation__container > .saelk-xmas-nav-item {
	margin-left: 12px;
}

/* The "Jólin" pill makes the menu 82px wider, which pushed it onto a
   second row on laptop widths (roughly 1240-1365px). There the other top
   level items give up some side padding, scaling from the normal 16px at
   1365px down to 8px, so the menu stays on one row wherever it fits on
   one row without Christmas mode. The 1170px leaves room for a scrollbar. */
@media (min-width: 961px) and (max-width: 1365px) {
	.is-christmas .site-header .wp-block-navigation__container > .wp-block-navigation-item:not(.saelk-xmas-nav-item) > .wp-block-navigation-item__content {
		padding-left: clamp(8px, calc((100vw - 1170px) / 12), 16px);
		padding-right: clamp(8px, calc((100vw - 1170px) / 12), 16px);
	}
}

/* ─── TOP BAR MESSAGE ─────────────────────────────────
   christmas-banner.js moves the Christmas message into the Tactica
   Opening Hours bar (the plugin's own output is left as it is).

   Side by side (.is-split): Christmas message, gold divider, opening
   hours, all on one line. Used whenever everything fits.

   Alternating (.is-rotating): when it does not fit (phones, or long
   holiday/announcement text from the plugin), both links share one grid
   cell so the bar keeps its height; only the active one is visible and
   clickable. */

.is-christmas .saelk-xmas-banner-cta {
	margin-left: 0.5em;
	padding-bottom: 1px;
	border-bottom: 1px solid currentColor;
}

.is-christmas .saelk-xmas-banner-divider {
	display: none;
}

/* Side by side */

.is-christmas .saelk-hours-banner.is-split {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: 22px;
	padding-left: 16px;
	padding-right: 16px;
}

.is-christmas .saelk-hours-banner.is-split > .saelk-hours-banner-inner {
	flex: 0 0 auto;
	white-space: nowrap;
}

.is-christmas .saelk-hours-banner.is-split > .saelk-xmas-banner-divider {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 7px;
}

.is-christmas .saelk-xmas-banner-divider::before,
.is-christmas .saelk-xmas-banner-divider::after {
	content: "";
	width: 18px;
	height: 1px;
}

.is-christmas .saelk-xmas-banner-divider::before {
	background: linear-gradient(90deg, rgba(217, 160, 102, 0), rgba(217, 160, 102, 0.8));
}

.is-christmas .saelk-xmas-banner-divider::after {
	background: linear-gradient(90deg, rgba(217, 160, 102, 0.8), rgba(217, 160, 102, 0));
}

.is-christmas .saelk-xmas-banner-divider svg {
	display: block;
	color: #D9A066;
}

/* Alternating */

.is-christmas .saelk-hours-banner.is-rotating {
	display: grid;
}

.is-christmas .saelk-hours-banner.is-rotating > .saelk-hours-banner-inner {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

.is-christmas .saelk-hours-banner.is-rotating > .saelk-hours-banner-inner.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.6s ease, visibility 0s;
}

/* No fade while christmas-banner.js measures whether everything fits. */
.is-christmas .saelk-hours-banner.is-measuring > .saelk-hours-banner-inner {
	transition: none !important;
}

/* Wine red: deep red bar with a soft sheen, cream text, gold accents. */
.is-christmas-raudur .saelk-hours-banner.has-xmas-msg {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 60%),
		linear-gradient(90deg, #561419, #7A1F27 50%, #561419);
	border-bottom-color: rgba(217, 160, 102, 0.45);
}

.is-christmas-raudur .saelk-hours-banner.has-xmas-msg .saelk-hours-text,
.is-christmas-raudur .saelk-hours-banner.has-xmas-msg .saelk-hours-banner-inner svg {
	color: #F7EBD9;
}

.is-christmas-raudur .saelk-xmas-banner-msg .saelk-xmas-banner-cta,
.is-christmas-raudur .saelk-xmas-banner-msg svg,
.is-christmas-raudur .saelk-hours-banner.has-xmas-msg .tactica-oh-label {
	color: #E2AE74;
}

.is-christmas .saelk-hours-banner.has-xmas-msg .tactica-oh-sep {
	opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
	.is-christmas .saelk-hours-banner.is-rotating > .saelk-hours-banner-inner,
	.is-christmas .saelk-hours-banner.is-rotating > .saelk-hours-banner-inner.is-active {
		transition: none;
	}
}

