/* -----------------------------------------
   HEADER WRAPPER
----------------------------------------- */

.site-header {
    background: var(--color-deep-navy);
    color: var(--text-inverse);
    border-bottom: var(--border-light);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Slight polish on non-homepage pages */
body:not(.homepage) .site-header {
    opacity: 0.98;
}

.header-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    /*overflow-x: hidden;*/
    overflow-x: visible;
}

/* Mobile padding so logo + hamburger don't touch edges */
@media (max-width: 767px) {
    .header-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* -----------------------------------------
   ROW 1: LOGO + HAMBURGER
----------------------------------------- */

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    transition: justify-content 0.35s ease, padding 0.35s ease;
}

/* Prevent logo from shrinking */
.site-brand {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-desktop {
    height: 80px;
    width: auto;
    display: block;
    flex-shrink: 0;
    transition: height 0.35s ease, transform 0.35s ease;
}

.logo-mobile {
    display: none;
    height: 48px;
    width: auto;
    margin-left: 0.25rem;
}

/* Mobile logo swap */
@media (max-width: 767px) {
    .logo-desktop {
        display: none;
    }
    .logo-mobile {
        display: block;
    }
    .header-top {
    padding: 0 1rem;
    }
}

/* -----------------------------------------
   FIXED MEMBER LOGIN (top-right corner)
----------------------------------------- */

.member-login-fixed {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2000;

    display: flex;
    align-items: center;
    gap: 6px;

    padding: 0.45rem 1rem;
    border: 1px solid var(--color-primary-700);
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-primary-700);
    font-size: var(--text-sm);
    text-decoration: none;
    white-space: nowrap;

    box-shadow: var(--shadow-sm);
    transition: background 0.2s ease, color 0.2s ease, opacity 0.25s ease;
}

.member-login-fixed:hover {
    background: var(--color-primary-700);
    color: #fff;
}

/* Hide on mobile (drawer already has login link) */
@media (max-width: 767px) {
    .member-login-fixed {
        display: none;
    }
}

/* Correct lock icon size */
.nav-icon {
    width: 16px;
    height: 16px;
}

/* -----------------------------------------
   HAMBURGER BUTTON
----------------------------------------- */

.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    padding: 0;
    margin-right: 0.25rem;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    outline: none;
}

@media (max-width: 767px) {
    .mobile-menu-button {
        display: block;
    }
}

.hamburger {
    display: inline-block;
    width: 24px;
    height: 18px;
    position: relative;
}

.hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    /*background: var(--color-primary-700);*/
    background: var(--text-inverse);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 7px; }
.hamburger span:nth-child(3) { top: 14px; }

.mobile-menu-button[aria-expanded="true"] .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-button[aria-expanded="true"] .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button[aria-expanded="true"] .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* -----------------------------------------
   ROW 2: NAVIGATION (FULL-WIDTH)
----------------------------------------- */

.site-nav {
  width: 100%;
  background: var(--color-deep-navy); /* dark background for contrast */
}

.site-nav .nav-list {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  transition: justify-content 0.35s ease, padding 0.35s ease;
}

.site-nav .nav-list a {
  padding: .5rem .25rem;
  color: var(--text-inverse); /* white text on dark background */
  letter-spacing: 0.2px;
  position: relative;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.site-nav .nav-list a:hover {
  color: var(--color-accent-gold); /* gold hover */
}

/* Hover underline */
.site-nav .nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background: var(--color-accent-gold); /* match hover color */
  transition: width 0.25s ease;
}

.site-nav .nav-list a:hover::after {
  width: 100%;
}

/* Tablet spacing fix */
@media (min-width: 768px) and (max-width: 1023px) {
  .site-nav .nav-list {
    gap: var(--space-3);
  }
}

/* -----------------------------------------
   MOBILE NAVIGATION DRAWER
----------------------------------------- */

@media (max-width: 767px) {

    /* The drawer container */
    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 260px;
        max-width: 90vw;
        background: #fff;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 998;
        padding: var(--space-6);
        display: block !important;
    }

    .site-nav.is-open {
        transform: translateX(0);
    }

    /* The list inside the drawer */
    .site-nav .nav-list {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        list-style: none;
        margin: 0;
        padding: 0;
        align-items: stretch;
        justify-content: flex-start;
    }

    .site-nav .nav-list a {
        padding: .75rem 0;
        -webkit-tap-highlight-color: transparent;
        color: var(--color-primary-700);
    }

    .site-nav .nav-list a:hover {
        color: var(--color-accent-gold); /* gold hover still works */
    }

}

/* -----------------------------------------
   MOBILE MEMBER LOGIN (DRAWER)
----------------------------------------- */

@media (min-width: 768px) {
    .mobile-member-login {
        display: none;
    }
}

@media (max-width: 767px) {
    .mobile-member-login {
        padding-top: var(--space-4);
        margin-top: var(--space-4);
        border-top: 1px solid #d0d0d0;
    }

    .mobile-member-login a {
        font-weight: 600;
        color: var(--color-primary-700);
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .mobile-member-login .nav-icon {
        width: 16px;
        height: 16px;
    }
}

/* -----------------------------------------
   MOBILE BACKDROP
----------------------------------------- */

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 997;
}

.mobile-menu-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* -----------------------------------------
   GLOBAL HEADER ENTRANCE ANIMATION (SAFE)
----------------------------------------- */

.site-header.animate-in {
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

body.loaded .site-header.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------------------
   HOMEPAGE SPECIAL LAYOUT (NO OPACITY)
    -- this is only for desktop view --
----------------------------------------- */
@media (min-width: 768px) {
    .homepage .logo-desktop {
        height: 96px;
    }

    .homepage .header-top {
        justify-content: center;
    }

    .homepage .site-nav .nav-list {
        justify-content: center;
    }
}
