.history-page .navigation a[aria-current="page"]::after { transform: scaleX(1); }

.history-hero {
  padding: calc(var(--header-height) + clamp(45px, 6vw, 85px)) var(--gutter) clamp(45px, 6vw, 75px);
  color: var(--cream);
  background: var(--ink);
}

.history-hero__copy { max-width: calc(var(--page) - 2 * var(--gutter)); margin: 0 auto; }
.history-hero h1 { font-size: clamp(3rem, 7.8vw, 7rem); line-height: .95; }
.history-hero__copy > p:not(.kicker) { max-width: 520px; margin: 24px 0; font-size: clamp(1rem, 1.4vw, 1.2rem); font-weight: 300; }

.history-archive { padding-top: clamp(45px, 6vw, 80px); }
.history-archive__header { margin-bottom: 28px; }
.history-archive__header h2 { font-size: clamp(2.2rem, 4.5vw, 4rem); line-height: 1; }
.history-archive__header > p { margin: 14px 0 0; color: #625f57; font-size: .95rem; }
.history-archive__controls { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 40px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.year-nav { flex: 1; min-width: 0; }
.year-nav summary { width: fit-content; min-height: 44px; padding: 8px 0; font-size: .9rem; font-weight: 500; cursor: pointer; }
.year-nav summary:hover { color: var(--red-deep); }
.year-nav__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; padding: 16px 0 8px; }
.year-nav [data-coverage] { --coverage-bg: #eeece6; --coverage-ink: #655f54; --coverage-border: #b9b5ab; --coverage-edge: dashed; }
.year-nav [data-coverage="recorded"] { --coverage-bg: #d8e8dd; --coverage-ink: #254c35; --coverage-border: #8aab95; --coverage-edge: solid; }
.year-nav a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; min-height: 44px; padding: 8px 10px; border: 1px var(--coverage-edge) var(--coverage-border); color: var(--coverage-ink); background: var(--coverage-bg); font-size: .85rem; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.year-nav a:hover,
.year-nav a:focus-visible { border-color: var(--coverage-ink); box-shadow: inset 0 0 0 1px var(--coverage-ink); }
.year-nav__symbol { font-size: .85rem; font-weight: 600; line-height: 1; }
.year-nav__legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 12px 0 0; padding: 0; color: #625f57; font-size: .78rem; list-style: none; }
.year-nav__legend li { display: inline-flex; align-items: center; gap: 6px; }
.year-nav__key { display: grid; width: 22px; height: 22px; place-items: center; border: 1px var(--coverage-edge) var(--coverage-border); color: var(--coverage-ink); background: var(--coverage-bg); font-weight: 600; line-height: 1; }
.history-archive__tools { flex-shrink: 0; }
.history-archive__tools button { min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; font-size: .85rem; font-weight: 500; cursor: pointer; }
.history-archive__tools button span { margin-left: 14px; color: var(--red); font-size: 1rem; }
.history-archive__tools button:hover { border-color: var(--red); }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline__entry { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 55px; scroll-margin-top: calc(var(--header-height) + 24px); }
.timeline__entry::before { position: absolute; top: 11px; bottom: -11px; left: 176px; width: 1px; content: ""; background: var(--line); }
.timeline__entry::after { position: absolute; top: 10px; left: 171px; width: 11px; height: 11px; border: 2px solid var(--paper); border-radius: 50%; content: ""; background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.timeline__entry:last-child::before { bottom: 0; }
.timeline__period { margin: 0; font-family: var(--display); font-size: clamp(2rem, 3vw, 3rem); line-height: 1; }
.timeline__period span { display: block; color: #6b685f; font-size: .65em; }
.timeline__chapter { min-width: 0; padding-bottom: 40px; }
.timeline__chapter > .kicker { margin-bottom: 10px; font-size: .7rem; }
.timeline__chapter h3 { margin-bottom: 16px; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1; overflow-wrap: anywhere; }
.year-roster { border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-height) + 24px); }
.year-roster:last-child { border-bottom: 1px solid var(--line); }
.year-roster:target { border-top-color: var(--red); }
.year-roster > summary { display: flex; min-height: 52px; align-items: center; gap: 24px; padding: 10px 16px; list-style: none; cursor: pointer; transition: background .2s; }
.year-roster > summary::-webkit-details-marker { display: none; }
.year-roster > summary::marker { content: ""; }
.year-roster > summary > span:first-child { font-family: var(--display); font-size: 1.5rem; line-height: 1; }
/* A single year's date is already beside the name. Keep it in the accessible
   summary label, but only show dates in multi-year groups. */
.timeline__chapter:not(:has(.year-roster--missing)) > details:only-of-type > summary > span:first-child { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.year-roster__label { color: #625f57; font-size: .9rem; }
.year-roster--missing { position: relative; padding: 0; border: 0; }
.year-roster--missing:last-child { border-bottom: 0; }
.year-roster--missing > [id] { position: absolute; top: 0; scroll-margin-top: calc(var(--header-height) + 24px); }
.year-roster--missing .year-roster__label { font-size: .85rem; }
.timeline__entry:has(:target) h3 { color: var(--red-deep); }
.year-roster__icon { position: relative; width: 18px; height: 18px; margin-left: auto; flex-shrink: 0; }
.year-roster__icon::before,
.year-roster__icon::after { position: absolute; top: 8px; left: 2px; width: 14px; height: 2px; content: ""; background: var(--red); }
.year-roster__icon::after { rotate: 90deg; }
.year-roster[open] .year-roster__icon::after { rotate: 0deg; }
.year-roster[open] > summary,
.year-roster > summary:hover { background: var(--cream); }
.roster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; margin: 0; padding: 24px 16px 28px; list-style: none; }
.roster li { font-size: .85rem; overflow-wrap: anywhere; }
.roster-note { max-width: 70ch; padding: 20px 16px 24px; font-size: .95rem; }
.roster-note p:last-child { margin-bottom: 0; }
.roster + .roster-note { padding-top: 0; }

.archive-note { max-width: 760px; margin: 30px 0 0 auto; padding: clamp(28px, 4vw, 50px); border-left: 3px solid var(--red); background: var(--cream); }
.archive-note h2 { margin-bottom: 18px; font-size: clamp(2rem, 3.5vw, 3.5rem); }

@media (max-width: 1080px) {
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .timeline__entry { grid-template-columns: 90px minmax(0, 1fr); column-gap: 40px; }
  .timeline__entry::before { left: 108px; }
  .timeline__entry::after { left: 103px; }
}

@media (max-width: 560px) {
  .history-archive__controls { flex-direction: column; align-items: stretch; gap: 16px; }
  .history-archive__tools { align-self: flex-end; }
  .year-nav__grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
  .year-nav a { gap: 4px; padding-right: 6px; padding-left: 6px; }
  .history-hero h1 { font-size: clamp(2.4rem, 10vw, 3.6rem); }
  .history-archive__controls { flex-wrap: wrap; gap: 8px 20px; }
  .year-nav { flex-basis: 100%; }
  .timeline__entry { display: block; padding-left: 25px; }
  .timeline__entry::before { left: 0; }
  .timeline__entry::after { left: -5px; }
  .timeline__period { margin-bottom: 12px; font-size: 1.6rem; color: #625f57; }
  .timeline__period span { display: inline; font-size: 1em; }
  .timeline__chapter { padding-bottom: 36px; }
  .timeline__chapter h3 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .year-roster > summary { gap: 16px; padding-right: 10px; padding-left: 10px; }
  .roster { gap: 7px; padding-right: 10px; padding-left: 10px; }
  .roster-note { padding-right: 10px; padding-left: 10px; }
  .archive-note { margin-top: 0; }
}
