/* Journey archive polish — keep the timeline cinematic while making each
   opened year feel like a clear, contained archival record. */

body:has(.year-hero) main {
  background:
    radial-gradient(circle at 88% 8%, rgba(185, 139, 53, .08), transparent 28rem),
    #f1ebdf;
}

.year-hero {
  isolation: isolate;
  width: min(calc(100% - 64px), 1360px);
  min-height: 0;
  margin: 34px auto 42px;
  padding: 0;
  color: #fff;
  background: #071b2a;
  border: 1px solid rgba(185, 139, 53, .26);
  border-radius: 4px;
  box-shadow: 0 26px 70px rgba(2, 11, 19, .18);
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(370px, .84fr);
  align-items: stretch;
  overflow: hidden;
}

.year-hero::before {
  content: "";
  min-height: clamp(430px, 52vw, 610px);
  background:
    linear-gradient(180deg, transparent 58%, rgba(2, 11, 19, .26)),
    var(--year-image) center / cover no-repeat;
}

.year-hero > div {
  align-self: stretch;
  padding: clamp(42px, 5vw, 76px);
  background:
    linear-gradient(145deg, rgba(19, 57, 82, .52), transparent 52%),
    #071b2a;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.year-hero > div > span {
  color: #d7ad60;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.year-hero h1 {
  max-width: 620px;
  margin: 18px 0 24px;
  font-size: clamp(3.5rem, 5.8vw, 6.4rem);
  line-height: .86;
}

.year-hero > div > p {
  max-width: 560px;
  margin: 0;
  color: rgba(239, 242, 244, .76);
  font-size: clamp(.82rem, .95vw, .96rem);
  line-height: 1.78;
}

.year-hero aside {
  width: 100%;
  margin-top: clamp(34px, 5vh, 56px);
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: center;
}

.year-hero aside img {
  grid-row: 1 / 3;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(215, 173, 96, .58);
  border-radius: 50%;
  object-fit: cover;
}

.year-hero aside small {
  align-self: end;
  color: rgba(255, 255, 255, .58);
  font-size: .58rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.year-hero aside strong {
  align-self: start;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
}

body:has(.year-hero) :is(
  .year-narrative,
  .year-numbers,
  .highlights,
  .project-strip,
  .year-gallery,
  .leadership,
  .documents
) {
  width: min(calc(100% - 64px), 1200px);
  margin: 24px auto;
  padding: clamp(44px, 5vw, 72px);
  background: rgba(250, 247, 240, .9);
  border: 1px solid rgba(17, 41, 58, .11);
  border-radius: 4px;
  box-shadow: 0 16px 50px rgba(17, 41, 58, .045);
}

body:has(.year-hero) .section-heading {
  padding-bottom: 22px;
  margin-bottom: clamp(30px, 4vw, 46px);
  border-bottom: 1px solid rgba(17, 41, 58, .14);
}

body:has(.year-hero) .section-heading h2 {
  font-size: clamp(2.5rem, 4.4vw, 4.6rem);
}

.year-narrative {
  display: grid;
  grid-template-columns: minmax(150px, .42fr) minmax(0, 1.25fr) minmax(260px, .76fr);
  gap: clamp(28px, 4vw, 58px);
  align-items: start;
}

.year-narrative > span {
  color: var(--gold);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.year-narrative h2 {
  margin: 0;
  font-size: clamp(2.7rem, 4.5vw, 4.9rem);
  line-height: .94;
}

.year-narrative p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.82;
}

.year-numbers {
  background: #e8decd !important;
}

.year-numbers .stat-line {
  margin-top: 0;
  background: rgba(255, 255, 255, .34);
  border: 1px solid rgba(17, 41, 58, .12);
}

.year-numbers .stat-line > div {
  padding: 28px 24px;
}

.highlights article {
  gap: clamp(30px, 5vw, 70px);
  margin: 0;
  padding: 30px 0;
  border-bottom: 1px solid rgba(17, 41, 58, .12);
}

.highlights article:first-of-type {
  padding-top: 0;
}

.highlights article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.highlights img {
  aspect-ratio: 1.55;
  border-radius: 2px;
  box-shadow: 0 16px 36px rgba(17, 41, 58, .12);
}

.highlights h3 {
  margin: 10px 0 14px;
  font-size: clamp(2.2rem, 3.4vw, 3.55rem);
  line-height: .96;
}

.highlights p,
.project-strip p,
.leader-feature p {
  color: var(--muted);
  line-height: 1.75;
}

.project-strip {
  background: #eee6d9 !important;
}

.project-strip > a {
  grid-template-columns: minmax(260px, .7fr) 1fr;
  align-items: center;
  gap: clamp(28px, 4vw, 58px);
  padding: 24px;
  background: rgba(255, 255, 255, .42);
  border: 1px solid rgba(17, 41, 58, .12);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

.project-strip > a + a {
  margin-top: 16px;
}

.project-strip > a:hover {
  box-shadow: 0 18px 40px rgba(17, 41, 58, .1);
  transform: translateY(-3px);
}

.project-strip h3 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 3vw, 3rem);
}

.leadership {
  background: #e8decd !important;
}

.leader-feature {
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: clamp(36px, 6vw, 84px);
}

.leader-feature img {
  max-height: 440px;
  aspect-ratio: .84;
  border-radius: 2px;
  box-shadow: 0 18px 40px rgba(17, 41, 58, .15);
}

.leader-feature h3 {
  margin: 12px 0 16px;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: .92;
}

.committee-list a {
  min-height: 58px;
  align-items: center;
  transition: color .2s ease, padding .2s ease;
}

.committee-list a:hover {
  color: #8d6420;
  padding-inline: 8px;
}

.documents button {
  min-height: 64px;
  transition: color .2s ease, background-color .2s ease, padding .2s ease;
}

.documents button:hover {
  color: #8d6420;
  background: rgba(185, 139, 53, .055);
  padding-inline: 12px;
}

body:has(.year-hero) .year-pager {
  width: min(calc(100% - 64px), 1200px);
  margin: 24px auto 56px;
  padding: 26px 30px;
  border-radius: 4px;
}

body:has(.year-hero) .year-pager a {
  align-items: center;
  color: rgba(255, 255, 255, .82);
  font-size: .76rem;
  transition: color .2s ease;
}

body:has(.year-hero) .year-pager a:hover {
  color: #d7ad60;
}

/* Direct-access chapter index for the animated Journey timeline. */
/* Avoid a non-scrolling body overflow context trapping the tablet sticky strip. */
html:has(.flip-timeline), body:has(.flip-timeline) { overflow-x:clip; overflow-y:visible; }
.journey-year-index-shell {
  z-index: 12;
}

.journey-year-index {
  color: rgba(17, 41, 58, .62);
}

.journey-year-index > span {
  display: block;
  margin-bottom: 13px;
  color: rgba(17, 41, 58, .5);
  font-size: .56rem;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.journey-year-index div {
  display: grid;
  gap: 3px;
}

.journey-year-index a {
  position: relative;
  min-height: 26px;
  padding: 5px 7px 5px 18px;
  border-radius: 3px;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .02em;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.journey-year-index a::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 5px;
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
}

.journey-year-index a:hover,
.journey-year-index a.is-active {
  color: #8d6420;
  background: rgba(255, 250, 240, .72);
  transform: translateX(3px);
}

.journey-year-index a.is-active::before {
  background: var(--gold);
  border-color: var(--gold);
}

.flip-timeline-step[id] {
  scroll-margin-top: 130px;
}

/* The enhanced timeline owns the card rotation so the reveal can happen a
   little later without changing the node and side-note animations. */
.flip-timeline[data-delayed-flips="true"] .timeline-flip-inner {
  transform: rotateY(var(--delayed-flip, 0deg)) !important;
}

/* Keep the existing alternating timeline, but fit both faces in the safe frame. */
.flip-timeline[data-delayed-flips="true"] .timeline-flip-card {
  height: var(--journey-card-height, 56svh);
  container-type: size;
}
.timeline-explore-prompt { color: #e1e7e9; font-size: .68rem; display: inline-block; padding: 8px 0; }
.timeline-explore-prompt:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.timeline-card-face > a.timeline-card-hit-area { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; z-index: 5; margin: 0; padding: 0; cursor: pointer; }
.timeline-card-hit-area:focus-visible { outline: 3px solid var(--gold); outline-offset: -5px; }
.flip-timeline[data-delayed-flips="true"] .timeline-card-front h2,
.flip-timeline[data-delayed-flips="true"] .timeline-card-back h2 { font-size: clamp(1.7rem, 8cqh, 3.6rem); line-height: .98; }
.flip-timeline[data-delayed-flips="true"] .timeline-card-back { padding: clamp(18px, 5cqh, 40px); }
.flip-timeline[data-delayed-flips="true"] .timeline-card-back h2 { margin: 12px 0; }
.flip-timeline[data-delayed-flips="true"] .timeline-card-back > p { font-size: clamp(.62rem, 2.3cqh, .78rem); line-height: 1.55; margin: 0; }
.flip-timeline[data-delayed-flips="true"] .timeline-card-stats { margin: 12px 0; padding-block: 10px; }
.flip-timeline[data-delayed-flips="true"] .timeline-card-stats b { font-size: clamp(1rem, 4cqh, 1.35rem); }
.flip-timeline[data-delayed-flips="true"] .timeline-card-front > div { bottom: 20px; left: 22px; right: 22px; }
@container (max-height: 350px) {
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back { padding:14px; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back > span { font-size:.48rem; line-height:1.4; letter-spacing:.08em; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back h2 { font-size:clamp(1rem,7cqh,1.5rem); margin:7px 0; line-height:1.02; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back > p { font-size:.6rem; line-height:1.4; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-stats { padding-block:6px; margin:8px 0; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-stats b { font-size:1rem; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-stats small { font-size:.43rem; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back > a { font-size:.6rem; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-front h2 { font-size:clamp(1.2rem,7cqh,1.6rem); }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-front > div { bottom:12px; left:14px; right:14px; }
}
/* Short landscape screens get a compact two-column reverse face, not clipping. */
@media (max-height: 520px) and (orientation: landscape) {
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back { display:grid; grid-template-columns:1fr 1fr; grid-template-rows:auto minmax(0,1fr) auto; gap:6px 12px; padding:12px; align-items:center; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back::before { inset:6px; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back > span { grid-column:1/-1; font-size:.48rem; line-height:1.3; letter-spacing:.06em; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back h2 { grid-column:1; grid-row:2; margin:0; font-size:1rem; line-height:1.05; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back > p { grid-column:2; grid-row:2; font-size:.58rem; line-height:1.35; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-stats { grid-column:1; grid-row:3; gap:5px; margin:0; padding-block:4px; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-stats b { font-size:.85rem; line-height:1; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-stats small { font-size:.4rem; line-height:1.25; }
  .flip-timeline[data-delayed-flips="true"] .timeline-card-back > a { grid-column:2; grid-row:3; font-size:.6rem; line-height:1.3; }
}

@media (min-width: 1200px) {
  .journey-year-index-shell {
    position: fixed;
    top: calc(50% + var(--journey-header-height, 108px) / 2);
    left: clamp(20px, 2.5vw, 48px);
    width: 100px;
    opacity: 0;
    visibility: hidden;
    transform: translate(-8px, -50%);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
  }

  .journey-year-index-shell.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
  }

  .journey-year-index {
    position: relative;
    pointer-events: auto;
  }

  .journey-year-index > div {
    max-height: calc(100svh - var(--journey-header-height, 108px) - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

@media (max-width: 1199px) {
  .journey-year-index-shell {
    position: sticky;
    top: var(--journey-header-height, 68px);
    margin: -2vh -5vw 24px;
    padding: 11px 5vw 10px;
    background: rgba(243, 238, 227, .94);
    border-block: 1px solid rgba(17, 41, 58, .12);
    backdrop-filter: blur(12px);
  }

  .journey-year-index {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .journey-year-index > span {
    flex: 0 0 auto;
    margin: 0;
  }

  .journey-year-index div {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .journey-year-index div::-webkit-scrollbar {
    display: none;
  }

  .journey-year-index a {
    flex: 0 0 auto;
    padding-left: 8px;
  }

  .journey-year-index a::before {
    display: none;
  }

  .journey-year-index a:hover,
  .journey-year-index a.is-active {
    transform: none;
  }
}

@media (max-width: 900px) {
  .year-hero {
    width: min(calc(100% - 36px), 760px);
    margin-block: 22px 28px;
    grid-template-columns: 1fr;
  }

  .year-hero::before {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .year-hero > div {
    padding: clamp(34px, 7vw, 54px);
  }

  .year-hero h1 {
    font-size: clamp(3.2rem, 10vw, 5.4rem);
  }

  body:has(.year-hero) :is(
    .year-narrative,
    .year-numbers,
    .highlights,
    .project-strip,
    .year-gallery,
    .leadership,
    .documents
  ) {
    width: min(calc(100% - 36px), 760px);
    padding: clamp(34px, 7vw, 54px);
  }

  .year-narrative {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .highlights article,
  .highlights article.reverse,
  .project-strip > a,
  .leader-feature {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .leader-feature img {
    width: min(100%, 380px);
  }

  body:has(.year-hero) .year-pager {
    width: min(calc(100% - 36px), 760px);
    margin-bottom: 36px;
  }
}

@media (max-width: 560px) {
  .year-hero,
  body:has(.year-hero) :is(
    .year-narrative,
    .year-numbers,
    .highlights,
    .project-strip,
    .year-gallery,
    .leadership,
    .documents
  ),
  body:has(.year-hero) .year-pager {
    width: calc(100% - 24px);
  }

  .year-hero::before {
    aspect-ratio: 4 / 3;
  }

  .year-hero > div {
    padding: 30px 24px 34px;
  }

  .year-hero aside {
    grid-template-columns: 54px 1fr;
  }

  .year-hero aside img {
    width: 54px;
    height: 54px;
  }

  body:has(.year-hero) :is(
    .year-narrative,
    .year-numbers,
    .highlights,
    .project-strip,
    .year-gallery,
    .leadership,
    .documents
  ) {
    margin-block: 14px;
    padding: 30px 22px;
  }

  .year-numbers .stat-line {
    grid-template-columns: 1fr 1fr;
  }

  .project-strip > a {
    padding: 14px;
  }

  body:has(.year-hero) .year-pager {
    padding: 22px 18px;
  }

  .journey-year-index-shell {
    margin-inline: -5vw;
  }

  .journey-year-index {
    display: block;
  }

  .journey-year-index > span {
    margin-bottom: 7px;
  }
}
