/* SpaceHowen - Tema Especial Navidad Cyber-Neón (100% CSS/SVG original) */

body.xmas-theme {
    padding-top: 28px;
    background-image:
        radial-gradient(55vw 40vw at 88% -5%, rgba(225, 29, 72, 0.20), transparent),
        radial-gradient(50vw 40vw at 8% 15%, rgba(34, 197, 94, 0.14), transparent),
        radial-gradient(45vw 35vw at 50% 85%, rgba(251, 191, 36, 0.10), transparent),
        linear-gradient(rgba(106, 92, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(106, 92, 255, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 44px 44px, 44px 44px;
}

@media (max-width: 768px) {
    body.xmas-theme {
        padding-top: 90px;
    }
}

/* ========== 1. Ticker Festivo Superior ========== */
.xmas-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    z-index: 1040;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #2a0826 0%, #4c0d29 35%, #1e1345 68%, #2a0826 100%);
    border-bottom: 1px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fde68a;
}

.xmas-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    min-width: max-content;
    animation: xmasMarquee 32s linear infinite;
}

.xmas-ticker:hover .xmas-ticker-track {
    animation-play-state: paused;
}

.xmas-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 28px;
    border-right: 1px solid rgba(251, 191, 36, 0.22);
    color: #fef3c7;
}

.xmas-ticker-item strong {
    color: #fb7185;
}

@keyframes xmasMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ========== 2. Navbar Navideña + Gorrito + Luces LED ========== */
body.xmas-theme .hw-navbar {
    top: 28px !important;
    padding-top: 14px !important;
    pointer-events: none;
}

body.xmas-theme .hw-navbar-pill {
    pointer-events: auto;
    position: relative;
    background: rgba(18, 12, 42, 0.88);
    border: 1px solid rgba(251, 191, 36, 0.38);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.55),
        0 0 22px rgba(225, 29, 72, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.xmas-theme .hw-navbar-pill:hover {
    border-color: #fbbf24;
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.6),
        0 0 28px rgba(251, 191, 36, 0.35);
}

.xmas-brand-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Gorrito SVG original apoyado sobre la S de SpaceHowen */
.xmas-santa-hat {
    position: absolute;
    top: -15px;
    left: -12px;
    width: 28px;
    height: 28px;
    transform: rotate(-16deg);
    pointer-events: none;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    z-index: 3;
}

body.xmas-theme .hw-brand-title {
    background: linear-gradient(90deg, #ffffff 0%, #fde68a 55%, #fda4af 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.xmas-theme .hw-badge-release {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(24, 12, 38, 0.9);
    color: #fde68a;
}

body.xmas-theme .hw-led {
    animation: xmasLedCycle 2.4s ease-in-out infinite;
}

@keyframes xmasLedCycle {
    0%, 100% {
        background: #22c55e;
        box-shadow: 0 0 6px #22c55e, 0 0 14px #22c55e;
    }
    50% {
        background: #ff2e63;
        box-shadow: 0 0 6px #ff2e63, 0 0 14px #ff2e63;
    }
}

/* Guirnalda de luces LED colgando debajo de la navbar */
.xmas-lights {
    position: fixed;
    top: 28px;
    left: 0;
    right: 0;
    height: 20px;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 0 12px;
    list-style: none;
    margin: 0;
    pointer-events: none;
    z-index: 1025;
    overflow: hidden;
}

.xmas-lights li {
    position: relative;
    width: 10px;
    height: 15px;
    border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
    margin-top: 3px;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.xmas-lights li::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 2px;
    width: 6px;
    height: 5px;
    background: #2e2562;
    border-radius: 2px 2px 0 0;
}

.xmas-lights li:nth-child(4n+1) {
    background: #ff2e63;
    box-shadow: 0 2px 12px #ff2e63, 0 0 20px rgba(255, 46, 99, 0.7);
    animation-name: xmasFlashA;
}

.xmas-lights li:nth-child(4n+2) {
    background: #fbbf24;
    box-shadow: 0 2px 12px #fbbf24, 0 0 20px rgba(251, 191, 36, 0.7);
    animation-name: xmasFlashB;
    animation-delay: 0.4s;
}

.xmas-lights li:nth-child(4n+3) {
    background: #3ddc97;
    box-shadow: 0 2px 12px #3ddc97, 0 0 20px rgba(61, 220, 151, 0.7);
    animation-name: xmasFlashA;
    animation-delay: 0.8s;
}

.xmas-lights li:nth-child(4n+4) {
    background: #6ee7f9;
    box-shadow: 0 2px 12px #6ee7f9, 0 0 20px rgba(110, 231, 249, 0.7);
    animation-name: xmasFlashB;
    animation-delay: 1.2s;
}

@keyframes xmasFlashA {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.88); }
}

@keyframes xmasFlashB {
    0%, 100% { opacity: 0.45; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.04); }
}

@media (max-width: 640px) {
    .xmas-lights li:nth-child(even) {
        display: none;
    }
}

/* ========== 3. Acentos Navideños en Cards y Botones ========== */
body.xmas-theme .btn-primary {
    background: linear-gradient(135deg, #e11d48 0%, #c026d3 60%, #f59e0b 125%) !important;
    box-shadow: 0 10px 28px rgba(225, 29, 72, 0.34) !important;
}

body.xmas-theme .btn-primary:hover {
    background: linear-gradient(135deg, #f43f5e 0%, #d946ef 60%, #fbbf24 125%) !important;
    box-shadow: 0 14px 36px rgba(244, 63, 94, 0.45) !important;
}

body.xmas-theme .card:hover,
body.xmas-theme .posts-grid .visual-post-card:hover {
    border-color: rgba(251, 191, 36, 0.55) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), 0 0 24px rgba(251, 191, 36, 0.18) !important;
}

body.xmas-theme .visual-post-category {
    border-color: #fbbf24;
    background: rgba(34, 15, 45, 0.88);
    color: #fef3c7;
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.2);
}

body.xmas-theme .pagination.sh-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #e11d48, #9333ea);
    box-shadow: 0 4px 18px rgba(225, 29, 72, 0.35);
}

body.xmas-theme .sh-cat-tile:hover {
    border-color: #fbbf24;
    background-color: rgba(251, 191, 36, 0.08);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.2);
}

/* ========== 4. Canvas Nieve + Toggle Discreto ========== */
.xmas-snow-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.xmas-snow-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(110, 231, 249, 0.35);
    background: rgba(18, 14, 46, 0.88);
    backdrop-filter: blur(10px);
    color: #e0f2fe;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: all 0.2s ease;
}

.xmas-snow-toggle:hover {
    border-color: #6ee7f9;
    box-shadow: 0 0 16px rgba(110, 231, 249, 0.3);
    transform: translateY(-2px);
}

.xmas-snow-toggle.is-off {
    opacity: 0.65;
    border-color: var(--line);
}

@media (max-width: 768px) {
    .xmas-snow-toggle {
        bottom: 20px;
        left: 15px;
        padding: 6px 11px;
        font-size: 0.72rem;
    }
}

/* ========== 5. Escena SVG Navideña en Footer (100% Original) ========== */
.xmas-footer-scene {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.xmas-footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.16), rgba(34, 197, 94, 0.14));
    border: 1px solid rgba(251, 191, 36, 0.32);
    color: #fef3c7;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
}

.xmas-svg-santa {
    width: 44px;
    height: 44px;
    animation: xmasSantaWave 3.2s ease-in-out infinite;
    filter: drop-shadow(0 4px 10px rgba(225, 29, 72, 0.3));
}

.xmas-svg-tree {
    width: 38px;
    height: 42px;
    filter: drop-shadow(0 4px 12px rgba(61, 220, 151, 0.35));
}

@keyframes xmasSantaWave {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-3px) rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
    .xmas-ticker-track,
    .xmas-lights li,
    .xmas-svg-santa {
        animation: none !important;
    }
}
