.jazz-history-document { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  .jazz-history-document { scroll-behavior: auto; }
}

.jazz-history-page {
  --history-accent: #763c34;
  --history-gold: #9c742c;
  --history-paper: #faf8f1;
}

.history-main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 18px 40px;
}

.history-main .panel {
  margin: 0 0 18px;
}

.history-hero {
  padding: 22px 26px;
  border-top: 5px solid var(--history-accent);
  background: var(--history-paper);
}

.history-kicker {
  margin-bottom: 5px;
  color: var(--history-accent);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.history-hero h1 {
  margin-bottom: 12px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
}

.history-hero p + p { margin-top: 9px; }
.timeline-help { margin: 0 0 16px; line-height: 1.6; }
.timeline-layout { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 16px; }
.timeline-navigation {
  position: sticky;
  top: calc(var(--history-toolbar-height, 60px) + 12px);
  align-self: start;
  max-height: calc(100dvh - var(--history-toolbar-height, 60px) - 24px);
  overflow-y: auto;
  padding: 10px 6px;
  border: 1px solid #777;
  background: var(--history-paper);
}
.timeline-navigation h2 { margin: 0 0 8px; font-size: 15px; text-align: center; }
.decade-links a:focus-visible {
  outline: 3px dashed var(--history-gold);
  outline-offset: -3px;
}
.decade-links { display: flex; flex-direction: column; gap: 4px; }
.decade-links a {
  padding: 6px 3px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #222;
  background: #f4f4f4;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
}
.decade-links a:hover,
.decade-links a[aria-current="location"] { color: #fff; background: var(--history-accent); }

.timeline {
  position: relative;
  min-width: 0;
  margin: 0 0 28px;
  padding-left: 32px;
}
.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 10px;
  width: 3px;
  background: var(--history-gold);
  content: "";
}
.timeline-period {
  position: relative;
  scroll-margin-top: calc(var(--history-toolbar-height, 60px) + 16px);
  margin: 0 0 20px;
  border: 1px solid #222;
  background: #fff;
  box-shadow: 2px 2px 0 #333;
}
.timeline-period::before {
  position: absolute;
  top: 20px;
  left: -29px;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--history-accent);
  box-shadow: 0 0 0 2px var(--history-gold);
  content: "";
}
.period-heading {
  padding: 12px 18px;
  border-bottom: 1px solid #222;
  background: repeating-linear-gradient(to bottom, #f4f4f4 0 2px, #d0d0d0 2px 3px);
}
.period-heading h2 { margin: 0; font-size: clamp(19px, 3vw, 25px); }
.period-range {
  margin: 0 0 2px;
  color: var(--history-accent);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: .08em;
}
.period-content { padding: 18px; }
.period-content > p { margin: 0 0 12px; line-height: 1.65; }
.period-content .players { padding: 10px 12px; border-left: 3px solid var(--history-gold); background: #f7f5ef; }
.milestones { padding-left: 22px; line-height: 1.6; }
.milestones li { margin: 7px 0; }
.milestones time { color: var(--history-accent); font-weight: bold; }
.genre-branch {
  margin: 14px 0;
  border: 1px solid #aaa;
  background: #fbfbf8;
}
.genre-branch summary {
  padding: 9px 12px;
  color: #28211d;
  background: #eee9dd;
  cursor: pointer;
  font-weight: bold;
}
.genre-branch summary:focus-visible { outline: 3px dashed var(--history-gold); outline-offset: -3px; }
.genre-branch > ul { margin: 12px 18px 14px; padding-left: 22px; }
.genre-branch li { margin: 6px 0; line-height: 1.55; }
.source-note { margin-top: 15px !important; color: #555; font-size: 12px; }
.source-note a, .history-sources a { color: #514018; text-decoration-thickness: 1px; text-underline-offset: 2px; }

.era-figure {
  float: right;
  width: min(210px, 34%);
  margin: 0 0 12px 18px;
  padding: 6px;
  border: 1px solid #999;
  background: #f3f1eb;
}
.era-figure img { display: block; width: 100%; height: auto; max-height: 250px; object-fit: cover; object-position: center 30%; }
.era-figure figcaption { margin-top: 6px; color: #444; font-size: 11px; line-height: 1.4; }
.portrait-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.portrait-row .era-figure { float: none; width: min(210px, calc(50% - 6px)); margin: 0; }
.featured-essays {
  clear: both;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #8a7960;
  background: #faf8f1;
}
.featured-essays h3 { margin-bottom: 8px; color: var(--history-accent); font-size: 20px; }
.featured-essays p { margin: 8px 0; }
.essay-status { color: #555; font-style: italic; }
.featured-essays details {
  margin: 10px 0;
  border: 1px solid #aaa;
  background: #fff;
}
.featured-essays details > summary {
  padding: 9px 12px;
  background: #eee9dd;
  cursor: pointer;
  font-weight: bold;
}
.essay-body { padding: 12px 16px; }
.essay-body p { margin: 0 0 12px; line-height: 1.7; }
.essay-body a { overflow-wrap: anywhere; }
.essay-body h4 { margin: 18px 0 8px; font-size: 17px; }
.essay-body blockquote { margin: 12px 18px; padding-left: 14px; border-left: 3px solid var(--history-gold); }
.essay-body figure { margin: 14px 0; }
.essay-body figure img { display: block; width: auto; max-width: 100%; height: auto; max-height: 500px; }
.essay-body figcaption { margin-top: 6px; color: #555; font-size: 12px; }
.era-listening { clear: both; margin: 20px 0; }
.era-listening h3 { margin-bottom: 8px; font-size: 18px; color: var(--history-accent); }
.era-listening p { margin-bottom: 10px; line-height: 1.6; }
.video-card { width: min(100%, 640px); margin: 14px 0; }
.video-preview { position: relative; aspect-ratio: 16 / 9; background: #171717; }
.video-preview img,
.essay-body .video-preview img { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; }
.video-preview button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border: 2px solid #fff;
  border-radius: 4px;
  color: #fff;
  background: var(--history-accent);
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
.video-preview button:hover { background: #522921; }
.video-preview button:focus-visible { outline: 3px dashed #fff; outline-offset: 4px; }
.video-preview iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-card figcaption { margin-top: 7px; font-size: 12px; line-height: 1.5; }
.video-card a { color: #514018; }
.artist-profiles { clear: both; margin-top: 24px; }
.artist-profiles > h3 { color: var(--history-accent); font-size: 21px; }
.artist-profile { clear: both; margin: 18px 0; padding: 16px; border: 1px solid #b2a58c; background: var(--history-paper); scroll-margin-top: calc(var(--history-toolbar-height, 60px) + 16px); }
.artist-profile::after { display: block; clear: both; content: ""; }
.artist-profile h4 { margin: 0 0 7px; color: var(--history-accent); font-size: 22px; }
.artist-profile p { margin: 8px 0; line-height: 1.65; }
.artist-genre { font-weight: bold; }
.artist-profile .era-figure { width: min(190px, 35%); }
.artist-recordings { margin-top: 14px; border-top: 1px solid #c6bda9; }
.artist-recordings > summary { padding: 10px 0; font-weight: bold; cursor: pointer; }
.artist-recordings > summary:focus-visible { outline: 3px dashed var(--history-gold); outline-offset: 2px; }
.artist-recordings .video-card { max-width: 100%; }
.artist-profile a { overflow-wrap: anywhere; }
.portrait-license-note { padding: 8px 10px; border-left: 3px solid var(--history-gold); font-size: 12px; color: #555; }
.artist-index { margin-top: 14px; }
.artist-index summary { cursor: pointer; font-weight: bold; }
.artist-index ul { display: flex; flex-wrap: wrap; gap: 7px 18px; padding-left: 20px; margin-top: 10px; }
.artist-index li { min-width: 145px; }
.history-sources { padding: 0 0 14px; }
.history-sources > p, .history-sources > ul { margin: 14px 18px; line-height: 1.65; }

@media (max-width: 620px) {
  .history-main { padding: 10px 8px 24px; }
  .history-hero { padding: 16px; }
  .timeline-layout { grid-template-columns: 70px minmax(0, 1fr); gap: 6px; }
  .timeline-navigation { padding: 8px 3px; }
  .decade-links a { font-size: 11px; }
  .timeline { margin: 0 0 18px; padding-left: 20px; }
  .timeline::before { left: 7px; }
  .timeline-period::before { left: -20px; }
  .period-content { padding: 13px; }
  .era-figure { float: none; width: min(210px, 100%); margin: 0 0 12px; }
  .portrait-row .era-figure { width: min(210px, 100%); }
  .featured-essays { padding: 8px; }
  .essay-body { padding: 10px; }
  .era-figure figcaption { font-size: 10px; }
  .artist-profile { padding: 10px; }
  .artist-profile .era-figure { float: none; width: min(190px, 100%); margin: 0 0 12px; }
  .artist-profile h4 { font-size: 19px; }
}

@media (max-width: 380px) {
  .era-figure { float: none; width: min(210px, 100%); margin: 0 0 12px; }
  .portrait-row .era-figure { width: 100%; max-width: 210px; }
}

/* 1959 album guide */
.decade-links a.special-year-link { border-style: dashed; }
.timeline-period.special-year::before { background: var(--history-gold); box-shadow: 0 0 0 2px var(--history-accent); }
.album-1959-summary { padding: 10px 12px; border-left: 3px solid var(--history-gold); background: #f7f5ef; }
.album-1959-index { margin: 0 0 14px; }
.album-1959-index summary { cursor: pointer; font-weight: bold; color: var(--history-accent); }
.album-1959-index summary:focus-visible { outline: 3px dashed var(--history-gold); outline-offset: 2px; }
.album-1959-index ol { columns: 2 220px; margin: 8px 0 0; padding-left: 26px; line-height: 1.6; }
.album-1959-index a { color: #514018; }
.album-1959-list { margin: 0; padding: 0; list-style: none; }
.album-1959-artist { margin: 18px 0; padding-top: 12px; border-top: 1px solid #d6ccb8; scroll-margin-top: calc(var(--history-toolbar-height, 60px) + 16px); }
.album-1959-artist h3 { margin: 0 0 4px; color: var(--history-accent); font-size: 20px; }
.album-1959-listing { margin: 0 0 8px; color: #555; font-size: 13px; }
.album-1959 { display: flow-root; margin: 10px 0; padding: 12px 14px; border: 1px solid #b2a58c; background: var(--history-paper); scroll-margin-top: calc(var(--history-toolbar-height, 60px) + 16px); }
.album-1959:target { outline: 3px solid var(--history-gold); }
.album-1959 h4 { margin: 0 0 8px; font-size: 18px; }
.album-1959 h4 cite { font-style: italic; }
.album-1959-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px 14px; margin: 0 0 8px; }
.album-1959-dates div { min-width: 0; }
.album-1959-dates dt { color: var(--history-accent); font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.04em; }
.album-1959-dates dd { margin: 0; overflow-wrap: anywhere; }
.album-1959-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.album-1959-badges span { padding: 2px 8px; border: 1px solid #b2a58c; border-radius: 999px; background: #fff; font-size: 12px; }
.album-1959-history { margin: 0; line-height: 1.6; }
.album-1959-sources { margin-top: 8px !important; overflow-wrap: anywhere; }
.album-1959-portrait { float: right; width: min(165px, 30%); margin: 0 0 12px 16px; padding: 6px; border: 1px solid #b2a58c; background: #f3f1eb; }
.album-1959-portrait img { display: block; width: 100%; height: auto; max-height: 210px; object-fit: cover; object-position: center 25%; }
.album-1959-portrait figcaption { margin-top: 6px; color: #444; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.album-1959-portrait figcaption span { display: block; margin-top: 4px; }
.album-1959-listening { padding-top: 12px; }
.album-1959-listening h5 { margin: 0 0 8px; color: var(--history-accent); font-size: 15px; }
.album-1959-listening ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.album-1959-listening li { min-width: 0; overflow-wrap: anywhere; }
.album-1959-listening .video-card { margin: 0; }
.album-1959-listening .video-preview-song { aspect-ratio: auto; min-height: 86px; background: #302a23; }
.album-1959-listening .video-preview-song:has(iframe) { aspect-ratio: 16 / 9; }
.album-1959-listening .video-preview-song button { max-width: calc(100% - 24px); white-space: normal; }
@media (max-width: 620px) {
  .album-1959 { padding: 10px; }
  .album-1959-portrait { float: none; width: min(165px, 100%); margin: 0 0 12px; }
  .album-1959-index ol { columns: 1; }
}
