/*
 * Vince Buffalo's Site
 * Clean, reading-focused design with Tufte-style sidenotes
 * Fonts loaded via <link> in head-end.html
 */

/* Safari stacking-context fix for the sticky navbar.
 * Hextra's nav-container is `bg-transparent` and relies on an absolutely-
 * positioned z-index:-1 blur child for its visible white background.
 * In WebKit, that child can escape the parent's stacking context and
 * render below the article body, which is what causes the navbar to look
 * "offset down" with body content showing through where it should be opaque.
 * Forcing an opaque background on the parent itself eliminates the
 * dependence on that fragile child. The blur div's drop-shadow still works. */
.nav-container {
  background: var(--bg);
}
html.dark .nav-container {
  background: var(--bg);
}

/* Editorial disclaimer / affiliation note under the post title.
 * Uses --text-muted so it auto-adapts to light + dark modes. */
.post-disclaimer {
  font-size: 0.88em;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5em;
}
.post-disclaimer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Wide tables / wide text-art code blocks: shrink so they fit without overflow */
.small-code pre,
.small-code pre code {
  font-size: 0.72em;
  line-height: 1.35;
}

/* Light-mode Chroma fills for token classes the bundled stylesheet only
 * styles in dark mode. Used by the camdl client-side highlighter (and by
 * any Chroma block whose class set isn't fully covered upstream). */
.highlight .chroma .k,
.highlight .chroma .kn  { color: #d73a49; }
.highlight .chroma .nf  { color: #6f42c1; font-weight: 700; }
.highlight .chroma .s   { color: #032f62; }
.highlight .chroma .m   { color: #005cc5; }
.highlight .chroma .o   { color: #d73a49; font-weight: 700; }

/* ============================================
   RESET HEXTRA UI
   ============================================ */
/* Hide theme's sidebar elements */
.hextra-sidebar-container,
nav.hextra-sidebar,
.hextra-sidebar-placeholder {
  display: none !important;
}

nav[aria-label="Breadcrumb"],
[class*="breadcrumb"] {
  display: none !important;
}

/* ============================================
   MOBILE NAV - No hamburger, just hide title
   ============================================ */
/* Hide mobile menu element entirely - not needed */
.mobile-menu {
  display: none !important;
}

/* Hide hamburger button - not needed */
.hamburger-menu {
  display: none !important;
}

@media (max-width: 767px) {
  /* Hide site title text on mobile, keep logo */
  nav.hextra-max-navbar-width > a:first-child span {
    display: none !important;
  }

  /* Force nav links to show on mobile (override Hextra's hx:hidden) */
  nav.hextra-max-navbar-width > a {
    display: inline-block !important;
  }

  /* Smaller nav text on mobile */
  nav.hextra-max-navbar-width {
    gap: 0.5rem !important;
  }

  nav.hextra-max-navbar-width > a {
    font-size: 0.9rem !important;
    padding: 0.25rem 0.5rem !important;
  }
}

/* ============================================
   BASE
   ============================================ */
:root {
  --text: #333;
  --text-muted: #666;
  --text-light: #888;
  --bg: #fcfcfc;
  --bg-code: #f4f4f4;
  --border: #e0e0e0;
  --link: #1a73a7;
  --link-hover: #0d4a6f;
  --accent: #b33;
  --heading: #222;
  --blockquote-text: #555;
  --callout-bg: #eef4e9;
  --callout-border: #d4e3ca;
  --callout-accent: #84a86c;
}

/* ============================================
   DARK MODE
   Uses Hextra's .dark class toggle (handles system preference via JS)
   ============================================ */

html.dark {
  --text: #d4d4d4;
  --text-muted: #999;
  --text-light: #777;
  --bg: #181818;
  --bg-code: #222;
  --border: #333;
  --link: #7eb8da;
  --link-hover: #a0d0f0;
  --accent: #d88;
  --heading: #e8e8e8;
  --blockquote-text: #aaa;
  --callout-bg: #1a221b;
  --callout-border: #2d3b2e;
  --callout-accent: #80a76f;
}

html.dark,
html.dark body {
  background-color: #181818 !important;
  color: #d4d4d4 !important;
}

html.dark main,
html.dark .hextra-content,
html.dark article {
  background-color: #181818 !important;
}

html.dark .nav-container {
  background: #181818 !important;
  border-bottom: 1px solid #333 !important;
}

html.dark .nav-container-blur {
  background: #181818 !important;
  box-shadow: none !important;
}

html.dark nav {
  background: #181818 !important;
}

html.dark footer,
html.dark .hextra-custom-footer {
  background: #181818 !important;
  border-top: 1px solid #333 !important;
}

html.dark h1, html.dark h2, html.dark h3,
html.dark h4, html.dark h5, html.dark h6 {
  color: #e8e8e8 !important;
}

html.dark blockquote {
  color: #aaa !important;
  border-left-color: #444 !important;
}

html.dark .pub-thumb {
  border: 1px solid #444 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

html.dark .post-image {
  border-color: #444 !important;
}

html.dark a {
  color: #7eb8da;
}

html.dark a:hover {
  color: #a0d0f0;
}

html.dark code {
  background: #252525 !important;
  color: #d4d4d4 !important;
}

html.dark pre {
  background: #1e1e1e !important;
  border: 1px solid #333;
}

html.dark pre code {
  background: transparent !important;
}

/* TOC styling */
.hextra-toc,
.hextra-toc * {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.hextra-toc {
  background: var(--bg) !important;
}

html.dark .hextra-toc {
  background: #181818 !important;
}

html.dark :not(pre) > code {
  background: #2a2a2a !important;
}

body {
  font-family: 'Alegreya Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  /* rem, not px: 20px at the browser default, and it follows a reader's own
     default-font-size setting (px would ignore it). */
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   LAYOUT
   ============================================ */
.homepage {
  max-width: 850px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.blog-archive,
.post,
.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  /* Article sits inside a flex container; without this, wide children
   * (code blocks, long inline links) force it past the viewport on mobile. */
  min-width: 0;
}

/* Wider layout for about and pubs pages */
.page-about .page-content,
.page-pubs .page-content {
  max-width: 800px;
}

/* Page styling */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

/* Two classes, so these beat `article.page` below, which otherwise
   wins and holds these pages at 680px. */
article.page.page-about,
article.page.page-pubs,
article.page.page-papers {
  max-width: 800px;
}

/* Papers page: style like blog */
.page-papers h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2rem 0 1rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}

.page-papers h2:first-of-type {
  margin-top: 1rem;
}

.page-papers .pub-card {
  margin-bottom: 1.5rem;
}

.page-papers .pub-card {
  flex-direction: column;
}

.page-papers .pub-card .post-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  max-height: 300px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.page-papers .pub-card .post-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.page-papers .pub-card .post-info .pub-citation {
  margin: 0;
  line-height: 1.6;
}

/* Book page needs to be wide for side-by-side layout */
article.page-book {
  max-width: 1100px !important;
}

article.page-book .page-content {
  max-width: none !important;
}

/* Title starts where the book column below it starts. */
article.page-book .page-header {
  max-width: 1000px;
  margin: 0 auto 1rem;
}

article.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

article.page .page-header {
  margin-bottom: 1rem;
}

article.page .page-title {
  font-size: 1.8rem;
  line-height: 1.2;
  margin: 0;
}

article.page .page-content {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ============================================
   BOOK PAGE
   ============================================ */
.book-page {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  max-width: 1000px;
  margin: 0 auto;
}

.book-content {
  flex: 1;
  min-width: 0;
}

.book-covers {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 5rem;
}

.book-covers img {
  width: auto;
  height: 330px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.book-covers figure {
  margin: 0;
}

@media (max-width: 800px) {
  .book-page {
    flex-direction: column;
    margin-top: 0;
    gap: 1rem;
    align-items: center;
  }

  .book-covers {
    flex-direction: row;
    position: static;
    justify-content: center;
    align-items: flex-start;
    order: -1;
    gap: 1rem;
    width: 100%;
  }

  .book-covers figure {
    width: 140px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .book-covers img {
    width: auto !important;
    height: 185px !important;
  }

  .book-covers figcaption {
    font-size: 0.75rem;
    text-align: center;
  }

  /* Reduce top padding on book page mobile */
  article.page-book .page-header {
    margin-bottom: 0.5rem;
  }

  .book-content {
    width: 100%;
  }
}

@media (min-width: 1100px) {
  .post,
  article .content {
    max-width: 680px;
    margin-left: calc(50% - 340px - 120px);
    padding-right: 0;
  }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  margin: 2em 0 0.5em;
  color: var(--heading);
}

h1 { font-size: 1.8rem; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.2em; }

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

a:hover {
  border-bottom-color: var(--link);
}

/* Pages (About, Papers, Book) use the site's link style, not the theme's
   underlined primary colour, so links look the same as on Home and in posts. */
.content a {
  color: var(--link);
  text-decoration: none;
}

/* ============================================
   CODE
   ============================================ */
code, pre {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88em;
}

code {
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--bg-code);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 1.5em 0;
}

/* Code blocks in posts: a fixed size independent of the body text. The
   generic `code, pre { 0.88em }` rule above otherwise applies twice to code
   inside a block (pre shrinks, then code shrinks again, to ~12.8px). */
.post-content pre { font-size: 0.91rem; }
.post-content pre code { font-size: inherit; }

/* On desktop, code blocks extend into the empty right margin so long lines
   don't scroll; the prose column keeps its line length. Clears the contents
   sidebar down to a 1100px-wide window. */
@media (min-width: 1100px) {
  .post-content .hextra-code-block { margin-right: -140px; }
}

/* Lists and tables in posts. Posts render in .post-content, not Hextra's
   .content, so the theme's CSS reset strips list markers and table rules
   unless they are restored here. */
.post-content ul { list-style: disc outside; padding-left: 1.4em; margin: 0 0 1.2em; }
.post-content ol { list-style: decimal outside; padding-left: 1.6em; margin: 0 0 1.2em; }
.post-content li { margin: 0.25em 0; }
.post-content li > p { margin: 0; }
.post-content table { border-collapse: collapse; margin: 0 0 1.4em; }
.post-content th { border-bottom: 1.5px solid var(--text-light); text-align: left; }
.post-content td { border-bottom: 1px solid var(--border); vertical-align: top; }
.post-content th, .post-content td { padding: 0.35em 0.75em 0.35em 0; }

pre code {
  background: none;
  padding: 0;
}

/* ============================================
   SIDENOTES (Tufte-style)
   ============================================ */
article {
  counter-reset: sidenote-counter;
}

/* Sidenotes - exclude sidebar-container and book-covers from these styles */
aside:not(.sidebar-container):not(.book-covers) {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

aside:not(.sidebar-container):not(.book-covers) sup {
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.3em;
}

aside:not(.sidebar-container):not(.book-covers) a {
  color: var(--text-muted);
  border-bottom-color: var(--border);
}

/* Footnote refs: Hextra leaves them inheriting body color and unstyled,
   which makes them disappear at sup-size. Color them like links and
   bracket them so they read as a footnote pointer. */
sup a.footnote-ref {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: none;
}
sup a.footnote-ref::before { content: "["; }
sup a.footnote-ref::after  { content: "]"; }
sup a.footnote-ref:hover {
  text-decoration: underline;
}

/* Footnote definitions at the bottom: Hextra/Tailwind preflight strips
   list-style from <ol>, so the numbers don't render. Restore decimal
   numbering for the footnotes block. */
.footnotes ol {
  list-style: decimal outside;
  padding-inline-start: 1.5em;
}
.footnotes ol li {
  padding-inline-start: 0.25em;
}

/* Desktop: margin positioning for sidenotes */
@media (min-width: 1100px) {
  aside:not(.sidebar-container):not(.book-covers) {
    float: right;
    clear: right;
    width: 220px;
    margin-right: -260px;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    padding: 0;
  }
}

/* Mobile: inline block for sidenotes */
@media (max-width: 1099px) {
  aside:not(.sidebar-container):not(.book-covers) {
    display: block;
    margin: 1.5em 0;
    padding: 0.75em 1em;
    background: var(--bg-code);
    border-left: 3px solid var(--border);
    border-radius: 0 4px 4px 0;
  }
}

/* ============================================
   HOMEPAGE
   ============================================ */
.homepage {
  padding-top: 3rem;
}

.bio {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.bio-photo {
  width: 300px;
  height: 300px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.bio-text p {
  margin: 0 0 0.8em;
}

.bio-links {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bio-links a {
  color: var(--text-muted);
}

.recent-posts h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-light);
  margin-bottom: 1rem;
  font-weight: 600;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.35em;
  line-height: 1.3;
}

.post-list time {
  font-size: 0.85rem;
  color: var(--text-light);
  min-width: 4.5rem;
  flex-shrink: 0;
}

.more-link {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================
   BLOG ARCHIVE
   ============================================ */
.blog-archive h1 {
  margin-bottom: 0.5em;
}

.archive-description {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  margin-top: 0;
}

/* First year header after description - tighter spacing */
.blog-archive .year-header:first-of-type {
  margin-top: 1rem;
}

.year-header {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}

.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.post-image {
  flex-shrink: 0;
  width: 130px;
  height: 90px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pubs page uses background images to bypass Hextra's img styles */
.pub-thumb {
  flex-shrink: 0;
  width: 130px;
  height: 90px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
}

.post-info {
  flex: 1;
  min-width: 0;
}

.post-info time {
  font-size: 0.8rem;
  color: var(--text-light);
}

.post-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.2em 0 0.3em;
  line-height: 1.3;
}

.post-info h3 a {
  color: var(--text);
}

.post-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}


/* ============================================
   POST PAGE
   ============================================ */
.post-header {
  margin-bottom: 2.5rem;
}

.post-title {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.post-meta time {
  color: var(--text-light);
}

.reading-time {
  color: var(--text-light);
}

.post-tags a {
  color: var(--text-light);
  margin-left: 0.5em;
}

.post-content {
  position: relative;
}

/* Center images in blog posts */
article img,
.post-content img,
.hextra-content img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.post-nav a {
  color: var(--text-muted);
}

/* ============================================
   FIGURES & IMAGES
   ============================================ */
figure {
  margin: 2em 0;
}

figure img {
  max-width: 100%;
  height: auto;
}

figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5em;
  font-style: italic;
}

figure.fullwidth {
  max-width: none;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Wider-than-column images (Tufte-style) */
figure.wide,
.wide {
  width: 1100px;
  max-width: 90vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 2em 0;
}

figure.wide img,
.wide img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* ============================================
   MISC
   ============================================ */
blockquote {
  margin: 1.5em 0;
  padding-left: 1.5em;
  border-left: 3px solid var(--border);
  color: var(--blockquote-text);
  font-style: italic;
}

/* Block quote with attribution (epigraph / pull quote) — {{< quote >}} */
figure.quote {
  margin: 1.5em 0;
}
figure.quote blockquote {
  margin: 0;
}
figure.quote figcaption {
  padding-left: 1.5em;   /* align the credit under the quote's indent */
  font-style: normal;    /* let <cite> carry the italics, not the whole line */
}
figure.quote figcaption cite {
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Navbar tweaks */
.nav-container,
.nav-container-blur {
  background: var(--bg) !important;
}

/* Navbar link styling */
nav.hextra-max-navbar-width > a {
  font-size: 1.1rem !important;
}

/* Logo and site title - first link in navbar */
nav.hextra-max-navbar-width > a:first-child span {
  font-size: 1.3rem !important;
}

/* No underline on logo/site title link */
nav.hextra-max-navbar-width > a:first-child {
  border-bottom: none !important;
}

nav.hextra-max-navbar-width > a:first-child:hover {
  border-bottom: none !important;
}

/* Taller navbar for logo */
nav.hextra-max-navbar-width {
  height: 4.5rem !important;
  gap: 1.5rem !important;
}

/* Current page indicator handled via JavaScript in head-end.html */

/* Footer */
footer {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

.hextra-custom-footer,
footer > div {
  width: 100%;
  display: flex;
  justify-content: center;
}

.custom-footer-copyright {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
}

/* Footer social icons */
.footer-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.footer-icons .theme-toggle {
  display: flex;
  align-items: center;
}

.footer-icons a {
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
  border-bottom: none;
}

.footer-icons a:hover {
  opacity: 1;
  color: var(--link);
  border-bottom: none;
}

.footer-divider {
  color: var(--border);
  margin: 0 0.25rem;
}

.footer-icons .theme-toggle {
  opacity: 0.7;
  transition: opacity 0.15s;
}

.footer-icons .theme-toggle:hover {
  opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
/* About page photo - no float on narrow screens */
@media (max-width: 768px) {
  .about-photo {
    float: none !important;
    display: block !important;
    margin: 0 auto 1.5em !important;
    width: 250px !important;
  }
}

@media (max-width: 600px) {
  body { font-size: 1.0625rem; }  /* 17px at the browser default */

  .bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .bio-photo {
    width: 250px;
    height: 250px;
  }

  .post-card {
    flex-direction: column;
  }

  .post-image {
    width: 100%;
    height: 160px;
  }
}

/* Block-image figures: render-image.html wraps standalone images in
   <figure> + <figcaption>. Caption is muted and adapts to light/dark
   via --text-muted; left-aligned since captions are often multi-line. */
figure.post-figure {
  margin: 1.75rem 0;
  text-align: center;
}
figure.post-figure img {
  max-width: 100%;
  height: auto;
}
figure.post-figure figcaption {
  margin: 0.6rem auto 0;
  max-width: 42rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: left;
}

/* OCaml toplevel (utop) transcripts: render-codeblock-ocaml.html highlights
   every line as OCaml. Result lines are tagged .ot-out and dimmed with opacity
   so they keep their syntax colors but recede. The "# " prompt is muted and
   not selectable so copied text stays clean. */
.chroma.ocamltop .ot-out {
  opacity: 0.6;
}
.chroma.ocamltop .ot-prompt {
  color: var(--text-muted);
  user-select: none;
}

/* Type-directed OCaml highlighting (tools/ocaml-hl, `make ocaml-hl`). Classes
   come from the type checker, not from regexes. Two axes:
   colour = what the thing is (purple: a function; orange: a value parameter);
   italic = it is a parameter. So a parameter the checker inferred to be a
   function (.oc-parf) is purple italic. The defining occurrence of a
   function name is bold. */
.highlight .chroma .oc-fdef { color: #6f42c1; font-weight: 700; }
.highlight .chroma .oc-fn   { color: #6f42c1; }
.highlight .chroma .oc-par  { color: #c24e00; font-style: italic; }
.highlight .chroma .oc-parf { color: #6f42c1; font-style: italic; }
.highlight .chroma .oc-lbl  { color: #c24e00; opacity: 0.75; }
.highlight .chroma .oc-ctor { color: #22863a; }
.highlight .chroma .oc-ty   { color: #1b7c83; }
.highlight .chroma .oc-mod  { color: #6a737d; }
html.dark .highlight .chroma .oc-fdef,
html.dark .highlight .chroma .oc-fn,
html.dark .highlight .chroma .oc-parf { color: #b392f0; }
html.dark .highlight .chroma .oc-par,
html.dark .highlight .chroma .oc-lbl  { color: #ffab70; }
html.dark .highlight .chroma .oc-ctor { color: #85e89d; }
html.dark .highlight .chroma .oc-ty   { color: #56c8d8; }
html.dark .highlight .chroma .oc-mod  { color: #959da5; }

/* Textbook-style callout / aside box ({{< box >}} shortcode): a light-tinted,
   bordered region for digressions, wide enough for code (unlike the margin
   asides). A left accent rule signals "aside." Code blocks inside drop back to
   the page background so they stay legible against the tint. Light/dark via vars. */
.callout-box {
  margin: 1.75rem 0;
  padding: 0.9rem 1.25rem;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-left: 3px solid var(--callout-accent);
  border-radius: 6px;
}
.callout-box-title {
  margin: 0 0 0.7rem;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  color: var(--text);
}
.callout-box > :first-child { margin-top: 0; }
.callout-box > :last-child { margin-bottom: 0; }
/* nested code blocks: contrast against the box tint */
.callout-box pre.chroma {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
}

/* Code blocks: less rounded site-wide (theme's xl radius is too round). Must
   out-specify the theme's .hextra-code-block pre:not(.lntable pre) -> (0,2,2). */
.hextra-code-block pre.chroma:not(.lntable) {
  border-radius: 5px;
}

/* Tabs: panel hugs its content (theme's hx:pt-6 leaves a 24px gap below the bar). */
div.hextra-tabs-panel {
  padding-top: 0.5rem;
}

/* {.verdict} tables (layouts/_markup/render-table.html): cell tint says when a
   mistake is caught. Translucent fills so one set of colours works in both
   light and dark mode. */
.post-content table.verdict td.v-yes  { background: rgba(46, 160, 67, 0.16); }
.post-content table.verdict td.v-late { background: rgba(212, 160, 23, 0.18); }
.post-content table.verdict td.v-no   { background: rgba(218, 54, 51, 0.14); }
.post-content table.verdict th + th,
.post-content table.verdict td + td { padding-left: 0.6em; }

/* Display math wider than the column scrolls inside its own box instead of
   widening the page (MathJax CHTML output on narrow screens). */
mjx-container[display="true"] {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Provenance block at the end of a post (layouts/partials/provenance.html). */
.post-content .provenance { margin: 3rem 0 1rem; padding: 0.8rem 1rem; border: 1px solid var(--border, #ddd); border-radius: 6px; font-size: 0.85rem; color: var(--text-muted, #666); }
.post-content .provenance-title { font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; margin-bottom: 0.4rem; }
.provenance dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 1rem; margin: 0; }
.provenance dt { font-weight: 600; }
.provenance dd { margin: 0; }

/* Always reserve the scrollbar's width, so the header does not shift sideways
   between short pages (no scrollbar) and long ones. */
html { scrollbar-gutter: stable; }
