/* Styles for the context plugin. Prefix every selector with .p-context */

.p-context h3 { margin: 22px 0 10px; }
.p-context h3:first-child { margin-top: 0; }
.p-context .note { font-size: 14px; line-height: 1.45; color: var(--ink-2); margin: 8px 0 0; max-width: 46em; }
.p-context .fine { margin-top: 18px; }

/* Inline citations: small mono links named by the site they point to. */
.p-context .cite { font: 400 11.5px/1.3 var(--mono); white-space: normal; }
.p-context .cite a { color: var(--ink-2); margin-right: 5px; white-space: nowrap; }
.p-context .cite a::before { content: "["; }
.p-context .cite a::after { content: "]"; }

.p-context details.src, .p-context details.tablewrap { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 10px; }
.p-context summary { cursor: pointer; font: 500 13px/1.4 var(--mono); color: var(--ink); width: fit-content; padding: 4px 0; }
.p-context summary:hover { background: var(--mark); }
.p-context details.src ol { margin: 10px 0 0; padding-left: 26px; font-size: 14px; line-height: 1.45; max-width: 60em; }
.p-context details.src li { margin-bottom: 5px; overflow-wrap: anywhere; }

/* 1. Story so far */
.p-context .story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 48px; }
.p-context .lead { font-size: 18px; line-height: 1.4; margin: 0 0 12px; max-width: 30em; }
.p-context .lead b { font-weight: 800; }
.p-context .basis { display: block; font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.p-context table.leaders { width: 100%; border-collapse: collapse; }
.p-context table.leaders td { padding: 8px 12px 8px 0; border-top: 1px solid var(--rule); vertical-align: top; font-size: 15px; }
.p-context table.leaders tr:last-child td { border-bottom: 1px solid var(--rule); }
.p-context table.leaders td.role { font: 400 12.5px/1.5 var(--mono); color: var(--ink-2); width: 34%; }
.p-context table.leaders .since { display: block; font: 400 12.5px/1.5 var(--mono); color: var(--ink-2); }
.p-context details.more { margin: 8px 0 0; }
.p-context details.more .note { margin-top: 4px; }
.p-context ul.fine { padding-left: 20px; }
.p-context ul.fine li { margin-bottom: 5px; }
.p-context .tablewrap h3 { font-size: 16px; }
.p-context table.leaders b { font-weight: 700; }

.p-context .bench { margin: 0 0 16px; }
.p-context .bench-label { font: 400 13px/1.4 var(--mono); color: var(--ink-2); margin: 0 0 6px; }
.p-context .bench-bar { position: relative; display: flex; gap: 2px; height: 26px; }
.p-context .bench-bar i { display: block; min-width: 3px; border-radius: 2px; }
.p-context .bench-bar i.vacant, .p-context .bench-legend .sw.vacant { border: 1.5px dashed var(--ink); }
.p-context .bench-bar > b { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.p-context .bench-legend { display: flex; flex-wrap: wrap; gap: 3px 16px; font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.p-context .bench-legend span { display: inline-flex; align-items: center; gap: 6px; }
.p-context .bench-legend b { font: 500 14px var(--mono); color: var(--ink); }
.p-context h3.gap { margin-top: 24px; }

.p-context ol.changes, .p-context ol.dates { list-style: none; margin: 0; padding: 0; }
.p-context ol.changes li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 14.5px; line-height: 1.4; }
.p-context ol.changes li:last-child { border-bottom: 1px solid var(--rule); }
.p-context ol.changes .when { font: 400 12.5px/1.6 var(--mono); color: var(--ink-2); }
.p-context ol.changes b { font-weight: 700; }

/* 2 and 3. History chart */
.p-context .col { outline: none; cursor: default; }
.p-context .col:focus-visible > rect:first-child, .p-context rect.col:focus-visible { stroke: var(--ink); stroke-width: 2; }
.p-context .col:hover > rect:first-child { fill: rgba(0, 0, 0, .045); }
.p-context .legend .key { width: 12px; height: 10px; flex: none; }
.p-context .key-box { display: inline-block; width: 18px; height: 9px; flex: none; }
.p-context .key-box.solid { background: var(--ink-2); border: 2px solid var(--ink-2); }
.p-context .key-box.hollow { background: var(--paper); border: 2px solid var(--ink-2); }
.p-context .key-box.dash { height: 13px; background: var(--wash); border: 1.5px dashed var(--ink); }
.p-context .fc-line { font-size: 15px; line-height: 1.45; max-width: 52em; margin: 16px 0 0; padding: 12px 14px; background: var(--wash); }
.p-context .fc-line b { font-weight: 800; }
.p-context table.hist { width: 100%; min-width: 1000px; border-collapse: collapse; margin-top: 10px; }
.p-context table.hist th { font: 400 12px var(--mono); color: var(--ink-2); text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.p-context table.hist td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 14px; line-height: 1.4; }
.p-context table.hist .n { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.p-context table.hist td.d { white-space: nowrap; font-weight: 700; }
.p-context table.hist td.notes { min-width: 440px; color: var(--ink-2); font-size: 13.5px; }
.p-context table.hist .dis { color: var(--ink); background: color-mix(in srgb, var(--mark) 45%, white); padding: 0 3px; }

/* 4. How unusual */
.p-context .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px 22px; }
.p-context .card { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 14px 16px 16px; margin: 0 4px 4px 0; }
.p-context .card .stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin: 0 0 10px; padding: 0 0 8px; border-bottom: 5px solid var(--ink); }
.p-context .card .stat b { font-weight: 900; font-size: 46px; line-height: 1; letter-spacing: -0.02em; font-variation-settings: "wdth" 70; }
.p-context .card .stat span { font: 400 12.5px/1.3 var(--mono); color: var(--ink-2); }
.p-context .card h3 { margin: 0 0 6px; }
.p-context .card p:last-child { margin: 0; font-size: 15px; line-height: 1.45; }

/* 5. Key dates */
.p-context ol.dates { max-width: 760px; border-left: 2px solid var(--ink); margin-left: 5px; }
.p-context ol.dates li { position: relative; display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 2px 18px; padding: 9px 0 9px 20px; font-size: 15px; line-height: 1.4; }
.p-context ol.dates li::before { content: ""; position: absolute; left: -7px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.p-context ol.dates li.past { color: var(--ink-2); }
.p-context ol.dates li.past::before { background: var(--ink); }
.p-context ol.dates li.next::before { background: var(--mark); width: 12px; height: 12px; left: -9px; top: 12px; }
.p-context ol.dates li.tba::before { border-style: dashed; border-width: 1.5px; }
.p-context ol.dates .when { font: 400 13px/1.55 var(--mono); }
.p-context ol.dates li.tba .when { color: var(--ink-2); }
.p-context ol.dates .tag { display: inline-block; font-size: 11.5px; color: var(--ink-2); border: 1px solid var(--rule); padding: 0 5px; border-radius: 2px; white-space: nowrap; }
.p-context ol.dates .tag.next { background: var(--mark); border-color: var(--ink); color: var(--ink); }
.p-context ol.dates b { font-weight: 700; }

@media (max-width: 760px) {
  .p-context .story-grid { grid-template-columns: minmax(0, 1fr); }
  .p-context ol.dates li { grid-template-columns: minmax(0, 1fr); }
  .p-context .card .stat b { font-size: 40px; }
  .p-context ol.changes li { grid-template-columns: minmax(0, 1fr); }
  .p-context table.leaders td.role { width: auto; }
}
