/* Responsive navigation for the Astro shell, retaining the original masthead styling. */
:root {
  --gaps-font-family: "IBM Plex Sans", -apple-system, "Segoe UI", Arial, sans-serif;
  --gaps-body-font-size: 0.95rem;
}

body,
h1, h2, h3, h4, h5, h6 {
  font-family: var(--gaps-font-family);
}

body {
  font-size: var(--gaps-body-font-size);
}

.greedy-nav { flex: 1 1 auto; }
.greedy-nav .visible-links { display: flex; flex-wrap: wrap; align-items: center; }
.greedy-nav .visible-links li { display: block; }

.masthead__menu-item--has-submenu { position: relative; }
.masthead__menu-item--has-submenu > a { display: inline-block; }
.masthead__submenu {
  position: absolute;
  z-index: 20;
  top: calc(100% - 0.25rem);
  left: 0.4rem;
  display: none !important;
  min-width: 13rem;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid #e4eaf0;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 33, 43, 0.14);
  list-style: none;
}
.masthead__menu-item--has-submenu:hover > .masthead__submenu,
.masthead__menu-item--has-submenu:focus-within > .masthead__submenu,
.masthead__menu-item--has-submenu.is-open > .masthead__submenu { display: block !important; }
.greedy-nav .masthead__submenu li { display: block; border: 0; }
.greedy-nav .masthead__submenu a {
  display: block;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 3px;
  color: #3f4650;
  white-space: normal;
}
.greedy-nav .masthead__submenu a::before { display: none; }
.greedy-nav .masthead__submenu a:hover,
.greedy-nav .masthead__submenu a:focus-visible { background: #eef7fc; color: #0783c5; }
.masthead__menu-item--has-submenu:focus-within > .masthead__submenu { display: block !important; }
.masthead__submenu:focus-within { display: block !important; }

@media (max-width: 760px) {
  .masthead__submenu { top: 100%; left: 50%; transform: translateX(-50%); }
}

.page__footer {
  position: relative;
  bottom: auto;
  float: none;
  clear: both;
  flex: 0 0 auto;
  width: 100%;
  margin-top: 3rem;
  background-color: #fff;
  border-top: 0;
  z-index: 1;
}

body:has(.home-wave-backdrop) {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  padding-bottom: 0;
}

#main {
  position: relative;
  /* Keep the flex item at the site's content width despite legacy auto margins. */
  width: 100%;
}

body:has(.home-wave-backdrop) #main {
  flex: 1 0 auto;
}

.masthead {
  position: relative;
  z-index: 2;
}

.home-wave-backdrop {
  position: absolute;
  z-index: 0;
  /* Bridge #main's default top margin and the footer's top margin. */
  inset: -2em auto -3rem 50%;
  width: 100vw;
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
  opacity: 0.72;
}

.home-sinc-svg {
  position: absolute;
  top: 0;
  display: block;
  width: clamp(190px, 24vw, 340px);
  height: 100%;
  max-width: none;
}

.home-sinc-svg--left { left: 0; }
.home-sinc-svg--right { right: 0; }

.home-sinc {
  fill: none;
  stroke: var(--gaps-blue);
  stroke-opacity: 0.48;
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.home-sinc--orange { stroke: var(--gaps-orange); }

#main > :not(.home-wave-backdrop) {
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .home-sinc-svg { display: none; }
}

@media (max-width: 760px) {
  .masthead__menu { flex-wrap: wrap; justify-content: center; }
  .greedy-nav { flex: 1 0 100%; }
  .greedy-nav .visible-links { justify-content: center; }
  .masthead__social { margin-left: 0; }
}
