/*
 * SAH Archipedia — Main navigation.
 * Uses sah-nav__* classes from our own menu template.
 * No Olivero overrides needed.
 */

/* =============================================
   Nav bar wrapper (set in page.html.twig)
   ============================================= */



.sah-nav__container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* =============================================
   Mobile toggle (injected by nav.js)
   ============================================= */

.sah-nav__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: #014360;
  font-family: var(--sah-font-head);
  font-weight: 400;
  padding: 0.75rem 1rem;
  cursor: pointer;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sah-nav__toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 20px;
}

.sah-nav__toggle-icon span {
  display: block;
  height: 2px;
  background: #014360;
  border-radius: 1px;
}

@media (min-width: 1100px) {
  .sah-nav__toggle {
    display: none;
  }
}

/* =============================================
   Top-level menu (level 1)
   ============================================= */

.sah-nav__menu--1 {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  flex-direction: column;
}

.sah-nav__menu--1.is-open {
  display: flex;
}

@media (min-width: 1100px) {
  .sah-nav__menu--1 {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
}

/* =============================================
   Top-level items
   ============================================= */

.sah-nav__item--1 {
  position: relative;
}

/* =============================================
   Top-level links
   ============================================= */

.sah-nav__link--1 {
  display: block;
  color: #014360;
  text-decoration: none;
  /* Nav is chrome, not reading content — keep it at its pre-bump size so the
     site-wide font bump doesn't widen the menu past the viewport.
     0.8rem at the 112.5% base == 0.9rem at the old 100% base (14.4px); padding
     1.35rem ≈ the old 1.5rem at the old base. */
  font-size: .9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.35rem;
  white-space: nowrap;
  transition: color 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--sah-font-head);
}

.sah-nav__link--1:hover,
.sah-nav__link--1:focus {
  color: #238fb5;
}

.sah-nav__link--1:focus-visible {
  outline: 2px solid #238fb5;
  outline-offset: -2px;
}

/* Dropdown caret for items with children */
.sah-nav__link--has-children::after {
  content: '▾';
  display: inline;
  margin-left: 0.25rem;
  font-size: 0.85em;
}

/* =============================================
   Dropdown submenus (level 2)
   ============================================= */

.sah-nav__menu--2 {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  background-color: #fbfbfb;
  border: 1px solid #c3e8f3;
  border-top: 3px solid #238fb5;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 300;
}

/* Mobile: show when toggled open */
.sah-nav__menu--2.is-open {
  display: block;
}

@media (min-width: 1100px) {
  .sah-nav__menu--2 {
    position: absolute;
    top: 100%;
    left: 0;
    border-radius: 0 0 4px 4px;
  }

  /* Desktop: show on hover and focus-within */
  .sah-nav__item--has-children:hover > .sah-nav__menu--2,
  .sah-nav__item--has-children:focus-within > .sah-nav__menu--2 {
    display: block;
  }
}

/* =============================================
   Dropdown links (level 2)
   ============================================= */

.sah-nav__link--2 {
  display: block;
  padding: 0.6rem 1rem;
  color: #014360;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: background-color 0.15s;
}

.sah-nav__link--2:hover,
.sah-nav__link--2:focus {
  background-color: #e8f4f8;
  color: #014360;
}

.sah-nav__link--2:focus-visible {
  outline: 2px solid #238fb5;
  outline-offset: -2px;
}

/* Separator between dropdown items */
.sah-nav__item--2 + .sah-nav__item--2 {
  border-top: 1px solid #e8f4f8;
}

/* =============================================
   Active trail
   ============================================= */

.sah-nav__item--1.sah-nav__item--active > .sah-nav__link--1 {
  border-bottom: 2px solid #238fb5;
}
