/* =====================================================
   Idiomas Switcher — switcher.css
   Blog do Tom — meublogdemusica.com.br
===================================================== */

/* ---- Reset base ---- */
.is-switcher,
.is-switcher * {
    box-sizing: border-box;
}

/* =====================================================
   DROPDOWN
===================================================== */
.is-switcher--dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
}

.is-switcher__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    cursor: pointer;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.is-switcher__btn:hover,
.is-switcher__btn:focus-visible {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.5);
    outline: none;
}

.is-switcher__arrow {
    transition: transform 0.2s ease;
    opacity: 0.75;
    flex-shrink: 0;
}

.is-switcher__btn[aria-expanded="true"] .is-switcher__arrow {
    transform: rotate(180deg);
}

/* ---- Dropdown list ---- */
.is-switcher__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 99999;
    overflow: hidden;
}

.is-switcher__dropdown.is-open {
    display: block;
    animation: isSlideDown 0.18s ease;
}

@keyframes isSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.is-switcher__option {
    list-style: none;
    margin: 0;
    padding: 0;
}

.is-switcher__option .is-switcher__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.15s;
}

.is-switcher__option .is-switcher__link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.is-switcher__option.is-current .is-switcher__link {
    color: #2563eb;
    font-weight: 600;
    background: #eff6ff;
}

.is-switcher__check {
    margin-left: auto;
    opacity: 0.7;
    flex-shrink: 0;
}

/* =====================================================
   LISTA HORIZONTAL
===================================================== */
.is-switcher--list {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.is-switcher--list .is-switcher__item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.is-switcher--list .is-switcher__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.is-switcher--list .is-switcher__link:hover {
    background: rgba(0,0,0,0.06);
}

.is-switcher--list .is-current .is-switcher__link {
    border-color: currentColor;
    font-weight: 700;
    opacity: 1;
}

.is-switcher--list .is-switcher__item:not(.is-current) .is-switcher__link {
    opacity: 0.7;
}

/* =====================================================
   FLAG
===================================================== */
.is-switcher__flag {
    border-radius: 2px;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* =====================================================
   WIDGET
===================================================== */
.widget.is-widget .is-switcher {
    margin-top: 4px;
}

/* =====================================================
   DARK MODE
===================================================== */
@media (prefers-color-scheme: dark) {
    .is-switcher__dropdown {
        background: #1e293b;
        border-color: #334155;
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    }
    .is-switcher__option .is-switcher__link {
        color: #cbd5e1;
    }
    .is-switcher__option .is-switcher__link:hover {
        background: #334155;
        color: #f1f5f9;
    }
    .is-switcher__option.is-current .is-switcher__link {
        background: #1e3a5f;
        color: #60a5fa;
    }
}

/* =====================================================
   RESPONSIVO
===================================================== */
@media (max-width: 768px) {
    .is-switcher--dropdown .is-switcher__dropdown {
        right: 0;
        left: auto;
    }
    .is-switcher__name {
        display: none;
    }
}
