/*
 * Puzi church history archive
 * A single, neutral editorial owner for /history. Verified text, dates and
 * photographs are the visual material; gold is reserved for archive indexing.
 */

html {
  max-width: 100%;
  overflow-x: clip;
}

body.history-archive {
  --history-ink: #17212b;
  --history-copy: #35414c;
  --history-muted: #66717c;
  --history-accent: #806300;
  --history-accent-soft: #b89a36;
  --history-paper: #fbfaf7;
  --history-warm: #f2f0ea;
  --history-surface: #ffffff;
  --history-line: #d9d9d2;
  --history-line-strong: #b9b9af;
  --history-max: 1180px;
  --gold-50: var(--history-paper);
  --gold-100: var(--history-warm);
  --gold-200: #d5c78d;
  --gold-300: var(--history-accent-soft);
  --gold-400: #967614;
  --gold-500: var(--history-accent);
  --sepia: var(--history-muted);
  --parchment: var(--history-warm);
  --ink: var(--history-ink);
  background: var(--history-paper) !important;
  color: var(--history-copy);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

body.history-archive :where(#origin, #timeline, #stories, #gallery, #memorial) {
  scroll-margin-top: 116px;
}

body.history-archive .archive-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.history-archive .hero {
  min-height: 0 !important;
  display: block;
  background: var(--history-warm) !important;
  border-bottom: 1px solid var(--history-line) !important;
  overflow: clip;
}

body.history-archive .hero::before {
  content: none;
}

body.history-archive .hero::after {
  content: none;
}

body.history-archive .hero-content {
  width: min(calc(100% - 48px), var(--history-max));
  max-width: none;
  min-height: 650px;
  margin: 0 auto;
  padding: clamp(58px, 8vw, 104px) 0;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  align-items: center;
  gap: clamp(48px, 7vw, 94px);
  text-align: left;
}

body.history-archive .hero-identity {
  min-width: 0;
}

body.history-archive .hero-badge {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 14px;
  margin: 0 0 clamp(32px, 5vw, 56px) !important;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  color: var(--history-accent);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

body.history-archive .hero-badge span + span {
  padding-left: 14px;
  border-left: 1px solid var(--history-line-strong);
  color: var(--history-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
}

body.history-archive .hero-title {
  margin: 0;
  color: var(--history-ink);
  font-size: clamp(46px, 5.8vw, 72px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.05em;
  text-shadow: none;
}

body.history-archive .hero-subtitle {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--history-copy);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

body.history-archive .hero-summary {
  max-width: 540px;
  margin: 20px 0 0;
  color: var(--history-muted);
  font-size: 16px;
  line-height: 1.9;
}

body.history-archive .hero-years {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
  margin: clamp(38px, 5vw, 58px) 0 0;
}

body.history-archive .hero-year-entry {
  display: grid;
  gap: 7px;
}

body.history-archive .hero-year-label {
  color: var(--history-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

body.history-archive .hero-year {
  color: var(--history-ink);
  font-size: clamp(25px, 3vw, 36px);
  font-variant-numeric: tabular-nums;
  font-weight: 450;
  line-height: 1;
  opacity: 1;
}

body.history-archive .hero-year-divider {
  width: clamp(42px, 7vw, 86px);
  height: 1px;
  background: var(--history-accent-soft);
}

body.history-archive .hero-archive-image {
  min-width: 0;
  margin: 0;
  padding: clamp(12px, 1.8vw, 22px) clamp(12px, 1.8vw, 22px) 0;
  border: 1px solid #ccc9c0;
  background: #e7e4dc;
}

body.history-archive .hero-archive-image picture,
body.history-archive .gallery-item picture {
  display: block;
  width: 100%;
  overflow: hidden;
}

body.history-archive .hero-archive-image picture,
body.history-archive .gallery-item picture {
  aspect-ratio: 4 / 3;
}

body.history-archive .hero-archive-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.68) contrast(1.04);
}

body.history-archive .hero-archive-image figcaption {
  min-height: 58px;
  padding: 16px 2px 17px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--history-copy);
  font-size: 13px;
  line-height: 1.55;
}

body.history-archive .hero-archive-image figcaption span {
  color: var(--history-accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

body.history-archive .nav-bar {
  top: 0;
  padding: 0 !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--history-line) !important;
  box-shadow: none;
  backdrop-filter: none;
}

body.history-archive .nav-container {
  width: min(calc(100% - 40px), var(--history-max));
  max-width: none;
  min-height: 68px;
  margin: 0 auto;
  padding: 8px 0;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 20px !important;
}

body.history-archive .exhibit-progress {
  grid-column: 1 / -1;
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(160px, auto) 1fr 44px;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--history-line);
  color: var(--history-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

body.history-archive .exhibit-progress-track {
  height: 2px;
  background: var(--history-line);
  overflow: hidden;
}

body.history-archive .exhibit-progress-value {
  display: block;
  width: 0;
  height: 100%;
  background: var(--history-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 120ms linear;
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  body.history-archive .animate-fadeInUp {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  body.history-archive :is(.hero-archive-image img, .gallery-image) {
    filter: none !important;
  }
}

@supports (content-visibility: auto) {
  body.history-archive :is(
    .stats-section,
    #origin,
    #timeline,
    #stories,
    #gallery,
    #memorial
  ) {
    content-visibility: auto;
  }

  body.history-archive .stats-section { contain-intrinsic-size: auto 320px; }
  body.history-archive #origin { contain-intrinsic-size: auto 440px; }
  body.history-archive #timeline { contain-intrinsic-size: auto 3900px; }
  body.history-archive #stories { contain-intrinsic-size: auto 2100px; }
  body.history-archive #gallery { contain-intrinsic-size: auto 3300px; }
  body.history-archive #memorial { contain-intrinsic-size: auto 1000px; }
}

body.history-archive .exhibit-progress-percent {
  text-align: right;
}

body.history-archive .nav-back {
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--history-ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

body.history-archive .nav-back::before {
  content: "";
  width: 24px;
  height: 1px;
  margin-right: 10px;
  background: var(--history-accent);
}

body.history-archive [data-page-lang-toggle] :where(button, select, a) {
  min-height: 48px;
  border-color: var(--history-line-strong) !important;
  border-radius: 2px !important;
  background: var(--history-surface) !important;
  color: var(--history-ink) !important;
  font-weight: 600;
}

body.history-archive .nav-links {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0;
}

body.history-archive .nav-link {
  min-height: 48px !important;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--history-muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

body.history-archive .nav-link::after {
  content: none;
}

body.history-archive .nav-link:is(:hover, :focus-visible),
body.history-archive .nav-link-related {
  border-bottom-color: var(--history-accent);
  color: var(--history-ink);
}

body.history-archive .nav-link[aria-current="location"] {
  border-bottom-color: var(--history-accent);
  color: var(--history-ink);
}

body.history-archive .stats-section {
  padding: clamp(34px, 5vw, 52px) 24px;
  border-block: 1px solid var(--history-line) !important;
  background: var(--history-surface);
}

body.history-archive .stats-grid {
  width: min(100%, var(--history-max));
  max-width: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  text-align: left;
}

body.history-archive .stat-item {
  min-height: 94px;
  padding: 10px clamp(20px, 3vw, 42px);
  border-left: 1px solid var(--history-line);
}

body.history-archive .stat-item:first-child {
  padding-left: 0;
  border-left: 0;
}

body.history-archive .stat-number {
  margin: 0 0 16px;
  color: var(--history-ink);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

body.history-archive .stat-label {
  color: var(--history-muted);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.04em;
}

body.history-archive .quote-section {
  padding: clamp(72px, 9vw, 112px) 24px;
  background: var(--history-paper);
  text-align: left;
}

body.history-archive .exhibit-label {
  width: min(100%, 850px);
  margin: 0 auto 30px;
  color: var(--history-accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

body.history-archive .quote-section::before {
  content: none;
}

body.history-archive .quote-text,
body.history-archive .quote-author,
body.history-archive .quote-date {
  width: min(100%, 850px);
  margin-inline: auto;
}

body.history-archive .quote-text {
  margin-bottom: 30px;
  padding-left: clamp(24px, 4vw, 44px);
  border-left: 3px solid var(--history-accent-soft);
  color: var(--history-ink);
  font-size: clamp(21px, 3vw, 32px);
  font-style: normal;
  font-weight: 550;
  line-height: 1.85;
}

body.history-archive .quote-author {
  color: var(--history-accent);
  font-size: 14px;
  font-weight: 700;
}

body.history-archive .quote-date {
  margin-top: 7px;
  color: var(--history-muted);
  font-size: 13px;
}

body.history-archive #timeline,
body.history-archive .stories-section,
body.history-archive .gallery-section,
body.history-archive .memorial-section {
  padding: clamp(72px, 9vw, 116px) 24px;
}

body.history-archive #timeline,
body.history-archive .memorial-section {
  background: var(--history-surface);
}

body.history-archive .stories-section,
body.history-archive .gallery-section {
  background: var(--history-warm);
}

body.history-archive .main-content {
  width: min(100%, var(--history-max));
  max-width: none;
  margin: 0 auto;
  padding: 0 !important;
}

body.history-archive .section-header {
  max-width: 780px;
  margin: 0 0 clamp(42px, 6vw, 72px);
  padding: 0;
  text-align: left;
}

body.history-archive .section-number {
  width: fit-content;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--history-accent-soft);
  color: var(--history-accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

body.history-archive .section-title {
  margin: 0;
  color: var(--history-ink) !important;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

body.history-archive .section-divider {
  display: none;
}

body.history-archive .section-intro {
  max-width: 690px !important;
  margin: 16px 0 0 !important;
  color: var(--history-muted) !important;
  font-size: 16px;
  line-height: 1.8;
}

body.history-archive .timeline-index {
  max-width: 900px;
  margin: -22px 0 50px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border-block: 1px solid var(--history-line);
  scrollbar-width: thin;
}

body.history-archive .timeline-index-label {
  padding-right: 14px;
  color: var(--history-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

body.history-archive .timeline-index button {
  min-width: 72px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--history-line);
  border-radius: 2px;
  background: var(--history-surface);
  color: var(--history-copy);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  cursor: pointer;
}

body.history-archive .timeline-index button:is(:hover, :focus-visible) {
  border-color: var(--history-ink);
  background: var(--history-ink);
  color: #ffffff;
}

body.history-archive .timeline-container {
  position: relative;
  padding: 0 !important;
}

body.history-archive .timeline-line {
  left: 126px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--history-line-strong);
  transform: none;
}

body.history-archive .timeline-item,
body.history-archive .timeline-item:nth-child(odd),
body.history-archive .timeline-item:nth-child(even) {
  position: relative;
  left: 0 !important;
  width: 100% !important;
  min-height: 150px;
  margin: 0;
  padding: 0 0 42px 170px;
  display: block;
  opacity: 1;
  transform: none;
  transition: none;
  outline: 0;
}

body.history-archive .timeline-item:last-child {
  padding-bottom: 0;
}

body.history-archive .timeline-marker {
  left: 122px;
  top: 10px;
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 0;
  background: var(--history-accent);
  box-shadow: 0 0 0 5px var(--history-surface);
  transform: none;
  transition: none;
}

body.history-archive .timeline-item:hover .timeline-marker {
  transform: none;
  box-shadow: 0 0 0 5px var(--history-surface);
}

body.history-archive .timeline-item:is(:focus-visible, .is-selected) .timeline-marker {
  background: var(--history-ink);
  box-shadow: 0 0 0 5px var(--history-surface), 0 0 0 7px var(--history-accent-soft);
}

body.history-archive .timeline-item:is(:focus-visible, .is-selected) .timeline-content {
  border-bottom-color: var(--history-accent-soft) !important;
  background: rgba(184, 154, 54, 0.08);
}

body.history-archive .timeline-content {
  width: 100%;
  min-height: 122px;
  padding: 0 0 34px;
  border: 0 !important;
  border-bottom: 1px solid var(--history-line) !important;
  border-radius: 0 !important;
  background: transparent;
  box-shadow: none;
  position: static;
  transition: none;
  transform: none !important;
  opacity: 1 !important;
}

body.history-archive :is(.timeline-content, .story-card, .gallery-item, .memorial-card).public-reveal,
body.history-archive :is(.timeline-content, .story-card, .gallery-item, .memorial-card).public-interactive-surface {
  transform: none !important;
  opacity: 1 !important;
}

body.history-archive .timeline-content:hover {
  box-shadow: none;
  transform: none;
}

body.history-archive .timeline-year,
body.history-archive .timeline-item:nth-child(odd) .timeline-year,
body.history-archive .timeline-item:nth-child(even) .timeline-year {
  position: absolute;
  top: 0;
  left: 0;
  right: auto;
  width: 98px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--history-accent);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

body.history-archive .timeline-title {
  margin: 0 0 10px;
  color: var(--history-ink);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 750;
  line-height: 1.4;
}

body.history-archive .timeline-text {
  max-width: 820px;
  color: var(--history-copy);
  font-size: 16px;
  line-height: 1.9;
}

body.history-archive .timeline-details {
  max-width: 820px;
  border-top-color: var(--history-line);
}

body.history-archive .timeline-detail-label {
  color: var(--history-accent);
}

body.history-archive .timeline-media-link {
  min-height: 48px;
  border-color: var(--history-line-strong);
  border-radius: 2px;
  background: var(--history-surface);
  color: var(--history-accent);
}

body.history-archive .collection-notice {
  margin-top: 12px;
}

body.history-archive .collection-notice .timeline-content {
  padding: 28px 30px;
  border: 1px solid var(--history-line-strong) !important;
  background: var(--history-paper);
}

body.history-archive .collection-status {
  margin-top: 18px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--history-accent-soft);
  border-radius: 0;
  background: transparent;
  color: var(--history-accent);
  font-size: 12px;
}

body.history-archive .story-grid {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--history-line-strong);
}

body.history-archive .story-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(190px, 0.4fr) minmax(0, 1.6fr);
  border: 0 !important;
  border-bottom: 1px solid var(--history-line) !important;
  border-radius: 0 !important;
  background: transparent;
  box-shadow: none;
  cursor: default;
  transition: background-color 160ms ease, border-color 160ms ease;
}

body.history-archive .story-card:hover {
  transform: none;
  border-color: var(--history-line-strong) !important;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: none;
}

body.history-archive .story-card-header {
  min-height: 0;
  padding: 28px 28px 24px;
  border-right: 1px solid var(--history-line);
  border-bottom: 0;
  background: transparent;
}

body.history-archive .story-card-header::before {
  content: none;
}

body.history-archive .story-card-number {
  margin-bottom: 14px;
  color: var(--history-accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

body.history-archive .story-card-title {
  color: var(--history-ink);
  font-size: 21px;
  font-weight: 750;
  line-height: 1.45;
}

body.history-archive .story-card-body {
  padding: 26px 28px 30px;
}

body.history-archive .story-card-text {
  color: var(--history-copy);
  font-size: 15px;
  line-height: 1.85;
}

body.history-archive .story-card-text strong {
  color: var(--history-ink) !important;
}

body.history-archive .gallery-grid {
  max-width: none;
  padding-inline: 0 !important;
  counter-reset: history-artifact;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

body.history-archive .gallery-item {
  width: 100%;
  min-height: 48px;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  aspect-ratio: auto;
  border: 1px solid var(--history-line) !important;
  border-radius: 2px !important;
  background: var(--history-surface);
  box-shadow: none;
  text-align: left;
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease;
  counter-increment: history-artifact;
}

body.history-archive .gallery-item:is(:hover, :focus-visible) {
  transform: none;
  border-color: var(--history-line-strong) !important;
  box-shadow: none;
}

body.history-archive .gallery-item:focus-visible {
  outline: 3px solid rgba(128, 99, 0, 0.32);
  outline-offset: 3px;
}

body.history-archive .gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.03);
  transition: filter 160ms ease;
}

body.history-archive .gallery-item:hover img {
  transform: none;
  filter: saturate(0.95) contrast(1.03);
}

body.history-archive .gallery-overlay {
  position: static;
  min-height: 94px;
  padding: 16px 18px 18px;
  display: flex;
  justify-content: flex-start;
  border-top: 1px solid var(--history-line);
  background: var(--history-surface);
  opacity: 1;
}

body.history-archive .gallery-overlay::before {
  content: "典藏影像 PH-" counter(history-artifact, decimal-leading-zero);
  margin-bottom: 8px;
  color: var(--history-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

body.history-archive .gallery-year {
  margin-bottom: 5px;
  color: var(--history-accent);
  font-size: 12px;
  font-weight: 700;
}

body.history-archive .gallery-title {
  color: var(--history-ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.55;
}

body.history-archive .memorial-section {
  padding-inline: 24px;
}

body.history-archive .memorial-section > .section-header,
body.history-archive .memorial-grid {
  width: min(100%, var(--history-max));
  margin-inline: auto;
}

body.history-archive .memorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

body.history-archive .memorial-card {
  max-width: none;
  margin: 0;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--history-line);
  border-radius: 2px;
  background: var(--history-paper);
  box-shadow: none;
  text-align: left;
}

body.history-archive .memorial-name {
  color: var(--history-ink);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.3;
}

body.history-archive .memorial-title {
  margin: 10px 0 24px;
  color: var(--history-accent);
  font-size: 14px;
  font-weight: 650;
}

body.history-archive .memorial-text {
  color: var(--history-copy);
  font-size: 15px;
  line-height: 1.9;
}

body.history-archive .memorial-dates {
  justify-content: flex-start;
  gap: 0;
  margin-top: 30px;
  padding-top: 22px;
  border-top-color: var(--history-line);
}

body.history-archive .memorial-date {
  flex: 1;
  padding: 0 18px;
  border-left: 1px solid var(--history-line);
  text-align: left;
}

body.history-archive .memorial-date:first-child {
  padding-left: 0;
  border-left: 0;
}

body.history-archive .memorial-date-label {
  color: var(--history-muted);
}

body.history-archive .memorial-date-value {
  color: var(--history-ink);
  font-size: 17px;
  font-weight: 650;
}

body.history-archive .memorial-link {
  min-height: 48px;
  margin-top: 28px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--history-ink);
  border-radius: 0;
  background: var(--history-ink);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

body.history-archive .history-footer {
  padding: 54px 24px calc(54px + env(safe-area-inset-bottom, 0px));
  border-top: 0;
  background: #101820;
  text-align: left;
}

body.history-archive :is(.public-back-to-top, .public-foundation-back-to-top) {
  width: auto !important;
  min-width: 64px !important;
  height: 48px !important;
  padding: 0 14px !important;
  border: 1px solid var(--history-line-strong) !important;
  border-radius: 2px !important;
  background: var(--history-paper) !important;
  background-image: none !important;
  color: var(--history-ink) !important;
  box-shadow: none !important;
  font-size: 0 !important;
}

body.history-archive :is(.public-back-to-top, .public-foundation-back-to-top)::before {
  border-radius: 0 !important;
}

body.history-archive :is(.public-back-to-top, .public-foundation-back-to-top)::after {
  content: "頁首";
  position: relative;
  z-index: 2;
  color: currentColor;
  font-size: 14px;
  font-weight: 700;
}

body.history-archive .public-back-to-top svg {
  display: none;
}

body.history-archive.public-has-modal :is(.public-back-to-top, .public-foundation-back-to-top) {
  display: none !important;
}

body.history-archive .footer-text,
body.history-archive .history-footer > p {
  width: min(100%, var(--history-max));
  margin-inline: auto;
}

body.history-archive .footer-text {
  margin-bottom: 18px;
  color: #bdc5cc;
  line-height: 1.85;
}

body.history-archive .footer-text a,
body.history-archive .footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px !important;
  color: #e1cf8c !important;
}

body.history-archive .photo-modal {
  padding: 24px 124px;
  background: rgba(10, 15, 20, 0.94);
  backdrop-filter: none;
}

body.history-archive .photo-modal-content {
  max-width: 1000px;
}

body.history-archive .photo-modal-image {
  max-height: 72dvh;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  box-shadow: none;
}

body.history-archive .photo-modal-caption {
  color: #ffffff;
  font-size: 17px;
}

body.history-archive .photo-modal-year,
body.history-archive .photo-counter {
  color: #d5c78d;
}

body.history-archive .photo-modal-close,
body.history-archive .photo-modal-nav {
  min-height: 48px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  background: rgba(16, 24, 32, 0.82);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

body.history-archive .photo-modal-close:is(:hover, :focus-visible),
body.history-archive .photo-modal-nav:is(:hover, :focus-visible) {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--history-ink);
}

@media (max-width: 1080px) {
  body.history-archive .nav-container {
    grid-template-columns: 1fr auto;
  }

  body.history-archive .nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  body.history-archive .nav-links::-webkit-scrollbar {
    display: block;
    height: 3px;
  }

  body.history-archive .nav-links::-webkit-scrollbar-thumb {
    background: var(--history-line-strong);
  }

  body.history-archive .nav-link {
    scroll-snap-align: start;
  }

  body.history-archive .nav-link:first-child {
    padding-left: 0;
  }
}

@media (max-width: 900px) {
  body.history-archive .hero-content {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 46px;
  }

  body.history-archive .hero-archive-image {
    max-width: 680px;
  }

  body.history-archive .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.history-archive .stat-item:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  body.history-archive .stat-item:nth-child(n + 3) {
    margin-top: 36px;
  }

  body.history-archive .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body.history-archive .hero-content {
    width: 100%;
    padding: 44px 20px 42px;
    gap: 34px;
  }

  body.history-archive .hero-badge {
    flex-wrap: wrap;
  }

  body.history-archive .hero-title {
    font-size: clamp(42px, 12vw, 52px);
  }

  body.history-archive .hero-subtitle {
    font-size: 19px;
  }

  body.history-archive .nav-container {
    width: 100%;
    padding: 8px 20px 0;
    gap: 8px 16px !important;
  }

  body.history-archive .nav-back {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.history-archive .nav-back::before {
    width: 16px;
  }

  body.history-archive .nav-links {
    margin-inline: 0;
    padding-inline: 0;
  }

  body.history-archive .exhibit-progress {
    margin-inline: 0;
    padding-inline: 0;
    grid-template-columns: minmax(118px, auto) 1fr 38px;
    gap: 9px;
  }

  body.history-archive .exhibit-progress-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.history-archive #timeline,
  body.history-archive .stories-section,
  body.history-archive .gallery-section,
  body.history-archive .memorial-section {
    padding: 68px 20px;
  }

  body.history-archive .timeline-index {
    margin-top: -12px;
    margin-bottom: 42px;
    scroll-snap-type: x proximity;
  }

  body.history-archive .timeline-index button {
    scroll-snap-align: start;
  }

  body.history-archive .timeline-line {
    left: 7px;
  }

  body.history-archive .timeline-item,
  body.history-archive .timeline-item:nth-child(odd),
  body.history-archive .timeline-item:nth-child(even) {
    min-height: 0;
    padding: 0 0 36px 34px;
  }

  body.history-archive .timeline-marker {
    left: 3px;
    top: 8px;
  }

  body.history-archive .timeline-year,
  body.history-archive .timeline-item:nth-child(odd) .timeline-year,
  body.history-archive .timeline-item:nth-child(even) .timeline-year {
    position: static;
    display: block;
    width: auto;
    margin-bottom: 9px;
  }

  body.history-archive .timeline-content {
    padding-bottom: 28px;
  }

  body.history-archive .collection-notice .timeline-content {
    padding: 24px 22px;
  }

  body.history-archive .story-grid,
  body.history-archive .gallery-grid,
  body.history-archive .memorial-grid {
    grid-template-columns: 1fr;
  }

  body.history-archive .story-card-header,
  body.history-archive .story-card-body {
    padding-inline: 22px;
  }

  body.history-archive .story-card {
    grid-template-columns: 1fr;
  }

  body.history-archive .story-card-header {
    border-right: 0;
    border-bottom: 1px solid var(--history-line);
  }

  body.history-archive .memorial-card {
    padding: 28px 22px;
  }

  body.history-archive .memorial-dates {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.history-archive .memorial-date {
    min-width: 0;
    padding-inline: 10px;
  }

  body.history-archive .memorial-date-value {
    overflow-wrap: anywhere;
  }

  body.history-archive .photo-modal {
    padding: 80px 18px 104px;
    align-items: center;
  }

  body.history-archive .photo-modal-close {
    top: max(16px, env(safe-area-inset-top, 0px));
    right: 18px;
  }

  body.history-archive .photo-modal-nav {
    top: auto;
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    transform: none;
  }

  body.history-archive .photo-modal-prev {
    left: 18px;
  }

  body.history-archive .photo-modal-next {
    right: 18px;
  }
}

@media (max-width: 420px) {
  body.history-archive .stats-grid {
    grid-template-columns: 1fr;
  }

  body.history-archive .stat-item,
  body.history-archive .stat-item:nth-child(3) {
    min-height: 0;
    margin: 0;
    padding: 22px 0;
    border-left: 0;
    border-top: 1px solid var(--history-line);
  }

  body.history-archive .stat-item:first-child {
    border-top: 0;
  }

  body.history-archive .stat-number {
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.history-archive *,
  body.history-archive *::before,
  body.history-archive *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body.history-archive .nav-bar,
  body.history-archive .photo-modal {
    display: none !important;
  }

  body.history-archive .hero,
  body.history-archive #timeline,
  body.history-archive .stories-section,
  body.history-archive .gallery-section,
  body.history-archive .memorial-section {
    background: #ffffff !important;
  }
}
