.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 2000;
  transform: translateY(calc(-100% - 2rem));
  padding: 0.75rem 1rem;
  background: #fff;
  color: #9b1c26;
  font-weight: 600;
  border: 2px solid #9b1c26;
}

/* Additional link context for assistive technology, without changing the layout. */
.link-context {
  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;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link:focus {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
iframe:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #9b1c26 !important;
  outline-offset: 3px;
}

#main-content {
  scroll-margin-top: 140px;
}

[x-cloak], [hidden] {
  display: none !important;
}

html {
  scroll-padding-top: 140px;
}

main a, footer a {
  overflow-wrap: anywhere;
}

/* Allow long medical terms to fit nested lists at narrow widths and larger text spacing. */
main .prose li {
  overflow-wrap: anywhere;
}

/* Keep contact and report links readable at high zoom. */
.accessibility-report {
  max-width: 70rem;
  margin: 140px auto 3rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 0.5rem;
}

.accessibility-report h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.accessibility-report h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
}

.accessibility-report {
  font-size: 1.125rem;
  line-height: 1.6;
}

.accessibility-report p {
  margin-bottom: 1rem;
}

.accessibility-report ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}

.accessibility-report h2 {
  margin-bottom: 0.75rem;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 1rem 0;
}

.footer-legal-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 48px;
  padding: 0.625rem 1rem;
  border: 1px solid #9b1c26;
  border-radius: 0.375rem;
  background: #fff;
  color: #9b1c26;
  font-size: 1.125rem;
  line-height: 1.5;
  text-decoration: underline;
}

.footer-legal-links a:hover {
  background: #f7ecee;
}

.footer-links-heading {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Respect the system preference for non-essential interaction animation. */
@media (prefers-reduced-motion: reduce) {
  .decorative-link-arrow {
    transition: none !important;
    transform: none !important;
  }
}

/* At narrow effective widths (including high zoom), keep the reading area free. */
@media (max-width: 767px) {
  body > header {
    position: relative !important;
  }

  .site-header-layout {
    flex-wrap: wrap;
  }

  #site-navigation {
    position: static;
    flex: 0 0 100%;
    width: 100%;
  }

  .header-content-offset {
    margin-top: 1rem !important;
  }

  .header-spacer {
    display: none;
  }

  .accessibility-report {
    margin-top: 1rem;
  }

  html {
    scroll-padding-top: 1rem;
  }

  #main-content {
    scroll-margin-top: 1rem;
  }
}

/* Identify the current page with shape and emphasis as well as color. */
#site-navigation a[aria-current="page"],
.footer-legal-links a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 0.15em;
  text-underline-offset: 0.2em;
  background-color: #f7ecee;
  box-shadow: inset 4px 0 0 #9b1c26;
}


/* Let practice cards wrap before their text becomes too narrow. */
.practice-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}

.practice-card-grid > .practice-card {
  min-width: 0;
  grid-row: span 4;
  grid-template-rows: subgrid;
  overflow-wrap: anywhere;
}

.practice-card-grid > .practice-card > * {
  min-width: 0;
  max-width: 100%;
}
