/* ==========================================================================
   Promptly Found: index surface layer (step 3e)
   Loads on /news, /glossary, /library, /research/facts, /paths, each reading path
   and /timeline (BaseLayout, by path) after site-lead.css. Every rule is scoped
   to html.pfm.pfl. The copy and the markup do not change.

     Night    the heading band
     Console  the filter bar crosses the bottom edge of the band from 1001px:
              news filters, the A to Z bar (it stays sticky), library filters
              and the facts filters
     Sheet    on a reading path, the progress track crosses the band
     List     months, terms, documents, chapters and timeline years: flat, a rule
              on top. News and timeline headings stay in view on the left.
     Desk     fact cards rest on the desk as sheets
   ========================================================================== */

/* ---- Consoles: the filter bars ---------------------------------------------- */
.pfm.pfl :is(.pf-nl-tools, .pf-az, .pf-shead ~ .pf-tools, .pf-intro ~ .pf-tools, .pf-fx-bar) {
  --paper: var(--pfl-console); --panel: #222226; --ink: #edebe6; --ink-2: #b5b3ad; --ink-3: #918f8a;
  --line: var(--pfl-console-line); --accent: #e58a9a; --focus: #8eb0ff;
  position: relative; top: auto; z-index: 4; max-width: var(--width-wide); padding: 16px 24px; border: 0; border-radius: 18px;
  background: var(--pfl-console); color: var(--ink); box-shadow: var(--pfl-console-lift);
}
/* the news filters and the A to Z bar keep their sticky place (and their page's top offset), now as consoles.
   A short shadow in the console color closes the gap under the header while they are stuck. */
.pfm.pfl .pf-wrap > .pf-nl-tools { position: sticky; top: var(--header-height); max-width: none; box-shadow: 0 -8px 0 var(--pfl-console), var(--pfl-console-lift); }
.pfm.pfl .pf-az.pf-az--sticky { position: sticky; top: calc(var(--sticky-top) - 24px); z-index: 5; margin-inline: 0; padding: 10px 20px; border-bottom: 0; gap: 2px 8px; box-shadow: 0 -8px 0 var(--pfl-console), var(--pfl-console-lift); }
.pfm.pfl .pf-az span { color: #4d4d54; }
.pfm.pfl .pf-az a:hover { color: var(--ink); }
.pfm.pfl .pf-az a[aria-current="true"] { box-shadow: inset 0 -2px 0 var(--ink); }
/* inputs and selects inside a console */
.pfm.pfl :is(.pf-nl-tools, .pf-shead ~ .pf-tools, .pf-intro ~ .pf-tools, .pf-fx-bar) :is(select, input:not([type="checkbox"], [type="radio"]), .pf-search) {
  border-color: #3a3a40; background: #121214; color: var(--ink);
}

/* ---- News: months as flat lists ---------------------------------------------- */
.pfm.pfl .pf-nl-month ol { border-top: 1px solid var(--ink); }
.pfm.pfl .pf-nl-month li:first-child { border-top: 0; }

/* ---- Glossary: terms as one flat list ---------------------------------------- */
.pfm.pfl .pf-gloss > section { border: 0; border-radius: 0; overflow: visible; }
.pfm.pfl .pf-gloss > section + section { margin-top: 0; }
.pfm.pfl .pf-gloss > section:first-child { border-top: 1px solid var(--ink); }
.pfm.pfl .pf-gloss__term { padding-inline: 0; }
.pfm.pfl .pf-gloss > section + section .pf-gloss__term:first-of-type { border-top: 1px solid var(--line); }

/* ---- Library: months as flat lists ------------------------------------------- */
.pfm.pfl [data-lib-list] > section { border: 0; border-radius: 0; overflow: visible; }
.pfm.pfl [data-lib-list] .pf-lmonth { padding-inline: 0; border-bottom-color: var(--ink); }
.pfm.pfl [data-lib-list] .pf-lrow { padding-inline: 0; }
.pfm.pfl [data-lib-list] .pf-lrow:hover { background: none; }
.pfm.pfl [data-lib-list] .pf-lrow:hover h3 { color: var(--accent); }

/* ---- Facts: cards as sheets on the desk -------------------------------------- */
.pfm.pfl .pf-fx-list {
  margin-top: 56px; padding-block: 8px 72px;
  background: var(--pfl-desk); box-shadow: 0 0 0 100vmax var(--pfl-desk); clip-path: inset(0 -100vmax);
  --line: #e2e0da;
}
.pfm.pfl .pf-fx-list .pf-fx { border: 0; background: var(--pfl-sheet); box-shadow: var(--pfl-rest); }
.pfm.pfl .pf-fx-list .pf-fx:hover { box-shadow: var(--pfl-rest); }
.pfm.pfl .pf-fx-endnote { margin-top: 48px; }

/* ---- Reading paths: flat lists, and the track as a sheet --------------------- */
.pfm.pfl :is(div, ol).pf-entries:not(.pf-entries--cols, .pf-steps3) { border: 0; border-radius: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); overflow: visible; }
.pfm.pfl :is(div, ol).pf-entries:not(.pf-entries--cols, .pf-steps3) .pf-entry { padding-inline: 0; }
.pfm.pfl :is(div, ol).pf-entries:not(.pf-entries--cols, .pf-steps3) .pf-entry:hover { background: none; }
.pfm.pfl :is(div, ol).pf-entries:not(.pf-entries--cols, .pf-steps3) .pf-entry:hover .pf-entry__title { color: var(--accent); }
.pfm.pfl .pf-shead + div:has(> .pf-track) {
  position: relative; z-index: 1; max-width: var(--width-wide); padding: 28px 32px 24px; border-radius: 20px;
  background: var(--pfl-sheet); box-shadow: var(--pfl-raised);
}

/* ---- Timeline: years as flat lists ------------------------------------------- */
.pfm.pfl .pf-tl { margin-top: 0; border: 0; border-radius: 0; overflow: visible; }
.pfm.pfl .pf-tl li { padding-inline: 0; }
.pfm.pfl section:has(> .pf-tl) > .pf-lmonth { border-bottom-color: var(--ink); }

@media (min-width: 1001px) {
  .pfm.pfl { --pfl-cross: 64px; }
  /* the band runs on, and the filter bar (or the track) crosses its bottom edge */
  .pfm.pfl :is(.pf-shead, .pf-intro).pfm-band--top:has(~ :is(.pf-nl-tools, .pf-az, .pf-tools, .pf-fx-bar)),
  .pfm.pfl .pf-shead.pfm-band--top:has(+ div > .pf-track) { padding-bottom: calc(64px + var(--pfl-cross)); }
  .pfm.pfl :is(.pf-shead, .pf-intro) + :is(.pf-nl-tools, .pf-tools, .pf-fx-bar),
  .pfm.pfl .pf-shead + .pf-gsearch__none + .pf-az,
  .pfm.pfl .pf-shead + div:has(> .pf-track) { margin-top: calc(var(--pfl-cross) * -1); }

  /* news: the month on the left stays in view, its posts on the right */
  .pfm.pfl .pf-nl { max-width: none; }
  .pfm.pfl .pf-nl-month { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: 64px; align-items: start; margin-top: 64px; }
  .pfm.pfl .pf-nl-month h2 { position: sticky; top: calc(var(--pfl-rail-top) + 72px); margin: 0; font-size: 40px; line-height: 44px; letter-spacing: -.024em; }

  /* timeline: the year on the left stays in view, its changes on the right */
  .pfm.pfl section:has(> .pf-tl) { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: 64px; align-items: start; }
  .pfm.pfl section:has(> .pf-tl) > .pf-lmonth { position: sticky; top: var(--pfl-rail-top); display: block; margin: 0; padding: 0; border: 0; }
  .pfm.pfl section:has(> .pf-tl) > .pf-lmonth h2 { font-size: 40px; line-height: 44px; }
  .pfm.pfl section:has(> .pf-tl) > .pf-lmonth span { display: block; margin-top: 8px; }
  .pfm.pfl .pf-tl { border-top: 1px solid var(--ink); }
  .pfm.pfl .pf-tl li:first-child { border-top: 0; }
}
@media (max-width: 1000px) {
  .pfm.pfl .pf-tl { margin-top: 0; }
}
@media (max-width: 600px) {
  .pfm.pfl :is(.pf-nl-tools, .pf-shead ~ .pf-tools, .pf-intro ~ .pf-tools, .pf-fx-bar) { padding: 14px 16px; border-radius: 14px; }
  .pfm.pfl .pf-az.pf-az--sticky { padding: 8px 12px; border-radius: 14px; }
  .pfm.pfl .pf-shead + div:has(> .pf-track) { padding: 18px 16px; border-radius: 16px; }
  .pfm.pfl [data-lib-list] :is(.pf-lrow, .pf-lmonth), .pfm.pfl .pf-gloss__term, .pfm.pfl .pf-tl li { padding-inline: 0; }
}
