/* Stable document geometry during wheel, trackpad and touch scrolling. */
html:root { scroll-behavior: auto; scrollbar-gutter: stable; scroll-padding-top: var(--site-header-offset, 150px); }
html:root, html body { overflow-x: clip; }
html.site-overlay-open, html.react-reader-open { overflow-y: hidden; }
html .site-header {
  top: 0;
  background: #123b33;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html .reading-progress span {
  width: 100% !important;
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: left center;
  transition: none;
}
html .hero-memory-tile img,
html .fieldwork-gallery img,
html .baydal-gallery img,
html .newspaper-image-button img,
html .facsimile-image-button img,
html .america-document-button img,
html .zegri-document-button img {
  transform: none;
  transition: filter 160ms ease;
}
html .has-detail-page { transition: box-shadow 160ms ease, border-color 160ms ease; }
html .has-detail-page:hover { transform: none; }
html .archive-tabs button { transition: color 160ms ease, background 160ms ease; }
html .archive-tabs button:hover { padding-left: 20px; }
/* The source previews retain their frame when the mobile address bar changes. */
@supports (height: 1svh) {
  html .newspaper-image-button img { height: min(72svh, 760px); }
  @media (max-width: 900px) {
    html .newspaper-image-button img { height: min(68svh, 650px); }
  }
}
html .hero-memory-lightbox { box-sizing: border-box; max-height: 100%; }
html .chapter-reader, html .scan-lightbox-frame, html .detail-page-content {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
@supports (height: 1dvh) {
  html .hero-memory-lightbox { height: 100dvh; }
  @media (max-width: 760px) {
    html .chapter-reader, html .scan-lightbox-frame { height: 100dvh; }
  }
}
/* Reserve the action area before the detail-page enhancements attach. */
html .america-morisca-facts > article,
html .america-survival-grid > article,
html .america-case-grid > article,
html .america-corridor-grid > article,
html .america-related-cases > article,
html .america-material-grid > article,
html .america-timeline > ol > li,
html .america-terms-grid > article,
html .america-open-trails > div > article,
html .zegri-lineage-facts > article,
html .zegri-routes-grid > article,
html .zegri-survival-grid > article,
html .zegri-geography > ol > li,
html .zegri-archive-grid > article,
html .banegas-perspectives-grid > article,
html .banegas-rebellion-timeline > article,
html .riopar-grid > article,
html .heritage-ledger > article,
html .eastern-proof-grid > article,
html .mojacar-route > li,
html .granada-stat-grid > article,
html .granada-network-map > article,
html .kettani-method-grid > article,
html .kettani-survival-grid > article,
html .chapter-card-grid > article,
html .diplomacy-reading-key > article,
html .baydal-proof-grid > article,
html .silk-facts > article,
html .region-grid > article,
html .navarra-history-grid > article {
  position: relative;
  padding-bottom: 5.2rem;
}
html .has-detail-page > .detail-card-open {
  position: absolute;
  left: 1.2rem;
  bottom: 1.2rem;
  max-width: calc(100% - 2.4rem);
  margin: 0;
}
html .america-timeline li > .detail-card-open { left: 6.4rem; max-width: calc(100% - 7.6rem); }
@media(max-width:760px) {
  html .america-timeline li > .detail-card-open { left: 1.2rem; max-width: calc(100% - 2.4rem); }
}

html .chapter-reader { scroll-padding-top: 5rem; }
