/* =============================================================
   assets/css/header.css — Estilos do Header
   ============================================================= */

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.nnews-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--color-primary);
    z-index: 99999; /* Acima de tudo */
    transition: width 0.1s ease-out;
}

/* ============================================================
   NEWS TICKER (Últimas Notícias)
   ============================================================ */
.nnews-ticker-wrap {
    background: var(--color-gray-900);
    color: var(--color-white);
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
}

.nnews-ticker-inner {
    display: flex;
    align-items: center;
    height: 40px;
}

.nnews-ticker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0 16px;
    height: 100%;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* Bolinha vermelha piscando (Live) */
.nnews-ticker-dot {
    width: 8px;
    height: 8px;
    background: #ef4444; /* red-500 */
    border-radius: 50%;
    animation: nnews-pulse-dot 1.5s infinite;
}

@keyframes nnews-pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.nnews-ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Efeito de Marquee (Rolar texto) */
.nnews-ticker-marquee {
    display: flex;
    white-space: nowrap;
    animation: nnews-marquee 40s linear infinite;
}

/* Pausar a animação ao passar o mouse */
.nnews-ticker-content:hover .nnews-ticker-marquee {
    animation-play-state: paused;
}

@keyframes nnews-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.nnews-ticker-item {
    color: var(--color-gray-300);
    text-decoration: none;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: color var(--transition);
}

.nnews-ticker-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
}

.nnews-ticker-item:hover {
    color: var(--color-white);
}

.nnews-ticker-time {
    color: var(--color-primary-light);
    font-weight: 600;
}

.nnews-ticker-title {
    font-weight: 500;
}

/* ============================================================
   TOPBAR (Logo + Carrossel)
   ============================================================ */
.site-header {
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-topbar {
    border-bottom: 1px solid var(--color-border);
    padding: 10px 0;
}

.header-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

/* ── Logo ── */
.site-branding {
    flex-shrink: 0;
}

.site-logo-link {
    display: inline-block;
    line-height: 0;
}

.site-logo {
    max-height: 80px;
    width: auto;
    display: block;
    object-fit: contain;
}

.site-name-link {
    text-decoration: none;
}

.site-name {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -.02em;
}

/* ── Área de banner do header ── */
.header-banner-area {
    flex: 1;
    max-width: calc(100% - 320px);
    overflow: hidden;
}

/* ── Carrossel do header ── */
.nnews-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-gray-100);
}

/* Proporção 720×90 para desktop */
.header-carousel {
    aspect-ratio: 720 / 90;
    max-height: 90px;
}

/* Track de slides */
.nnews-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(.25,.8,.25,1);
    height: 100%;
    will-change: transform;
}

.nnews-carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    overflow: hidden;
}

.nnews-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Botões prev/next */
.nnews-carousel-prev,
.nnews-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(9,67,214,.7);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition);
    z-index: 2;
}

.nnews-carousel:hover .nnews-carousel-prev,
.nnews-carousel:hover .nnews-carousel-next {
    opacity: 1;
}

.nnews-carousel-prev { left: 6px; }
.nnews-carousel-next { right: 6px; }

.nnews-carousel-prev:hover,
.nnews-carousel-next:hover {
    background: var(--color-primary);
}

/* Dots de navegação */
.nnews-carousel-dots {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.nnews-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background var(--transition), transform var(--transition);
}

.nnews-carousel-dot.active {
    background: var(--color-white);
    transform: scale(1.3);
}

/* ============================================================
   NAVBAR (Menu + Busca)
   ============================================================ */
.main-navigation {
    background: var(--color-primary);
}

.nav-inner {
    display: flex;
    align-items: center;
    height: 46px;
}

/* ── Hambúrguer (oculto no desktop) ── */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-white);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: background var(--transition);
}

.menu-toggle:hover { background: rgba(255,255,255,.1); }

.hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

/* Hambúrguer → X quando ativo */
.menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Logo mobile (oculta no desktop) ── */
.mobile-logo-link {
    display: none;
    margin: 0 auto;
}

.mobile-logo {
    max-height: 36px;
    width: auto;
}

/* ── Menu horizontal ── */
.nav-menu-wrap {
    flex: 1;
    overflow: hidden;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 46px;
}

.nav-menu li a {
    display: inline-flex;
    align-items: center;
    height: 46px;
    padding: 0 14px;
    color: rgba(255,255,255,.9);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item > a,
.nav-menu li.current-page-ancestor > a {
    background: rgba(255,255,255,.15);
    color: var(--color-white);
}

.nav-menu li.current-menu-item > a {
    background: rgba(255,255,255,.2);
    font-weight: 700;
}

/* ── Busca lupa ── */
.search-toggle {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: var(--color-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: background var(--transition);
}

.search-toggle:hover { background: rgba(255,255,255,.2); }

/* ── Overlay do menu mobile ── */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 998;
    opacity: 0;
    transition: opacity .3s;
}

.menu-overlay.visible {
    display: block;
    opacity: 1;
}

/* ============================================================
   MODAL DE BUSCA
   ============================================================ */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: rgba(9,67,214,.97);
    padding: 60px var(--container-pad);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .3s;
}

.search-modal:not([hidden]) {
    transform: translateY(0);
    opacity: 1;
}

.search-modal-inner {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-modal-form {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.search-modal-input {
    flex: 1;
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 100px;
    padding: 14px 24px;
    font-size: 18px;
    color: var(--color-white);
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}

.search-modal-input::placeholder { color: rgba(255,255,255,.5); }

.search-modal-input:focus {
    border-color: rgba(255,255,255,.7);
    background: rgba(255,255,255,.18);
}

.search-modal-submit {
    background: rgba(255,255,255,.15);
    border: 2px solid rgba(255,255,255,.3);
    color: var(--color-white);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition);
}

.search-modal-submit:hover { background: rgba(255,255,255,.25); }

.search-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: rgba(255,255,255,.7);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}

.search-modal-close:hover { color: var(--color-white); }

.search-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1999;
    background: transparent;
}

/* ============================================================
   RESPONSIVO — HEADER
   ============================================================ */

/* iPad retrato (≤991px): oculta logo do topbar, mantém logo mobile */
@media (max-width: 991px) {
    .header-topbar-inner { flex-direction: column; align-items: center; }
    .header-banner-area { max-width: 100%; width: 100%; }
    .header-carousel { aspect-ratio: 500 / 350; max-height: none; }
    .site-branding { text-align: center; }
}

/* Mobile (≤767px): hambúrguer + logo centro + lupa */
@media (max-width: 767px) {
    /* Topbar: esconde logo desktop, carrossel full-width */
    .header-topbar-inner { gap: 0; }
    .site-branding { display: none; }
    .header-banner-area { max-width: 100%; border-radius: 0; }
    .header-carousel { aspect-ratio: 500 / 350; border-radius: 0; max-height: none; }

    /* Navbar mobile */
    .main-navigation { position: relative; }
    .nav-inner { justify-content: space-between; padding: 0 var(--container-pad); }
    .menu-toggle { display: flex; }
    .mobile-logo-link { display: block; position: absolute; left: 50%; transform: translateX(-50%); }

    /* Drawer do menu */
    .nav-menu-wrap {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: var(--color-white);
        z-index: 999;
        overflow-y: auto;
        padding: var(--space-xl) 0;
        transition: left .3s cubic-bezier(.16,1,.3,1);
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }

    .nav-menu-wrap.open {
        left: 0;
    }

    .nav-menu {
        flex-direction: column;
        height: auto;
        gap: 0;
        align-items: stretch;
    }

    .nav-menu li a {
        height: auto;
        padding: 14px 24px;
        color: var(--color-gray-900);
        font-size: 16px;
        border-radius: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu li a:hover {
        background: var(--color-gray-50);
        color: var(--color-primary);
    }

    .nav-menu li.current-menu-item > a {
        background: rgba(9,67,214,.06);
        color: var(--color-primary);
        font-weight: 700;
    }
}

/* Mobile retrato (≤480px) */
@media (max-width: 480px) {
    .search-modal { padding: 40px var(--container-pad); }
    .search-modal-input { font-size: 15px; padding: 12px 18px; }
}
