/**
 * Site translation globe menu. See inc/site-translate.php.
 *
 * Colors resolve through the role tokens in style.css, so light and dark
 * appearance flip together; fallbacks cover MLD templates that load without
 * the theme's token sheet.
 */

.bne-xlate {
    position: fixed;
    left: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 9990; /* below MLD modals (10000+), above page chrome */
    font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bne-xlate[hidden],
.bne-xlate__menu[hidden] {
    display: none;
}

.bne-xlate__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--bmn-border, #d6dce4);
    border-radius: 999px;
    background: var(--bmn-card, #ffffff);
    color: var(--bmn-text, #16202c);
    font: inherit;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
    cursor: pointer;
}

.bne-xlate__toggle:hover {
    border-color: var(--bmn-border-strong, #aab4c0);
}

.bne-xlate__toggle:focus-visible,
.bne-xlate__menu a:focus-visible {
    outline: 3px solid var(--bmn-focus-ring, #93c5fd);
    outline-offset: 2px;
}

.bne-xlate__icon {
    flex: none;
}

/* Opens upward from the bottom-left button. */
.bne-xlate__menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    min-width: 200px;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid var(--bmn-border, #d6dce4);
    border-radius: 12px;
    background: var(--bmn-card, #ffffff);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.24);
}

.bne-xlate__menu li {
    margin: 0;
}

.bne-xlate__menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--bmn-text, #16202c);
    font-weight: 500;
    text-decoration: none;
}

.bne-xlate__menu a:hover {
    background: var(--bmn-canvas, rgba(15, 23, 42, 0.06));
}

.bne-xlate__menu a[aria-checked="true"] {
    font-weight: 700;
}

.bne-xlate__menu a[aria-checked="true"]::after {
    content: "✓";
    color: var(--bmn-action, #1d4ed8);
}

/* Map search: the script moves the menu into the full-screen search shell
   (a z-index 9999 stacking context): above the results list, below the filter
   modal (10000) and the List/Map toggle (9998), clear of the bottom-left
   "Recently viewed" pill. Elsewhere the script lifts the menu above any fixed
   bottom bar it overlaps (PM sticky CTA, property status bar, banners). */
.mld-fixed-wrapper > .bne-xlate {
    z-index: 9997;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

/* Phones: clear the listing-count chip and List/Map toggle at the bottom. */
@media (max-width: 768px) {
    .mld-fixed-wrapper > .bne-xlate {
        bottom: calc(112px + env(safe-area-inset-bottom, 0px));
    }
}

.bne-footer__language a[aria-current="true"] {
    font-weight: 700;
    text-decoration: none;
}

/* Google's translator UI: its stylesheet is blocked by the site CSP, so hide
   the unstyled banner frame and "original text" tooltip outright. */
body > .skiptranslate,
iframe.skiptranslate,
.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

@media print {
    .bne-xlate {
        display: none !important;
    }
}
