/*
 * news-lang.css — News content language switcher + first-visit modal.
 * Loaded via header_ssr.html alongside news-lang.js.
 */

/* Two mount modes:
     .nld-fixed  → floating top-right (used on pages without a slot)
     .nld-inline → sits inside #news-lang-slot in the sidebar, next to
                    the search bar. Block-styled, full-width, integrates
                    with the existing sidebar-widget look.
*/
.news-lang-dropdown {
    font-family: inherit;
}
.news-lang-dropdown.nld-fixed {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 200;
}
.news-lang-dropdown.nld-inline {
    position: relative;
    display: block;
    margin-bottom: 14px;
}
.news-lang-dropdown.nld-inline .nld-heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 6px 4px;
}

.news-lang-dropdown .nld-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.72);
    color: #f9fafb;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.15s, border-color 0.15s;
}
.news-lang-dropdown .nld-trigger:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.3);
}
/* Inline variant: stretches to fit the sidebar width, slightly bigger
   to match the search box's visual weight. */
.news-lang-dropdown.nld-inline .nld-trigger {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}
.news-lang-dropdown .nld-flag { font-size: 16px; line-height: 1; }
.news-lang-dropdown .nld-label { font-weight: 500; }
.news-lang-dropdown .nld-caret { opacity: 0.6; font-size: 10px; }

.news-lang-dropdown .nld-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: rgba(15, 19, 25, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-width: 180px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5;
}
.news-lang-dropdown.nld-inline .nld-menu {
    left: 0;
    right: 0;
    min-width: 0;
}
.news-lang-dropdown .nld-menu[hidden] { display: none; }
.news-lang-dropdown .nld-menu li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    color: #e5e7eb;
    font-size: 14px;
    transition: background 0.12s;
}
.news-lang-dropdown .nld-menu li:hover { background: rgba(255, 255, 255, 0.06); }
.news-lang-dropdown .nld-menu li.is-active {
    background: rgba(0, 255, 163, 0.08);
    color: #00ffa3;
    font-weight: 600;
}
.news-lang-dropdown .nld-menu li .nld-flag { font-size: 18px; }

/* First-visit modal — minimal, centered. Avoids any layout shift on the
   underlying page by being fully fixed-position with a backdrop. */
#news-lang-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: nlm-fade-in 0.18s ease-out;
}
@keyframes nlm-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
#news-lang-modal .nlm-box {
    position: relative;
    background: #0f1319;
    color: #f9fafb;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 380px;
    width: calc(100% - 32px);
    text-align: center;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}
#news-lang-modal .nlm-flag {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
}
#news-lang-modal .nlm-msg {
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 22px;
    color: #e5e7eb;
}
#news-lang-modal .nlm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
#news-lang-modal .nlm-actions button {
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 0.08s, box-shadow 0.12s;
}
#news-lang-modal .nlm-accept {
    background: #00ffa3;
    color: #000;
}
#news-lang-modal .nlm-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 255, 163, 0.3);
}
#news-lang-modal .nlm-decline {
    background: transparent;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.2);
}
#news-lang-modal .nlm-decline:hover {
    background: rgba(255, 255, 255, 0.06);
}
#news-lang-modal .nlm-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
}
#news-lang-modal .nlm-close:hover { color: #f9fafb; }

@media (max-width: 480px) {
    .news-lang-dropdown.nld-fixed { top: 70px; right: 8px; }
    .news-lang-dropdown.nld-fixed .nld-trigger {
        padding: 5px 10px;
        font-size: 12px;
    }
    .news-lang-dropdown.nld-fixed .nld-label { display: none; }
}
