/* ─────────────────────────────────────────────────────────────
   MRKTMAP festive theme — css/festive.css  (v3, 22 Nov 2026: snow + frost)
   Loaded by includes/header.php from 1 Dec to 6 Jan (or when
   FESTIVE_THEME is defined), which also adds class "theme-xmas" to
   <body>. Decoration only — no colours, buttons or pills are changed,
   and nothing here ever blocks a click. Checked against main.css
   (sticky .site-header 72px, z-index 200; .nav-overlay z-index 9999).
   ───────────────────────────────────────────────────────────── */

/* 1. Frost watermark — a faint icy haze and large snowflakes in the
      top-left and bottom-right corners, sitting BEHIND the content
      (cards, images and buttons cover it; it shows on the page background) */
body.theme-xmas::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1; /* behind the page content: shows on the background only, never over cards, text or buttons */
    pointer-events: none;
    background:
        /* top-left snowflake */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'%3E%3Cdefs%3E%3Cpath id='a' d='M0 0V-46M0-14l-8-8M0-14l8-8M0-28l-7-7M0-28l7-7M0-40l-4-4M0-40l4-4' stroke='%2389b8b0' stroke-width='1.6' stroke-linecap='round' fill='none'/%3E%3C/defs%3E%3Cuse href='%23a'/%3E%3Cuse href='%23a' transform='rotate(60)'/%3E%3Cuse href='%23a' transform='rotate(120)'/%3E%3Cuse href='%23a' transform='rotate(180)'/%3E%3Cuse href='%23a' transform='rotate(240)'/%3E%3Cuse href='%23a' transform='rotate(300)'/%3E%3C/svg%3E")
            -90px 96px / 260px 260px no-repeat,
        /* bottom-right snowflake */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'%3E%3Cdefs%3E%3Cpath id='a' d='M0 0V-46M0-14l-8-8M0-14l8-8M0-28l-7-7M0-28l7-7M0-40l-4-4M0-40l4-4' stroke='%2389b8b0' stroke-width='1.6' stroke-linecap='round' fill='none'/%3E%3C/defs%3E%3Cuse href='%23a'/%3E%3Cuse href='%23a' transform='rotate(60)'/%3E%3Cuse href='%23a' transform='rotate(120)'/%3E%3Cuse href='%23a' transform='rotate(180)'/%3E%3Cuse href='%23a' transform='rotate(240)'/%3E%3Cuse href='%23a' transform='rotate(300)'/%3E%3C/svg%3E")
            right -90px bottom -90px / 320px 320px no-repeat,
        /* icy haze creeping in from the corners */
        radial-gradient(circle at 0 160px,   rgba(205,228,236,0.55), transparent 22rem),
        radial-gradient(circle at 100% 100%, rgba(205,228,236,0.55), transparent 26rem);
    opacity: 0.35;
}

/* 2. Gentle snowfall over the page */
body.theme-xmas::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.9) 1.5px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.7) 1px,   transparent 1.5px),
        radial-gradient(circle, rgba(150,190,185,0.8) 1.2px, transparent 1.7px); /* faint icy flakes so snow shows on the pale page too */
    background-size: 180px 180px, 120px 120px, 240px 240px;
    background-position: 0 0, 40px 60px, 110px 30px;
    opacity: 0.55;
    animation: xmas-snowfall 28s linear infinite;
}
@keyframes xmas-snowfall {
    from { background-position: 0 0,         40px 60px,  110px 30px; }
    to   { background-position: 60px 720px,  10px 540px, 170px 990px; }
}

/* 3. Top date card (market/event pages) — faint snow, falling slowly,
      plus a frosted watermark flake in the corner */
body.theme-xmas .dc-hero {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'%3E%3Cdefs%3E%3Cpath id='a' d='M0 0V-46M0-14l-8-8M0-14l8-8M0-28l-7-7M0-28l7-7' stroke='%23ffffff' stroke-opacity='0.16' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/defs%3E%3Cuse href='%23a'/%3E%3Cuse href='%23a' transform='rotate(60)'/%3E%3Cuse href='%23a' transform='rotate(120)'/%3E%3Cuse href='%23a' transform='rotate(180)'/%3E%3Cuse href='%23a' transform='rotate(240)'/%3E%3Cuse href='%23a' transform='rotate(300)'/%3E%3C/svg%3E"),
        radial-gradient(circle, rgba(255,255,255,0.40) 1.3px, transparent 1.9px),
        radial-gradient(circle, rgba(255,255,255,0.25) 1px,   transparent 1.5px),
        radial-gradient(circle, rgba(255,255,255,0.18) 0.9px, transparent 1.4px);
    background-repeat: no-repeat, repeat, repeat, repeat;
    background-size: 150px 150px, 71px 59px, 43px 37px, 29px 53px;
    background-position: right -40px top -40px, 0 0, 19px 23px, 7px 41px;
    animation: xmas-card-snow 18s linear infinite;
}
@keyframes xmas-card-snow {
    from { background-position: right -40px top -40px, 0 0,         19px 23px,  7px 41px; }
    to   { background-position: right -40px top -40px, 71px 590px,  62px 393px, 36px 571px; }
}

/* 4. Small date cards ("Upcoming Dates") — still snow texture on the header */
body.theme-xmas .date-card-header {
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.3)  1px, transparent 1.6px),
        radial-gradient(circle, rgba(255,255,255,0.18) 1px, transparent 1.4px);
    background-size: 26px 26px, 17px 17px;
    background-position: 0 0, 8px 11px;
}

/* Small screens: shrink the corner frost so it doesn't crowd content */
@media (max-width: 600px) {
    body.theme-xmas::before {
        opacity: 0.22;
        background-size: 160px 160px, 200px 200px, auto, auto;
        background-position: -60px 84px, right -60px bottom -60px, 0 0, 0 0;
    }
}

/* Reduced motion: keep the snow and frost, stop the movement */
@media (prefers-reduced-motion: reduce) {
    body.theme-xmas::after,
    body.theme-xmas .dc-hero {
        animation: none;
    }
}

/* Print: no snow or frost */
@media print {
    body.theme-xmas::before,
    body.theme-xmas::after { display: none; }
}