/*
 * Christmas look. Loaded only between K24_CHRISTMAS_FROM and K24_CHRISTMAS_TO (inc/christmas.php),
 * and everything is scoped to body.k24-christmas.
 */

/* ---------- Colours: holly red + pine green + gold ---------- */
/* --k24-xm-alt replaces the neon purple (#8b5cf6) in gradients; --k24-cyan becomes pine green. */
:root:not([data-theme="dark"]) .k24-christmas {
	--k24-primary: #c92a2a;
	--k24-primary-soft: #fff0f0;
	--k24-cyan: #1f8f4e;
	--k24-page: #f4f6f4;
	--k24-footer: #12372b;
	--k24-xm-alt: #1f8f4e;
	--k24-xm-hover: #a51d1d;
	--k24-xm-deep: #8a1c1c;
	--k24-xm-pale: #f3b8b8;
	--k24-xm-glow: 201, 42, 42;
}
[data-theme="dark"] .k24-christmas {
	--k24-primary: #ef3b4d;
	--k24-primary-hover: #ff6b78;
	--k24-primary-soft: #3a1c20;
	--k24-cyan: #43d17a;
	--k24-page: #070d0b;
	--k24-bg: #0f1714;
	--k24-surface: #15201c;
	--k24-surface-2: #1c2a25;
	--k24-line: #243530;
	--k24-strong: #2e433c;
	--k24-muted: #8ea39a;
	--k24-sub: #b9cbc3;
	--k24-footer: #08110e;
	--k24-frame: 0 0 0 1px rgba(239, 59, 77, .10), 0 0 40px rgba(0, 0, 0, .6);
	--k24-xm-alt: #1fa35a;
	--k24-xm-pale: #ffb3b3;
	--k24-xm-glow: 239, 59, 77;
}

/* ---------- Header ---------- */
.k24-christmas .k24-logo { display: inline-flex; align-items: center; }
.k24-christmas .k24-logo::after {
	content: "🎄";
	margin-left: 6px;
	font-size: 20px;
	line-height: 1;
	animation: k24-xm-sway 4s ease-in-out infinite;
	transform-origin: 50% 100%;
}
.k24-christmas .k24-logo span { color: #ff6b6b; }

/* String of fairy lights along the bottom edge of the header */
.k24-christmas .k24-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -4px;
	height: 8px;
	background:
		radial-gradient(circle 3px at 6px 4px, #ff6b6b 90%, transparent) 0 0 / 48px 8px repeat-x,
		radial-gradient(circle 3px at 18px 4px, #ffd43b 90%, transparent) 0 0 / 48px 8px repeat-x,
		radial-gradient(circle 3px at 30px 4px, #69db7c 90%, transparent) 0 0 / 48px 8px repeat-x,
		radial-gradient(circle 3px at 42px 4px, #74c0fc 90%, transparent) 0 0 / 48px 8px repeat-x;
	filter: drop-shadow(0 0 3px rgba(255, 236, 153, .8));
	pointer-events: none;
	animation: k24-xm-twinkle 1.8s ease-in-out infinite alternate;
}

/* ---------- Falling snow (assets/christmas.js draws it) ---------- */
.k24-xmsnow {
	position: fixed;
	inset: 0;
	z-index: 40; /* over the page, under the header (50) and its menus */
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* ---------- Santa's sleigh along the bottom (assets/christmas.js) ---------- */
.k24-xmsleigh {
	position: fixed;
	left: 0;
	bottom: 2px;
	z-index: 41; /* over the snow, under the header and its menus */
	width: 220px;
	visibility: hidden;
	pointer-events: none;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
}
.k24-xmsleigh svg { display: block; width: 100%; height: auto; }
.k24-xmsleigh.is-riding {
	visibility: visible;
	animation: k24-xm-ride 16s linear both;
}
.k24-xmsleigh.is-riding svg { animation: k24-xm-bob .5s ease-in-out infinite alternate; }
.k24-xmsleigh__legs path { fill: none; stroke: #6e4423; stroke-width: 3; stroke-linecap: round; }
.k24-xmsleigh__legs { transform-box: fill-box; transform-origin: 50% 0; animation: k24-xm-gallop .32s ease-in-out infinite alternate; }
.k24-xmsleigh__legs--b { animation-delay: -.16s; }
.k24-xmsleigh__nose { animation: k24-xm-twinkle .6s ease-in-out infinite alternate; }
@media (max-width: 600px) {
	.k24-xmsleigh { width: 150px; }
}

/* ---------- Banner under the header ---------- */
.k24-xmbar {
	background: linear-gradient(90deg, #12372b, #1e6b45 50%, #b02525);
	color: #fff;
	font-size: 14px;
}
.k24-xmbar__inner {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding-top: 8px;
	padding-bottom: 8px;
}
.k24-xmbar__icon { font-size: 20px; line-height: 1; flex: none; }
.k24-xmbar__gift { animation: k24-xm-hop 2.4s ease-in-out infinite; }
button.k24-xmbar__gift {
	padding: 4px;
	margin: -4px 0;
	border: 0;
	border-radius: 8px;
	background: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	filter: drop-shadow(0 0 6px rgba(255, 224, 102, .7));
}
button.k24-xmbar__gift:hover { background: rgba(255, 255, 255, .15); }
button.k24-xmbar__gift:focus-visible { outline: 2px solid #ffe066; outline-offset: 2px; }
.k24-xmbar__text { margin: 0; flex: 1; min-width: 0; }
.k24-xmbar__text b { color: #ffe066; margin-right: 6px; }

/* ---------- Gift modal (inc/christmas.php) ---------- */
.k24-xmgift { width: min(420px, calc(100vw - 32px)); border-radius: 12px; overflow: hidden; border-top: 4px solid #c92a2a; }
.k24-xmgift .k24-modal__box { padding: 22px 22px 18px; }
.k24-xmgift__art { margin: 0 0 6px; font-size: 44px; line-height: 1; text-align: center; animation: k24-xm-hop 2.4s ease-in-out infinite; }
.k24-xmgift .k24-modal__title { justify-content: center; text-align: center; }
.k24-xmgift .k24-modal__text { text-align: center; }
.k24-xmgift__done,
.k24-xmgift[data-opened] .k24-xmgift__intro,
.k24-xmgift[data-opened] .k24-xmgift__claim { display: none; }
.k24-xmgift[data-opened] .k24-xmgift__done { display: block; }
.k24-xmgift:not([data-opened]) .k24-xmgift__codes,
.k24-xmgift:not([data-opened]) .k24-xmgift__my { display: none; }
.k24-xmgift__codes { list-style: none; margin: 0 0 16px; padding: 0; }
.k24-xmgift__codes li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 1px dashed rgba(201, 42, 42, .45);
	border-radius: 8px;
	background: var(--k24-page);
}
.k24-xmgift__codes li + li { margin-top: 6px; }
.k24-xmgift__code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .06em; color: var(--k24-primary); }
.k24-xmgift__codes small { flex: 1; min-width: 0; color: var(--k24-muted); font-size: 11px; }
.k24-xmgift__codes .is-used .k24-xmgift__code { color: var(--k24-muted); text-decoration: line-through; }
.k24-xmgift__copy {
	flex: none;
	padding: 4px 10px;
	border: 1px solid var(--k24-line);
	border-radius: 6px;
	background: transparent;
	color: var(--k24-text);
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}
.k24-xmgift__copy:hover { border-color: var(--k24-primary); color: var(--k24-primary); }
.k24-xmgift__copy.is-copied { border-color: #2f9e44; color: #2f9e44; }
.k24-xmgift__used { flex: none; color: var(--k24-muted); font-size: 12px; }
.k24-xmgift__error { margin: 0 0 12px; color: #e03131; font-size: 13px; text-align: center; }
.k24-xmgift .k24-modal__actions { flex-wrap: wrap; }
.k24-xmgift .k24-modal__ok,
.k24-xmgift .k24-modal__cancel { border-radius: 8px; }
.k24-xmgift .k24-modal__ok { background: linear-gradient(90deg, #c92a2a, #1f8f4e); }
.k24-xmgift .k24-modal__ok:hover { filter: brightness(1.1); }
.k24-xmgift .k24-modal__ok[disabled] { opacity: .6; cursor: wait; }
a.k24-xmgift__my { margin-right: auto; text-decoration: none; }
[data-theme="dark"] .k24-xmgift__codes li { background: var(--k24-bg); border-color: rgba(239, 59, 77, .4); }
[data-theme="dark"] .k24-xmgift__copy.is-copied { border-color: #43d17a; color: #43d17a; }
[data-theme="dark"] .k24-xmgift__error { color: #ff8a80; }
@media (max-width: 480px) {
	.k24-xmgift__codes li { flex-wrap: wrap; }
	.k24-xmgift__codes small { order: 3; flex-basis: 100%; }
}

/* ---------- Footer ---------- */
.k24-christmas .k24-footer { box-shadow: inset 0 3px 0 #c92a2a; }

/* ---------- Neon theme: swap the pink/purple/cyan glow for red, green and gold ---------- */
/* Gradients that ran pink -> purple now run red -> green */
.k24-christmas .k24-sitesearch button,
[data-theme="dark"] .k24-christmas .k24-btn:not([disabled]),
[data-theme="dark"] .k24-christmas .k24-top,
[data-theme="dark"] .k24-christmas .k24-tab[aria-selected="true"] {
	background: linear-gradient(90deg, var(--k24-primary), var(--k24-xm-alt));
}
[data-theme="dark"] .k24-christmas .k24-btn:not([disabled]),
[data-theme="dark"] .k24-christmas .k24-top,
[data-theme="dark"] .k24-christmas .k24-tab[aria-selected="true"] { box-shadow: 0 0 16px rgba(var(--k24-xm-glow), .35); }
[data-theme="dark"] .k24-christmas .k24-btn[disabled] { background: #2a2124; color: #a08a8d; }

/* Night sky: red glow top left, pine green top right */
[data-theme="dark"] body.k24-christmas {
	background:
		radial-gradient(900px 520px at 8% -8%, rgba(239, 59, 77, .15), transparent 60%),
		radial-gradient(900px 560px at 108% 12%, rgba(67, 209, 122, .10), transparent 60%),
		var(--k24-page);
	background-attachment: fixed;
}
[data-theme="dark"] .k24-christmas .k24-header { background: rgba(8, 17, 14, .84); }
[data-theme="dark"] .k24-christmas .k24-main > .k24-container { background: rgba(15, 23, 20, .8); }
[data-theme="dark"] .k24-christmas .k24-box { background: linear-gradient(180deg, var(--k24-surface), rgba(21, 32, 28, .55)); }
[data-theme="dark"] .k24-christmas .k24-card__thumb { background: linear-gradient(135deg, #2a1a1d, #13261d); }

/* Logo: snowy white into red, "hrs." in gold */
[data-theme="dark"] .k24-christmas .k24-logo {
	background: linear-gradient(90deg, #fff 0%, #ffd0d4 45%, var(--k24-primary) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	text-shadow: 0 0 18px rgba(239, 59, 77, .35);
}
[data-theme="dark"] .k24-christmas .k24-logo span { color: #ffd166; -webkit-text-fill-color: #ffd166; }
:root:not([data-theme="dark"]) .k24-christmas .k24-logo span { color: #ffd166; }
.k24-christmas .k24-logo::after { -webkit-text-fill-color: initial; text-shadow: none; }

/* Menu, badges, boxes: red glow instead of pink */
[data-theme="dark"] .k24-christmas .k24-nav > ul > li > a:hover { text-shadow: 0 0 10px rgba(239, 59, 77, .8); }
[data-theme="dark"] .k24-christmas .k24-nav > ul > :is(.current-menu-item, .current_page_item, .current-cat, .current-cat-parent, .current-menu-ancestor) > a {
	background: rgba(239, 59, 77, .14);
	box-shadow: inset 0 0 0 1px rgba(239, 59, 77, .55), 0 0 16px rgba(239, 59, 77, .25);
}
[data-theme="dark"] .k24-christmas .k24-badge { box-shadow: 0 0 10px rgba(239, 59, 77, .55); }
[data-theme="dark"] .k24-christmas .k24-sitesearch input:focus { box-shadow: 0 0 0 3px rgba(239, 59, 77, .2); }
[data-theme="dark"] .k24-christmas .k24-att { border-color: rgba(67, 209, 122, .35); box-shadow: 0 0 26px rgba(67, 209, 122, .10), inset 0 1px 0 rgba(255, 255, 255, .04); }
[data-theme="dark"] .k24-christmas .k24-att__num { text-shadow: 0 0 14px rgba(239, 59, 77, .6); }
[data-theme="dark"] .k24-christmas .k24-card:not(.is-featured):hover .k24-card__thumb,
[data-theme="dark"] .k24-christmas .k24-card.is-featured:hover { box-shadow: 0 0 0 1px var(--k24-primary), 0 0 22px rgba(239, 59, 77, .35); }
[data-theme="dark"] .k24-christmas .k24-chat__box { box-shadow: 0 0 30px rgba(67, 209, 122, .07); }

/* Pink text accents (comment counts, tags, info notes) */
[data-theme="dark"] .k24-christmas :is(.k24-list__cmt, .k24-board__cmt, .k24-post__tags a, .k24-flash--info, .k24-ed__chip, .k24-post__body a.k24-dl, .k24-post__body .wp-block-button__link) { color: var(--k24-xm-pale); }
[data-theme="dark"] .k24-christmas :is(.k24-post__tags a:hover, .k24-ed__chip button:hover) { background: #42202a; }

/* Light theme: hard-coded pink hovers and borders */
:root:not([data-theme="dark"]) .k24-christmas :is(.k24-btn, .k24-cform__submit, .k24-chat__send, .k24-new-topic, .k24-bb-hide.is-locked a, .k24-modal__ok, .k24-auth__submit):hover { background: var(--k24-xm-hover); }
:root:not([data-theme="dark"]) .k24-christmas :is(.k24-post__tags a, .k24-flash--info) { color: var(--k24-xm-deep); }
:root:not([data-theme="dark"]) .k24-christmas :is(.k24-act:hover, button.k24-user:hover, .k24-chat__more:hover, .k24-post__owner a:hover) { border-color: var(--k24-xm-pale); }
:root:not([data-theme="dark"]) .k24-christmas :is(.k24-bb-quote, .k24-chat__quote) { border-left-color: var(--k24-xm-pale); }
:root:not([data-theme="dark"]) .k24-christmas .k24-header :is(.k24-signup, .k24-login-btn):hover { color: #ffd166; }

/* ---------- Motion ---------- */
@keyframes k24-xm-sway {
	0%, 100% { transform: rotate(0); }
	50% { transform: rotate(-6deg); }
}
@keyframes k24-xm-twinkle {
	from { opacity: .55; }
	to { opacity: 1; }
}
@keyframes k24-xm-ride {
	from { transform: translateX(-100%); }
	to { transform: translateX(100vw); }
}
@keyframes k24-xm-bob {
	from { transform: translateY(0); }
	to { transform: translateY(-3px); }
}
@keyframes k24-xm-gallop {
	from { transform: rotate(-18deg); }
	to { transform: rotate(18deg); }
}
@keyframes k24-xm-hop {
	0%, 70%, 100% { transform: translateY(0); }
	80% { transform: translateY(-4px); }
	90% { transform: translateY(0); }
}

@media (max-width: 900px) {
	.k24-xmbar { font-size: 13px; }
	span.k24-xmbar__gift { display: none; } /* The gift button stays: it opens the gift. */
}

/* Phones: the header has no room to spare */
@media (max-width: 480px) {
	.k24-christmas .k24-logo::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.k24-christmas .k24-logo::after,
	.k24-christmas .k24-header::after,
	.k24-xmbar__gift,
	.k24-xmgift__art { animation: none; }
	.k24-xmsleigh { display: none; }
}
