/* Navigation stays available; the location trail remains at the page opening. */
:root { --facus-header-height: 103px; }
html { scroll-padding-top: var(--facus-header-height); }
.header {
  position: sticky;
  top: 0;
  z-index: 50;
}
.location-bar {
  position: static;
  top: auto;
  z-index: auto;
  box-shadow: none;
}
.skip-link { z-index: 2000; }

/* scrollIntoView and native keyboard navigation clear the measured header. */
#main-content,
.page [id] { scroll-margin-top: 24px; }
#page-historia .history-chapter-head {
  top: calc(var(--facus-header-height) + 24px);
}

@media (min-width: 1450px) {
  :root { --facus-header-height: 108px; }
}
@media (max-width: 900px) {
  :root { --facus-header-height: 85px; }
  .nav.open {
    max-height: max(0px, calc(100vh - var(--facus-header-height)));
    max-height: max(0px, calc(100dvh - var(--facus-header-height)));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 650px) {
  :root { --facus-header-height: 77px; }
}
@media (max-height: 650px) {
  #page-historia .history-chapter-head { position: static; }
}
@media print {
  html { scroll-padding-top: 0; }
  .header { position: static; }
  #page-historia .history-chapter-head { position: static; top: auto; }
}
