/* ==========================================================
   THE DAILY PRINT — the docs (Section R, the reference desk)
   Loaded after assets/site.css. Uses its tokens, fonts, masthead,
   edition themes and footer. Nothing here changes the landing page.
   ========================================================== */

/* The docs use the same frame width as the landing page (--maxw from site.css). */

.hide-sm { display: inline; }
@media (max-width: 700px) { .hide-sm { display: none; } }

/* Skip link: hidden until it has keyboard focus */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 80;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); padding: 12px 16px; text-decoration: none;
}
.skip:focus { left: 12px; top: 12px; outline: 3px solid var(--fire); outline-offset: 2px; }

.docs-page a:focus-visible,
.docs-page button:focus-visible,
.docs-page summary:focus-visible { outline: 3px solid var(--fire); outline-offset: 2px; }

/* ---------- Strip above the masthead ---------- */
.docs-strip { background: var(--ink); color: var(--paper); border-bottom: 2px solid var(--fire); }
.docs-strip .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.docs-strip span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.docs-strip b { color: var(--fire); font-weight: 700; }

/* ---------- Slim masthead ---------- */
.docs-mast__row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 10px 0 12px; }
.docs-mast__title { display: inline-flex; align-items: center; gap: clamp(8px, 1.2vw, 14px); text-decoration: none; min-width: 0; }
.docs-mast__title img { width: clamp(32px, 4vw, 50px); height: auto; flex: none; }
.docs-mast__title span { font-family: var(--f-black); font-size: clamp(34px, 5.4vw, 66px); line-height: 1; }
.docs-mast__tag {
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: .03em; line-height: 1;
  font-size: clamp(17px, 2.2vw, 26px);
  border: 2px solid var(--ink); padding: 7px 12px 5px; box-shadow: 3px 3px 0 var(--fire);
  white-space: nowrap;
}
.docs-page .nav a[aria-current] { color: var(--fire); }
.docs-page .nav__id { font-size: 11px; }

/* ---------- Page grid: index, article, on this page ---------- */
.docs {
  display: grid; grid-template-columns: 260px minmax(0, 1fr);
  gap: 0 clamp(28px, 4vw, 64px); align-items: start;
  padding-top: 30px; padding-bottom: 80px;
}

/* The index, set like a newspaper's "inside" box */
.docs-side { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; border: 2px solid var(--ink); background: var(--paper); }
.docs-menu { display: none; }
.docs-index__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin: 0; padding: 10px 14px 8px; border-bottom: 2px solid var(--ink);
  background: var(--ink); color: var(--paper);
}
.docs-index__head b { font-family: var(--f-head); font-weight: 400; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; line-height: 1; }
.docs-index__head span { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ember); }
.docs-index ol { list-style: none; margin: 0; padding: 6px 0; }
.docs-index li + li { border-top: 1px dotted color-mix(in srgb, var(--ink) 35%, transparent); }
.docs-index a {
  display: flex; align-items: baseline; gap: 8px; padding: 9px 14px; text-decoration: none;
  font-size: 16px; line-height: 1.25; border-left: 4px solid transparent;
}
.docs-index a .t { flex: 0 1 auto; }
.docs-index a .dots { flex: 1 1 12px; min-width: 12px; border-bottom: 2px dotted color-mix(in srgb, var(--ink) 40%, transparent); transform: translateY(-4px); }
.docs-index a .p { flex: none; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.docs-index a:hover { background: var(--paper-2); }
.docs-index a:hover .t { color: var(--fire); }
.docs-index a[aria-current="page"] { border-left-color: var(--fire); background: var(--paper-2); font-weight: 650; }
.docs-index a[aria-current="page"] .p { color: var(--fire); font-weight: 700; }
.docs-index__foot { margin: 0; padding: 10px 14px 12px; border-top: 2px solid var(--ink); }
.docs-index__foot a { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.docs-index__foot a:hover { color: var(--fire); }

/* Article column, with "on this page" beside it on wide screens */
.docs-main { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.docs-head, .docs-body, .docs-pager { min-width: 0; max-width: 980px; }
/* Running text keeps a readable line length; tables, cards and examples use the full column. */
.docs-body > p, .docs-body > ul, .docs-body > ol:not([class]), .docs-body > h3 { max-width: 42em; }

.docs-kicker { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0 0 12px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.docs-kicker b { background: var(--fire); color: #15110E; padding: 3px 7px 2px; font-weight: 700; letter-spacing: .1em; }
.docs-head h1 { font-family: var(--f-head); font-weight: 400; text-transform: uppercase; letter-spacing: .005em; line-height: .92; font-size: clamp(42px, 6.4vw, 84px); margin: 0 0 16px; overflow-wrap: break-word; }
.docs-deck { font-size: clamp(19px, 2vw, 23px); line-height: 1.35; font-style: italic; color: var(--ink-2); margin: 0 0 22px; max-width: 34em; }
.docs-head::after { content: ""; display: block; height: 7px; border-top: 3px solid var(--rule); border-bottom: 1px solid var(--rule); }

.docs-toc { margin: 22px 0 16px; border: 1px solid var(--ink); padding: 12px 14px; max-width: 980px; }
.docs-toc__label { margin: 0 0 6px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.docs-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-toc a { display: block; padding: 4px 0 4px 10px; border-left: 3px solid transparent; text-decoration: none; font-size: 15px; line-height: 1.3; color: var(--ink-2); }
.docs-toc a:hover { color: var(--fire); }
.docs-toc a.is-here { border-left-color: var(--fire); color: var(--ink); font-weight: 600; }

@media (min-width: 1180px) {
  .docs-main { grid-template-columns: minmax(0, 1fr) 230px; column-gap: clamp(32px, 4vw, 60px); }
  .docs-head { grid-column: 1; grid-row: 1; }
  .docs-body { grid-column: 1; grid-row: 2; }
  .docs-pager { grid-column: 1; grid-row: 3; }
  .docs-toc { grid-column: 2; grid-row: 1 / span 3; align-self: start; position: sticky; top: 18px; margin: 0; border: 0; border-top: 3px solid var(--ink); padding: 10px 0 0; }
}

/* ---------- Article type ---------- */
.docs-body { font-size: 18px; line-height: 1.62; padding-top: 6px; }
.docs-body p { margin: 0 0 1.05em; }
.docs-body h2 {
  font-family: var(--f-head); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1;
  font-size: clamp(27px, 3.2vw, 36px); margin: 1.7em 0 .55em; padding-top: 16px; border-top: 1px solid var(--rule);
  scroll-margin-top: 16px;
}
.docs-body h2:first-child { border-top: 0; margin-top: .9em; padding-top: 0; }
.docs-body h3 { font-family: var(--f-serif); font-weight: 700; font-size: 21px; line-height: 1.25; margin: 1.5em 0 .4em; scroll-margin-top: 16px; }
.docs-body a { text-decoration: underline; text-decoration-color: var(--fire); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.docs-body a:hover { color: var(--fire); }
.docs-body ul, .docs-body ol { margin: 0 0 1.1em; padding-left: 1.25em; }
.docs-body li { margin: 0 0 .45em; }
.docs-body li::marker { color: var(--fire); font-weight: 700; }
.docs-body strong { font-weight: 700; }
.docs-body code {
  font-family: var(--f-mono); font-size: .82em; background: var(--paper-2); border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  padding: 1px 5px; overflow-wrap: anywhere; white-space: normal;
}
.docs-body .ticker { font-size: .9em; }

/* Opening paragraph with a drop cap, front page only */
.docs-lede { font-size: 20px; line-height: 1.55; }
.docs-lede::first-letter { font-family: var(--f-head); float: left; font-size: 4.1em; line-height: .78; padding: .08em .1em 0 0; color: var(--fire); }

/* Numbered steps */
.docs-body .docs-steps { list-style: none; margin: 0 0 1.3em; padding: 0; counter-reset: step; border-top: 2px solid var(--ink); }
.docs-steps > li { counter-increment: step; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 0 14px; margin: 0; padding: 16px 0; border-bottom: 1px solid var(--ink); }
.docs-steps > li::before { content: counter(step, decimal-leading-zero); font-family: var(--f-head); font-size: 44px; line-height: .9; color: var(--fire); }
.docs-steps > li > div > b { display: block; font-family: var(--f-head); font-weight: 400; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; margin: 2px 0 6px; }
.docs-steps p { margin: 0; }

/* Worked example, set like a clipping */
.docs-clip { margin: 1.5em 0; border: 2px dashed var(--ink); background: var(--paper-2); padding: 16px 18px 6px; position: relative; }
.docs-clip__label { display: inline-block; margin: 0 0 10px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 4px 8px 3px; }
.docs-clip__label b { color: var(--ember); font-weight: 500; }
.docs-clip > p, .docs-clip > ul, .docs-clip > ol { font-size: 17px; }
.docs-clip .docs-table { background: var(--paper); }

/* A rule worth remembering */
.docs-note { margin: 1.4em 0; border-left: 5px solid var(--fire); padding: 4px 0 4px 16px; }
.docs-note p { margin: 0; }
.docs-note .mono { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: .13em; margin-bottom: 4px; }

/* Tables */
.docs-table-wrap { margin: 1.2em 0 1.4em; overflow-x: auto; }
.docs-table { width: 100%; border-collapse: collapse; font-size: 16.5px; line-height: 1.35; border: 2px solid var(--ink); }
.docs-table th, .docs-table td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--ink); }
.docs-table thead th { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; background: var(--ink); color: var(--paper); }
.docs-table tbody tr:last-child th, .docs-table tbody tr:last-child td { border-bottom: 0; }
.docs-table tbody th { font-weight: 700; }
.docs-table .num { text-align: right; font-family: var(--f-mono); font-size: 14.5px; white-space: nowrap; }
.docs-table thead th.num { font-family: var(--f-mono); font-size: 10.5px; }
.docs-table .hot { color: var(--fire); font-weight: 700; }
@media (max-width: 480px) { .docs-table { font-size: 15px; } .docs-table th, .docs-table td { padding: 8px 8px; } .docs-table .num { font-size: 13px; } }

/* Tier cards (the rate card) */
.docs-tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 1.2em 0 1.4em; }
.docs-tier { border: 2px solid var(--ink); padding: 14px 14px 12px; background: var(--paper); display: flex; flex-direction: column; }
.docs-tier .mono { font-size: 10.5px; letter-spacing: .12em; color: var(--muted); }
.docs-tier h3 { font-family: var(--f-head); font-weight: 400; text-transform: uppercase; font-size: 34px; line-height: 1; margin: 6px 0 8px; }
.docs-tier p { font-size: 16px; line-height: 1.4; margin: 0 0 12px; flex: 1; }
.docs-tier__bar { display: flex; height: 12px; border: 2px solid var(--ink); background: var(--fire); }
.docs-tier__bar span { background: var(--flare); border-right: 2px solid var(--ink); }
.docs-tier__bar span[style*="width:0%"] { border-right: 0; }
.docs-tier dl { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 0; }
.docs-tier dt { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.docs-tier dd { margin: 0; font-family: var(--f-head); font-size: 28px; line-height: 1; }
.docs-tier dl > div:last-child { text-align: right; }
.docs-tier dl > div:last-child dd { color: var(--fire); }
.docs-tier--spiked { border-style: dashed; }
@media (max-width: 560px) { .docs-tiers { grid-template-columns: 1fr; } }

/* Facts, set like classified ads */
.docs-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 1.2em 0 1.4em; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.docs-facts > div { border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 12px 14px; min-width: 0; }
.docs-facts dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.docs-facts dd { margin: 4px 0 0; font-size: 16px; line-height: 1.35; }
.docs-facts dd b { display: block; font-family: var(--f-head); font-weight: 400; font-size: 28px; line-height: 1.05; text-transform: uppercase; margin-bottom: 4px; overflow-wrap: anywhere; }
.docs-facts dd b.asis { text-transform: none; }
.docs-facts .full { grid-column: 1 / -1; }
.docs-facts .fire { background: var(--fire); color: #15110E; }
.docs-facts .fire dt { color: #15110E; }
.docs-facts code { display: inline-block; margin: 2px 0 6px; font-size: 14px; padding: 6px 9px; background: var(--ink); color: var(--paper); border: 0; }
@media (max-width: 520px) { .docs-facts { grid-template-columns: 1fr; } }

/* The map of the docs on the first page */
.docs-body .docs-map { list-style: none; margin: 1.1em 0 1.5em; padding: 0; border-top: 2px solid var(--ink); }
.docs-map li { margin: 0; border-bottom: 1px solid var(--ink); }
.docs-map a { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 2px 12px; padding: 13px 0; text-decoration: none; }
.docs-map .p { grid-row: 1 / span 2; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: var(--fire); font-weight: 700; padding-top: 5px; }
.docs-map b { font-family: var(--f-head); font-weight: 400; font-size: 23px; text-transform: uppercase; letter-spacing: .015em; line-height: 1.1; }
.docs-map span.d { font-size: 16px; line-height: 1.4; color: var(--ink-2); }
.docs-map a:hover b { color: var(--fire); }

/* A post shown as an example */
.docs-post { margin: 0 0 1em; border: 1px solid var(--ink); background: var(--paper); padding: 10px 12px; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.docs-post s { color: var(--muted); text-decoration-color: var(--fire); }
.docs-post + p.docs-count { margin-top: -.4em; font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-2); }

/* Glossary */
.docs-terms { margin: 1.1em 0 1.4em; }
.docs-terms > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px dotted color-mix(in srgb, var(--ink) 45%, transparent); }
.docs-terms dt { font-family: var(--f-head); text-transform: uppercase; font-size: 20px; line-height: 1.15; }
.docs-terms dd { margin: 0; font-size: 17px; line-height: 1.45; }
@media (max-width: 520px) { .docs-terms > div { grid-template-columns: 1fr; } }

/* ---------- Previous / next ---------- */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 44px; padding-top: 22px; border-top: 3px solid var(--ink); }
.docs-pager a { display: block; border: 2px solid var(--ink); padding: 12px 14px 11px; text-decoration: none; box-shadow: 4px 4px 0 var(--ink); transition: transform .12s ease, box-shadow .12s ease; background: var(--paper); min-width: 0; }
.docs-pager a:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--fire); }
.docs-pager .mono { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--muted); margin-bottom: 5px; }
.docs-pager strong { display: block; font-family: var(--f-head); font-weight: 400; text-transform: uppercase; font-size: clamp(19px, 2.2vw, 24px); line-height: 1.08; letter-spacing: .015em; }
.docs-pager__next { text-align: right; grid-column: 2; }
.docs-pager__prev { grid-column: 1; }
@media (max-width: 560px) { .docs-pager { grid-template-columns: 1fr; } .docs-pager__next, .docs-pager__prev { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) { .docs-pager a { transition: none; } .docs-pager a:hover { transform: none; } }

/* ---------- Footer additions ---------- */
.docs-page .footer .footer-h { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ember); margin: 4px 0 12px; font-weight: 500; }
/* The follow button and the mail line: the same rules the landing page carries inline */
.docs-page .footer__follow { display: inline-block; margin-top: 16px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--furnace-ink); border: 1.5px solid var(--ember); padding: 9px 12px; }
.docs-page .footer__follow:hover { background: var(--fire); border-color: var(--fire); color: #15110E; }
.docs-page .footer .footer__mail { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; margin-top: 14px; }
.docs-page .footer__mail a { text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 3px; overflow-wrap: anywhere; }
.docs-page .footer__mail a:hover { color: var(--fire); }
.docs-page .footer__brand img { width: 44px; height: 44px; }
.docs-page .footer ul.two { display: block; columns: 2; column-gap: 18px; }
.docs-page .footer ul.two li { break-inside: avoid; margin-bottom: 6px; }
.docs-page .footer__grid { grid-template-columns: 1.3fr 1.3fr .8fr; }
@media (max-width: 760px) {
  .docs-page .footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Narrow screens: the index becomes a menu ---------- */
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); padding-top: 18px; padding-bottom: 56px; }
  .docs-side { position: static; max-height: none; overflow: visible; margin-bottom: 26px; }
  .js .docs-menu {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--ink); color: var(--paper); border: 0; border-radius: 0; cursor: pointer; text-align: left;
    padding: 12px 14px; min-height: 48px; font: inherit;
  }
  .docs-menu b { font-family: var(--f-head); font-weight: 400; font-size: 20px; text-transform: uppercase; letter-spacing: .03em; line-height: 1; }
  .docs-menu span { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ember); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: right; }
  .docs-menu i { font-style: normal; font-family: var(--f-mono); font-size: 14px; flex: none; transition: transform .15s ease; }
  .docs-menu[aria-expanded="true"] i { transform: rotate(180deg); }
  .js .docs-index__head { display: none; }
  .js .docs-index { display: none; }
  .js .docs-index.is-open { display: block; }
  .docs-index a { padding: 12px 14px; font-size: 17px; }
}
@media (max-width: 700px) {
  .docs-page .nav__id { display: none; }
  .docs-page .nav { padding: 5px 0; }
}
@media (max-width: 420px) {
  .docs-strip span:last-child { display: none; }
  .docs-mast__tag { box-shadow: 2px 2px 0 var(--fire); padding: 6px 9px 4px; }
  .docs-body { font-size: 17px; }
  .docs-steps > li { grid-template-columns: 46px minmax(0, 1fr); }
  .docs-steps > li::before { font-size: 34px; }
}

/* Wide screens: slightly larger text so the wider column still reads comfortably. */
@media (min-width: 1440px) {
  .docs-body { font-size: 20px; }
  .docs-toc a { font-size: 16px; }
}
