/* CSS for CNN-Style Header */

:root {
    --header-height: 50px;
    --header-bg: #000000;
    --header-text: #ffffff;
    --brand-color: #cc0000;
    /* CNN Red-ish */
    --font-nav: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Header Container */
.site-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: var(--font-nav);
}

/* Hamburger Menu Icon */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 20px;
    z-index: 1002;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--header-text);
    transition: transform 0.3s, opacity 0.3s;
}

/* Logo "CNN" Style */
.header-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--brand-color);
    text-decoration: none;
    letter-spacing: -1px;
    margin-right: 30px;
    border: 2px solid var(--brand-color);
    padding: 0 5px;
    line-height: 1;
    display: inline-block;
}

.header-logo:hover {
    background-color: var(--brand-color);
    color: white;
}

/* Nav Links (Desktop) */
.header-nav {
    display: flex;
    height: 100%;
    align-items: center;
}

.header-nav a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    margin-right: 20px;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
}

.header-nav a:hover,
.header-nav a.active {
    border-bottom: 3px solid var(--brand-color);
    opacity: 1;
    background-color: transparent;
    /* Override global hover yellow */
    color: white;
}

/* Header Right Controls */
.header-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Theme Toggle in Header */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--header-text);
    padding: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    opacity: 0.7;
}

/* Search Icon */
.header-search {
    font-size: 1.5rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--header-text);
    padding: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search:hover {
    opacity: 0.7;
}

/* Dropdown Menu (The 3 lines result) */
/* Initially hidden, drops down */
.dropdown-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: #111;
    color: white;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    transform: translateY(-150%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
    border-bottom: 2px solid var(--brand-color);
}

.dropdown-menu.open {
    transform: translateY(0);
}

.dropdown-col h4 {
    color: #ccc;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-size: 0.8rem;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.dropdown-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-col li {
    margin-bottom: 8px;
}

.dropdown-col a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
}

.dropdown-col a:hover {
    text-decoration: underline;
    color: var(--brand-color);
    background-color: transparent;
}


/* Mobile adjustments */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    /* Hide horizontal nav links */
    .site-title {
        font-size: 1.8rem;
    }

    .dropdown-menu {
        grid-template-columns: 1fr;
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* Shared header keyboard accessibility (also defined in cnn-theme.css). */
.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1100;
    padding: 10px 14px;
    border: 2px solid #cc0000;
    border-radius: 4px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform 0.15s;
}

.skip-link:focus {
    transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px #ffffff;
}

#main-content:focus {
    outline: none;
}
