/* ============================================================
   NAV MOBILE — hamburger drawer (flex-wrap pattern)
   ============================================================
   SESHP · adapts the "MSEn flex-wrap pattern" to the SESHP
   nav markup, which lacks .site-header / .header-left wrappers.

   Target class is .nav itself (the single nav element) with
   .is-open toggled via the inline script in nav.ejs.

   Desktop (>960px) is untouched — .nav-primary becomes a flex
   container that holds the right-side items so the existing
   layout is preserved exactly.
   ============================================================ */


/* ---------- DESKTOP (>960px) ---------- */

/* Hamburger is hidden on desktop */
.nav-toggle {
    display: none;
  }
  
  /* The new .nav-primary wrapper preserves the existing desktop
     layout. .nav-logo keeps its margin-right:auto, pushing
     .nav-primary (and its children) to the right. */
  .nav-primary {
    display: flex;
    align-items: center;
    min-width: 0;
  }
  
  
  /* ============================================================
     MOBILE DRAWER — ≤960px
     ============================================================ */
  @media (max-width: 960px) {
  
    /* Allow the nav to wrap, so the drawer can occupy a new row */
    .nav {
      flex-wrap: wrap;
      padding: 0 24px;
      row-gap: 0;
    }
  
    /* ----- HAMBURGER BUTTON ----- */
    .nav-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      margin-left: auto;           /* flush right alongside the logo */
      padding: 0;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: 4px;
      cursor: pointer;
      flex-shrink: 0;              /* MUST NOT shrink below 44px */
      position: relative;
      transition:
        background 220ms var(--motion-ease, ease),
        border-color 220ms var(--motion-ease, ease);
    }
  
    .nav-toggle:hover,
    .nav-toggle:focus-visible {
      background: rgba(255, 255, 255, 0.05);
      border-color: var(--accent-warm, #D4A87C);
      outline: none;
    }
  
    .nav-toggle:focus-visible {
      outline: 2px solid var(--accent-warm, #D4A87C);
      outline-offset: 2px;
    }
  
    /* Hamburger bars — three horizontal lines, centred vertically */
    .nav-toggle-bar {
      position: absolute;
      left: 11px;
      width: 22px;
      height: 2px;
      background: #fff;
      border-radius: 1px;
      transition:
        transform 240ms cubic-bezier(.22, 1, .36, 1),
        opacity 180ms ease,
        top 220ms ease;
    }
  
    .nav-toggle-bar:nth-child(1) { top: 14px; }
    .nav-toggle-bar:nth-child(2) { top: 21px; }
    .nav-toggle-bar:nth-child(3) { top: 28px; }
  
    /* Animate hamburger into × when open */
    .nav.is-open .nav-toggle-bar:nth-child(1) {
      top: 21px;
      transform: rotate(45deg);
    }
    .nav.is-open .nav-toggle-bar:nth-child(2) {
      opacity: 0;
    }
    .nav.is-open .nav-toggle-bar:nth-child(3) {
      top: 21px;
      transform: rotate(-45deg);
    }
  
    /* ----- DRAWER ----- */
    /* Hidden by default; opens to a full-width column below the logo row */
    .nav-primary {
      display: none;
      width: 100%;
      flex-basis: 100%;            /* forces wrap to new row */
      flex-direction: column;
      align-items: stretch;
      padding: 4px 0 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      margin-top: 8px;
    }
  
    .nav.is-open .nav-primary {
      display: flex;
    }
  
    /* ----- NAV LINKS AS FULL-WIDTH ROWS (Georgia serif, hairline dividers) ----- */
    .nav.is-open .nav-primary .nav-link {
      display: block;
      width: 100%;
      padding: 16px 0;
      font-family: Georgia, serif;
      font-size: 17px;
      font-weight: 400;
      color: rgba(255, 255, 255, 0.86);
      letter-spacing: 0.005em;
      line-height: 1.2;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      text-decoration: none;
      transition: color 180ms ease, background 180ms ease;
    }
  
    .nav.is-open .nav-primary .nav-link:hover,
    .nav.is-open .nav-primary .nav-link:focus-visible {
      color: #fff;
      background: rgba(255, 255, 255, 0.03);
      outline: none;
    }
  
    /* Active-state in drawer — left accent bar instead of bottom underline */
    .nav.is-open .nav-primary .nav-link.active {
      color: #fff;
      box-shadow: inset 3px 0 0 var(--accent-warm, #D4A87C);
      padding-left: 10px;
    }
  
    /* ----- SOCIAL ICONS AS A HORIZONTAL ROW ----- */
    .nav.is-open .nav-primary .nav-social {
      display: flex;
      gap: 10px;
      margin: 20px 0 0;
      padding: 0;
      justify-content: flex-start;
    }
  
    .nav.is-open .nav-primary .nav-social-link {
      width: 42px;
      height: 42px;
    }
  
    /* ----- APPLY CTA AS A FULL-WIDTH BUTTON ----- */
    .nav.is-open .nav-primary .nav-apply {
      display: flex;
      width: 100%;
      margin: 20px 0 0;
      padding: 14px 20px;
      justify-content: center;
      font-size: 13px;
    }
  
    /* Keep the arrow visible on mobile */
    .nav.is-open .nav-primary .nav-apply .nav-apply-arrow {
      margin-left: 4px;
    }
  }
  
  
  /* ============================================================
     SCROLL-LOCK WHEN DRAWER IS OPEN
     ============================================================ */
  html.nav-locked,
  html.nav-locked body {
    overflow: hidden;
    height: 100%;
  }
  
  
  /* ============================================================
     NARROW SCREENS (≤360px)
     MSEn hides .header-wm and .header-divider here. SESHP has
     no direct equivalents, so instead we shrink the logo to
     preserve horizontal space for the hamburger.
     ============================================================ */
  @media (max-width: 360px) {
    .nav {
      padding: 0 16px;
    }
    .nav-logo {
      gap: 10px;
    }
    .nav-logo-icon {
      width: 72px;
      height: auto;
    }
    .nav-logo-main {
      font-size: 12.5px;
      line-height: 1.1;
    }
    .nav-separator {
      display: none;
    }
  }