/* Phone and tablet layout. Desktop (960px and up) stays as designed. */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
}

img,
video {
  max-width: 100%;
}

nav.fixed {
  padding-top: env(safe-area-inset-top);
}

nav [data-menu] {
  max-height: calc(100dvh - 4.5rem - env(safe-area-inset-top));
  overflow-y: auto;
}

nav [data-menu] button {
  min-height: 44px;
}

footer {
  padding-bottom: calc(3rem + env(safe-area-inset-bottom));
}

footer p,
footer span {
  overflow-wrap: anywhere;
}

/* Portrait tablets: the horizontal nav touches the logo around 768px. */
@media (max-width: 959px) {
  nav .md\:flex {
    display: none !important;
  }

  nav [data-menu-toggle] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  nav [data-menu]:not([hidden]) {
    display: block !important;
  }
}

/* Show the hero photo once there is room, stacked under the copy. */
@media (min-width: 768px) and (max-width: 1023px) {
  .relative.hidden.lg\:block.hero-in {
    display: block !important;
    margin-top: 1rem;
  }

  .relative.hidden.lg\:block.hero-in .h-\[600px\] {
    height: 420px;
  }
}

@media (max-width: 767px) {
  .px-6 {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  h1,
  h2 {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .grid.grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 2.25rem;
  }

  .grid.grid-cols-3 > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .grid.grid-cols-3 .text-sm {
    text-align: right;
  }

  .h-\[600px\] {
    height: 280px;
  }

  .h-\[400px\] {
    height: 220px;
  }

  .h-\[300px\] {
    height: 200px;
  }

  .p-8 {
    padding: 1.25rem;
  }

  .p-12 {
    padding: 1.5rem;
  }

  .gap-12 {
    gap: 2rem;
  }

  .py-16 {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  section.min-h-screen {
    min-height: 100svh;
  }

  .min-h-\[80vh\] {
    min-height: 0;
  }

  .scroll-mouse {
    display: none;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .hero-in.flex > button,
  .text-center > button,
  .text-center > a {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Very narrow phones: keep display type inside the screen. */
@media (max-width: 380px) {
  h1 {
    font-size: 2.6rem !important;
    line-height: 0.95 !important;
  }

  h2 {
    font-size: 1.9rem !important;
    line-height: 0.95 !important;
  }
}
