/* ============================================
   HEADER.CSS — Site Header, Navigation Sidebar
   ============================================ */

/* ---------- Site Header ---------- */
.site-header {
    background: var(--bg-header);
    padding: 30px 0 0 0;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Profile Photo — circular, grayscale like reference */
.header-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--border-light);
    transition: transform var(--transition-medium);
}

.header-photo:hover {
    transform: scale(1.05);
}

.header-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%);
    transition: filter var(--transition-medium);
}

.header-photo:hover img {
    filter: grayscale(0%);
}

/* Name and Title */
.header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-name {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 400;
    color: var(--accent-red);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
}

.header-title {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

/* Red accent divider line */
.header-divider {
    height: 4px;
    background: linear-gradient(90deg, var(--accent-red) 0%, var(--accent-red-hover) 50%, var(--accent-red) 100%);
    margin-top: 24px;
    border: none;
}

/* ---------- Sidebar Navigation ---------- */
.sidebar-nav {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--bg-sidebar);
    border-radius: 6px;
    padding: 16px 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 8px 24px;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    color: var(--accent-red);
    background: var(--accent-red-light);
    border-left-color: var(--accent-red);
}

.sidebar-nav a.active {
    color: var(--accent-red);
    font-weight: 600;
    border-left-color: var(--accent-red);
}

/* ---------- Mobile Hamburger ---------- */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 1001;
    border-radius: 8px;
    background: var(--bg-white);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.hamburger-btn:hover {
    background: var(--accent-red-light);
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--accent-red);
    margin: 5px 0;
    transition: all var(--transition-medium);
    border-radius: 2px;
}

.hamburger-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

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

/* ---------- Responsive: Tablet ---------- */
@media (max-width: 900px) {
    .header-name {
        font-size: 2.2rem;
    }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 768px) {
    .site-header {
        padding: 20px 0 0 0;
    }

    .header-inner {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 0 16px;
    }

    .header-photo {
        width: 80px;
        height: 80px;
    }

    .header-name {
        font-size: 1.7rem;
    }

    .header-title {
        font-size: 0.88rem;
    }

    .header-info {
        align-items: center;
    }

    .header-divider {
        margin-top: 16px;
        height: 3px;
    }

    /* Show hamburger on mobile */
    .hamburger-btn {
        display: block;
    }

    /* --- Mobile Top Nav: drops down from under header --- */
    .sidebar-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 100vh;
        z-index: 1000;
        background: var(--bg-white);
        padding: 60px 0 20px 0;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        border-radius: 0 0 16px 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateY(-110%);
        transition: transform 0.3s ease;
    }

    .sidebar-nav.open {
        transform: translateY(0);
    }

    .sidebar-nav ul {
        background: transparent;
        border-radius: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .sidebar-nav a {
        padding: 14px 28px;
        font-size: 1rem;
        font-weight: 500;
        text-align: center;
        border-left: none;
        border-bottom: 1px solid var(--border-light);
        transition: all var(--transition-fast);
    }

    .sidebar-nav li:last-child a {
        border-bottom: none;
    }

    .sidebar-nav a:hover {
        background: var(--accent-red-light);
        color: var(--accent-red);
        border-left: none;
    }

    .sidebar-nav a.active {
        color: var(--bg-white);
        background: var(--accent-red);
        font-weight: 600;
        border-left: none;
    }
}

/* ---------- Responsive: Small Mobile ---------- */
@media (max-width: 480px) {
    .header-photo {
        width: 64px;
        height: 64px;
        border-width: 2px;
    }

    .header-name {
        font-size: 1.45rem;
    }

    .header-title {
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .sidebar-nav a {
        padding: 12px 20px;
        font-size: 0.93rem;
    }
}