/**
 * Header Styles - idioms.toolsyte.com
 * Matching the approved visual reference specification & mobile responsive requirements.
 */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(252, 251, 248, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.65);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.25rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    position: relative;
}

/* Brand */
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--color-text-main, #0c1524);
    border-radius: var(--radius-md, 0.75rem);
    padding: 0.35rem 0.5rem;
    margin-left: -0.5rem;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.site-brand:hover {
    opacity: 0.9;
}

.site-brand:focus-visible {
    outline: 2px solid var(--color-accent, #2563eb);
    outline-offset: 3px;
}

.brand-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(234, 179, 8, 0.3));
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text-main, #0c1524);
}

.brand-byline {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted, #64748b);
    letter-spacing: 0.01em;
}

/* Desktop Navigation */
.site-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: inline-block;
    padding: 0.4rem 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-secondary, #475569);
    text-decoration: none;
    position: relative;
    transition: color 0.15s ease;
}

.nav-link:hover {
    color: var(--color-text-main, #0c1524);
}

.nav-link.is-active {
    color: var(--color-text-main, #0c1524);
    font-weight: 700;
}

.nav-link:focus-visible {
    outline: 2px solid var(--color-accent, #2563eb);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Hamburger Toggle Button (Hidden by default on Desktop) */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.45rem;
    border-radius: 0.5rem;
    background: transparent;
    border: 1px solid rgba(226, 232, 240, 0.8);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: rgba(203, 213, 225, 0.9);
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--color-accent, #2563eb);
    outline-offset: 2px;
}

.hamburger-line {
    display: block;
    width: 1.15rem;
    height: 2px;
    background-color: var(--color-text-main, #0c1524);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hamburger Active / Open State Animation */
.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Mobile Header Breakpoint (<= 680px)
   ========================================================================== */
@media (max-width: 680px) {
    .header-container {
        min-height: 3.5rem;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .brand-name {
        font-size: 1.2rem;
    }

    .brand-byline {
        font-size: 0.7rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile Nav Dropdown */
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #ffffff;
        border-bottom: 1px solid rgba(226, 232, 240, 0.9);
        box-shadow: 0 16px 32px -8px rgba(12, 21, 36, 0.12);
        padding: 0.75rem 1.25rem 1.25rem 1.25rem;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 99;
    }

    .site-nav.is-open {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .nav-link {
        display: flex;
        align-items: center;
        padding: 0.75rem 0.85rem;
        font-size: 0.95rem;
        border-radius: 0.5rem;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .nav-link:hover {
        background-color: rgba(37, 99, 235, 0.05);
        color: var(--color-accent, #2563eb);
    }

    .nav-link.is-active {
        background-color: rgba(37, 99, 235, 0.08);
        color: var(--color-accent, #2563eb);
        font-weight: 700;
    }
}

@media (max-width: 360px) {
    .brand-name {
        font-size: 1.1rem;
    }

    .brand-byline {
        display: none;
    }

    .header-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
