/**
 * Header, mobile navigation and container corrections.
 *
 * Loaded after style.css so the rules here win without !important. Kept
 * separate because it fixes two structural problems rather than restyling the
 * theme: the header stacked into four rows on tablets, and nested containers
 * subtracted their gutters twice.
 */

/* --- Containers: only the outermost one owns the gutter ----------------- */
.site-main .page-shell,
.site-main .hero-shell,
.site-main .section-shell {
  width: 100%;
}

/* --- Compact header ----------------------------------------------------- */
.site-header__inner {
  min-height: 68px;
  gap: 20px;
}

.mi-nav-toggle {
  display: none; /* desktop: the full navigation is visible */
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--mi-border);
  border-radius: 10px;
  background: var(--mi-surface);
  color: var(--mi-text);
  cursor: pointer;
}

.mi-nav-toggle:focus-visible {
  outline: 2px solid var(--mi-primary);
  outline-offset: 2px;
}

.mi-nav-toggle__bars,
.mi-nav-toggle__bars::before,
.mi-nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.mi-nav-toggle__bars {
  position: relative;
}

.mi-nav-toggle__bars::before,
.mi-nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.mi-nav-toggle__bars::before { top: -6px; }
.mi-nav-toggle__bars::after  { top: 6px; }

.mi-mobile-nav {
  display: none;
}

/* --- Below 1100px: one row plus a disclosure ---------------------------- */
@media (max-width: 1100px) {
  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    min-height: 60px;
  }

  /* The desktop navigation and account buttons move into the panel. */
  .site-header__inner > .primary-nav,
  .site-header__inner > .header-actions {
    display: none;
  }

  .mi-nav-toggle {
    display: inline-flex;
  }

  .mi-mobile-nav {
    display: block;
    border-top: 1px solid var(--mi-border);
    background: var(--mi-surface);
    padding: 12px 0 18px;
  }

  .mi-mobile-nav[hidden] {
    display: none;
  }

  .mi-mobile-nav__inner {
    width: min(calc(100% - 28px), var(--mi-container));
    margin: 0 auto;
    display: grid;
    gap: 14px;
  }

  .mi-mobile-nav ul {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mi-mobile-nav ul a {
    display: block;
    padding: 12px 10px; /* full-width, comfortable touch target */
    border-radius: 10px;
    color: var(--mi-text);
    text-decoration: none;
    font-size: 16px;
  }

  .mi-mobile-nav ul a:hover,
  .mi-mobile-nav .current-menu-item > a {
    background: var(--mi-surface-muted);
  }

  .mi-mobile-nav__actions {
    display: grid;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--mi-border);
  }

  .mi-mobile-nav__actions .mi-button,
  .mi-mobile-nav__actions .signin-link {
    display: block;
    width: 100%;
    min-height: 46px;
    line-height: 46px;
    text-align: center;
  }

  /* Keep the page behind the open panel from scrolling under the finger. */
  body.mi-nav-open {
    overflow: hidden;
  }
}
