/* ============================================
   EA EventAgro — Header (CNN Brasil Style)
   Dark unified bar with inline navigation
   ============================================ */

/* ─── Site Header ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--color-header-bg, #1a1a1a);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ─── Main Header Bar ─── */
.header-main {
    background: var(--color-header-bg, #1a1a1a);
}

.header-main-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 0;
    padding-bottom: 0;
    height: 56px;
}

/* ─── Hamburger Toggle ─── */
.hamburger-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.hamburger-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--color-menu-text, #ffffff);
    transition: all 0.3s ease;
    border-radius: 1px;
}

/* ─── Brand / Logo ─── */
.header-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.header-brand .custom-logo-link {
    display: flex;
    align-items: center;
}

.header-brand .custom-logo {
    max-height: 36px;
    width: auto;
}

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

.site-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 900;
    color: var(--color-menu-text, #ffffff);
    letter-spacing: -0.02em;
}

.site-title-link:hover .site-title {
    color: var(--color-primary);
}

/* ─── Inline Navigation ─── */
.main-nav {
    flex: 1;
    overflow: hidden;
    background: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu .menu-item {
    position: relative;
}

.nav-menu .menu-item > a {
    display: flex;
    align-items: center;
    padding: 18px 14px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-menu-text, rgba(255, 255, 255, 0.8));
    text-transform: none;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    opacity: 0.8;
}

.nav-menu .menu-item > a:hover {
    color: var(--color-menu-text, #ffffff);
    opacity: 1;
    border-bottom-color: var(--color-primary);
}

.nav-menu .current-menu-item > a,
.nav-menu .current-cat > a {
    color: var(--color-menu-text, #ffffff);
    opacity: 1;
    border-bottom-color: var(--color-primary);
}

/* Live indicator dot for first item (optional) */
.nav-menu .menu-item:first-child > a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    margin-right: 6px;
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Submenu */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #2a2a2a;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.25s ease;
    z-index: 100;
    border-radius: 0 0 8px 8px;
    padding: 4px 0;
    list-style: none;
}

.nav-menu .menu-item:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu .menu-item > a {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,0.7);
    border-bottom: none;
}

.nav-menu .sub-menu .menu-item > a:hover {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
}

/* ─── Header Actions (right) ─── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.header-date {
    display: none; /* Hidden in CNN style */
}

/* Search Toggle */
.header-search {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: var(--color-menu-text, rgba(255, 255, 255, 0.7));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.search-toggle:hover {
    color: var(--color-menu-text, #ffffff);
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* User Button */
.header-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: var(--color-menu-text, rgba(255, 255, 255, 0.7));
    border-radius: 6px;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.header-user-btn:hover {
    color: var(--color-menu-text, #ffffff);
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 340px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.25s ease;
    z-index: 200;
}

.search-dropdown.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-dropdown .search-form {
    display: flex;
    gap: 8px;
}

.search-dropdown .search-field {
    flex: 1;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: var(--text-base);
    outline: none;
    transition: border-color 0.2s ease;
    background: #f9fafb;
}

.search-dropdown .search-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 168, 89, 0.12);
    background: #ffffff;
}

.search-dropdown .search-submit {
    background: var(--color-primary);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-dropdown .search-submit:hover {
    background: var(--color-primary-dark);
}

/* ─── Breaking News Bar (below header) ─── */
.breaking-news-bar {
    background-color: #111111;
    color: #FFFFFF;
    overflow: hidden;
    position: relative;
    z-index: 89;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.breaking-news-inner {
    display: flex;
    align-items: center;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    height: 34px;
}

.breaking-label {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--color-primary);
    padding: 2px 8px;
    margin-right: 14px;
    border-radius: 3px;
}

.breaking-ticker {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
    gap: 8px;
}

.ticker-item {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 500;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.ticker-item:hover {
    opacity: 0.8;
    color: #FFFFFF;
}

.ticker-separator {
    opacity: 0.3;
    font-size: 10px;
    flex-shrink: 0;
}

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================================================
   Sidebar Drawer
   ========================================================================== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.sidebar-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: #1a1a1a;
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
    overflow: hidden;
}

.sidebar-drawer.is-active {
    left: 0;
}

.sidebar-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-drawer-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: #ffffff;
}

.sidebar-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: rgba(255,255,255,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-drawer-close:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
}

.sidebar-drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-drawer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-drawer-menu .menu-item a,
.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    transition: all 0.2s ease;
}

.sidebar-drawer-menu .menu-item a:hover,
.sidebar-menu-item a:hover {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
    padding-left: 24px;
}

.sidebar-drawer-menu .menu-item a svg,
.sidebar-menu-item a svg {
    flex-shrink: 0;
    color: rgba(255,255,255,0.4);
}

.sidebar-drawer-menu .menu-item a:hover svg,
.sidebar-menu-item a:hover svg {
    color: var(--color-primary);
}

.sidebar-drawer-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 20px;
}

.sidebar-drawer-label {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 8px 20px 4px;
}

.sidebar-categories .sidebar-menu-item a,
.sidebar-categories .menu-item a {
    font-weight: 500;
    padding: 10px 20px;
    font-size: var(--text-sm);
}

.sidebar-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-login {
    background: var(--color-primary);
    color: #fff;
}

.sidebar-login:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.sidebar-logout {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.15);
}

.sidebar-logout:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* ─── Mobile Menu (hidden, replaced by sidebar) ─── */
.mobile-menu-toggle {
    display: none;
}

/* ─── Responsive ─── */
@media (max-width: 992px) {
    .main-nav {
        display: none;
    }
    .header-main-inner {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .sidebar-drawer {
        width: 280px;
        left: -280px;
    }
}
