/*
 * Bombkowy wygląd — style ładowane tylko w okresie świątecznym.
 * Wszystkie reguły działają wyłącznie pod klasą html.is-bauble (na <html>, bo nie każdy motyw
 * wywołuje body_class()). Kolory (--bauble-dark, --bauble-gold, --bauble-mint, --bauble-rose, --bauble-light)
 * dopisuje wtyczka z ustawień.
 */

html.is-bauble {
    --bauble-gold-light: color-mix(in srgb, var(--bauble-gold) 55%, #fff);
    --bauble-text: color-mix(in srgb, var(--bauble-light) 85%, #fff);
    --bauble-topbar-height: 40px;
    --bauble-garland-height: 40px;
}

/* ---------- Bombka (wspólna, sam CSS) ---------- */

.is-bauble .bauble {
    position: relative;
    display: block;
    width: var(--bauble-size, 18px);
    height: var(--bauble-size, 18px);
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 30%, rgb(255 255 255 / 80%) 0 9%, transparent 26%),
        radial-gradient(circle at 50% 45%, var(--bauble-color) 50%, color-mix(in srgb, var(--bauble-color) 55%, #000));
    box-shadow: 0 2px 4px rgb(0 0 0 / 18%);
}

/* Złota zawieszka na górze bombki. */
.is-bauble .bauble::before {
    position: absolute;
    top: -14%;
    left: 34%;
    width: 32%;
    height: 20%;
    border-radius: 2px 2px 1px 1px;
    background: linear-gradient(90deg, var(--bauble-gold), var(--bauble-gold-light), var(--bauble-gold));
    content: "";
}

.is-bauble .bauble--dark {
    --bauble-color: var(--bauble-dark);
}

.is-bauble .bauble--gold {
    --bauble-color: var(--bauble-gold);
}

.is-bauble .bauble--mint {
    --bauble-color: var(--bauble-mint);
}

.is-bauble .bauble--rose {
    --bauble-color: var(--bauble-rose);
}

/* Bombka na nitce, kołysząca się wokół punktu zawieszenia. */
.is-bauble .bauble-drop {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    transform-origin: 50% 0;
    animation: bauble-swing var(--bauble-swing, 3.2s) ease-in-out infinite alternate;
}

.is-bauble .bauble-drop::before {
    width: 1px;
    height: var(--bauble-string, 8px);
    margin-bottom: 1px;
    background: var(--bauble-gold);
    content: "";
}

@keyframes bauble-swing {
    from {
        transform: rotate(-6deg);
    }

    to {
        transform: rotate(6deg);
    }
}

/* ---------- Pasek: morska zieleń ze złotym brokatem ---------- */

/*
 * Miejsce na pasek rezerwuje CSS (padding body), a sam pasek leży nad nim.
 * Dzięki temu nic nie przeskakuje, także gdy pasek wstawia skrypt (motyw bez wp_body_open()).
 */
html.is-bauble.bauble-pasek body {
    position: relative;
    padding-top: var(--bauble-topbar-height);
}

.is-bauble .bauble-topbar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: var(--bauble-topbar-height);
    padding: 0 96px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 30%, var(--bauble-gold) 0 0.8px, transparent 1.4px) 0 0 / 23px 19px,
        radial-gradient(circle at 70% 65%, var(--bauble-gold-light) 0 0.6px, transparent 1.2px) 0 0 / 31px 27px,
        var(--bauble-dark);
    color: var(--bauble-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.25;
}

.is-bauble .bauble-topbar__text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.is-bauble .bauble-topbar__star {
    color: var(--bauble-gold);
}

.is-bauble .bauble-drop--topbar {
    --bauble-size: 18px;
    --bauble-string: 10px;
}

.is-bauble .bauble-topbar__bauble--left {
    left: 44px;
}

.is-bauble .bauble-topbar__bauble--right {
    right: 44px;
    animation-delay: -1.6s;
}

/* ---------- Złoty łańcuch z bombkami pod menu ---------- */

/*
 * Łańcuch wisi pod dolną krawędzią nagłówka. Miejsce na niego rezerwuje CSS.
 * .header1–.header3 to warianty nagłówka w tp-wordpress-theme.
 */
.is-bauble.bauble-girlanda :is(.header1, .header2, .header3, #masthead, .site-header) {
    margin-bottom: var(--bauble-garland-height);
}

.is-bauble .bauble-garland {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 40;
    height: var(--bauble-garland-height);
    overflow: hidden;
    pointer-events: none;
}

/* Łańcuch z koralików. */
.is-bauble .bauble-garland::before {
    position: absolute;
    top: 2px;
    right: 0;
    left: 0;
    height: 4px;
    border-radius: 2px;
    background:
        radial-gradient(circle, var(--bauble-gold-light) 0 1.2px, transparent 1.6px) 0 0 / 7px 4px,
        var(--bauble-gold);
    content: "";
}

.is-bauble .bauble-garland .bauble-drop {
    top: 5px;
}

/* Bombki nad stopką: zwisają z dolnej krawędzi sekcji kontaktowej. */
.is-bauble .bauble-garland--footer {
    top: auto;
    bottom: calc(100% + 3px);
    height: 64px;
}

.is-bauble .bauble-garland--footer::before {
    display: none;
}

.is-bauble .bauble-garland--footer .bauble-drop {
    top: 0;
}

/* ---------- Błysk na logo ---------- */

.is-bauble .bauble-sheen {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

.is-bauble .bauble-sheen::before {
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    width: 22%;
    background: linear-gradient(100deg, transparent, rgb(255 255 255 / 70%), transparent);
    content: "";
    transform: translateX(-150%) skewX(-12deg);
    animation: bauble-sheen 7s ease-in-out infinite;
}

@keyframes bauble-sheen {
    0% {
        transform: translateX(-150%) skewX(-12deg);
    }

    18%,
    100% {
        transform: translateX(550%) skewX(-12deg);
    }
}

/* ---------- Światełka choinki w tle ---------- */

.is-bauble #bauble-lights {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

/* ---------- Motyw tp-wordpress-theme: kolory i elementy ---------- */

html.is-bauble.bauble-motyw-tp {
    --primary-color: var(--bauble-dark);
    --secondary-color: var(--bauble-gold);
    --tertiary-color: var(--bauble-light);
}

.is-bauble.bauble-motyw-tp :is(.header1__logo, .header2__logo, .header3__logo) {
    position: relative;
}

.is-bauble.bauble-motyw-tp .newsbar__label {
    background: var(--bauble-dark);
    color: var(--bauble-text);
}

/* Sekcja kontaktowa: złoto z delikatnym brokatem. */
.is-bauble.bauble-motyw-tp .contactUs2 {
    background:
        radial-gradient(circle at 30% 40%, rgb(255 255 255 / 45%) 0 0.9px, transparent 1.5px) 0 0 / 21px 17px,
        radial-gradient(circle at 75% 70%, rgb(255 255 255 / 30%) 0 0.7px, transparent 1.3px) 0 0 / 29px 23px,
        var(--bauble-gold);
}

.is-bauble.bauble-motyw-tp footer {
    position: relative;
    border-top: 3px solid var(--bauble-gold);
    background: var(--bauble-dark);
    color: var(--bauble-text);
}

.is-bauble.bauble-motyw-tp footer :is(a, p, span, li, div, h2, h3, h4, h5, h6) {
    color: var(--bauble-text);
}

.is-bauble.bauble-motyw-tp footer a:hover {
    color: var(--bauble-gold-light);
}

/*
 * Motyw na telefonie zeruje odstępy w stopce. Na białym tle tego nie widać,
 * ale na kolorowej stopce logo kleiłoby się do górnej krawędzi.
 */
@media (max-width: 768px) {
    .is-bauble.bauble-motyw-tp footer > .footer {
        padding-top: 40px;
        padding-bottom: 16px;
    }
}

/* ---------- Telefony ---------- */

@media (max-width: 768px) {
    html.is-bauble {
        --bauble-topbar-height: 48px;
        --bauble-garland-height: 34px;
    }

    .is-bauble .bauble-topbar {
        padding: 0 48px;
        font-size: 12px;
        text-align: center;
    }

    /* Na telefonie tekst w maksymalnie dwóch liniach, pasek ma stałą wysokość. */
    .is-bauble .bauble-topbar__text {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        white-space: normal;
    }

    .is-bauble .bauble-drop--topbar {
        --bauble-size: 14px;
        --bauble-string: 8px;
    }

    .is-bauble .bauble-topbar__bauble--left {
        left: 16px;
    }

    .is-bauble .bauble-topbar__bauble--right {
        right: 16px;
    }
}

/* ---------- Ograniczenie ruchu ---------- */

@media (prefers-reduced-motion: reduce) {
    .is-bauble .bauble-drop,
    .is-bauble .bauble-sheen::before {
        animation: none;
    }

    .is-bauble #bauble-lights {
        display: none;
    }
}
