/* Article pages only (matches your DOM: #quarto-content has page-layout-article + page-navbar) */
#quarto-content.page-layout-article.page-navbar {
  padding-top: 48px !important; /* adjust */
}

/* Optional: a bit tighter on mobile */
@media (max-width: 992px) {
  #quarto-content.page-layout-article.page-navbar {
    padding-top: 32px !important;
  }
}

/* Optional: prevent in-page anchor jumps from hiding under the fixed navbar */
#quarto-document-content h1,
#quarto-document-content h2,
#quarto-document-content h3,
#quarto-document-content h4 {
  scroll-margin-top: 96px; /* tune if needed */
}

/* =========================================================
   3) FUTURE-PROOF DARK CARD UTILITY CLASS
   ========================================================= */

.dark-card {
  background: #0B1220;
  color: #E5E7EB;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
}

.dark-card a { color: #38BDF8; }
.dark-card a:hover { color: #FACC15; }

.dark-card .text-muted,
.dark-card small {
  color: rgba(229,231,235,0.82) !important;
}

/* =========================================================
   2) CITATION PANEL VISIBILITY FIX
   ========================================================= */

/* Quarto citation appendix - fix text visibility on dark backgrounds */
#quarto-appendix.default .quarto-appendix-heading,
#quarto-appendix.default .quarto-appendix-contents,
#quarto-appendix.default p,
#quarto-appendix.default span,
.quarto-appendix-citeas,
.quarto-appendix-bibtex,
#quarto-citation,
#quarto-citation * {
  color: #E5E7EB !important; /* light gray text */
}

/* Citation section headings */
#quarto-appendix.default .quarto-appendix-heading {
  color: #F3F4F6 !important;
  font-weight: 600;
}

/* "BibTeX citation:" and "For attribution..." labels */
#quarto-appendix.default .quarto-appendix-secondary-label,
.quarto-appendix-bibtex summary,
.quarto-appendix-citeas::before {
  color: rgba(229,231,235,0.85) !important;
}

/* If your citation block has a wrapper class, target it.
   Replace .citation-block with your actual wrapper if different. */

.citation-block,
.citation-block * {
  color: #E5E7EB;
}

.citation-block .text-muted,
.citation-block .secondary,
.citation-block small {
  color: rgba(229,231,235,0.82) !important; /* readable muted */
}

/* Links on dark */
.citation-block a {
  color: #38BDF8 !important; /* cyan */
  text-decoration: underline;
}
.citation-block a:hover {
  color: #FACC15 !important; /* yellow */
}

/* =========================================================
   1) QUARTO CELL OUTPUT VISIBILITY FIX (dark output cards)
   ========================================================= */

/* If you wrap outputs in a dark box, you MUST set foreground too */
.cell-output, 
.cell-output pre, 
.cell-output code,
.cell-output-stdout pre,
.cell-output-stderr pre {
  color: #E5E7EB !important; /* light gray */
}

/* If you style the output background yourself, keep it consistent */
.cell-output pre,
.cell-output-stdout pre,
.cell-output-stderr pre {
  background: #0B1220 !important; /* deep navy */
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 14px;
  padding: 14px 16px;
  overflow-x: auto;
}

/* ASCII tables (Polars text tables) live in <pre> — make lines readable */
.cell-output pre {
  white-space: pre;
}

/* HTML tables produced in outputs (pandas/polars HTML, etc.) */
.cell-output table {
  color: #E5E7EB !important;
  background: transparent !important;
  border-color: rgba(255,255,255,0.12) !important;
}

.cell-output table th {
  color: #F3F4F6 !important;
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

.cell-output table td {
  color: #E5E7EB !important;
  background: rgba(255,255,255,0.02) !important;
  border-color: rgba(255,255,255,0.10) !important;
}

/* Scrollbar (optional; improves perceived polish on dark blocks) */
.cell-output pre::-webkit-scrollbar {
  height: 10px;
}
.cell-output pre::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

/* =========================================================
   4) INLINE CODE VISIBILITY FIX (ALL CONTEXTS)
   ========================================================= */

/* 
 * COMPREHENSIVE FIX: Target ALL inline code on light backgrounds
 * This applies to: body text, tables, callouts, and any future content
 * Excludes: code inside <pre> blocks (syntax-highlighted code blocks)
 */

/* Base fix for all inline code outside of pre blocks */
body code:not(pre code),
article code:not(pre code),
main code:not(pre code),
.content code:not(pre code),
#quarto-content code:not(pre code),
#quarto-document-content code:not(pre code) {
  background: rgba(6, 182, 212, 0.15) !important; /* light teal background */
  color: #0e7490 !important; /* dark teal text */
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
  font-weight: 500 !important;
}

/* Markdown tables - inline code in table cells */
table code:not(pre code),
.table code:not(pre code),
table td code,
table th code {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #0e7490 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
  font-weight: 500 !important;
}

/* Callout boxes - all types */
.callout code:not(pre code),
.callout-tip code:not(pre code),
.callout-note code:not(pre code),
.callout-important code:not(pre code),
.callout-warning code:not(pre code),
.callout-caution code:not(pre code) {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #0e7490 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
  font-weight: 500 !important;
}

/* Paragraphs and general text content */
p code:not(pre code),
li code:not(pre code),
span code:not(pre code),
div:not(.sourceCode) > code,
.quarto-appendix code:not(pre code) {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #0e7490 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
  font-weight: 500 !important;
}

/* Headers with inline code */
h1 code:not(pre code),
h2 code:not(pre code),
h3 code:not(pre code),
h4 code:not(pre code),
h5 code:not(pre code),
h6 code:not(pre code) {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #0e7490 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
}

/* EXCEPTION: Preserve dark styling for code inside dark containers */
.dark-card code:not(pre code),
.cell-output code:not(pre code),
.sourceCode code,
pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  font-weight: inherit !important;
}