/* Keep the brand and menu inside the header on narrow screens.
   The fixed mobile action bar already provides the application link. */
@media (max-width: 700px) {
  header .nav {
    gap: 12px;
    padding-inline: 16px;
  }
  header .logo {
    flex: 0 0 auto;
    gap: 8px;
  }
  header .logo img {
    flex-shrink: 0;
    height: 40px !important;
    width: auto;
  }
  header .logo > span {
    display: block;
    white-space: nowrap;
  }
  header .logo b {
    display: block;
    font-size: 20px;
    line-height: 1.2;
  }
  header .logo small {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.4;
  }
  header .nav .cta {
    flex: 0 0 auto;
  }
  header .nav .cta > .btn {
    display: none;
  }
  header .mtoggle {
    min-width: 64px;
    min-height: 44px;
  }
}

/* Keep every menu item reachable on short phone and tablet screens. */
@media (max-width: 1024px) {
  header .links.open {
    max-height: calc(100vh - 144px);
    max-height: calc(100dvh - 144px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .final .box > img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }
  .split > img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
  .mbar {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  header .links.open {
    max-height: calc(100vh - 248px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 248px - env(safe-area-inset-bottom, 0px));
  }
}

/* Touch controls should remain comfortable on tablets as well as phones. */
@media (max-width: 1180px) {
  summary {
    min-height: 44px;
    align-items: center;
  }
  footer a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  .location-map-canvas .maplibregl-ctrl-group button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .location-map-canvas .maplibregl-ctrl-attrib-button,
  .location-map-canvas .maplibregl-popup-close-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .location-map-canvas .maplibregl-ctrl-attrib.maplibregl-compact {
    min-height: 44px;
    padding-right: 44px;
  }
  .location-map-canvas .maplibregl-ctrl-attrib-inner {
    line-height: 1.5;
  }
  .location-map-canvas .maplibregl-ctrl-attrib-button {
    background-repeat: no-repeat;
    background-position: center;
  }
}

@media (min-width: 701px) and (max-width: 1024px) {
  header .nav {
    gap: 16px;
  }
  header .logo,
  header .nav .cta {
    flex-shrink: 0;
  }
  header .logo > span,
  header .nav .cta > .btn {
    white-space: nowrap;
  }
  header .links {
    display: none;
  }
  header .mtoggle {
    display: block;
    min-width: 64px;
    min-height: 44px;
  }
  header .links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--surface);
    padding: 16px 24px;
    gap: 14px;
    border-bottom: 1px solid var(--line);
  }
}

@media (min-width: 701px) and (max-width: 1180px) {
  header .links > a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}

/* These photos stack below the copy up to the existing 860px breakpoint. */
@media (min-width: 701px) and (max-width: 860px) {
  .final .box > img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }
  .split > img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
}
