/* ==========================================================================================
   Bible Timeline Series — layout and type (shared by every chart; colours in theme_*.css, fonts in fonts.css)
   ==========================================================================================
   Page 1 = US Letter landscape: 1056 × 816 CSS px (96 px per inch) → main JPG 4400 px wide, PDF page 11 × 8.5 in.
   Fonts: Literata cut into fixed instances per text ROLE (Design\Fonts\fonts.yaml) — each role has its own optical size,
   so use the role's family AND one of its exact weights (--w-<role>-…); other weights would fall to the wrong face.
   Type hierarchy (owner, Q10/Q19 notes): facts large and clear; sub-notes SMALLER and LIGHTER (size + colour; weight ≥ 380);
   minor notes smallest. Limits checked by "tl.py qa": nothing under 6.5 pt (8.67 px); labels ≥ 7.5 pt (10 px).
   Classes used by the layout check (build.py): .fit = text must not overflow its box; .lbl = labels must not overlap.
   ========================================================================================== */

/* ---------------------------------------- Control panel: sizes (CSS px; 1 pt = 1.333 px) ---------------------------------------- */
:root {
	--size-title:      38px;          /* 28.5 pt */
	--size-subtitle:   13.4px;        /* 10 pt   */
	--size-series:     10.4px;        /* small caps */
	--size-verse:      12.4px;        /* 9.3 pt  */
	--size-day:        14.6px;        /* 11 pt   */
	--size-day-sub:    10px;          /* 7.5 pt  */
	--size-event:      10.6px;        /* 8 pt    */
	--size-ref:        10px;          /* 7.5 pt  */
	--size-detail:     9.4px;         /* 7 pt — sub-notes */
	--size-note:       9.2px;         /* 6.9 pt  */
	--size-note-minor: 8.8px;         /* 6.6 pt  */
	--size-box-title:  11.4px;
	--gap-column:      5px;
}

/* ---------------------------------------- Page ---------------------------------------- */
@page { size: 11in 8.5in; margin: 0; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	background: #8d8478;                                    /* only seen around the sheets when chart.html is opened on screen */
	font-family: var(--font-label); font-weight: var(--w-label-regular);
	color: var(--ink);
	font-optical-sizing: none;                              /* optical size is fixed per role (static fonts) */
	font-synthesis: none;                                   /* never fake bold, italic or small caps */
	font-kerning: normal;
	font-variant-numeric: lining-nums proportional-nums;
	-webkit-font-smoothing: antialiased;
}
@media print { body { background: none; } }
.sheet {
	width: 1056px; height: 816px; overflow: hidden; position: relative;
	background: radial-gradient(ellipse at 50% 45%, var(--paper) 62%, var(--paper-edge) 100%);
	break-after: page;
}
.sheet:last-child { break-after: auto; }
@media screen { .sheet { margin: 0 auto 24px; box-shadow: 0 2px 14px rgba(0,0,0,.35); } }
.num { font-variant-numeric: lining-nums tabular-nums; }
.lord { font-variant-caps: small-caps; letter-spacing: .04em; }           /* KJV Lᴏʀᴅ: L + small caps */
.kjv { font-style: normal; }                                               /* KJV quotations in roman: italic marks supplied words in the KJV */
q.kjv { quotes: '“' '”'; } q.kjv::before { content: open-quote; } q.kjv::after { content: close-quote; }
em { font-style: italic; }
sup.fn { font-family: var(--font-label); font-weight: var(--w-label-bold); font-size: .7em; color: var(--accent); vertical-align: .5em; line-height: 0; margin-left: 1px; }
sup.fn + sup.fn::before { content: ','; }
.ic { width: 1em; height: 1em; vertical-align: -.14em; flex: none; }
.emoji { width: 1.1em; height: 1.1em; vertical-align: -.18em; }

/* ---------------------------------------- Chart page grid ---------------------------------------- */
.chart { position: absolute; inset: 20px 26px 14px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; row-gap: 6px; }

/* header */
.head { display: grid; grid-template-columns: 1fr 452px; column-gap: 26px; align-items: end; padding-bottom: 5px; border-bottom: 1.4px solid var(--rule); }
.series { font-family: var(--font-caps); font-weight: var(--w-caps-regular); font-size: var(--size-series); font-variant-caps: all-small-caps; letter-spacing: .1em; color: var(--gold); }
.title { font-family: var(--font-title); font-weight: var(--w-title-regular); font-size: var(--size-title); line-height: 1; color: var(--accent); margin: 1px 0 3px; letter-spacing: -.005em; }
.subtitle { font-family: var(--font-text); font-weight: var(--w-text-regular); font-style: italic; font-size: var(--size-subtitle); color: var(--ink-soft); }
.verse { font-family: var(--font-text); font-weight: var(--w-text-regular); font-size: var(--size-verse); line-height: 1.32; color: var(--ink); text-align: right; }
.legend { margin-top: 4px; font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: var(--size-note); color: var(--ink-soft); display: flex; flex-wrap: wrap; column-gap: 7px; align-items: center; }
.legend b { font-family: var(--font-label); font-weight: var(--w-label-bold); }
.legend .sep { margin-left: 6px; }
.legend .swatch { width: 9px; height: 10px; margin-right: 3px; vertical-align: -1px; }
.verse .ref { display: block; font-family: var(--font-label); font-size: var(--size-ref); color: var(--ink-soft); margin-top: 2px; }

/* day columns */
.days { display: grid; grid-template-rows: auto minmax(0, 1fr); column-gap: var(--gap-column); min-height: 0; }
.day { display: grid; grid-row: span 2; grid-template-rows: subgrid; min-height: 0; border-radius: 4px; background: color-mix(in srgb, var(--panel) 60%, transparent); }
.day-head { color: var(--on-dark); background: var(--day-colour); padding: 3px 6px 4px; border-radius: 4px 4px 0 0; line-height: 1.16; }
.day-head .wd { font-family: var(--font-heading); font-weight: var(--w-heading-regular); font-size: var(--size-day); }
.day-head .nm { font-family: var(--font-label); font-weight: var(--w-label-regular); font-style: italic; font-size: var(--size-day-sub); }
.day-head .dt { font-family: var(--font-label); font-weight: var(--w-label-regular); font-size: var(--size-day-sub); }
.day-head sup.fn { color: inherit; opacity: .82; }                          /* note numbers readable on every day colour */
.day-body { padding: 5px 5px 3px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.ev { border-left: 2.2px solid var(--day-colour); padding: 0 0 0 5px; flex: none; }          /* never squeezed: overflow must be measurable */
.ev.soft { border-left-style: dashed; }
.et { font-family: var(--font-label); font-weight: var(--w-label-medium); font-size: var(--size-event); line-height: 1.2; color: var(--ink); }
.ev.key .et { font-weight: var(--w-label-bold); }
.et .ic { color: var(--day-colour); margin-right: 3px; width: 1.15em; height: 1.15em; vertical-align: -.22em; }
.refs { font-size: var(--size-ref); line-height: 1.24; color: var(--ink-soft); margin-top: 1px; display: grid; grid-template-columns: repeat(auto-fill, minmax(53px, 1fr)); column-gap: 3px; }
.refs .r { white-space: nowrap; }
.refs .r.wide { grid-column: 1 / -1; }
.refs .r b { font-weight: var(--w-label-medium); }
.refs .r-Matt b { color: var(--matt); } .refs .r-Mark b { color: var(--mark); } .refs .r-Luke b { color: var(--luke); } .refs .r-John b { color: var(--john); }
.dl { font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: var(--size-detail); color: var(--ink-faint); line-height: 1.22; margin-top: 1px; }

/* hour strip */
.strip { position: relative; height: 122px; border: 1px solid var(--rule); border-radius: 4px; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.strip-title { position: absolute; left: 8px; top: 3px; font-family: var(--font-heading); font-weight: var(--w-heading-regular); font-size: 12.4px; color: var(--accent); }
.strip-title small { font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: var(--size-detail); color: var(--ink-faint); margin-left: 6px; }
.strip-area { position: absolute; left: 12px; right: 12px; top: 22px; bottom: 15px; }
.night { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.night span { position: absolute; top: 1px; left: 3px; font-family: var(--font-note); font-size: 8.8px; color: var(--ink-faint); }
.tick { position: absolute; top: 0; bottom: 0; border-left: 1px dotted var(--rule); }
.tick span { position: absolute; bottom: -14px; transform: translateX(-50%); font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: 8.8px; color: var(--ink-faint); white-space: nowrap; }
.band { position: absolute; height: 8px; border-radius: 2px; background: var(--band-colour); }
.band.est { background: repeating-linear-gradient(135deg, var(--band-colour) 0 1.6px, transparent 1.6px 4px); border: 1px solid var(--band-colour); }
.band-label { position: absolute; font-size: 9.8px; line-height: 1.12; white-space: nowrap; color: var(--ink); font-weight: var(--w-label-regular); }
.band-label .tm { font-family: var(--font-note); font-weight: var(--w-note-regular); color: var(--ink-faint); font-size: 8.8px; }
.band-label.stated b { font-weight: var(--w-label-medium); }

/* bottom band: dating + key (left), notes in columns (right) — fixed height so the day columns keep their room */
.bottom { display: grid; grid-template-columns: 1fr; align-items: stretch; height: 150px; }
.bottom > .box { overflow: hidden; }
.box { border: 1px solid var(--rule); border-radius: 4px; padding: 4px 7px 4px; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.box h3 { margin: 0 0 3px; font-family: var(--font-caps); font-weight: var(--w-caps-regular); font-size: var(--size-box-title); font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--accent); }
.box p, .box li { margin: 0 0 2px; font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: var(--size-note); line-height: 1.24; }
.box b { font-family: var(--font-note); font-weight: var(--w-note-bold); }
.box ul { margin: 0; padding: 0; list-style: none; }
.key-row { display: flex; align-items: center; gap: 5px; font-family: var(--font-note); font-size: var(--size-note); margin-bottom: 2px; }
.swatch { width: 11px; height: 10px; border-left: 2.2px solid var(--ink-soft); display: inline-block; flex: none; }
.swatch.soft { border-left-style: dashed; }
.swatch-band { width: 18px; height: 7px; border-radius: 2px; background: var(--ink-soft); display: inline-block; flex: none; }
.swatch-band.est { background: repeating-linear-gradient(135deg, var(--ink-soft) 0 1.6px, transparent 1.6px 4px); border: 1px solid var(--ink-soft); }
.notes { columns: 5; column-gap: 12px; column-fill: auto; height: calc(100% - 17px); }
.box h3 .h3-sub { font-family: var(--font-note); font-variant-caps: normal; letter-spacing: 0; color: var(--ink-faint); font-size: 9px; }
.notes p { break-inside: auto; orphans: 2; widows: 2; font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: var(--size-note); line-height: 1.22; margin: 0 0 3px; }
.notes p.minor { font-size: var(--size-note-minor); color: var(--ink-faint); }
.notes .n { font-family: var(--font-label); font-weight: var(--w-label-bold); color: var(--accent); margin-right: 2px; }
.foot { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: 8.9px; color: var(--ink-faint); border-top: 1px solid var(--rule); padding-top: 3px; }
.draft { position: absolute; right: 26px; top: 6px; font-family: var(--font-caps); font-weight: var(--w-caps-regular); font-size: 9.5px; letter-spacing: .14em; color: #9b2c2c; }

/* ---------------------------------------- Study notes pages ---------------------------------------- */
.notes-page { position: absolute; inset: 28px 34px 24px; font-family: var(--font-text); font-weight: var(--w-text-regular); font-size: 10.2px; line-height: 1.3; }
.notes-page h2 { font-family: var(--font-title); font-weight: var(--w-title-regular); color: var(--accent); font-size: 21px; margin: 0; }
.notes-page .sub { font-style: italic; color: var(--ink-soft); margin: 0 0 7px; }
.notes-page h3 { font-family: var(--font-caps); font-weight: var(--w-caps-regular); font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--accent); font-size: 13px; margin: 8px 0 3px; }
table.sn { width: 100%; border-collapse: collapse; font-family: var(--font-label); font-size: 9.6px; }
table.sn th { text-align: left; font-family: var(--font-caps); font-weight: var(--w-caps-regular); color: var(--ink-soft); border-bottom: 1.2px solid var(--rule); padding: 2px 4px; font-size: 9.4px; font-variant-caps: all-small-caps; letter-spacing: .05em; }
table.sn td { border-bottom: .8px solid var(--rule-soft); padding: 2.4px 4px; vertical-align: top; }
table.sn td.ev-name { font-weight: var(--w-label-medium); }
table.sn tr.dayrow td { font-family: var(--font-heading); font-weight: var(--w-heading-regular); color: var(--on-dark); background: var(--day-colour); padding: 2px 5px; font-size: 10.4px; }
table.sn .g { font-weight: var(--w-label-bold); text-align: center; }
table.sn .r-Matt { color: var(--matt); } table.sn .r-Mark { color: var(--mark); } table.sn .r-Luke { color: var(--luke); } table.sn .r-John { color: var(--john); }
.fullnotes { columns: 2; column-gap: 18px; }
.fullnotes p { margin: 0 0 4px; break-inside: avoid; }
.fullnotes p.minor { color: var(--ink-faint); font-size: 9.6px; }
.fullnotes .n { font-family: var(--font-label); font-weight: var(--w-label-bold); color: var(--accent); }
.sources p { margin: 0 0 2px; }
.hourlist { columns: 2; column-gap: 18px; }
.hourlist p { margin: 0 0 2px; break-inside: avoid; }
.hourlist b { font-family: var(--font-label); font-weight: var(--w-label-medium); color: var(--ink-soft); }

/* ---------------------------------------- Layout "years": eras band, time axis, lanes (chart_years.html.j2) ----------------------------------------
   Positions come from the scale (Tools\tltools\when.py) as percent of the TRACK width; the in-page script packs each lane's labels into
   rows so nothing overlaps, sizes every lane to its rows, and reports a lane area that does not fit (build → qa). */
.chart.years { grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
.tl-top { margin-left: var(--label-w); position: relative; }
.eras { position: relative; height: 22px; }
.era { position: absolute; top: 0; bottom: 0; background: var(--era-colour); color: var(--on-dark); border-radius: 3px; border-right: 1.5px solid var(--paper);
       display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 4px; overflow: hidden; white-space: nowrap; }
.era .era-name { font-family: var(--font-heading); font-weight: var(--w-heading-regular); font-size: 11px; }
.era .era-dates { font-family: var(--font-label); font-weight: var(--w-label-regular); font-size: 9.2px; opacity: .9; }
.era sup.fn { color: inherit; opacity: .85; }
.axis { position: relative; height: 15px; border-bottom: 1px solid var(--rule); }
.axis .tk { position: absolute; bottom: 0; height: 4px; border-left: 1px solid var(--ink-faint); }
.axis .tk span { position: absolute; bottom: 4px; left: 0; font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: 8.9px; color: var(--ink-faint); white-space: nowrap; transform: translateX(-50%); }
.axis .tk span.cell { transform: none; text-align: center; }
/* a second row of tick labels under the axis (scale.also, e.g. Ussher's years beside System A's): same ticks, smaller and italic, its name in the label column */
.axis.also { height: 12px; border-bottom: none; margin-top: -1px; }
.axis.also .tk { border-left: none; height: 0; }
.axis.also .tk span { bottom: 0; font-size: 8.8px; font-style: italic; }
.axis.also .also-name { position: absolute; right: calc(100% + 28px); bottom: 0; font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: 8.8px; font-style: italic; color: var(--ink-faint); white-space: nowrap; }
.axis .brk { position: absolute; bottom: -6px; transform: translateX(-50%); background: var(--paper); line-height: 0; padding: 0 2px; }
.brk-mark { display: inline-block; width: 6px; height: 11px; border-left: 1.7px solid var(--accent); border-right: 1.7px solid var(--accent);
            transform: skewX(-24deg); vertical-align: -1px; margin: 0 3px 0 1px; }          /* drawn: the series fonts have no ⫽ glyph */
.mk-row { position: relative; height: 13px; }
.mk-label sup.fn { font-size: 7px; }                                         /* note numbers ≥ 5 pt (qa) in the 8.9-px marker labels */
.mk-label { position: absolute; top: 1px; transform: translateX(-50%); font-family: var(--font-note); font-weight: var(--w-note-bold); font-size: 8.9px; color: var(--accent); white-space: nowrap; }
.legend .k-sym .ic { width: 1.05em; height: 1.05em; vertical-align: -.2em; margin-right: 3px; color: var(--accent); }                   /* chart option legend_extra: a drawn symbol and its meaning */
.tl-lanes { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tl-grid { position: absolute; left: var(--label-w); right: 0; top: 0; bottom: 0; pointer-events: none; }
.tl-grid .gl { position: absolute; top: 0; bottom: 0; border-left: .8px dotted var(--rule); }
.tl-grid .ml { position: absolute; top: 0; bottom: 0; border-left: 1.2px dashed color-mix(in srgb, var(--accent) 55%, transparent); }
.tl-grid .bl { position: absolute; top: 0; bottom: 0; border-left: 3px double color-mix(in srgb, var(--accent) 45%, transparent); }
.lane { display: grid; grid-template-columns: var(--label-w) 1fr; flex: none; border-bottom: 1px solid var(--rule-soft); }
.lane.alt { background: color-mix(in srgb, var(--panel) 55%, transparent); }
.lane-label { display: flex; flex-direction: column; justify-content: center; padding: 2px 6px 2px 2px; border-right: 1.2px solid var(--rule); }
.lane-label b { font-family: var(--font-caps); font-weight: var(--w-caps-regular); font-variant-caps: all-small-caps; letter-spacing: .05em; font-size: 11.6px; color: var(--accent); line-height: 1.05; }
.lane-label small { font-family: var(--font-note); font-weight: var(--w-note-regular); font-size: 8.8px; color: var(--ink-faint); line-height: 1.15; margin-top: 1px; }
.track { position: relative; min-height: var(--lane-min, 22px); }                                            /* chart option lane_min_height: the template sets --lane-min only for a value under 22 */
.it { position: absolute; top: 0; font-size: 9px; line-height: 1.16; }
.it .lb { position: relative; max-width: var(--label-max); width: max-content; line-height: 1.16; padding: 0 1px; }
.it .t { font-family: var(--font-label); font-weight: var(--w-label-medium); font-size: 10px; color: var(--ink); }
.it.key .t { font-weight: var(--w-label-bold); font-size: 10.6px; }
.it .t .ic { color: var(--c); margin-right: 2px; width: 1.1em; height: 1.1em; vertical-align: -.2em; }
.it .d { font-family: var(--font-label); font-weight: var(--w-label-regular); font-size: 9px; color: var(--ink-soft); }
.it .d .dt { font-family: var(--font-note); font-weight: var(--w-note-bold); color: var(--ink-faint); white-space: nowrap; }
.it .d .r { white-space: nowrap; }
.it .d .r b { font-weight: var(--w-label-medium); }
.it .d .r-Matt b { color: var(--matt); } .it .d .r-Mark b { color: var(--mark); } .it .d .r-Luke b { color: var(--luke); } .it .d .r-John b { color: var(--john); }
.it .dl { font-size: 8.8px; margin-top: 0; }
.it .dot { position: absolute; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.it.key .dot { top: 2.5px; width: 9px; height: 9px; box-shadow: 0 0 0 1.2px var(--paper), 0 0 0 2.2px var(--c); }
.it.soft .dot { background: var(--paper); border: 1.6px dashed var(--c); }
.it .wh { position: absolute; top: 6px; height: 0; border-top: 1.6px dotted var(--c); }
.it .bar-line { height: 6px; border-radius: 2px; background: var(--c); }
.it.cut-left .bar-line { border-top-left-radius: 0; border-bottom-left-radius: 0; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px); mask-image: linear-gradient(to right, transparent 0, #000 16px); }
.it.cut-right .bar-line { border-top-right-radius: 0; border-bottom-right-radius: 0; -webkit-mask-image: linear-gradient(to left, transparent 0, #000 16px); mask-image: linear-gradient(to left, transparent 0, #000 16px); }
.it.cut-left.inside .lb { padding-left: 10px; }
.it.soft .bar-line { background: repeating-linear-gradient(135deg, var(--c) 0 2px, transparent 2px 4.5px); border: 1px solid var(--c); }
.it.bar .lb { margin-top: 1px; }
.it.bar.inside .bar-line { height: auto; padding: 1px 4px 1px; }
.it.bar.side .bar-line { height: 14px; }                                                                     /* chart option bar_labels: side — the bar keeps the thickness of a bar with its label inside … */
.it.bar.side .lb { position: absolute; top: 1px; margin: 0; }                                                /* … and its one-line label stands beside it, on the same row */
.it.bar.inside .lb { background: none; margin: 0; max-width: none; }
.it.bar.inside .t, .it.bar.inside .d, .it.bar.inside .d .dt, .it.bar.inside .d .r b { color: var(--on-dark) !important; }
.it.bar.inside.soft .bar-line, .it.bar.inside-title.soft .bar-line {                                           /* reconstructed (D/E) bars stay hatched */
	background: repeating-linear-gradient(135deg, var(--c) 0 3px, color-mix(in srgb, var(--c) 72%, black) 3px 6px); border: 0; }   /* two dark shades: light text stays readable */
.it.bar.inside-title .bar-line { height: auto; padding: 1px 4px 1px; white-space: nowrap; }                  /* title in the bar … */
.it.bar.inside-title .bar-line .t { color: var(--on-dark) !important; }
.it.bar.inside-title.cut-left .bar-line { padding-left: 10px; }
.it.bar.inside-title .lb .d { white-space: nowrap; }                                                         /* … date + references under it */
/* chart_labels: one-line — title, date and reference flow on one line (wrapping only past --label-max): half the height in a crowded lane */
.it.flip .lb { text-align: right; }                                                                          /* a label left of its dot ends at the dot */
.labels-one-line .it:not(.inside) .lb .t, .labels-one-line .it:not(.inside) .lb .d { display: inline; }
.labels-one-line .it:not(.inside) .lb .d { margin-left: 5px; }
.labels-one-line .it.inside-title .lb .d { margin-left: 0; }
.lb.one-line { white-space: nowrap; max-width: none; }
.lb.one-line .t, .lb.one-line .d { display: inline; }
.lb.one-line .d { margin-left: 4px; }
.legend .k-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); margin-right: 3px; }
.legend .k-dot.soft { background: none; border: 1.4px dashed var(--ink-soft); }
.legend .k-bar { display: inline-block; width: 16px; height: 6px; border-radius: 2px; background: var(--ink-soft); margin-right: 3px; vertical-align: 1px; }
.legend .k-wh { display: inline-block; width: 16px; border-top: 1.6px dotted var(--ink-soft); margin-right: 3px; vertical-align: 3px; }
table.sn tr.dayrow.era-row td { font-size: 10.4px; }
table.sn td.when { white-space: nowrap; }
table.sn td.when .also { font-size: 8.4px; color: var(--ink-faint); }          /* the second system's year (scale.also: Ussher) in small italic under the date */
table.sn td.lane-cell { color: var(--ink-faint); font-family: var(--font-note); font-size: 9px; }
.marker-list p { margin: 0 0 2px; }
