/* The masthead follows the paper, type and rules of Life in America. */
.site-header.archive-masthead {
  --nav-paper: #f3f0e8;
  --nav-ink: #282b26;
  --nav-muted: #68695e;
  --nav-line: #cfcec2;
  --nav-rust: #a64b2d;
  position: relative;
  z-index: 30;
  inset: auto;
  display: flex;
  width: auto;
  min-height: 100px;
  margin: 0 5vw;
  padding: 20px 0;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: nowrap;
  transform: none;
  border: 0;
  border-bottom: 1px solid var(--nav-line);
  border-radius: 0;
  color: var(--nav-ink);
  background: var(--nav-paper);
  box-shadow: none;
  backdrop-filter: none;
}
.archive-masthead .archive-wordmark {
  display: block;
  flex-shrink: 0;
  color: var(--nav-ink);
  font: 400 26px/1.1 Georgia, 'Times New Roman', serif;
  letter-spacing: -.4px;
  text-decoration: none;
  white-space: nowrap;
}
.archive-wordmark i { color: var(--nav-rust); font-weight: 400; }
.archive-wordmark span {
  display: block;
  margin-top: 9px;
  font: 500 9px/1.4 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}
.archive-masthead .archive-primary-nav {
  position: relative;
  display: flex;
  min-width: 0;
  margin-left: auto;
  gap: 22px;
  align-items: center;
}
.archive-masthead .archive-primary-nav > a,
.archive-masthead .archive-nav-group > summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  color: var(--nav-ink);
  background: transparent;
  font: 500 11px/1.5 ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}
.archive-masthead .archive-nav-group > summary::-webkit-details-marker { display: none; }
.archive-nav-group { position: relative; }
.archive-nav-chevron {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.archive-nav-group[open] > summary .archive-nav-chevron { transform: translateY(1px) rotate(225deg); }
.archive-masthead .archive-primary-nav > a:hover,
.archive-masthead .archive-primary-nav > a[aria-current],
.archive-masthead .archive-nav-group > summary:hover,
.archive-masthead .archive-nav-group[open] > summary,
.archive-masthead .archive-nav-group[data-active] > summary { color: var(--nav-rust); background: transparent; }
.archive-masthead .archive-session-link { color: var(--nav-muted); }
.archive-nav-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: -20px;
  display: grid;
  width: 238px;
  max-height: min(70vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid var(--nav-line);
  background: var(--nav-paper);
  color: var(--nav-ink);
  box-shadow: 0 14px 32px rgb(40 43 38 / 10%);
}
.archive-records-panel { width: 540px; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.archive-nav-column { min-width: 0; }
.archive-nav-panel .archive-nav-heading {
  margin: 0 0 10px;
  color: var(--nav-rust);
  font: 600 9px/1.6 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.archive-masthead .archive-nav-panel a {
  display: flex;
  min-height: 42px;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--nav-line);
  color: var(--nav-ink);
  background: transparent;
  font: 400 12px/1.5 ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
  white-space: normal;
}
.archive-nav-panel a > span { color: var(--nav-muted); font-size: 14px; }
.archive-masthead .archive-nav-panel a:hover,
.archive-masthead .archive-nav-panel a[aria-current] { color: var(--nav-rust); background: transparent; }
.archive-nav-preferences { grid-column: 1 / -1; }
.archive-motion-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--nav-muted);
  font: 400 11px/1.5 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}
.archive-motion-toggle[hidden] { display: none; }
.archive-motion-toggle:hover { color: var(--nav-rust); }
.archive-masthead .site-language {
  position: static;
  display: inline-flex;
  flex-shrink: 0;
  gap: 3px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--nav-line);
  border-radius: 0;
}
.archive-masthead .site-language a {
  display: flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 9px;
  border-radius: 0;
  color: var(--nav-ink);
  background: transparent;
  font: 400 11px/1.3 ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
}
.archive-masthead .site-language a[aria-current="true"] { background: var(--nav-ink); color: var(--nav-paper); }
.archive-masthead .site-language a:hover:not([aria-current]) { background: #e3dfd4; }
.archive-masthead :is(a, summary, button):focus-visible {
  outline: 2px solid var(--nav-rust);
  outline-offset: 4px;
}
.archive-skip-link {
  position: fixed;
  left: 5vw;
  top: -100px;
  z-index: 100;
  padding: 14px 18px;
  color: #282b26;
  background: #f3f0e8;
  border: 1px solid #a64b2d;
}
.archive-skip-link:focus { top: 12px; }
/* A small lift follows the reading rhythm without concealing whole chapters. */
.archive-reveal-ready { opacity: 0; transform: translateY(12px); }
.archive-reveal-ready.archive-reveal-visible {
  opacity: 1;
  transform: none;
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.7,.3,1);
  transition-delay: var(--archive-reveal-delay, 0ms);
}
.archive-reveal-ready:is(.archive-reveal-immediate, :focus-within) {
  opacity: 1;
  transform: none;
  transition: none;
}
.timeline > li > .date::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  margin-top: 14px;
  background: #a64b2d;
  transform: scaleX(1);
  transform-origin: left;
}
.timeline > li > .date { flex-direction: column; }
.timeline > li.archive-reveal-ready:not(.archive-reveal-visible) > .date::after { transform: scaleX(0); }
.timeline > li.archive-reveal-visible > .date::after {
  transform: scaleX(1);
  transition: transform .45s cubic-bezier(.2,.7,.3,1) .1s;
}
.timeline > li.archive-reveal-immediate > .date::after { transition: none; }
@keyframes archive-nav-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.archive-motion-paused) .archive-nav-group[open] > .archive-nav-panel {
    animation: archive-nav-enter .17s ease-out both;
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html:not(.archive-motion-paused) .archive-nav-chevron { transition: transform .17s ease; }
  html:not(.archive-motion-paused) :is(.archive-nav-panel a, .archive-opening-links a, .america-feature a, .estate-paper-link, .estate-link) > span[aria-hidden] {
    display: inline-block;
    transition: transform .17s ease;
  }
  html:not(.archive-motion-paused) :is(.archive-nav-panel a, .archive-opening-links a, .america-feature a, .estate-paper-link, .estate-link):hover > span[aria-hidden] {
    transform: translateX(3px);
  }
}
/* The shared preference also covers animations in the older page styles. */
html.archive-motion-paused,
.archive-motion-paused *,
.archive-motion-paused *::before,
.archive-motion-paused *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
.archive-motion-paused .archive-reveal-ready { opacity: 1; transform: none; }
.archive-motion-paused .timeline > li.archive-reveal-ready > .date::after { transform: scaleX(1); }
.archive-motion-paused :is(.record-card, .map-card, .church-image-grid, .property-plan-visual, .property-card, .estate-newspaper-card, .voyage-record, .passport-example-gallery) img {
  transform: none !important;
}
@media (max-width: 900px) {
  .site-header.archive-masthead { gap: 16px; }
  .archive-masthead .archive-primary-nav { gap: 16px; }
}
@media (max-width: 680px) {
  .site-header.archive-masthead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 122px;
    margin: 0 6vw;
    padding: 18px 0 7px;
    gap: 10px 12px;
  }
  .archive-masthead .archive-wordmark { font-size: 22px; }
  .archive-wordmark span { margin-top: 7px; font-size: 7px; letter-spacing: 1.6px; }
  .archive-masthead .site-language { grid-column: 2; grid-row: 1; }
  .archive-masthead .site-language a { padding: 6px 7px; font-size: 10px; }
  .archive-masthead .archive-primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    row-gap: 0;
  }
  .archive-masthead .archive-primary-nav > a,
  .archive-masthead .archive-nav-group > summary { min-height: 42px; padding: 7px 0; font-size: 11px; }
  .archive-nav-group { position: static; }
  .archive-nav-panel { top: calc(100% + 6px); left: 0; right: 0; width: 100%; max-height: 65vh; padding: 20px; }
  .archive-records-panel { grid-template-columns: 1fr; gap: 24px; }
  .archive-nav-panel a { min-height: 44px; }
  .archive-nav-preferences { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html, *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .archive-reveal-ready,
  .archive-reveal-ready.archive-reveal-visible { opacity: 1; transform: none; }
  .timeline > li.archive-reveal-ready > .date::after { transform: scaleX(1); }
  :is(.record-card, .map-card, .church-image-grid, .property-plan-visual, .property-card, .estate-newspaper-card, .voyage-record, .passport-example-gallery) img {
    transform: none !important;
  }
}
