/* MangyByte — language picker
   Adapted from racketleagues.app's language-picker.css with class
   names rl-* → mb-* and accent fallback chain tuned to this site's
   orange palette (--orange) before falling back to chalk/green. */

.mb-lang-picker { position: relative; display: inline-block; }

.mb-lang-wrap {
    position: relative;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary, #f0f0f0);
}

.mb-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--card-border, #1a1a1a);
    border-radius: 10px;
    color: var(--text-primary, #f0f0f0);
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.mb-lang-btn:hover,
.mb-lang-btn[aria-expanded="true"] {
    border-color: var(--orange, #e87a1e);
    color: var(--orange, #e87a1e);
}

.mb-lang-btn:focus-visible {
    outline: 2px solid var(--orange, #e87a1e);
    outline-offset: 2px;
}

.mb-lang-flag {
    font-size: 1.05rem;
    line-height: 1;
}

.mb-lang-name {
    font-weight: 500;
    white-space: nowrap;
}

.mb-lang-caret {
    opacity: 0.7;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.mb-lang-btn[aria-expanded="true"] .mb-lang-caret {
    transform: rotate(180deg);
}

.mb-lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--card-bg, #111);
    border: 1px solid var(--card-border, #1a1a1a);
    border-radius: 10px;
    padding: 6px;
    margin: 0;
    list-style: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1100;
}

.mb-lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary, #a6a6a6);
    transition: background 0.1s ease, color 0.1s ease;
    outline: none;
}

.mb-lang-item:hover,
.mb-lang-item:focus {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #f0f0f0);
}

.mb-lang-item.is-current {
    color: var(--orange, #e87a1e);
    background: rgba(232, 122, 30, 0.08);
}

/* Mobile collapse — when nav goes vertical, hide the language name
   in the closed-button state so the button stays compact next to
   the hamburger. The menu items themselves keep both flag + name. */
@media (max-width: 900px) {
    .mb-lang-btn .mb-lang-name {
        display: none;
    }
}
