/* Traditional mobile navigation; desktop remains unchanged. */
.minerva-mobile-toggle, .minerva-mobile-nav { display: none; }
@media (max-width: 480px) {
  #header .header-menu { display: none !important; }
  .minerva-mobile-toggle {
    display: flex; position: relative; width: 44px; height: 44px;
    align-items: center; justify-content: center; padding: 0;
    border: 0; background: transparent; color: var(--navigationLinkColor, inherit); cursor: pointer;
  }
  .minerva-mobile-toggle span { position: absolute; width: 24px; height: 2px; background: currentColor; transition: transform .15s, opacity .15s; }
  .minerva-mobile-toggle span:nth-child(1) { transform: translateY(-7px); }
  .minerva-mobile-toggle span:nth-child(3) { transform: translateY(7px); }
  .minerva-mobile-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
  .minerva-mobile-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .minerva-mobile-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }
  .minerva-mobile-nav:not([hidden]) {
    display: block; position: absolute; top: 100%; left: 0; right: 0;
    pointer-events: auto;
    background: #000; color: #fff; padding: 12px 6vw 20px;
    border-top: 1px solid #333; border-bottom: 1px solid #333;
    max-height: 65vh; overflow-y: auto; box-sizing: border-box; z-index: 100;
  }
  .minerva-mobile-nav a, .minerva-mobile-nav button {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; min-height: 44px; box-sizing: border-box;
    padding: 10px 0; color: #fff; background: transparent; border: 0;
    font-family: inherit; font-size: 18px; font-weight: 400; line-height: 1.3;
    text-align: left; text-decoration: none; cursor: pointer;
  }
  .minerva-mobile-nav [hidden] { display: none !important; }
  .minerva-mobile-submenu { padding-left: 18px; }
  .minerva-mobile-toggle:focus-visible, .minerva-mobile-nav :focus-visible { outline: 2px solid white; outline-offset: 3px; }
}

/* Shared two-line mobile title: cap width and scale text to its own column. */
@media (max-width: 480px) {
  #header .header-display-mobile .header-title {
    container-type: inline-size; min-width: 0; max-width: 70vw;
  }
  html:root body #header .header-display-mobile #site-title {
    display: block; max-width: 70vw;
    font-size: min(var(--minerva-mobile-title-cap, 2.25rem), 9.3cqw) !important;
    line-height: 1.2;
  }
  html:root body #header .header-display-mobile #site-title span {
    display: block; font-size: inherit !important; white-space: nowrap;
  }
}

@media (min-width: 481px) {
  #header .header-display-desktop { display: flex !important; }
  #header .header-display-mobile { display: none !important; }
  #header .header-nav { display: block !important; }
  #header .header-burger { display: none !important; }

  body.homepage #header .header-display-desktop .header-title { display: none; }
  body.homepage #header .header-title-nav-wrapper { width: 100%; }
  body.homepage #header .header-nav { flex: 0 0 auto; margin-left: auto; }
  body.homepage #header .header-nav-list { display: flex; flex-direction: row; flex-wrap: nowrap; }
}
