/* al-folio uses rem for its body, headings, navigation, publication controls,
   social icons, and footer. Scale their shared root from 16px to 12px while
   preserving the template's type hierarchy and respecting browser zoom. */
html {
  font-size: 75%;
}

/* Keep the original 930px / 16px reading measure as the type becomes smaller. */
.container {
  max-width: 58.125rem;
}

/* These theme controls use an absolute/keyword size instead of rem. */
.code-display-wrapper .copy {
  font-size: 1rem;
}

ninja-keys {
  --ninja-font-size: 1rem;
  --ninja-width: min(40rem, calc(100vw - 2rem));
}

/* Long author names, titles, and citation URLs must fit narrow screens. */
.publications .row > [class*="col"] {
  min-width: 0;
}

.publications .title,
.publications .author,
.publications .periodical {
  overflow-wrap: anywhere;
}

.publications .hidden pre {
  max-width: 100%;
  overflow-x: auto;
}

/* Same-page anchors under al-folio's fixed navigation. */
.onepage-section {
  clear: both;
  margin-top: 2.5rem;
  padding-top: 0.25rem;
  scroll-margin-top: 5rem;
}

/* Keep compact publication controls legible after reducing the root size. */
.publications .links .btn {
  font-size: 0.75rem;
}

.service-subheading {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}

.social .contact-icons {
  font-size: 2rem;
}

/* Center the library's icon in al-folio's smaller button and clear the footer. */
:root #back-to-top {
  display: grid;
  place-items: center;
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}

:root #back-to-top svg {
  width: 24px;
  height: 24px;
  margin: 0;
}
