/* TAMBANG language switcher — isolated header rules; no page/feed changes. */
#gh-navigation .tambang-lang-switcher {
    position: relative;
    display: block;
    flex: 0 0 auto;
    font-family: var(--font-sans, Arial, sans-serif);
    line-height: 1.2;
    z-index: 100;
}
#gh-navigation .tambang-lang-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 65px;
    height: 33px;
    padding: 0 7px;
    border: 1px solid #dfe3e8;
    border-radius: 4px;
    color: inherit;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .16s ease, background-color .16s ease;
}
#gh-navigation .tambang-lang-trigger:hover,
#gh-navigation .tambang-lang-trigger[aria-expanded="true"] {
    background: rgba(128,128,128,.06);
    border-color: #919ba9;
}
#gh-navigation .tambang-lang-trigger:focus-visible,
#gh-navigation .tambang-lang-panel button:focus-visible {
    outline: 2px solid #1677d2;
    outline-offset: 2px;
}
#gh-navigation .tambang-lang-current-flag,
#gh-navigation .tambang-lang-panel button > span:first-child { font-size: 16px; line-height: 1; }
#gh-navigation .tambang-lang-chevron { flex: 0 0 9px; opacity: .7; }
#gh-navigation .tambang-lang-panel {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    width: 177px;
    border: 1px solid #e3e5e8;
    background: #fff;
    color: #15171a;
    border-radius: 5px;
    box-shadow: 0 10px 25px rgba(0,0,0,.14);
    padding: 5px;
    z-index: 10001;
}
#gh-navigation .tambang-lang-panel[hidden] { display: none !important; }
#gh-navigation .tambang-lang-panel button {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 10px;
    width: 100%;
    min-height: 35px;
    padding: 5px 7px;
    font-size: 12px;
    font-weight: 500;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #15171a;
    cursor: pointer;
}
#gh-navigation .tambang-lang-panel button:hover,
#gh-navigation .tambang-lang-panel button[aria-current="true"] { background: #f1f4f7; }
#gh-navigation .tambang-lang-opt-code { margin-left: auto; color: #858b91; font-size: 10px; }
#gh-navigation .tambang-mobile-controls { display: none; }
#gh-navigation .tambang-lang--mobile { display: none; }
#gh-navigation .tambang-desktop-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    margin-left: auto;
    min-width: 0;
}
/* Retain the Search-left / Logo-centre / Sign-in-right stacked arrangement. */
@media (min-width: 768px) {
    #gh-navigation.is-stacked .gh-navigation-actions { justify-content: space-between; }
    #gh-navigation.is-stacked .tambang-desktop-right { justify-content: flex-end; }
}
@media (max-width: 767px) {
    /* Change only the logo/search/burger row. The menu remains intact. */
    #gh-navigation .gh-navigation-brand {
        display: grid;
        grid-template-columns: minmax(38px,1fr) minmax(0,auto) minmax(72px,1fr);
        align-items: center;
        gap: 4px;
        justify-items: normal;
        width: 100%;
    }
    #gh-navigation .tambang-lang--mobile { display: block; grid-column: 1; justify-self: start; }
    #gh-navigation .gh-navigation-logo {
        grid-column: 2;
        justify-self: center;
        text-align: center;
        max-width: 48vw;
    }
    #gh-navigation .gh-navigation-logo img {
        max-width: 100%;
        max-height: 31px;
        width: auto;
        object-fit: contain;
    }
    #gh-navigation .tambang-mobile-controls {
        grid-column: 3;
        justify-self: end;
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
    }
    #gh-navigation .tambang-mobile-controls .gh-search { display: inline-flex; margin: 0; }
    #gh-navigation .tambang-mobile-controls .gh-burger { margin: 0; }
    #gh-navigation .tambang-lang--desktop { display: none; }
    #gh-navigation .tambang-lang-trigger { min-width: 39px; width: 39px; height: 32px; padding: 0 3px; gap: 3px; }
    #gh-navigation .tambang-lang-current-code { display: none; }
    #gh-navigation .tambang-lang-chevron { flex-basis: 7px; width: 7px; }
    #gh-navigation .tambang-lang--mobile .tambang-lang-panel { left: 0; right: auto; }
    /* Keep Ghost member actions visible when the mobile burger is opened. */
    #gh-navigation .tambang-desktop-right { display: flex; flex-direction: column; margin-left: 0; gap: 0; }
}
/* On-demand dialog is generated only when a language is selected. */
.tambang-translation-overlay[hidden] { display: none !important; }
.tambang-translation-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147480000;
    background: rgba(15,23,42,.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.tambang-translation-dialog {
    position: relative;
    width: min(100%,410px);
    padding: 24px;
    border-radius: 10px;
    background: #fff;
    color: #15171a;
    box-shadow: 0 18px 50px rgba(0,0,0,.23);
    text-align: left;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
.tambang-translation-dialog h2 { margin: 0 32px 10px 0; font: 700 20px/1.25 Arial,sans-serif; }
.tambang-translation-dialog p { margin: 0 0 16px; font-size: 14px; }
.tambang-translation-dialog .tambang-translation-close {
    position: absolute; top: 10px; right: 10px;
    width: 34px; height: 34px;
    border: 0; border-radius: 5px; background: transparent;
    color: #30353c; font-size: 25px; cursor: pointer;
}
.tambang-translation-dialog .tambang-translation-widget { min-height: 0; }
.tambang-translation-dialog .tambang-translation-message { color: #444; font-size: 13px; }
.tambang-translation-dialog .tambang-translation-close:focus-visible { outline: 2px solid #1677d2; }
@media (prefers-reduced-motion: reduce) {
    #gh-navigation .tambang-lang-trigger { transition: none; }
}
