/* ── Nordic Translator – Switcher Styles ─────────────────────────────────── */

.nordic-switcher {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    position: relative;
    display: inline-block;
    z-index: 9999;
}

/* Floating variant */
.nordic-switcher--floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
}

/* Toggle button */
.nordic-switcher__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    transition: box-shadow .15s, border-color .15s;
    white-space: nowrap;
}

.nordic-switcher__toggle:hover {
    border-color: #999;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.nordic-switcher__flag {
    font-size: 18px;
    line-height: 1;
}

.nordic-switcher__caret {
    font-size: 10px;
    opacity: .6;
    transition: transform .2s;
}

.nordic-switcher.is-open .nordic-switcher__caret {
    transform: rotate(180deg);
}

/* Dropdown */
.nordic-switcher__dropdown {
    display: none;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.16);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    min-width: 150px;
}

/* Inline variant: drop downward */
.nordic-switcher--inline .nordic-switcher__dropdown {
    bottom: auto;
    top: calc(100% + 6px);
}

.nordic-switcher.is-open .nordic-switcher__dropdown {
    display: block;
    animation: nordic-fade-in .12s ease;
}

@keyframes nordic-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nordic-switcher__dropdown li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #333;
    text-decoration: none;
    transition: background .1s;
}

.nordic-switcher__dropdown li a:hover {
    background: #f5f5f5;
}

.nordic-switcher__dropdown li[aria-selected="true"] a {
    font-weight: 600;
    background: #f0f7ff;
    color: #0073aa;
}

/* Dark background support */
@media (prefers-color-scheme: dark) {
    .nordic-switcher__toggle,
    .nordic-switcher__dropdown {
        background: #1e1e1e;
        border-color: #444;
        color: #e0e0e0;
    }
    .nordic-switcher__dropdown li a { color: #e0e0e0; }
    .nordic-switcher__dropdown li a:hover { background: #2a2a2a; }
    .nordic-switcher__dropdown li[aria-selected="true"] a { background: #003d5c; color: #7ecfff; }
}
