/* GZ-THEME-01: the night / day sky switch (partials/theme-switch.php, assets/js/theme-switch.js).
   Sizes, colours, sky, stars, crescent, sun and timing from docs/designer/theme-toggle/TemaAnahtari.kaynak.html:
   60 x 32 px track, 26 px knob. Night is the default; the day look applies under html/body.light-mode (public pages) and
   html[data-theme="light"] (customer panel). Transitions only run after the visitor's first pointer or key press
   (data-gzts-motion, set by the script), so a page that opens in day mode shows the knob on the right without a slide,
   and never under prefers-reduced-motion. */

.gzts-slot {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.gzts {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    width: 60px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    direction: ltr;
    vertical-align: middle;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* style.css gives every element a colour / transform transition; the switch runs its own timing only */
.gzts,
.gzts * {
    transition: none;
}

.gzts:focus {
    outline: none;
}

.gzts:focus-visible {
    outline: 2px solid #D9B65E;
    outline-offset: 3px;
}

/* larger tap target, the visible track stays 60 x 32 */
.gzts::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
}

.gzts-slot--row .gzts::after {
    height: 44px;
}

@media (pointer: coarse) {
    .gzts::after {
        height: 44px;
    }
}

.gzts .gzts-sky {
    position: absolute;
    inset: 0;
    display: block;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(217, 182, 94, .38);
    border-radius: 999px;
    background: linear-gradient(135deg, #0B1330 0%, #1A2452 100%);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, .6), 0 0 0 3px rgba(217, 182, 94, .06);
}

/* the day sky fades in over the night sky (gradients cannot be interpolated) */
.gzts .gzts-sky::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #FBE7AE 0%, #EBC567 100%);
    opacity: 0;
}

.gzts .gzts-stars,
.gzts .gzts-haze {
    position: absolute;
    inset: 0;
    display: block;
}

.gzts .gzts-haze {
    opacity: 0;
}

.gzts .gzts-knob {
    position: absolute;
    left: 3px;
    top: 3px;
    display: block;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    transform: translateX(0);
}

.gzts .gzts-knob svg {
    display: block;
    overflow: visible;
}

.gzts .gzts-rays {
    opacity: 0;
    transform: scale(.4) rotate(-45deg);
    transform-origin: 12px 12px;
}

.gzts .gzts-sun {
    opacity: 0;
}

.gzts .gzts-shadow {
    fill: #131C40;
    transform: translate(5px, -3px);
}

/* hidden source of the aria-label (language switch on index.php); never shown, not in the accessibility tree */
.gzts .gzts-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ── day ── */
:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-sky {
    border-color: rgba(184, 146, 62, .55);
    box-shadow: inset 0 1px 3px rgba(156, 122, 46, .35), 0 0 14px rgba(241, 216, 143, .55);
}

:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-sky::before,
:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-haze,
:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-sun {
    opacity: 1;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-stars,
:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-moon {
    opacity: 0;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-knob {
    transform: translateX(28px);
}

:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-rays {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

:is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts .gzts-shadow {
    fill: #EBC567;
    transform: translate(14px, -10px);
}

/* ── motion ── */
@media (prefers-reduced-motion: no-preference) {
    @keyframes gztsTwinkle {
        0%, 100% { opacity: 1; }
        50% { opacity: .25; }
    }

    .gzts .gzts-tw1 { animation: gztsTwinkle 2.4s ease-in-out infinite; }
    .gzts .gzts-tw2 { animation: gztsTwinkle 3.1s ease-in-out infinite .8s; }
    .gzts .gzts-tw3 { animation: gztsTwinkle 2.7s ease-in-out infinite 1.4s; }

    :is(html.light-mode, body.light-mode, html[data-theme="light"]) .gzts :is(.gzts-tw1, .gzts-tw2, .gzts-tw3) {
        animation-play-state: paused;
    }

    .gzts[data-gzts-motion] .gzts-sky {
        transition: border-color .55s ease, box-shadow .55s ease;
    }

    .gzts[data-gzts-motion] .gzts-sky::before {
        transition: opacity .55s ease;
    }

    .gzts[data-gzts-motion] .gzts-knob {
        transition: transform .5s cubic-bezier(.65, .05, .25, 1);
    }

    .gzts[data-gzts-motion] .gzts-shadow {
        transition: transform .5s cubic-bezier(.65, .05, .25, 1), fill .55s ease;
    }

    .gzts[data-gzts-motion] .gzts-rays {
        transition: opacity .4s ease .12s, transform .5s cubic-bezier(.2, .8, .2, 1);
    }

    .gzts[data-gzts-motion] :is(.gzts-moon, .gzts-sun, .gzts-haze) {
        transition: opacity .5s ease;
    }

    .gzts[data-gzts-motion] .gzts-stars {
        transition: opacity .4s ease;
    }
}
