/* ─── MISSION WEST CDP — SITE HEADER & NAV ──────────────────────────────── */
/* Enqueued on all pages. Page-specific overrides live in front-page.css     */
/* and inner-pages.css.                                                      */

:root {
  --cedars:   #002446;
  --missions: #002446;
  --bdc:      #266A82;
  --fec:      #2F5D46;
  --cdc:      #2F6F63;
  --ced:      #D8CEA3;
  --larch:    #B7653A;
  --cream:    #f5f0e8;
  --gold:     #c9a84c;
  --dark:     #0a1a16;
  --nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── STRIP GENESIS WRAP ───────────────────────────────────────────────── */

.site-header {
  border: none !important;
  box-shadow: none;
}
.site-header > .wrap {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 100%;
}

/* ─── HEADER INNER ──────────────────────────────────────────────────────── */

.mw-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

/* ─── LOGO ──────────────────────────────────────────────────────────────── */

.mw-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.mw-logo-img {
  height: 108px;
  width: auto;
  display: block;
  transition: height 0.4s var(--nav-ease);
}
.mw-site-name {
  font-family: 'Lexend Deca', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

/* ─── NAV WRAPPER ───────────────────────────────────────────────────────── */

.mw-nav {
  display: flex;
  align-items: center;
  height: 100%;
}
.mw-nav-menu {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
}
.mw-nav-menu > li {
  position: relative;
  display: flex;
  align-items: center;
}

/* ─── TOP-LEVEL NAV LINKS ───────────────────────────────────────────────── */

.mw-nav-menu > li > a {
  display: flex;
  align-items: center;
  padding: 0 13px;
  height: 100%;
  font-family: 'Lexend Deca', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(0, 36, 70, 0.82);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.mw-nav-menu > li > a:hover,
.mw-nav-menu > li.current-menu-item > a,
.mw-nav-menu > li.current-menu-ancestor > a {
  color: #B7653A;
}

/* Dropdown caret */
.mw-nav-menu > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 5px;
  opacity: 0.6;
  transition: transform 0.2s, opacity 0.2s;
  flex-shrink: 0;
}
.mw-nav-menu > li.menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
  opacity: 1;
}

/* ─── DROPDOWN ──────────────────────────────────────────────────────────── */

.mw-nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--cedars);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  min-width: 240px;
  padding: 8px 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s var(--nav-ease), transform 0.18s var(--nav-ease), visibility 0.18s;
  pointer-events: none;
  z-index: 300;
}
.mw-nav-menu > li:hover > .sub-menu,
.mw-nav-menu > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Dept color accent on first-level dropdown top border */
/* Dept-hover border colors removed — clean dropdown edges */

.mw-nav-menu .sub-menu li {
  display: block;
  position: relative;
  background: transparent; /* prevent front-page.css dept color bleed */
}
.mw-nav-menu .sub-menu a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  padding: 10px 22px;
  font-family: 'Lexend Deca', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  height: auto;
}
.mw-nav-menu .sub-menu a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

/* Dept color left border as identity marker */
.mw-nav-menu .sub-menu > li.dept-bdc { border-left: 3px solid var(--bdc); }
.mw-nav-menu .sub-menu > li.dept-fec { border-left: 3px solid var(--fec); }
.mw-nav-menu .sub-menu > li.dept-cdc { border-left: 3px solid var(--cdc); }
.mw-nav-menu .sub-menu > li.dept-ced { border-left: 3px solid var(--ced); }

/* ─── NESTED SUBMENU (level 3) ─────────────────────────────────────────── */

/* Program items (flyout panel): column layout to show description below name */
.mw-nav-menu .sub-menu .sub-menu a {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: normal;
}

/* Program description line */
.menu-desc {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.4;
}

/* Right-arrow indicator on sub-menu items that have children */
.mw-nav-menu .sub-menu li.menu-item-has-children > a {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.mw-nav-menu .sub-menu li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 4px solid currentColor;
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.mw-nav-menu .sub-menu li.menu-item-has-children:hover > a::after {
  opacity: 1;
}

/* Nested panel flies out to the right */
.mw-nav-menu .sub-menu .sub-menu {
  position: absolute;
  top: -8px;
  left: 100%;
  background: var(--missions);
  border-top: none;
  border-left: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  min-width: 260px;
  padding: 8px 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(6px);
  transition: opacity 0.18s var(--nav-ease), transform 0.18s var(--nav-ease), visibility 0.18s;
  pointer-events: none;
  z-index: 301;
}
.mw-nav-menu .sub-menu li:hover > .sub-menu,
.mw-nav-menu .sub-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

/* Dept-specific flyout panel background */
.mw-nav-menu .sub-menu .dept-bdc > .sub-menu { background: var(--bdc); }
.mw-nav-menu .sub-menu .dept-fec > .sub-menu { background: var(--fec); }
.mw-nav-menu .sub-menu .dept-cdc > .sub-menu { background: var(--cdc); }
.mw-nav-menu .sub-menu .dept-ced > .sub-menu { background: var(--ced); }

/* Dept-colored hover on program items */
.mw-nav-menu .sub-menu .dept-bdc > .sub-menu a:hover { background: rgba(29, 101, 141, 0.25); color: #fff; }
.mw-nav-menu .sub-menu .dept-fec > .sub-menu a:hover { background: rgba(21, 95,  81, 0.25); color: #fff; }
.mw-nav-menu .sub-menu .dept-cdc > .sub-menu a:hover { background: rgba( 6, 150, 153, 0.25); color: #fff; }
.mw-nav-menu .sub-menu .dept-ced > .sub-menu a       { color: var(--cedars); }
.mw-nav-menu .sub-menu .dept-ced > .sub-menu .menu-desc { color: rgba(0,36,70, 0.6); }
.mw-nav-menu .sub-menu .dept-ced > .sub-menu a:hover { background: rgba(0,36,70, 0.1); color: var(--cedars); }

/* ─── DONATE BUTTON ─────────────────────────────────────────────────────── */

.mw-donate-btn {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  padding: 11px 24px;
  background: #B7653A;
  color: #ffffff !important;
  font-family: 'Lexend Deca', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.mw-donate-btn:hover {
  background: #9c5430;
  transform: translateY(-1px);
  color: #ffffff !important;
}

/* ─── HAMBURGER ─────────────────────────────────────────────────────────── */

.mw-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  margin-left: 16px;
}
.mw-nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #002446;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s, background 0.25s;
}
/* When the panel is open (navy overlay), the X switches to white */
.mw-nav-toggle[aria-expanded="true"] span {
  background: #ffffff;
}
.mw-nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.mw-nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.mw-nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ─── MOBILE ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .mw-nav-toggle {
    display: flex;
  }

  .mw-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 90vw);
    height: 100vh;
    background: var(--cedars);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 100px 32px 40px;
    overflow-y: auto;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.45);
    z-index: 9999;
    transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .mw-nav.is-open {
    right: 0;
  }

  .mw-nav-menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    height: auto;
  }
  .mw-nav-menu > li {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .mw-nav-menu > li > a {
    height: auto;
    padding: 14px 8px 14px 0;
    font-size: 15px;
    width: 100%;
    color: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .mw-nav-menu > li.menu-item-has-children > a::after {
    margin-left: auto;
  }

  .mw-nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: transparent;
    border-top: none;
    border-radius: 0;
    min-width: 0;
    width: 100%;
    padding: 6px 0 6px 16px;
    pointer-events: auto;
    display: none;
  }
  .mw-nav-menu > li.menu-item-has-children.is-open > .sub-menu {
    display: block;
  }
  .mw-nav-menu .sub-menu a {
    color: rgba(255, 255, 255, 0.72) !important;
    padding: 12px 8px 12px 0;
    font-size: 13.5px;
    white-space: normal;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .mw-nav-menu .sub-menu a:hover {
    background: transparent;
    color: #fff !important;
  }

  /* Kill dept-color left borders on mobile */
  .mw-nav-menu .sub-menu > li.dept-bdc,
  .mw-nav-menu .sub-menu > li.dept-fec,
  .mw-nav-menu .sub-menu > li.dept-cdc,
  .mw-nav-menu .sub-menu > li.dept-ced {
    border-left: none;
  }

  /* Nested submenu on mobile — indented, no distinct background */
  .mw-nav-menu .sub-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: none;
    border-left: none;
    border-radius: 0;
    min-width: 0;
    width: 100%;
    padding: 4px 0 4px 14px;
    margin-left: 0;
    pointer-events: auto;
    display: none;
    background: transparent;
  }
  .mw-nav-menu .sub-menu .sub-menu a {
    padding: 11px 0;
    font-size: 13px;
  }
  .mw-nav-menu .sub-menu li.menu-item-has-children.is-open > .sub-menu {
    display: block;
  }
  .mw-nav-menu .sub-menu li.menu-item-has-children > a::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    border-bottom: none;
    margin-left: auto;
  }
  .mw-nav-menu .sub-menu li.menu-item-has-children.is-open > a::after {
    transform: rotate(180deg);
  }

  .mw-donate-btn {
    margin-left: 0;
    margin-top: 24px;
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
    font-size: 15px;
  }
}

/* ─── Footer newsletter signup ──────────────────────────────────────────── */
/* Newsletter signup — its own column in the main footer grid */
.footer-newsletter-col {
  min-width: 0;
}
.footer-newsletter-blurb {
  font-family: var(--body);
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 14px;
}
.footer-newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  position: relative;
  margin: 0;
  max-width: 320px;
}
.footer-newsletter-form input[type="email"] {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--white);
  font-family: var(--body);
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 4px;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
}
.footer-newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--larch);
  background: rgba(255,255,255,0.09);
}
.footer-newsletter-form input[type="email"]::placeholder {
  color: rgba(255,255,255,0.4);
}
.footer-newsletter-btn {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cedars);
  background: var(--larch);
  border: 1px solid var(--larch);
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.footer-newsletter-btn:hover {
  background: var(--harvest);
  border-color: var(--harvest);
}
/* Link variant (footer "Subscribe" button is an <a>, not a form submit) — sits as
   its own block below the blurb so its padding doesn't overlap the text above. */
.footer-newsletter-link {
  display: inline-block;
  margin-top: 18px;
  text-decoration: none;
}
.footer-newsletter-status {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  font-family: var(--body);
  font-size: 12px;
  color: var(--larch);
}
.footer-newsletter-status:empty { display: none; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

@media (max-width: 500px) {
  .footer-newsletter-btn { width: 100%; }
  .footer-newsletter-status { position: static; margin-top: 10px; }
}
