/* =========================================================
   /oscars/history/ page styles. Moved out of the page's inline <style>
   block on 2026-09-29 as part of the scoreboard redesign.

   Page order: header (intro on the left; on the right the year navigator with
   this ceremony's score beside it) -> the 8 category tabs, each carrying its
   own hit/miss mark, so the tab row is the per-category scoreboard ->
   featured winner + The Field -> "How the model has done overall" (the
   all-years record, which used to sit above the fold even though it never
   changes with the year).

   Shared pieces live elsewhere: .osc-field-* and .osc-empty-state in
   oscars.css, .osc-tabs / .osc-tab in oscars-shared.js's injected styles
   (the forecasts page uses them too, so the marks here are scoped to
   .osc-hist-board rather than restyling the shared tab).
   ========================================================= */

.osc-hist-page { max-width: var(--max); margin: 0 auto; padding: 36px var(--pad) 64px; }

/* [hidden] loses to any author display value, so the pieces that start
   hidden and are revealed once the data lands spell it out. */
.osc-hist-navcol[hidden], .osc-hist-board[hidden], .osc-hist-record[hidden] { display: none; }

/* The year's content arrives ~5 s after load (one data call). Until then the shelf is a one-line "Loading" note,
   so the footer sat in view and was shoved out of it when the content landed (CLS 0.51 at 390, 0.35 at 1440).
   Hold a viewport of space for the shelf, and the measured heights of the three blocks above it that the data
   un-hides: the tab row (41px), the year navigator (95px; 157px once it stacks) and the record grid (350px; 413px
   on a phone), so nothing in view moves. scripting: enabled keeps the no-JS page from showing a blank screen
   under its loading note. */
@media (scripting: enabled) {
  .osc-hist-board[hidden] { display: block; visibility: hidden; min-height: 41px; }
  .osc-hist-navcol[hidden] { display: block; visibility: hidden; min-height: 95px; }
  .osc-hist-gridwrap[hidden] { display: block; visibility: hidden; min-height: 350px; }
  #osc-hist-shelf { min-height: 100vh; min-height: 100svh; }
}
@media (scripting: enabled) and (max-width: 600px) {
  .osc-hist-navcol[hidden] { min-height: 157px; }
  .osc-hist-gridwrap[hidden] { min-height: 352px; }
}
@media (scripting: enabled) and (max-width: 420px) {
  .osc-hist-gridwrap[hidden] { min-height: 413px; }
}

/* ---- Header: intro + year navigator ---- */
.osc-hist-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 500px; gap: var(--s-6);
  align-items: center; margin-bottom: var(--s-5);
}
.osc-hist-sub {
  font-family: var(--fb); font-size: 15px; line-height: 1.6; color: var(--sub);
  margin: 0; max-width: 620px;
}

.osc-hist-navcol { display: flex; flex-direction: column; gap: var(--s-2); }
.osc-hist-yearrow { display: flex; gap: var(--s-3); align-items: stretch; }
.osc-hist-nav {
  flex: 1; min-width: 0; display: flex; align-items: stretch; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-1);
}
.osc-hist-nav-btn {
  background: none; border: none; cursor: pointer; font-family: var(--fb);
  font-size: 20px; color: var(--sub); padding: 0 var(--s-4); border-radius: var(--r-md);
  transition: background 0.12s, color 0.12s;
}
.osc-hist-nav-btn:hover:not(:disabled) { background: var(--border); color: var(--text); }
.osc-hist-nav-btn:disabled { color: var(--muted); cursor: default; }
.osc-hist-nav-center {
  flex: 1; text-align: center; padding: var(--s-2) 0;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.osc-hist-nav-ceremony { font-family: var(--fb); font-weight: 600; font-size: 19px; color: var(--text); line-height: 1.15; }
.osc-hist-nav-year { font-family: var(--fm); font-size: 12px; color: var(--orange); margin-top: 2px; }
.osc-hist-nav-hint { margin: 0; text-align: center; font-family: var(--fm); font-size: 11px; color: var(--muted); }
@media (hover: none) { .osc-hist-nav-hint { display: none; } }

/* ---- This ceremony's score, beside the year navigator ---- */
.osc-hist-score {
  flex: none; max-width: 200px; display: flex; align-items: center; gap: var(--s-3);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-2) var(--s-4);
}
.osc-hist-score-value { font-family: var(--fd); font-weight: 700; font-size: 26px; color: var(--orange); line-height: 1; }
.osc-hist-score-value--none { color: var(--muted); }
.osc-hist-score-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.osc-hist-score-label {
  font-family: var(--fb); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.osc-hist-score-sub { font-family: var(--fm); font-size: 11px; line-height: 1.35; color: var(--muted); }

/* ---- Category tabs: the per-category scoreboard ---- */
/* position: relative is load-bearing. The .trr-sr-only word inside each tab is
   position: absolute; without a positioned ancestor it escapes the tab row's
   overflow-x: auto and stretches the whole page sideways. */
.osc-hist-board .osc-tab { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); padding: 11px var(--s-3); }

/* Hit / miss / no-data mark on each tab. Flat squares: this is an observed
   outcome, not a projection (CHART_STYLE.md section 2). Colour is never the
   only carrier -- the glyph differs and a sr-only word follows it. */
.osc-hist-mark {
  display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px;
  border-radius: var(--r-sm); font-family: var(--fm); font-size: var(--t-mini);
  font-weight: 700; line-height: 1; letter-spacing: 0; text-transform: none;
}
.osc-hist-mark[hidden] { display: none; }
.osc-hist-mark--hit  { background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live); }
.osc-hist-mark--miss { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.osc-hist-mark--none { color: var(--muted); }

/* ---- Featured winner ---- */
.osc-feat {
  position: relative; overflow: hidden; background: var(--card);
  border: 1px solid var(--border); border-top: 2px solid var(--orange);
  border-radius: var(--r-lg); padding: var(--s-5); margin-bottom: var(--s-5);
}
.osc-feat::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(680px 320px at 0% 0%, rgba(255,119,4,0.14), transparent 68%);
}
.osc-feat-grid {
  position: relative; display: grid; grid-template-columns: 176px minmax(0, 1fr);
  gap: 26px; align-items: center;
}
.osc-feat-poster {
  position: relative; align-self: start; aspect-ratio: 2/3; border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-2); background: var(--surface);
}
.osc-feat-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.osc-feat-poster-tag {
  position: absolute; top: 9px; right: 9px; font-family: var(--fb); font-weight: 600;
  font-size: 11px; padding: 4px 11px; border-radius: var(--r-pill); background: rgba(255,119,4,0.9); color: var(--bg);
}
.osc-feat-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.osc-feat-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.osc-badge {
  font-family: var(--fb); font-weight: 600; font-size: 11px; padding: 4px 11px; border-radius: var(--r-pill);
}
.osc-badge--won { background: rgba(255,119,4,0.15); color: var(--orange); }
.osc-badge--hit { background: rgba(34,197,94,0.12); color: var(--live); }
.osc-badge--miss { background: rgba(239,68,68,0.10); color: var(--danger); }
.osc-feat-title {
  font-family: var(--fd); font-weight: 700; font-size: 32px; line-height: 1.04;
  letter-spacing: -0.015em; color: var(--text); margin-bottom: 6px; text-wrap: pretty;
}
.osc-feat-film { font-family: var(--fm); font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.osc-feat-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.osc-feat-chip { font-family: var(--fm); font-size: 11px; padding: 3px 9px; border-radius: var(--r-sm); background: var(--surface); color: var(--muted); }
.osc-feat-chip.accent { background: rgba(255,119,4,0.15); color: var(--orange); }

.osc-feat-problabel {
  font-family: var(--fb); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 6px;
}
.osc-feat-probrow { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.osc-feat-prob { font-family: var(--fd); font-weight: 700; font-size: 38px; line-height: 0.9; color: var(--orange); }
.osc-feat-prob span { font-size: 22px; }
.osc-feat-bar-wrap { flex: 1; min-width: 120px; padding-bottom: 6px; }
.osc-feat-bar-track { height: 8px; background: var(--border); border-radius: var(--r-sm); overflow: hidden; }
.osc-feat-bar { height: 100%; background: var(--orange); border-radius: var(--r-sm); }

.osc-feat-stats { display: flex; gap: 26px; margin-top: 6px; flex-wrap: wrap; }
.osc-feat-stat-value { font-family: var(--fm); font-size: 18px; font-weight: 700; color: var(--text); }
.osc-feat-stat-value.accent { color: var(--orange); }
.osc-feat-stat-value small { font-size: 12px; color: var(--muted); font-weight: 400; }
.osc-feat-stat-label {
  font-family: var(--fb); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em; margin-top: 2px;
}
.osc-feat-nomodel { font-family: var(--fb); font-size: 12.5px; color: var(--muted); font-style: italic; line-height: 1.6; max-width: 460px; }

/* ---- How the model has done overall (the all-years record) ---- */
.osc-hist-record { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--border); }
.osc-hist-record .osc-field-title { margin: 0; }
.osc-hist-metrics { display: flex; gap: 14px; margin-bottom: var(--s-4); }
.osc-hist-metric {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s-4); text-decoration: none; color: inherit;
  transition: border-color 0.12s, background 0.12s;
}
a.osc-hist-metric:hover { border-color: var(--orange); background: var(--surface); }
.osc-hist-metric-label {
  font-family: var(--fb); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px;
}
.osc-hist-metric-value { font-family: var(--fd); font-weight: 700; font-size: 30px; line-height: 1; color: var(--text); }
.osc-hist-metric-value.accent { color: var(--orange); }
.osc-hist-metric-sub { font-family: var(--fm); font-size: 11px; color: var(--muted); margin-top: 4px; }

.osc-hist-caveat { font-family: var(--fb); font-size: 12px; color: var(--sub); }
.osc-hist-caveat summary {
  cursor: pointer; color: var(--muted); font-family: var(--fb); font-weight: 500;
  font-size: 11px; list-style: none;
}
.osc-hist-caveat summary::-webkit-details-marker { display: none; }
.osc-hist-caveat summary::before { content: "+ "; color: var(--orange); }
.osc-hist-caveat[open] summary::before { content: "\2212 "; }
.osc-hist-caveat-body { padding-top: 8px; line-height: 1.6; max-width: 620px; }
.osc-hist-caveat-body strong { color: var(--text); }

/* Eight marked tabs need ~940px; below the nav collapse width they get tighter
   padding, gaps and tracking so the row fits without scrolling down to ~700px. */
@media (max-width: 1099px) {
  .osc-hist-board .osc-tab { padding: 11px 6px; gap: 5px; letter-spacing: 0.03em; }
  .osc-hist-mark { width: 14px; height: 14px; }
}
@media (max-width: 900px) {
  .osc-hist-head { grid-template-columns: 1fr; gap: var(--s-4); }
  .osc-hist-navcol { max-width: 500px; }
  .osc-hist-metrics { flex-wrap: wrap; }
  .osc-hist-metric { min-width: 140px; }
}
@media (max-width: 680px) {
  .osc-hist-page { padding: 28px 20px 60px; }
  /* Navigator and score stack: side by side they'd squeeze the ceremony name. */
  .osc-hist-yearrow { flex-direction: column; }
  .osc-hist-score { max-width: none; }
  .osc-feat-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .osc-feat-poster { max-width: 140px; }
  .osc-feat-title { font-size: 26px; }
}

/* ---- The record grid (renderGrid in the page): every modeled ceremony x the Big 8. One column
   button per ceremony; squares, not circles (CHART_STYLE.md §2). Filled amber is a hit, an outline
   a miss, a dot no model. The column bar is that ceremony's hit share. ---- */
.osc-hist-gridwrap { margin: 6px 0 30px; padding: var(--s-5); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); }
.osc-hg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.osc-hg-labels { display: grid; grid-template-rows: 30px repeat(8, 12px); row-gap: 3px; padding-top: 4px; }
.osc-hg-labels span { font-family: var(--fm); font-size: var(--t-mini); line-height: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.osc-hg-labels .osc-hg-label-bar { align-self: end; }
.osc-hg-labels .is-current { color: var(--orange); }
.osc-hg-scroll {
  overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
}
.osc-hg-cols { display: flex; gap: 2px; padding: 4px 16px 18px; width: max-content; }
.osc-hg-col {
  position: relative; display: grid; grid-template-rows: 30px repeat(8, 12px); row-gap: 3px; justify-items: center;
  width: 13px; padding: 0; margin: 0; border: 0; border-radius: 2px; background: none; cursor: pointer;
}
.osc-hg-col:hover { background: var(--surface); }
.osc-hg-col:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.osc-hg-col.is-current { background: var(--surface); box-shadow: 0 0 0 1px var(--orange); }
.osc-hg-col.is-cut::before {
  content: ""; position: absolute; left: -2px; top: -4px; bottom: -2px; border-left: 1.5px dashed var(--orange); opacity: 0.8;
}
.osc-hg-bar { display: flex; align-items: flex-end; width: 7px; height: 30px; background: var(--border); border-radius: 1px; overflow: hidden; }
.osc-hg-bar span { display: block; width: 100%; background: var(--sub); }
.osc-hg-col.is-current .osc-hg-bar span { background: var(--orange); }
.osc-hg-cell { display: block; width: 10px; height: 10px; margin-top: 1px; box-sizing: border-box; border-radius: 2px; }
.osc-hg-cell.is-hit { background: var(--orange); }
.osc-hg-cell.is-miss { border: 1.5px solid color-mix(in srgb, var(--muted) 70%, transparent); }
.osc-hg-cell.is-none { width: 3px; height: 3px; margin-top: 4px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.osc-hg-cell.is-current { box-shadow: 0 0 0 2px var(--text); }
.osc-hg-year { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-family: var(--fm); font-size: var(--t-mini); color: var(--muted); }
.osc-hg-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-family: var(--fm); font-size: 11px; color: var(--muted); }
.osc-hg-key span { display: inline-flex; align-items: center; gap: 6px; }
.osc-hg-key .osc-hg-cell { margin: 0; }
.osc-hg-key .osc-hg-cell.is-none { margin: 0 3px; }
.osc-hg-cutkey { display: inline-block; height: 12px; border-left: 1.5px dashed var(--orange); }

/* A new year or category arrives rather than swaps. */
@keyframes osc-hist-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.osc-hist-enter > * { animation: osc-hist-rise 0.3s ease both; }
.osc-hist-enter .osc-feat-bar { transform-origin: left center; animation: osc-hist-grow 0.6s 0.1s ease both; }
@keyframes osc-hist-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .osc-hist-enter > *, .osc-hist-enter .osc-feat-bar { animation: none; }
}
@media (max-width: 680px) {
  .osc-hist-gridwrap { padding: var(--s-4); }
}
