/* =========================================
   Божиќен / новогодишен дизајн
   Се вчитува само кога е активен (inc/festive.php) и ги надградува,
   а не ги заменува, основните стилови. Брендот (--color-primary од
   Customizer) и светлата/темната тема остануваат недопрени.
   ========================================= */

body.festive-mode {
    --festive-red: #c1121f;
    --festive-green: #1b7f4b;
    --festive-gold: #e6b422;
    --festive-ice: #bfe3ff;
}

/* ---------- Лента со честитка ---------- */
.festive-ribbon {
    background: linear-gradient(90deg, var(--festive-red), #8f0d17 50%, var(--festive-green));
    color: #fff;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 7px 0;
    position: relative;
    z-index: 101;
}
.festive-ribbon .container {
    padding-top: 0;
    padding-bottom: 0;
}

/* ---------- Заглавие: бонбона-лента наместо тенка линија ---------- */
body.festive-mode .site-header {
    border-bottom: 4px solid transparent;
    border-image: repeating-linear-gradient(
        -45deg,
        var(--festive-red) 0 12px,
        #ffffff 12px 24px
    ) 1;
}

/* ---------- Гирлянда од светилки под менито ---------- */
body.festive-lights .site-header {
    /* ја оставаме висината на хедерот иста; светилките висат под него */
    overflow: visible;
}
body.festive-lights .site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 26px;
    margin-top: 4px; /* под бонбона-линијата */
    pointer-events: none;
    background-image:
        radial-gradient(circle at 15px 15px, #ff5c68 0 4px, rgba(255, 92, 104, 0.35) 5px, transparent 10px),
        radial-gradient(circle at 45px 15px, #ffd24d 0 4px, rgba(255, 210, 77, 0.35) 5px, transparent 10px),
        radial-gradient(circle at 75px 15px, #4fd18b 0 4px, rgba(79, 209, 139, 0.35) 5px, transparent 10px),
        radial-gradient(circle at 105px 15px, #5cb8ff 0 4px, rgba(92, 184, 255, 0.35) 5px, transparent 10px),
        radial-gradient(circle at 135px 15px, #ff5c68 0 4px, rgba(255, 92, 104, 0.35) 5px, transparent 10px),
        linear-gradient(to bottom, rgba(40, 40, 40, 0.75) 0 2px, transparent 2px);
    background-size: 150px 26px, 150px 26px, 150px 26px, 150px 26px, 150px 26px, 100% 26px;
    background-repeat: repeat-x;
    animation: festive-twinkle 2.2s ease-in-out infinite alternate;
}
@keyframes festive-twinkle {
    from { opacity: 0.55; }
    to   { opacity: 1; }
}

/* ---------- Банер ---------- */
body.festive-mode .site-banner__title {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 0 22px rgba(230, 180, 34, 0.55);
}
body.festive-mode .site-banner__title::before { content: "❄ "; color: var(--festive-ice); }
body.festive-mode .site-banner__title::after  { content: " ❄"; color: var(--festive-ice); }

/* ---------- Дедомразовци пред и по насловите на секциите ---------- */
body.festive-mode {
    --festive-santa: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 15C8 8 13 4 22 5L24 5.5C21 8 21 12 23 15Z' fill='%23d62828'/%3E%3Ccircle cx='25.5' cy='5.5' r='3.3' fill='%23fff'/%3E%3Cellipse cx='16' cy='20' rx='7.2' ry='6' fill='%23f6c9a0'/%3E%3Cpath d='M8.3 20.5C8.8 30 23.2 30 23.7 20.5C21.5 24.5 10.5 24.5 8.3 20.5Z' fill='%23fff'/%3E%3Crect x='5' y='13.5' width='22' height='5' rx='2.5' fill='%23fff'/%3E%3Cellipse cx='16' cy='22.6' rx='5' ry='2' fill='%23fff'/%3E%3Ccircle cx='12.9' cy='19.3' r='.95' fill='%23222'/%3E%3Ccircle cx='19.1' cy='19.3' r='.95' fill='%23222'/%3E%3Ccircle cx='16' cy='21' r='1.3' fill='%23e8998d'/%3E%3C/svg%3E");
    --festive-hat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 42'%3E%3Cpath d='M6 32C8 14 20 4 36 6C34 12 38 24 42 32Z' fill='%23d62828'/%3E%3Crect x='3' y='29' width='42' height='9' rx='4.5' fill='%23fff'/%3E%3Ccircle cx='38' cy='7' r='5' fill='%23fff'/%3E%3C/svg%3E");
}
body.festive-mode .block-heading::before,
body.festive-mode .block-heading::after,
body.festive-mode .channel-history h2::before,
body.festive-mode .channel-history h2::after,
body.festive-mode .channel-schedule h2::before,
body.festive-mode .channel-schedule h2::after {
    content: "";
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    background: var(--festive-santa) center / contain no-repeat;
    vertical-align: -0.2em;
}
body.festive-mode .block-heading::before,
body.festive-mode .channel-history h2::before,
body.festive-mode .channel-schedule h2::before { margin-right: 0.35em; }
body.festive-mode .block-heading::after,
body.festive-mode .channel-history h2::after,
body.festive-mode .channel-schedule h2::after { margin-left: 0.35em; }

/* ---------- Капа на дедомраз на логото на секоја картичка ---------- */
body.festive-mode .channel-card__logo-wrap::before {
    content: "";
    position: absolute;
    top: -15px;
    left: -9px;
    width: 46px;
    height: 40px;
    background: var(--festive-hat) center / contain no-repeat;
    transform: rotate(-14deg);
    z-index: 3;
    pointer-events: none; /* не го попречува кликот на логото */
}

/* ---------- Картички на каналите ---------- */
/* Горната боја на картичката (--accent на каналот) се остава недопрена -
   секој канал си го задржува својот идентитет; додаваме само топол сјај. */
body.festive-mode .channel-card {
    box-shadow: 0 0 0 1px rgba(230, 180, 34, 0.12);
}
body.festive-mode .channel-card:hover {
    box-shadow: 0 8px 26px rgba(230, 180, 34, 0.22);
}

/* ---------- Копчиња за свирење ---------- */
body.festive-mode .channel-card__play-btn:hover,
body.festive-mode .gp-play-pause:hover {
    box-shadow: 0 0 0 3px rgba(230, 180, 34, 0.45);
}

/* ---------- Плеер-лента и подножје ---------- */
body.festive-mode .global-player-bar {
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--festive-red), var(--festive-gold), var(--festive-green), var(--festive-gold), var(--festive-red)) 1;
}
body.festive-mode .site-footer {
    border-top: 3px solid var(--festive-gold);
}
body.festive-mode .site-footer::before {
    content: "🎄  ✨  🎁  ✨  🎄";
    display: block;
    text-align: center;
    letter-spacing: 0.4em;
    padding: 14px 0 0;
    opacity: 0.9;
}

/* ---------- Снег (canvas од festive.js) ---------- */
.festive-snow {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* никогаш не ги блокира кликовите */
    z-index: 90;          /* над содржината, под менито (100) и плеерот (200) */
}
.festive-snow[hidden] { display: none; }

/* Копче за гасење на снегот (пристапност/перформанси) */
.festive-snow-toggle {
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    bottom: calc(var(--gp-bar-height, 69px) + 12px + env(safe-area-inset-bottom, 0px));
    z-index: 150;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--festive-ice);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.festive-snow-toggle:hover { border-color: var(--festive-gold); }
.festive-snow-toggle[aria-pressed="false"] { opacity: 0.55; }
html[data-theme="light"] .festive-snow-toggle { color: #2f7fc1; }

/* ---------- Мали екрани ---------- */
@media (max-width: 640px) {
    .festive-ribbon { font-size: 0.8rem; padding: 6px 0; }
    body.festive-mode .block-heading::before,
    body.festive-mode .block-heading::after,
    body.festive-mode .channel-history h2::before,
    body.festive-mode .channel-history h2::after,
    body.festive-mode .channel-schedule h2::before,
    body.festive-mode .channel-schedule h2::after { width: 1em; height: 1em; }
    body.festive-mode .site-banner__title::before,
    body.festive-mode .site-banner__title::after { content: none; }
}

/* ---------- Без анимации ако корисникот така бара ---------- */
@media (prefers-reduced-motion: reduce) {
    body.festive-lights .site-header::after { animation: none; opacity: 0.9; }
}

/* Многу тесни екрани: само еден дедомраз, пред насловот */
@media (max-width: 400px) {
    body.festive-mode .block-heading::after,
    body.festive-mode .channel-history h2::after,
    body.festive-mode .channel-schedule h2::after { content: none; }
}
