/* Blog post layout.
   Header is centered. Below it: contents box pinned to the left edge, article centered in the page (800px). Fonts follow the BAIR blog: Merriweather body, Lato headings.
   Under 1230px the contents box collapses above the article. */
:root {
  --accent: #db3e75;
  --text: #26232e;
  --muted: #6b6775;
  --bg: #f5f4ef;
  --border: #e5e2dc;
  --sans: 'Lato', 'Helvetica Neue', Helvetica, sans-serif;
  --fig-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Merriweather', 'PT Serif', Georgia, 'Times New Roman', serif;
  --col: 800px;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --edge: clamp(16px, 2.5vw, 40px);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.bp { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }

/* top bar */
.bp-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px var(--edge); font-size: 15px; }
.bp-home { color: var(--text); font-weight: 650; text-decoration: none; }
.bp-top nav { display: flex; gap: 20px; }
.bp-top nav a { color: var(--muted); text-decoration: none; }
.bp-top nav a:hover, .bp-top nav a.on { color: var(--accent); }

/* header (centered) */
.bp-head { max-width: 860px; margin: 28px auto 44px; padding: 0 24px; text-align: center; }
.bp-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.15rem); line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 18px; font-weight: 900; text-wrap: balance; }
.bp-sub { font-size: 1.05rem; color: var(--muted); margin: -6px 0 16px; line-height: 1.45; }
.bp-authors { font-size: 17px; line-height: 1.7; }
.bp-authors a { color: var(--accent); text-decoration: none; }
.bp-authors a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bp-au { white-space: nowrap; }
.bp-eq { font-size: .8em; margin-left: 2px; color: var(--muted); }
.bp-meta { margin-top: 4px; font-size: 15px; color: var(--muted); display: flex; justify-content: center; gap: 14px; }
.bp-eqnote { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.bp-eqnote sup { font-size: 1em; vertical-align: baseline; }
.bp-links { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.bp-links a, .bp-links .off { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 700; color: var(--text); text-decoration: none; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; }
.bp-links a:hover { border-color: var(--accent); color: var(--accent); }
.bp-links .off { color: #a6a2ae; background: transparent; border-style: dashed; cursor: default; }

/* three columns: contents | article | empty, so the article sits in the middle of the page */
.bp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--col)) minmax(0, 1fr); column-gap: 32px; padding: 0 var(--edge) 96px; }
.bp-toc { grid-column: 1; justify-self: start; width: 176px; align-self: start; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.bp-article { grid-column: 2; }
.bp-toc-box { font-size: 14px; line-height: 1.45; }
.bp-toc-box summary { font-weight: 650; cursor: pointer; list-style: none; color: var(--text); font-size: 12.5px; letter-spacing: .02em; padding-left: 14px; margin-bottom: 8px; }
.bp-toc-box summary::-webkit-details-marker { display: none; }
.bp-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.bp-toc li a { display: block; padding: 5px 0 5px 13px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.bp-toc li.sub a { padding-left: 26px; font-size: 13px; }
.bp-toc li a:hover { color: var(--text); }
.bp-toc li a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* body text: serif for reading, sans for headings */
.bp-content { font-family: var(--serif); font-weight: 300; font-size: 16.5px; line-height: 1.75; }
.bp-content > :first-child { margin-top: 0; }
.bp-content h2, .bp-content h3 { font-family: var(--sans); color: var(--text); scroll-margin-top: 20px; }
.bp-content h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.005em; margin: 2.4em 0 .6em; font-weight: 900; }
.bp-content h3 { font-size: 1.1rem; line-height: 1.3; margin: 1.9em 0 .5em; font-weight: 900; }
.bp-content p { margin: 0 0 1.1em; }
.bp-content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(219,62,117,.35); }
.bp-content a:hover { border-bottom-color: var(--accent); }
.bp-content ul, .bp-content ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.bp-content li { margin: .1em 0; line-height: 1.6; }
.bp-content li > p { margin: 0; }
.bp-content strong { font-weight: 700; }
.bp-content blockquote { margin: 1.4em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--border); color: #4a4655; }
.bp-content blockquote.tldr { font-family: var(--sans); font-size: 15.5px; line-height: 1.6; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; color: var(--text); }
.bp-content blockquote.tldr p:last-child { margin-bottom: 0; }
.bp-content img { max-width: 100%; height: auto; border-radius: 8px; }
.bp-content figure { margin: 1.8em 0; }
.bp-content figcaption { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.bp-content hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.bp-content code { font-family: var(--mono); font-size: .84em; background: #ece9e0; padding: .12em .38em; border-radius: 5px; }
.bp-content pre { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.55; margin: 1.4em 0; }
.bp-content pre code { background: none; padding: 0; font-size: inherit; }
.bp-content table { font-family: var(--sans); border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 1.4em 0; }
.bp-content th, .bp-content td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.bp-content th { font-weight: 650; }
.bp-content .footnotes { font-size: 14px; line-height: 1.5; color: #4a4655; margin-top: 3em; }
.bp-content .footnotes hr { margin-bottom: 1em; }
.bp-content .footnotes li { margin: .15em 0; line-height: 1.5; }
.bp-content sup a { border-bottom: 0; }

/* references: small and tight; in-text (Name, Year) links jump here */
.bp-content ul.refs { list-style: none; padding-left: 0; font-family: var(--sans); font-weight: 400; font-size: 13px; line-height: 1.45; color: #4a4655; }
.bp-content ul.refs li { margin: 0 0 .35em; padding-left: 1.2em; text-indent: -1.2em; line-height: 1.45; scroll-margin-top: 20px; border-radius: 4px; transition: background-color .4s; }
.bp-content ul.refs li:target { background: rgba(219,62,117,.12); }
.bp-content a[href^="#ref-"] { color: inherit; border-bottom: 0; background: rgba(219,62,117,.1); padding: 0 .15em; border-radius: 3px; }
.bp-content a[href^="#ref-"]:hover { background: rgba(219,62,117,.22); }

/* color macros for the markdown: **word**{: .pk} */
.bp-content .pk { color: var(--accent); }
.bp-content [class^="hl-"] { font-weight: inherit; padding: .04em .3em; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.bp-content .hl-rel { background: #bbbbbb55; }
.bp-content .hl-lic { background: #edb64766; }
.bp-content .hl-ans { background: #a3cc8f77; }
.bp-content .hl-clo { background: #eedd8877; }
.bp-content .hl-rou { background: #ee886644; }
.bp-content .rt-user { color: #3f6be0; }
.bp-content .rt-env { color: #d93a74; }
.bp-content .rt-infer { color: #d9830f; }

/* animated figures use the sans face and may extend slightly past the column */
.bp-content .soi-fig { margin: 2em 0; font-family: var(--fig-sans); font-weight: 400; }
@media (min-width: 1230px) { .bp-content .soi-fig { margin-left: -28px; margin-right: -28px; } }
/* wide figure: breaks out of the text column, stays centered on it */
@media (min-width: 1230px) {
  .bp-content .soi-fig[data-fig="props"], .bp-content .soi-fig[data-fig="plots"], .bp-content .soi-fig[data-fig="sample"], .bp-content .soi-fig[data-fig="gen"], .bp-content .soi-fig[data-fig="human"] { position: relative; left: 50%; transform: translateX(-50%); margin-left: 0; margin-right: 0; width: clamp(800px, calc(100vw - 16px - 2 * (var(--edge) + 208px)), 1040px); }
}

.bp-foot { margin-top: 4em; padding-top: 1.2em; border-top: 1px solid var(--border); font-family: var(--sans); font-size: 14px; }
.bp-foot a { color: var(--muted); text-decoration: none; }
.bp-foot a:hover { color: var(--accent); }

/* narrow screens: contents box moves above the post */
@media (max-width: 1229px) {
  .bp-wrap { grid-template-columns: minmax(0, var(--col)); justify-content: center; row-gap: 20px; }
  .bp-toc, .bp-article { grid-column: 1; }
  .bp-toc { position: static; max-height: none; width: auto; }
  .bp-toc-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
  .bp-toc-box summary { padding-left: 0; margin-bottom: 0; }
  .bp-toc-box[open] summary { margin-bottom: 8px; }
}
@media (max-width: 600px) {
  .bp-head { margin-top: 12px; }
  .bp-content { font-size: 16.5px; }
}

/* scanned table figure (see _includes/peterson-table.html) */
.bp-content .tbl-fig { margin: 1.8em auto; font-family: var(--sans); text-align: center; }
.bp-content .tbl-fig img { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.bp-content .tbl-fig figcaption { text-align: center; }

/* justified body text; headings, TL;DR and captions stay left or centered */
@media (min-width: 601px) {
  .bp-content p, .bp-content li { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }
  .bp-content blockquote.tldr p, .bp-content .soi-fig p, .bp-content .soi-fig li { text-align: left; hyphens: manual; }
}
