/* =====================================================================
 * components/lang-toggle.css — floating EN | BM language switch pill.
 *
 * Fixed to the bottom-LEFT corner: the mirror of the WhatsApp float
 * (.wa-float) on the bottom-right. It floats over arbitrary page content
 * (hero photos, dark sections), so the container carries a solid surface
 * background + shadow for legibility — unlike its earlier in-navbar form.
 *
 * Markup: a <nav class="lang-float"> wrapping two segments. The active
 * locale is a non-link <span class="lang-float__segment is-active">; the
 * inactive locale is an <a> pointing at lang_switch_url().
 *
 * Layering: z-index var(--z-sticky) (100) sits ABOVE page content but BELOW
 * the mobile-menu backdrop (.navbar--open::before, z calc(var(--z-fixed) - 1)
 * = 199) and the slide-in panel (.navbar__menu, z var(--z-fixed) = 200). The
 * pill also fades out while the menu is open, mirroring .wa-float (see the
 * body.has-menu-open rule below).
 *
 * No hex literals — design tokens + color-mix() only (hex-audit clean).
 * ===================================================================== */

.lang-float {
    position: fixed;
    /* Offsets mirror the WhatsApp float's var(--space-5) bottom inset on the
     * right; safe-area insets keep the pill clear of notches / home bars. */
    bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
    left:   calc(var(--space-5) + env(safe-area-inset-left));
    z-index: var(--z-sticky);
    display: inline-flex;
    align-items: stretch;
    /* Solid surface + hairline frame + shadow so the pill stays legible over
     * photos and dark sections. Full pill radius; overflow-hidden lets the
     * active segment's fill reach the rounded edge. */
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    line-height: 1;
}

.lang-float__segment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;   /* 44px tap target */
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    letter-spacing: 0.04em;
    /* Inactive: muted, transparent — reads as the secondary choice. */
    color: var(--color-text-muted);
    background-color: transparent;
    text-decoration: none;
    transition: color var(--transition-fast),
                background-color var(--transition-fast);
}

/* Inactive segment is an <a>; subtle hover tint built from a token. */
a.lang-float__segment:hover {
    color: var(--color-primary);
    background-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

a.lang-float__segment:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Active segment: filled primary, contrast text, slightly bolder. */
.lang-float__segment.is-active {
    color: var(--color-text-inverse);
    background-color: var(--color-primary);
    font-weight: var(--fw-semibold);
    cursor: default;
}

/* Mobile: tighter horizontal padding; tap target stays >= 44px tall. */
@media (max-width: 1023.98px) {
    .lang-float__segment {
        padding-inline: var(--space-3);
    }

    /* When the mobile menu is open, hide the language pill exactly like the
     * WhatsApp float (.wa-float) does — same body class the toggle adds in
     * app.js, same property set (navbar.css). */
    body.has-menu-open .lang-float {
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-fast);
    }
}
