/* ============================================
   THEME — inspired by sta210-s22.github.io
   ============================================ */

/* --- Bootstrap Color Overrides --- */
:root {
  --bs-primary: #166534;
  --bs-primary-rgb: 22, 101, 52;
  --bs-link-color: #166534;
  --bs-link-hover-color: #14532D;
}

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&family=PT+Sans:wght@400;700&family=Inter:wght@400;500;600&display=swap');

/* --- Body & Typography --- */
body {
  font-family: "PT Sans", sans-serif;
  font-size: 1.05rem;
  color: #2c2c2c;
  background-color: #ffffff;
  line-height: 1.7;
}

h1, h2, h3, h4 {
  color: #166534;
  font-weight: 600;
  font-family: "Nunito", sans-serif;
}

h2 {
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.3rem;
  margin-top: 2rem;
}

/* --- Links --- */
a {
  color: #166534 !important;
}

a:hover {
  color: #14532D !important;
  text-decoration: underline;
}

/* --- Navigation --- */
.navbar {
  background-color: #166534 !important;
}

.navbar-brand {
  color: #ffffff !important;
  font-weight: 600;
}

.navbar-brand:hover {
  color: #bbf7d0 !important;
}

.navbar-nav .nav-link {
  color: #ffffff !important;
}

.navbar-nav .nav-link:hover {
  color: #bbf7d0 !important;
}

.navbar-nav .dropdown-menu {
  background-color: #ffffff;
  border: 1px solid #166534;
}

.navbar-nav .dropdown-item {
  color: #166534 !important;
}

.navbar-nav .dropdown-item:hover {
  background-color: #f0fdf4 !important;
  color: #14532D !important;
}

/* Navbar items are left-aligned via _quarto.yml (navbar: left) */

/* --- Sidebar --- */
.sidebar, .sidebar-navigation {
  background-color: #f6fdf9 !important;
  border-right: 1px solid #d1fae5;
}

.sidebar-title {
  color: #166534 !important;
  font-weight: 600;
  background-color: #f0fdf4 !important;
  padding: 0.75rem 1rem;
  margin-bottom: 0;
  border-bottom: 1px solid #d1fae5;
}

.sidebar-item a {
  color: #166534 !important;
  padding: 0.5rem 1rem;
  display: block;
  text-decoration: none;
}

.sidebar-item a:hover {
  color: #14532D !important;
  background-color: #f0fdf4 !important;
}

.sidebar-item.active > a {
  color: #14532D !important;
  background-color: #dcfce7 !important;
  font-weight: 600;
}

a.sidebar-link.active {
  color: #14532D !important;
  background-color: #dcfce7 !important;
  font-weight: 600;
  border-left: 3px solid #166534;
}

.sidebar-item-container {
  border-bottom: 1px solid #f0f0f0;
}

/* --- Buttons --- */
.btn-primary {
  background-color: #166534 !important;
  border-color: #166534 !important;
}

.btn-primary:hover {
  background-color: #14532D !important;
  border-color: #14532D !important;
}

/* --- TOC (Right Sidebar) --- */
#TOC {
  font-size: 0.9rem;
  border-left: 2px solid #dee2e6;
  padding-left: 0.75rem;
  background-color: transparent !important;
}

#TOC a {
  color: #555 !important;
}

#TOC a:hover {
  color: #166534 !important;
}

.toc-right {
  background-color: transparent !important;
}

.sidebar-toc {
  background-color: transparent !important;
}

.page-columns .margin-sidebar {
  background-color: transparent !important;
}

/* --- Code Blocks --- */
pre {
  background-color: #f5f7fa;
  border: 1px solid #e3e8ef;
  border-radius: 4px;
  font-size: 0.875rem;
  padding: 1rem;
}

code {
  font-size: 0.875em;
}

:not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background-color: #f0fdf4;
  color: #166534;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid #e3e8ef;
}

pre code {
  color: inherit;
  background-color: transparent;
  border: none;
  padding: 0;
}

/* --- Blockquotes (citations) --- */
blockquote {
  border-left: 4px solid #166534;
  padding-left: 1rem;
  color: #555;
  background-color: #f0fdf4;
  border-radius: 0 4px 4px 0;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}

/* --- Tables --- */
table {
  font-size: 0.95rem;
}

thead {
  background-color: #166534 !important;
  color: #ffffff !important;
}

/* --- Callouts --- */
.callout {
  border-radius: 4px;
  margin: 1.5rem 0;
}

.callout-note {
  border-left: 4px solid #166534;
}

.callout-tip {
  border-left: 4px solid #166534;
  background-color: #f0fdf4;
}

.callout-tip .callout-title {
  background-color: #dcfce7;
  color: #166534;
}

.callout-tip .callout-icon::before {
  background-image: none;
}

.callout-tip .callout-title-container {
  color: #166534;
  font-weight: 600;
}

/* --- Footer --- */
.nav-footer {
  background-color: #166534 !important;
  color: #bbf7d0 !important;
  font-size: 0.85rem;
}

.nav-footer a {
  color: #bbf7d0 !important;
}

.nav-footer a:hover {
  color: #ffffff !important;
}

/* --- Full-width layout --- */
.page-columns {
  max-width: 100% !important;
}

/* --- Plotly centering --- */
.plotly {
  display: flex;
  justify-content: center;
}

.js-plotly-plot {
  margin: 0 auto;
}
.quarto-title-banner {
  background-color: #166534 !important;
  color: #ffffff !important;
}

/* YAML description feeds meta/OG tags only; hide duplicate under page title */
#title-block-header .description {
  display: none;
}

.page-navigation a {
  color: #166534 !important;
}

.page-navigation a:hover {
  color: #14532D !important;
}

/* --- AI-Generated Content Disclaimer --- */
.ai-generated-badge {
  display: block;
  background-color: #f0fdf4;
  color: #166534;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border-left: 4px solid #166534;
  border-radius: 0 4px 4px 0;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

.needs-review-pill {
  display: inline-block;
  background-color: #d1fae5;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-right: 0.5rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}


/* ============================================
   WARM THEME (orange/gold)
   ============================================ */
.theme-warm {
  --bs-primary: #B8620B;
  --bs-primary-rgb: 184, 98, 11;
  --bs-link-color: #B8620B;
  --bs-link-hover-color: #8B4513;
}

.theme-warm body {
  background-color: #FFFBF5;
  color: #3D2B1F;
}

.theme-warm h1,
.theme-warm h2,
.theme-warm h3,
.theme-warm h4 {
  color: #6B3A0A;
}

.theme-warm h2 {
  border-bottom-color: #E8D5C0;
}

.theme-warm a {
  color: #B8620B !important;
}

.theme-warm a:hover {
  color: #8B4513 !important;
}

.theme-warm .navbar {
  background-color: #8B4513 !important;
}

.theme-warm .navbar-brand:hover,
.theme-warm .navbar-nav .nav-link:hover {
  color: #FFD700 !important;
}

.theme-warm .navbar-nav .dropdown-menu {
  border-color: #B8620B;
}

.theme-warm .navbar-nav .dropdown-item {
  color: #6B3A0A !important;
}

.theme-warm .navbar-nav .dropdown-item:hover {
  background-color: #FFF3E0 !important;
  color: #8B4513 !important;
}

.theme-warm .sidebar,
.theme-warm .sidebar-navigation {
  background-color: #FFF8F0 !important;
  border-right-color: #E8D5C0;
}

.theme-warm .sidebar-title {
  color: #6B3A0A !important;
  background-color: #FFF3E0 !important;
  border-bottom-color: #E8D5C0;
}

.theme-warm .sidebar-item a {
  color: #6B3A0A !important;
}

.theme-warm .sidebar-item a:hover {
  background-color: #FFF3E0 !important;
  color: #8B4513 !important;
}

.theme-warm .sidebar-item.active > a {
  background-color: #FFE8CC !important;
  color: #8B4513 !important;
}

.theme-warm a.sidebar-link.active {
  background-color: #FFE8CC !important;
  color: #8B4513 !important;
  font-weight: 600;
  border-left: 3px solid #B8620B;
}

.theme-warm .btn-primary {
  background-color: #B8620B !important;
  border-color: #B8620B !important;
}

.theme-warm .btn-primary:hover {
  background-color: #8B4513 !important;
  border-color: #8B4513 !important;
}

.theme-warm pre {
  background-color: #FFF8F0;
  border-color: #E8D5C0;
}

.theme-warm blockquote {
  border-left-color: #B8620B;
  background-color: #FFF3E0;
}

.theme-warm thead {
  background-color: #8B4513 !important;
}

.theme-warm .callout-note {
  border-left-color: #B8620B;
}

.theme-warm .callout-tip {
  border-left-color: #B8620B;
  background-color: #FFF3E0;
}

.theme-warm .callout-tip .callout-title {
  background-color: #FFE8CC;
  color: #6B3A0A;
}

.theme-warm .callout-tip .callout-title-container {
  color: #6B3A0A;
}

.theme-warm .nav-footer {
  background-color: #8B4513 !important;
  color: #FFD700 !important;
}

.theme-warm .nav-footer a {
  color: #FFD700 !important;
}

.theme-warm .nav-footer a:hover {
  color: #ffffff !important;
}

.theme-warm .quarto-title-banner {
  background-color: #8B4513 !important;
}

.theme-warm .page-navigation a {
  color: #B8620B !important;
}

.theme-warm .page-navigation a:hover {
  color: #8B4513 !important;
}

.theme-warm .ai-generated-badge {
  background-color: #FFF3E0;
  color: #6B3A0A;
  border-left-color: #B8620B;
}

.theme-warm .needs-review-pill {
  background-color: #FFE8CC;
  color: #6B3A0A;
}

.theme-warm #TOC a:hover {
  color: #B8620B !important;
}


/* Warm theme: navbar brand white */
.theme-warm .navbar-brand {
  color: #ffffff !important;
}

/* Warm theme: callout-tip (answer sections) in gold instead of green */
.theme-warm .callout-tip {
  border-left-color: #D4A017 !important;
  background-color: #FFF8E1 !important;
}

.theme-warm .callout-tip .callout-title {
  background-color: #FFECB3 !important;
  color: #6B3A0A !important;
}

.theme-warm .callout-tip .callout-title-container {
  color: #6B3A0A !important;
}

.theme-warm .callout-tip .callout-icon::before {
  color: #D4A017 !important;
}

.theme-warm div.callout-tip.callout {
  border-left-color: #D4A017 !important;
}

.theme-warm div.callout-tip .callout-header {
  background-color: #FFECB3 !important;
}


/* ============================================
   MIDNIGHT THEME (dark with teal/cyan accents)
   A deep, immersive dark theme inspired by
   late-night coding sessions and aurora borealis.
   ============================================ */
.theme-midnight {
  --bs-primary: #5EEAD4;
  --bs-primary-rgb: 94, 234, 212;
  --bs-link-color: #5EEAD4;
  --bs-link-hover-color: #99F6E4;
}

.theme-midnight body {
  background-color: #0F172A;
  color: #CBD5E1;
}

.theme-midnight h1,
.theme-midnight h2,
.theme-midnight h3,
.theme-midnight h4 {
  color: #E2E8F0;
}

.theme-midnight h2 {
  border-bottom-color: #334155;
}

.theme-midnight a {
  color: #5EEAD4 !important;
}

.theme-midnight a:hover {
  color: #99F6E4 !important;
}

.theme-midnight .navbar {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  border-bottom: 1px solid #334155;
}

.theme-midnight .navbar-brand {
  color: #5EEAD4 !important;
  font-weight: 600;
}

.theme-midnight .navbar-brand:hover {
  color: #99F6E4 !important;
}

.theme-midnight .navbar-nav .nav-link {
  color: #94A3B8 !important;
}

.theme-midnight .navbar-nav .nav-link:hover {
  color: #5EEAD4 !important;
}

.theme-midnight .navbar-nav .dropdown-menu {
  background-color: #1E293B;
  border: 1px solid #334155;
}

.theme-midnight .navbar-nav .dropdown-item {
  color: #CBD5E1 !important;
}

.theme-midnight .navbar-nav .dropdown-item:hover {
  background-color: #334155 !important;
  color: #5EEAD4 !important;
}

.theme-midnight .sidebar,
.theme-midnight .sidebar-navigation {
  background-color: #1E293B !important;
  border-right: 1px solid #334155;
}

.theme-midnight .sidebar-title {
  color: #E2E8F0 !important;
  background-color: #0F172A !important;
  border-bottom-color: #334155;
}

.theme-midnight .sidebar-item a {
  color: #94A3B8 !important;
}

.theme-midnight .sidebar-item a:hover {
  background-color: #334155 !important;
  color: #5EEAD4 !important;
}

.theme-midnight .sidebar-item.active > a {
  background-color: #334155 !important;
  color: #5EEAD4 !important;
  font-weight: 600;
  border-left: 3px solid #5EEAD4;
}

.theme-midnight a.sidebar-link.active {
  background-color: #334155 !important;
  color: #5EEAD4 !important;
  font-weight: 600;
  border-left: 3px solid #5EEAD4;
}

.theme-midnight .sidebar-item-container {
  border-bottom-color: #334155;
}

.theme-midnight .btn-primary {
  background-color: #5EEAD4 !important;
  border-color: #5EEAD4 !important;
  color: #0F172A !important;
}

.theme-midnight .btn-primary:hover {
  background-color: #99F6E4 !important;
  border-color: #99F6E4 !important;
  color: #0F172A !important;
}

.theme-midnight #TOC {
  border-left-color: #334155;
}

.theme-midnight #TOC a {
  color: #64748B !important;
}

.theme-midnight #TOC a:hover {
  color: #5EEAD4 !important;
}

.theme-midnight pre {
  background-color: #1E293B;
  border: 1px solid #334155;
  color: #E2E8F0;
}

.theme-midnight code {
  color: #F472B6;
}

.theme-midnight pre code {
  color: #E2E8F0;
}

.theme-midnight blockquote {
  border-left-color: #5EEAD4;
  background-color: #1E293B;
  color: #94A3B8;
}

.theme-midnight table {
  color: #CBD5E1;
}

.theme-midnight thead {
  background-color: #334155 !important;
  color: #E2E8F0 !important;
}

.theme-midnight tbody tr:nth-child(even) {
  background-color: #1E293B;
}

.theme-midnight .callout-note {
  border-left-color: #5EEAD4;
  background-color: #1E293B;
  color: #CBD5E1;
}

.theme-midnight .callout-tip {
  border-left-color: #FBBF24;
  background-color: #1C1917;
}

.theme-midnight .callout-tip .callout-title {
  background-color: #292524;
  color: #FDE68A;
}

.theme-midnight .callout-tip .callout-title-container {
  color: #FDE68A;
}

.theme-midnight div.callout-tip.callout {
  border-left-color: #FBBF24 !important;
}

.theme-midnight div.callout-tip .callout-header {
  background-color: #292524 !important;
}

.theme-midnight .nav-footer {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  border-top: 1px solid #334155;
  color: #64748B !important;
}

.theme-midnight .nav-footer a {
  color: #5EEAD4 !important;
}

.theme-midnight .nav-footer a:hover {
  color: #99F6E4 !important;
}

.theme-midnight .quarto-title-banner {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #164E63 100%) !important;
  color: #E2E8F0 !important;
}

.theme-midnight .page-navigation a {
  color: #5EEAD4 !important;
}

.theme-midnight .page-navigation a:hover {
  color: #99F6E4 !important;
}

.theme-midnight .ai-generated-badge {
  background-color: #1E293B;
  color: #94A3B8;
  border-left-color: #5EEAD4;
}

.theme-midnight .needs-review-pill {
  background-color: #334155;
  color: #5EEAD4;
}

/* Theme toggle button adapts to midnight */
.theme-midnight #theme-toggle {
  background: #1E293B !important;
  border-color: #334155 !important;
  box-shadow: 0 2px 8px rgba(94, 234, 212, 0.2) !important;
}


/* Midnight theme: fix visibility of text that uses Bootstrap CSS vars */
.theme-midnight {
  --bs-body-color: #CBD5E1;
  --bs-body-bg: #0F172A;
  --bs-secondary-color: #94A3B8;
  --bs-tertiary-color: #64748B;
  --bs-secondary-bg: #334155;
  --bs-border-color: #475569;
  --bs-emphasis-color: #E2E8F0;
}

/* Progress bar text and background in sidebar */
.theme-midnight #section-progress-widget p {
  color: #94A3B8 !important;
}

/* Progress bar: override all inline background styles inside the widget */
.theme-midnight #section-progress-widget div[style] {
  background: #1E293B !important;
}

.theme-midnight #section-progress-widget div[style] > div[style] {
  background: #5EEAD4 !important;
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.5);
}

/* General text elements that might inherit dark-on-dark */
.theme-midnight .text-muted,
.theme-midnight .text-secondary {
  color: #94A3B8 !important;
}

/* Reading time metadata */
.theme-midnight .quarto-title-meta-contents,
.theme-midnight .quarto-title-meta {
  color: #94A3B8 !important;
}

/* Quarto listing cards and descriptions */
.theme-midnight .quarto-listing-default .listing-description,
.theme-midnight .quarto-listing-default .listing-date,
.theme-midnight .quarto-listing-default .listing-categories {
  color: #94A3B8 !important;
}

/* Inputs, selects, form controls */
.theme-midnight input,
.theme-midnight select,
.theme-midnight textarea {
  background-color: #1E293B !important;
  color: #E2E8F0 !important;
  border-color: #475569 !important;
}

/* Pagination */
.theme-midnight .page-link {
  background-color: #1E293B !important;
  color: #5EEAD4 !important;
  border-color: #334155 !important;
}

.theme-midnight .page-link:hover {
  background-color: #334155 !important;
  color: #99F6E4 !important;
}

/* Breadcrumb */
.theme-midnight .breadcrumb-item + .breadcrumb-item::before {
  color: #64748B !important;
}

.theme-midnight .breadcrumb-item.active {
  color: #94A3B8 !important;
}

/* Cards */
.theme-midnight .card {
  background-color: #1E293B !important;
  border-color: #334155 !important;
}

.theme-midnight .card-body {
  color: #CBD5E1 !important;
}

/* Badges */
.theme-midnight .badge {
  background-color: #334155 !important;
  color: #5EEAD4 !important;
}

/* Horizontal rules */
.theme-midnight hr {
  border-color: #334155;
}

/* Table borders */
.theme-midnight table,
.theme-midnight th,
.theme-midnight td {
  border-color: #334155 !important;
}

.theme-midnight td {
  background-color: transparent;
}


/* Midnight theme: give inline SVGs a white background so dark lines remain visible */
.theme-midnight svg {
  background-color: #ffffff;
  border-radius: 6px;
  padding: 8px;
  color-scheme: light !important;
}

.theme-midnight svg * {
  color-scheme: light !important;
}

.theme-midnight svg text {
  fill: #000000 !important;
}

.theme-midnight svg foreignObject div,
.theme-midnight svg foreignObject span {
  color: #000000 !important;
}

/* Exception: do not apply white bg to tiny UI icons or the theme toggle */
.theme-midnight .bi svg,
.theme-midnight .nav-link svg,
.theme-midnight .navbar svg,
.theme-midnight #theme-toggle svg {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}


/* Match callout-tip icon color to the title text color in each theme */

/* Default theme: indigo tint */
.callout-tip .callout-icon-container .callout-icon {
  filter: brightness(0) saturate(100%) invert(10%) sepia(80%) saturate(4000%) hue-rotate(250deg) brightness(80%);
}

/* Warm theme: dark brown/gold tint */
.theme-warm .callout-tip .callout-icon-container .callout-icon {
  filter: brightness(0) saturate(100%) invert(20%) sepia(60%) saturate(2000%) hue-rotate(20deg) brightness(80%);
}

/* Midnight theme: gold/cream tint */
.theme-midnight .callout-tip .callout-icon-container .callout-icon {
  filter: brightness(0) saturate(100%) invert(90%) sepia(30%) saturate(600%) hue-rotate(10deg) brightness(105%);
}


/* Midnight theme: fix callout-note header readability */
.theme-midnight .callout-note .callout-header {
  background-color: #1E293B !important;
}

.theme-midnight .callout-note .callout-title {
  background-color: #1E293B;
  color: #93C5FD;
}

.theme-midnight .callout-note .callout-title-container {
  color: #93C5FD;
}

.theme-midnight .callout-note .callout-icon-container .callout-icon {
  filter: brightness(0) saturate(100%) invert(70%) sepia(30%) saturate(800%) hue-rotate(190deg) brightness(105%);
}

.theme-midnight .callout-note .callout-body {
  color: #CBD5E1;
  background-color: #0F172A;
}

.theme-midnight .callout-note {
  background-color: #0F172A;
  border-color: #334155;
}

/* Midnight theme: fix inline code (IPs, MACs, CLI commands) */
.theme-midnight code {
  color: #5EEAD4 !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.theme-midnight pre code {
  color: #E2E8F0 !important;
  background-color: transparent !important;
}

/* Midnight theme: fix text highlighting (mark/highlight) */
.theme-midnight mark,
.theme-midnight .highlight,
.theme-midnight ::selection {
  background-color: #854D0E;
  color: #FEF3C7;
}

.theme-midnight mark {
  background-color: #5B21B6 !important;
  color: #F5F3FF !important;
}

/* Override inline highlight spans (yellow background set via style attr) */
.theme-midnight span[style*="background-color"] {
  background-color: #5B21B6 !important;
  color: #F5F3FF !important;
}

/* Midnight theme: syntax highlighting overrides for code blocks */
.theme-midnight pre code,
.theme-midnight pre code span {
  color: #E2E8F0 !important;  /* Base: all text light by default */
}
.theme-midnight code span.at { color: #7DD3FC !important; }  /* Attribute - light blue */
.theme-midnight code span.cf { color: #C4B5FD !important; }  /* ControlFlow - lavender */
.theme-midnight code span.cn { color: #FDA4AF !important; }  /* Constant - pink */
.theme-midnight code span.co { color: #6B7280 !important; }  /* Comment - gray */
.theme-midnight code span.dt { color: #67E8F9 !important; }  /* DataType - cyan */
.theme-midnight code span.dv { color: #FCD34D !important; }  /* DecVal - yellow */
.theme-midnight code span.fu { color: #A78BFA !important; }  /* Function - purple */
.theme-midnight code span.kw { color: #F472B6 !important; }  /* Keyword - pink */
.theme-midnight code span.op { color: #E2E8F0 !important; }  /* Operator - light gray */
.theme-midnight code span.sc { color: #34D399 !important; }  /* SpecialChar - green */
.theme-midnight code span.st { color: #86EFAC !important; }  /* String - light green */
.theme-midnight code span.al { color: #FCA5A5 !important; }  /* Alert - red */
.theme-midnight code span.an { color: #6B7280 !important; }  /* Annotation - gray */
.theme-midnight code span.bu { color: #7DD3FC !important; }  /* BuiltIn - light blue */
.theme-midnight code span.ch { color: #86EFAC !important; }  /* Char - green */
.theme-midnight code span.ex { color: #A78BFA !important; }  /* Extension - purple */
.theme-midnight code span.fl { color: #FCD34D !important; }  /* Float - yellow */
.theme-midnight code span.im { color: #7DD3FC !important; }  /* Import - light blue */
.theme-midnight code span.in { color: #6B7280 !important; }  /* Information - gray */
.theme-midnight code span.ot { color: #67E8F9 !important; }  /* Other - cyan */
.theme-midnight code span.pp { color: #F472B6 !important; }  /* Preprocessor - pink */
.theme-midnight code span.ss { color: #FCA5A5 !important; }  /* SpecialString - red */
.theme-midnight code span.va { color: #E2E8F0 !important; }  /* Variable - light gray */
.theme-midnight code span.vs { color: #86EFAC !important; }  /* VerbatimString - green */
.theme-midnight code span.wa { color: #FBBF24 !important; }  /* Warning - amber */


/* ============================================
   RESUME READING BUTTON
   ============================================ */
#resume-reading-container {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-left: 12px;
}

#resume-reading-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255,255,255,0.15);
  color: #fff !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.2s, opacity 0.2s;
  border: 1px solid rgba(255,255,255,0.3);
}

#resume-reading-btn:hover {
  background: rgba(255,255,255,0.28);
  text-decoration: none !important;
}

/* Warm theme */
.theme-warm #resume-reading-btn {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,215,0,0.4);
}

.theme-warm #resume-reading-btn:hover {
  background: rgba(255,215,0,0.2);
}

/* Midnight theme */
.theme-midnight #resume-reading-btn {
  background: rgba(94,234,212,0.1);
  border-color: rgba(94,234,212,0.3);
  color: #5EEAD4 !important;
}

.theme-midnight #resume-reading-btn:hover {
  background: rgba(94,234,212,0.2);
}

/* Hide on very small screens to avoid navbar overflow */
@media (max-width: 576px) {
  #resume-reading-container {
    display: none !important;
  }
}


/* ============================================
   SEARCH SCOPE FILTER
   ============================================ */
#search-scope-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  flex-wrap: wrap;
}

.search-scope-pill {
  padding: 3px 12px;
  border-radius: 14px;
  border: 1px solid #dee2e6;
  background: #fff;
  color: #555;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}

.search-scope-pill:hover {
  border-color: #166534;
  color: #166534;
}

.search-scope-pill.active {
  background: #166534;
  border-color: #166534;
  color: #fff;
}

/* Warm theme */
.theme-warm #search-scope-bar {
  background: #FFF8F0;
  border-bottom-color: #E8D5C0;
}

.theme-warm .search-scope-pill {
  border-color: #E8D5C0;
  color: #6B3A0A;
}

.theme-warm .search-scope-pill:hover {
  border-color: #B8620B;
  color: #B8620B;
}

.theme-warm .search-scope-pill.active {
  background: #B8620B;
  border-color: #B8620B;
  color: #fff;
}

/* Midnight theme */
.theme-midnight #search-scope-bar {
  background: #1E293B;
  border-bottom-color: #334155;
}

.theme-midnight .search-scope-pill {
  background: #0F172A;
  border-color: #334155;
  color: #94A3B8;
}

.theme-midnight .search-scope-pill:hover {
  border-color: #5EEAD4;
  color: #5EEAD4;
}

.theme-midnight .search-scope-pill.active {
  background: #5EEAD4;
  border-color: #5EEAD4;
  color: #0F172A;
}


/* Reading time info tooltip */
.rt-info .rt-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 0;
  background: #333;
  color: #fff;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: normal;
  width: 220px;
  text-align: center;
  z-index: 9999;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
  pointer-events: none;
}

.rt-info:hover .rt-tooltip {
  visibility: visible;
  opacity: 1;
  transition-delay: 0.02s;
}


/* --- Figure captions --- */
figcaption {
  text-align: center;
}


