.post-lang-box.nanews-lang-switcher {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 5px 20px;
    margin: 5px 0 10px 0;
    text-align: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease-in-out;
    /* Do not clear floating header/theme elements: on some RTL Elementor pages
       clear:both creates a large empty gap above the switcher. */
    clear: none !important;
    box-sizing: border-box;
}

.nanews-lang-switcher-pending {
    display: none !important;
}

.post-lang-box.nanews-lang-switcher:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

/* WordPress/Elementor Hebrew global CSS often forces every <p> to RTL/right.
   Override it here so the language control remains centered and predictable. */
.post-lang-box.nanews-lang-switcher .lang-links {
    font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    color: #000;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.6;
    white-space: normal;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35em;
    text-align: center !important;
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

.nanews-lang-prefix {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.35em;
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

.nanews-lang-prefix-text {
    unicode-bidi: isolate !important;
}

.nanews-lang-list {
    display: inline-block;
    direction: ltr !important;
    unicode-bidi: isolate !important;
    white-space: nowrap;
}

.nanews-lang-globe {
    display: inline-block;
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

.post-lang-box.nanews-lang-switcher .lang-links a {
    color: #1e73be;
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    margin: 0 2px;
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

.post-lang-box.nanews-lang-switcher .lang-links a:hover {
    color: #0056b3;
    border-color: #1e73be;
}

/* When the front page has no visible title, JS mounts the top switcher before
   the page/main wrapper. Keep it tight to the header instead of inheriting an
   Elementor top spacer/margin from the page content. */
.nanews-lang-switcher-front-top {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

@media (max-width: 768px) {
    .post-lang-box.nanews-lang-switcher {
        font-size: 14px;
        padding: 14px;
        margin-top: 25px;
    }

    .post-lang-box.nanews-lang-switcher .lang-links {
        line-height: 1.5;
    }

    /* On mobile the article sentence stays on the first line and the language
       abbreviations always start on a new line. */
    .post-lang-box.nanews-lang-switcher[data-nanews-context="post"] .lang-links {
        flex-direction: column;
        gap: 4px;
    }

    .post-lang-box.nanews-lang-switcher[data-nanews-context="post"] .nanews-lang-prefix,
    .post-lang-box.nanews-lang-switcher[data-nanews-context="post"] .nanews-lang-list {
        width: 100%;
        text-align: center !important;
    }

    .nanews-lang-switcher-front-top {
        margin-top: 0 !important;
    }
}

/* Localized article byline, placed ABOVE language links in the top switcher. */
.post-lang-box.nanews-lang-switcher[data-nanews-context="post"][data-nanews-position="top"] {
    border: 0; background: transparent; padding: 0; box-shadow: none;
}
.post-lang-box.nanews-lang-switcher[data-nanews-context="post"][data-nanews-position="top"]:hover { box-shadow: none; }
.post-lang-box.nanews-lang-switcher[data-nanews-context="post"][data-nanews-position="top"] > .lang-links {
    padding: 5px 20px !important; background: #f8f9fa; border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0,0,0,.04); box-sizing: border-box;
}
.post-lang-box.nanews-lang-switcher .nanews-post-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
    border-block: 1px solid #ececec; margin-top: 0; margin-bottom: 10px; padding: 10px 8px;
    font-size: 15px; line-height: 1.5; color: #111;
    text-align: start; direction: inherit;
}
.post-lang-box.nanews-lang-switcher .nanews-post-meta-item { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.post-lang-box.nanews-lang-switcher .nanews-post-meta-item a { color: #004d86; text-decoration: none; }
.post-lang-box.nanews-lang-switcher .nanews-post-meta-item a:hover { text-decoration: underline; }
@media (max-width: 768px) {
  .post-lang-box.nanews-lang-switcher .nanews-post-meta { font-size: 13px; gap: 6px 12px; }
  .post-lang-box.nanews-lang-switcher[data-nanews-context="post"][data-nanews-position="top"] { margin-top: 8px; }
}
