/* ============================================================
   MCDoctor.ai — Language picker (flag grid in the top nav)
   Standalone so it layers on top of style.css without touching it.
   ============================================================ */
/* Push the picker to the right edge of the nav; auth sits next to it. */
.top-nav .lang-picker {
    position: relative;
    margin-left: auto;
    z-index: 12;
}
.top-nav .nav-auth {
    margin-left: 14px;   /* override the original margin-left:auto */
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    padding: 10px 10px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    line-height: 1;
    border: 2px solid #3a3f4a;
    color: #acd7d0;
}
.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}
.lang-toggle .flag-icon {
    width: 1.3em;
    height: 1em;
    border-radius: 2px;
}
.lang-toggle-caret {
    font-size: 0.7em;
    opacity: 0.7;
}

.lang-grid {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    display: none;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 2px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
    background: #14161c;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.lang-picker.open .lang-grid {
    display: grid;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #e8e8ea;
    font-size: 0.9rem;
    white-space: nowrap;
    font-family: "Minecraftia", monospace;font-weight: 700;
}
.lang-item:hover {
    background: rgba(108, 195, 73, 0.15);
}
.lang-item.is-active {
    background: rgba(108, 195, 73, 0.25);
    font-weight: 600;
}
.lang-item .flag-icon {
    width: 1.4em;
    height: 1em;
    border-radius: 2px;
    flex: 0 0 auto;
}

/* RTL: flip the dropdown anchor */
html[dir="rtl"] .lang-grid {
    right: auto;
    left: 0;
}

/* Mobile/tablet: site switches to the burger nav at 1148px.
   Keep the flag picker inline, just left of the burger. */
@media (max-width: 1148px) {
    .top-nav .lang-picker {
        margin-left: auto;
        margin-right: 12px;
    }
    .top-nav .burger {
        margin-left: 0;   /* picker already took the free space */
    }
    .lang-grid {
        grid-template-columns: 1fr 1fr;
        right: -45px;
        left: auto;
        max-height: 70vh;
    }
}
