/* =============================================================
   Barra Institucional – Elementor Widget  |  v1.0.0
   ============================================================= */

/* ── Reset de base ─────────────────────────────────────────── */
.bi-bar *,
.bi-bar *::before,
.bi-bar *::after {
    box-sizing: border-box;
}

/* ── Barra principal ───────────────────────────────────────── */
.bi-bar {
    width: 100%;
    position: relative;
    background: #155a8a;
    font-family: inherit;
    line-height: 1;
    z-index: 9999;
}

/* ── Inner container ───────────────────────────────────────── */
.bi-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 8px 20px;
    max-width: 100%;
    width: 100%;
    justify-content: space-between;
}

/* ── Identidade ────────────────────────────────────────────── */
.bi-identity-wrap {
    flex-shrink: 0;
}

.bi-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    transition: opacity .2s;
}

.bi-identity:hover {
    opacity: .85;
    text-decoration: none;
    color: #ffffff;
}

.bi-logo img {
    display: block;
    width: 40px;
    height: auto;
    object-fit: contain;
}

.bi-identity-name {
    white-space: nowrap;
}

/* ── Grupo direito ─────────────────────────────────────────── */
.bi-right-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
}

/* ── Links principais ──────────────────────────────────────── */
.bi-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bi-link a {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color .2s, background .2s;
    padding: 2px 0;
}

.bi-link a:hover {
    color: #f5c518;
    text-decoration: none;
}

.bi-link a i,
.bi-link a svg {
    font-size: 0.85em;
    flex-shrink: 0;
}

.bi-link--highlight a {
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 4px;
}

.bi-link--highlight a:hover {
    background: rgba(255,255,255,0.25);
}

/* ── Redes sociais ─────────────────────────────────────────── */
.bi-socials {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bi-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
    text-decoration: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: color .2s, background .2s, transform .18s;
}

.bi-social a:hover {
    color: #f5c518;
    transform: translateY(-2px);
    text-decoration: none;
}

.bi-social a i,
.bi-social a svg {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ── Pesquisa ──────────────────────────────────────────────── */
.bi-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.bi-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    font-size: 1rem;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color .2s;
    line-height: 1;
}

.bi-search-toggle:hover {
    color: #f5c518;
}

.bi-search-toggle i,
.bi-search-toggle svg {
    font-size: 14px;
    width: 14px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.bi-search-box {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(20, 60, 100, 0.97);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 10px;
    width: 260px;
    z-index: 10000;
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
    animation: biDropDown .18s ease;
}

.bi-search-box form {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bi-search-box input[type="search"] {
    flex: 1;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.82rem;
    padding: 6px 10px;
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
}

.bi-search-box input[type="search"]::placeholder {
    color: rgba(255,255,255,0.6);
}

.bi-search-box input[type="search"]:focus {
    border-color: rgba(255,255,255,0.8);
}

.bi-search-box button[type="submit"] {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    padding: 6px 9px;
    font-size: 0.85rem;
    transition: background .2s;
    line-height: 1;
}

.bi-search-box button[type="submit"]:hover {
    background: rgba(255,255,255,0.3);
}

/* ── Acessibilidade ────────────────────────────────────────── */
.bi-accessibility {
    position: relative;
}

.bi-acc-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 10px;
    white-space: nowrap;
    transition: background .2s, color .2s;
    line-height: 1.5;
}

.bi-acc-trigger:hover,
.bi-acc-trigger[aria-expanded="true"] {
    background: rgba(255,255,255,0.2);
}

.bi-acc-trigger i,
.bi-acc-trigger svg {
    font-size: 0.9em;
    flex-shrink: 0;
}

.bi-acc-arrow {
    font-size: 0.7em !important;
    transition: transform .2s;
}

.bi-acc-trigger[aria-expanded="true"] .bi-acc-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.bi-acc-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1a5276;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    min-width: 200px;
    z-index: 10000;
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: biDropDown .18s ease;
}

.bi-acc-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    color: #ffffff;
    font-size: 0.82rem;
    text-decoration: none;
    text-align: left;
    transition: background .18s;
    line-height: 1.4;
}

.bi-acc-item:last-child {
    border-bottom: none;
}

.bi-acc-item:hover,
.bi-acc-item:focus {
    background: rgba(255,255,255,0.15);
    outline: none;
    text-decoration: none;
    color: #ffffff;
}

.bi-acc-item i,
.bi-acc-item svg {
    font-size: 0.95em;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Estado ativo do contraste */
.bi-acc-contrast[aria-pressed="true"] {
    background: rgba(255,255,255,0.2);
    font-weight: 600;
}

.bi-acc-contrast[aria-pressed="true"]::after {
    content: " ✓";
    opacity: .7;
    font-size: 0.75em;
}

/* ── Barra separadora colorida ─────────────────────────────── */
.bi-separator {
    width: 100%;
    height: 5px;
    display: block;
}

/* ── Animação de dropdown ──────────────────────────────────── */
@keyframes biDropDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Alto Contraste (classe aplicada ao <body>) ─────────────── */
body.bi-high-contrast {
    filter: none !important;
    background: #000 !important;
    color: #ffff00 !important;
}

body.bi-high-contrast a {
    color: #ffff00 !important;
}

body.bi-high-contrast img:not(.bi-logo img) {
    filter: grayscale(100%) contrast(200%);
}

body.bi-high-contrast .bi-bar {
    background: #000 !important;
    border-bottom: 2px solid #ffff00;
    filter: none !important;
}

body.bi-high-contrast .bi-identity,
body.bi-high-contrast .bi-link a,
body.bi-high-contrast .bi-social a,
body.bi-high-contrast .bi-acc-trigger,
body.bi-high-contrast .bi-search-toggle {
    color: #ffff00 !important;
}

body.bi-high-contrast .bi-acc-dropdown,
body.bi-high-contrast .bi-search-box {
    background: #000 !important;
    border-color: #ffff00 !important;
}

body.bi-high-contrast .bi-acc-item {
    color: #ffff00 !important;
    border-color: #444 !important;
}

body.bi-high-contrast .bi-acc-item:hover {
    background: #333 !important;
}

/* ── Responsivo ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bi-inner {
        padding: 6px 12px;
        gap: 6px 10px;
    }

    .bi-identity-name {
        font-size: 0.78rem;
    }

    .bi-links {
        gap: 8px;
    }

    .bi-link a {
        font-size: 0.75rem;
    }

    .bi-acc-trigger span:not(.bi-acc-arrow) {
        display: none;
    }

    .bi-acc-dropdown {
        right: -10px;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .bi-identity-name {
        display: none;
    }

    .bi-links {
        display: none;
    }
}
