/* ========================================================
   base.css - Page-wide defaults, utilities and a11y helpers

   --site-header-height: height of a host site's fixed navbar,
   when these pages run inside one (set by that site, or
   measured by js/utils/header-offset.js); 0 otherwise.

   .me-page is the page's wrapper (inside the website's navbar
   and footer), or <body> on the PDF and video pages.
   ======================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--site-header-height, 0px);
}

.me-page {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

body.me-page {
  min-height: var(--screen-height);
}

/* Safety net: nothing may push the page sideways on small screens. `clip` (unlike
   `hidden`) creates no scroll container, so the sticky top bar keeps working. */
@supports (overflow: clip) {
  .me-page {
    overflow-x: clip;
  }
}

:where(.me-page) :focus-visible {
  outline: 3px solid var(--color-blue-light);
  outline-offset: 3px;
}

/* Hidden visually, still read by screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  :where(.me-page) *,
  :where(.me-page) *::before,
  :where(.me-page) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* The PDF and video pages on the website: the site's header lies over the top ~80px of every page (navbar.css,
   --fwc-page-clearance), so their content starts below it. The home page's picture is meant to run under it. */
.me-page--viewer {
  padding-top: var(--fwc-page-clearance, 0px);
}
