/* CodeCraft.gr — the Christmas look (Admin → Settings → Εμφάνιση → «Χριστουγεννιάτικο»).
   Loaded by template/index.php only while the theme is on; everything is scoped under body.cc-xmas, so turning it off leaves the site exactly as it was.
   Markup added by the layout: .xmas-lights (inside the navbar), .xmas-hat (on the logo), .xmas-greeting (in the footer). Snow: christmas.js. */

body.cc-xmas {
    --xmas-red: #ff3b4e;
    --xmas-green: #2fe07a;
    --xmas-gold: #ffd34d;
    --xmas-ice: #7fe9ff;
}

/* ---------- a string of lights hanging under the header ---------- */
body.cc-xmas .navbar { overflow: visible; }
.xmas-lights {
    position: absolute; left: 0; right: 0; bottom: -17px; height: 26px;
    display: flex; overflow: hidden; pointer-events: none; z-index: 1;
}
.xmas-lights i {
    flex: 0 0 46px; height: 26px; position: relative;
    /* the wire: one sag per bulb */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='12' viewBox='0 0 46 12'%3E%3Cpath d='M0 1 Q23 13 46 1' fill='none' stroke='%23263b47' stroke-width='1.6'/%3E%3C/svg%3E") top left / 46px 12px no-repeat;
}
.xmas-lights i::before {       /* the socket */
    content: ""; position: absolute; left: 20px; top: 6px; width: 6px; height: 5px; border-radius: 1px; background: #33505e;
}
.xmas-lights i::after {        /* the bulb */
    content: ""; position: absolute; left: 18px; top: 10px; width: 10px; height: 14px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    background: var(--bulb); box-shadow: 0 0 6px 1px var(--bulb), 0 0 16px 3px var(--bulb-glow);
    animation: xmas-twinkle 2.6s ease-in-out infinite;
}
.xmas-lights i:nth-child(4n+1) { --bulb: var(--xmas-red);   --bulb-glow: rgba(255, 59, 78, .45); }
.xmas-lights i:nth-child(4n+2) { --bulb: var(--xmas-gold);  --bulb-glow: rgba(255, 211, 77, .4); }
.xmas-lights i:nth-child(4n+3) { --bulb: var(--xmas-green); --bulb-glow: rgba(47, 224, 122, .4); }
.xmas-lights i:nth-child(4n+4) { --bulb: var(--xmas-ice);   --bulb-glow: rgba(127, 233, 255, .45); }
.xmas-lights i:nth-child(3n+1)::after { animation-delay: -.9s; }
.xmas-lights i:nth-child(3n+2)::after { animation-delay: -1.8s; }
.xmas-lights i:nth-child(5n)::after { animation-duration: 3.4s; }
@keyframes xmas-twinkle {
    0%, 100% { opacity: 1; filter: brightness(1.1); }
    50%      { opacity: .45; filter: brightness(.7); box-shadow: 0 0 3px 0 var(--bulb); }
}
@media (max-width: 575.98px) { .xmas-lights { bottom: -15px; } .xmas-lights i { flex-basis: 38px; background-size: 38px 12px; } .xmas-lights i::before { left: 16px; } .xmas-lights i::after { left: 14px; } }

/* ---------- a Santa hat on the </> of the logo ---------- */
body.cc-xmas .navbar-brand { position: relative; }
.xmas-hat {
    position: absolute; left: -.28em; top: -.36em; width: 1em; height: .88em;
    transform: rotate(-16deg); transform-origin: 40% 90%; pointer-events: none; z-index: 2;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45));
    animation: xmas-hat-sway 5s ease-in-out infinite;
}
.xmas-hat svg { display: block; width: 100%; height: 100%; }
@keyframes xmas-hat-sway { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(-10deg); } }

/* ---------- small festive touches on the existing header ---------- */
body.cc-xmas .hp-tagline i:nth-of-type(odd)  { color: var(--xmas-red); }
body.cc-xmas .hp-tagline i:nth-of-type(even) { color: var(--xmas-green); }
body.cc-xmas.hp-home {
    background-image: radial-gradient(900px 420px at 12% -8%, rgba(0, 229, 240, .08), transparent 62%), radial-gradient(700px 360px at 100% 2%, rgba(255, 59, 78, .07), transparent 60%);
}

/* ---------- snow on the top edge of the footer + the greeting ---------- */
body.cc-xmas .footer { position: relative; }
body.cc-xmas .footer::before {
    content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 18px; pointer-events: none;
    background:
        radial-gradient(circle at 12px 18px, #f4fbff 11px, transparent 12px) 0 0 / 34px 18px repeat-x,
        radial-gradient(circle at 9px 18px, #e3f2fa 8px, transparent 9px) 17px 3px / 29px 18px repeat-x;
    filter: drop-shadow(0 -1px 2px rgba(127, 233, 255, .25));
}
.xmas-greeting {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1rem;
    margin: 0 auto 1.6rem; padding: .7rem 1.1rem; max-width: 760px;
    border: 1px solid rgba(255, 211, 77, .28); border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 59, 78, .12), rgba(255, 211, 77, .07), rgba(47, 224, 122, .12));
    color: #f3f7fa; font-weight: 600; font-size: .95rem; text-align: center;
}
.xmas-greeting .xmas-tree { color: var(--xmas-green); filter: drop-shadow(0 0 6px rgba(47, 224, 122, .5)); }
.xmas-greeting .xmas-star { color: var(--xmas-gold); }
.xmas-snow-toggle {
    border: 1px solid rgba(127, 233, 255, .35); border-radius: 999px; background: rgba(127, 233, 255, .07);
    color: #cfeefa; font-size: .8rem; font-weight: 600; padding: .25rem .75rem; cursor: pointer;
}
.xmas-snow-toggle:hover { border-color: var(--xmas-ice); color: #fff; }
.xmas-snow-toggle:focus-visible { outline: 2px solid var(--xmas-ice); outline-offset: 2px; }

/* ---------- a decorated tree in the bottom-left corner (the bottom-right belongs to the newsletter popup); no clicks caught, the snow falls in front of it ---------- */
.xmas-tree-corner {
    position: fixed; left: 14px; bottom: 10px; width: 78px; height: 97px; z-index: 1028; pointer-events: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55));
}
.xmas-tree-corner svg { display: block; width: 100%; height: 100%; overflow: visible; }
.xmas-tree-corner .xo { animation: xmas-ornament 2.4s ease-in-out infinite; }
.xmas-tree-corner .xo2 { animation-delay: -.6s; }
.xmas-tree-corner .xo3 { animation-delay: -1.2s; }
.xmas-tree-corner .xo4 { animation-delay: -1.8s; }
.xmas-tree-corner .xmas-star-glow { transform-box: fill-box; transform-origin: center; animation: xmas-star 3s ease-in-out infinite; }
@keyframes xmas-ornament { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes xmas-star { 0%, 100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
@media (min-width: 992px) { .xmas-tree-corner { left: 18px; bottom: 12px; width: 100px; height: 124px; } }
@media (max-width: 575.98px) { .xmas-tree-corner { left: 8px; bottom: 8px; width: 52px; height: 65px; } }

/* ---------- snow (christmas.js draws it on this canvas) ---------- */
.xmas-snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1029; }   /* under the fixed navbar (1030) and every dialog */

@media (prefers-reduced-motion: reduce) {
    .xmas-lights i::after, .xmas-hat, .xmas-tree-corner .xo, .xmas-tree-corner .xmas-star-glow { animation: none; }
    .xmas-snow { display: none; }
}
@media print {
    .xmas-lights, .xmas-hat, .xmas-snow, .xmas-greeting, .xmas-tree-corner { display: none !important; }
    body.cc-xmas .footer::before { content: none; }
}
