/**
 * Astroscriba - Language switcher (EN/PL toggle slider).
 *
 * Append this to astro-styles.css (or load separately).
 */

.astro-lang-switch {
    display: inline-flex;
    align-items: center;
    position: relative;
    background: rgba(88, 25, 52, 0.08);
    border: 1px solid rgba(88, 25, 52, 0.25);
    border-radius: 999px;
    padding: 4px;
    font-family: 'Quicksand', sans-serif;
    user-select: none;
    transition: opacity .15s ease;
}

.astro-lang-switch.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* The two clickable labels (EN, PL) */
.astro-lang-switch .astro-lang-option {
    position: relative;
    z-index: 2;
    background: transparent !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 6px 16px !important;
    font-family: inherit !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #581934 !important;
    cursor: pointer;
    border-radius: 999px;
    line-height: 1 !important;
    box-shadow: none !important;
    transition: color .2s ease;
    min-height: 0 !important;
    height: auto !important;
}

.astro-lang-switch .astro-lang-option:hover,
.astro-lang-switch .astro-lang-option:focus,
.astro-lang-switch .astro-lang-option:active {
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
    outline: none;
}

.astro-lang-switch .astro-lang-option.is-active {
    color: #c9a050 !important;
}

/* The sliding pill behind the active option */
.astro-lang-switch .astro-lang-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: #581934;
    border: 0;
    border-radius: 999px;
    transition: transform .25s cubic-bezier(.4, .0, .2, 1);
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    padding: 0 !important;
    margin: 0 !important;
}

/* When PL option is active, slide right */
.astro-lang-switch:has(.astro-lang-option[data-astro-lang="pl"].is-active) .astro-lang-slider {
    transform: translateX(100%);
}

/* Fallback for browsers without :has() — use [data-active] attribute set by JS,
   but since we're reloading the page on switch, the server renders is-active
   in the right place. :has() has 95%+ support, so this is a non-issue. */

/* Optional: tweak spacing when placed above a form */
.astro-lang-switch-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}
