/* Layout and interaction hardening layered after the primary visual system. */

html,
body {
  overflow-x: clip;
}

img {
  display: block;
}

main :is(h1, h2, h3, p, li, a, blockquote),
.form-status {
  overflow-wrap: anywhere;
}

.profile-card > *,
.books > section > *,
.publications > section,
.book-description,
.endorsement-slide {
  min-width: 0;
}

.book-image-1 img,
.book-image-2 img,
.book-image-3 img {
  aspect-ratio: 2 / 3;
  object-fit: contain;
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.form-note {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 48rem) {
  .site-menu {
    max-height: calc(100svh - 5.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .hero {
    min-height: clamp(24rem, 70svh, 30rem);
  }

  .endorsement-gallery {
    padding-inline: 4.25rem;
  }

  .carousel-control.previous {
    left: 0.75rem;
  }

  .carousel-control.next {
    right: 0.75rem;
  }

  .document-actions .button {
    flex: 1 1 12rem;
  }
}

@media (max-width: 25rem) {
  .page-heading h1 {
    font-size: clamp(2.65rem, 14vw, 3.4rem);
  }

  .endorsement-gallery {
    padding-inline: 3.75rem;
  }

  .carousel-control {
    width: 2.75rem;
    height: 2.75rem;
  }

  .message-card {
    padding: 2rem 1.25rem;
  }
}

@media (max-height: 32rem) and (orientation: landscape) and (max-width: 60rem) {
  .hero {
    min-height: 22rem;
    padding-block: 3rem;
  }
}

@media (hover: none) {
  .site-menu a:hover,
  .button:hover,
  .publications > section:hover,
  .books > section:hover .book-image-1 img,
  .books > section:hover .book-image-2 img,
  .books > section:hover .book-image-3 img {
    transform: none;
  }
}
