/* The record timeline (timeline.html). Builds on styles.css tokens. */

.tl-hero { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(3.5rem, 7vw, 6.5rem) 0 2.5rem; }
.tl-hero h1 { max-width: 16ch; margin: .4rem 0 1rem; font: 500 clamp(2.6rem, 6vw, 4.6rem)/1 var(--serif); letter-spacing: -0.03em; }
.tl-hero h1 em { color: var(--red); font-style: normal; }
.tl-hero .dek { max-width: 40rem; color: var(--muted); font-size: 1.15rem; }

.tl-stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin: 2rem 0 0; padding: 1.25rem 0 0; border-top: 1px solid var(--line); }
.tl-stats div { display: flex; flex-direction: column; }
.tl-stats strong { font: 500 2.4rem/1 var(--serif); }
.tl-stats span { color: var(--muted); font-size: .85rem; font-weight: 600; }

.tl-filters { display: flex; flex-wrap: wrap; gap: .5rem; width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.tl-filters button { min-height: 36px; padding: .35rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font-size: .85rem; font-weight: 700; }
.tl-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tl-filters .tl-count { margin-left: auto; align-self: center; color: var(--muted); font-size: .8rem; font-weight: 600; }

.tl-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 3rem; width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }

/* Sticky year rail */
.tl-rail { position: sticky; top: calc(var(--tl-top, 72px) + 1.5rem); align-self: start; }
.tl-rail-year { display: block; font: 500 4.2rem/1 var(--serif); letter-spacing: -0.04em; color: var(--red); font-variant-numeric: tabular-nums; }
.tl-rail-note { display: block; margin-top: .5rem; color: var(--muted); font-size: .85rem; font-weight: 600; line-height: 1.35; }
.tl-rail-bar { position: relative; height: 6px; margin-top: 1.1rem; border-radius: 3px; background: var(--paper-deep); overflow: hidden; }
.tl-rail-bar span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--red); transition: width .3s ease; }
.tl-rail-ends { display: flex; justify-content: space-between; margin-top: .35rem; color: var(--muted); font-size: .75rem; font-weight: 700; }

/* Entries */
.tl-list { position: relative; margin: 0; padding: 0 0 0 2rem; list-style: none; }
.tl-list::before { content: ""; position: absolute; left: 5px; top: .5rem; bottom: 0; width: 2px; background: var(--line); }

.tl-item { position: relative; padding: 0 0 3.25rem; }
.tl-item::before { content: ""; position: absolute; left: calc(-2rem + 0px); top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--red); }
.tl-item[hidden] { display: none; }

.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 .5rem; color: var(--muted); font-size: .85rem; font-weight: 700; }
.tl-tag { padding: .15rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--paper-deep); color: var(--ink); }
.tl-tag.palestine { background: #e9d6cf; color: var(--red-dark); }
.tl-tag.gop { background: #dfe3ea; color: #2c3a52; }
.tl-tag.wallstreet { background: #ece2c6; color: #6b5212; }
.tl-tag.war { background: #e3ddd3; color: #4a4339; }
.tl-tag.strategy { background: var(--green-light); color: var(--green); }

.tl-item h2 { margin: 0 0 .55rem; font: 500 clamp(1.55rem, 2.6vw, 2rem)/1.12 var(--serif); letter-spacing: -0.02em; }
.tl-item p { max-width: 40rem; margin: 0 0 .75rem; font-size: 1.02rem; }
.tl-item .tl-source { color: var(--muted); font-size: .85rem; font-weight: 700; }
.tl-item .tl-source a { color: var(--muted); }

.tl-item figure { max-width: 40rem; margin: 1rem 0 .9rem; }
.tl-item figure img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; background: var(--paper-deep); filter: grayscale(.25); }
.tl-item figcaption { margin-top: .4rem; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.tl-item figcaption a { color: inherit; }

/* Leadership milestones */
.tl-milestone { position: relative; margin: 0 0 3.25rem; padding: 1rem 1.2rem; border-radius: 14px; background: var(--ink); color: var(--paper); }
.tl-milestone::before { content: ""; position: absolute; left: calc(-2rem - 2px); top: 1.2rem; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); }
.tl-milestone strong { display: block; font: 500 1.35rem/1.15 var(--serif); }
.tl-milestone span { color: #cfc9bc; font-size: .85rem; font-weight: 600; }

/* Reveal on scroll (only when JS is running) */
.js .tl-item, .js .tl-milestone { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.js .tl-item.is-in, .js .tl-milestone.is-in { opacity: 1; transform: none; }

.tl-end { width: min(1080px, calc(100% - 2rem)); margin: 0 auto 5rem; padding: clamp(2rem, 5vw, 3.5rem); border-radius: var(--radius); background: var(--red-dark); color: var(--paper); }
.tl-end h2 { max-width: 20ch; margin: 0 0 .75rem; font: 500 clamp(2rem, 4.5vw, 3.2rem)/1.03 var(--serif); letter-spacing: -0.03em; }
.tl-end p { max-width: 36rem; margin: 0 0 1.5rem; color: #f6d3cc; font-size: 1.1rem; }
.tl-end .button { background: var(--paper); color: var(--ink); }
.tl-method { width: min(1080px, calc(100% - 2rem)); margin: -3rem auto 4rem; color: var(--muted); font-size: .85rem; }

@media (max-width: 820px) {
  .tl-wrap { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .tl-rail { top: var(--tl-top, 72px); z-index: 15; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .9rem; margin: 0 -1rem 1.5rem; padding: .55rem 1rem; background: rgba(242, 238, 228, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .tl-rail-year { font-size: 1.8rem; grid-row: span 2; }
  .tl-rail-note { margin: 0; font-size: .75rem; }
  .tl-rail-bar { margin: .3rem 0 0; height: 4px; }
  .tl-rail-ends { display: none; }
  .tl-filters { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tl-filters::-webkit-scrollbar { display: none; }
  .tl-filters button { flex: none; }
  .tl-filters .tl-count { display: none; }
  .tl-list { padding-left: 1.6rem; }
  .tl-item::before { left: -1.6rem; }
  .tl-milestone::before { left: calc(-1.6rem - 2px); }
  .tl-stats { gap: 1.5rem; }
  .tl-stats strong { font-size: 1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .js .tl-item, .js .tl-milestone { opacity: 1; transform: none; transition: none; }
}
.tl-wrap { scroll-margin-top: calc(var(--tl-top, 72px) + .5rem); }
.tl-item figure img.portrait { object-position: 50% 18%; }

.tl-faq { width: min(1080px, calc(100% - 2rem)); margin: 0 auto 3rem; }
.tl-faq h2 { margin: 0 0 1rem; font: 500 clamp(1.8rem, 3.5vw, 2.4rem)/1.1 var(--serif); letter-spacing: -0.02em; }
.tl-faq-item { border-top: 1px solid var(--line); }
.tl-faq-item:last-child { border-bottom: 1px solid var(--line); }
.tl-faq-item summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; font-weight: 800; font-size: 1.05rem; cursor: pointer; list-style: none; }
.tl-faq-item summary::-webkit-details-marker { display: none; }
.tl-faq-item summary::after { content: "+"; flex: none; color: var(--red); font-size: 1.3rem; line-height: 1; }
.tl-faq-item[open] summary::after { content: "−"; }
.tl-faq-item p { max-width: 44rem; margin: 0 0 1.1rem; color: var(--muted); }
