/**
 * Header Styles for Dayu Theme
 * Full-bleed, responsive header with logo left and menu right
 */

/* =================================================================
   HEADER CONTAINER
   ================================================================= */

/* Full-width header with orange background */
.site-header {
    background-color: #E96B3F;
    width: 100%;
    position: sticky;
    top: 0;
    /* position: relative; */
    z-index: 1000;
}

/* Inner container: flexbox for logo left, menu right */
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 75px;
    max-width: 100%;
    margin: 0 auto;
}

/* =================================================================
   LOGO  (Left Side)
   ================================================================= */

.site-branding {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-branding a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Custom logo sizing */
.custom-logo-link {
    display: inline-block;
    max-width: 200px;
}

.custom-logo-link img {
    height: auto;
    max-height: 40px;
    width: auto;
    display: block;
}


/* =================================================================
   NAVIGATION MENU (Right Side)
   ================================================================= */

.main-navigation {
    display: flex;
    align-items: center;
}

/* Horizontal menu list */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-menu li {
    position: relative;
    margin: 0;
    padding: 0;
}

/* Menu link styling */
.nav-menu a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 25px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.nav-menu a:hover {
  transform: translateY(-3px);
}

.nav-menu a::before {
    content: "";
    position: absolute;
    width: 0;
    height: 5px;
    background-color: #ffffff;
    bottom: -18px; /* Positions bar at bottom of orange header */
    left: 0;
    transition: width 0.4s ease;
}

.nav-menu a:hover::before {
  width: 100%;
  transform: scaleY(1);
}




/* =================================================================
   MOBILE MENU TOGGLE (Hamburger Icon)
   ================================================================= */

/* Hidden by default, shown on mobile */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Three horizontal bars container */
.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 30px;
}

/* Individual hamburger bar */
.menu-toggle-icon .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animated X when menu is open */
.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

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

.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hide text visually but keep for screen readers */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

/* =================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================= */

/* Tablet: Reduce spacing and font sizes */
@media screen and (max-width: 1024px) {
    .header-inner {
        padding: 15px 30px;
    }
    
    .nav-menu a {
        padding: 10px 18px;
        font-size: 15px;
    }
}

/* Mobile: Show hamburger, hide desktop menu */
@media screen and (max-width: 768px) {
    .header-inner {
        padding: 15px 20px;
    }
    
    /* Show hamburger icon */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Slide-in menu from right side */
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: #E96B3F;
        padding: 80px 20px 20px;
        transition: right 0.3s ease;
        overflow-y: auto;
    }
    
    /* Menu slides in when active */
    .main-navigation.active {
        right: 0;
    }
    
    /* Vertical stacked menu items */
    .nav-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu a {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    /* Dark overlay behind menu when open */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/* Small mobile: Further reduce sizes */
@media screen and (max-width: 480px) {
    .header-inner {
        padding: 12px 15px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .custom-logo-link img {
        max-height: 45px;
    }
    
    .main-navigation {
        width: 250px;
    }
}

/* =================================================================
   ACCESSIBILITY
   ================================================================= */

/* Remove focus outline on mouse click, keep for keyboard navigation */
.nav-menu a:focus:not(:focus-visible) {
    outline: none;
}

.nav-menu a:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.mobile-menu-toggle:focus:not(:focus-visible) {
    outline: none;
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}