@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ==========================================================================
   HPC & AI Infra Technical Publication Design System
   Inspired by Anthropic Claude Research, Stripe Press & Linear.app Aesthetics
   Refined typography, warm ivory palette, macOS code blocks, and crisp diagrams
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Root Variables & Theme Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand Accent Tokens */
  --primary-accent: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --terracotta: #cc6644;
  --terracotta-hover: #b35536;
  --terracotta-light: #fbf5f2;
  
  /* Neutral Palette (Warm Anthropic Light) */
  --bg-main: #fafaf7;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f3ef;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-strong: #0f172a;
  --border-light: rgba(15, 23, 42, 0.08);
  --border-focus: rgba(37, 99, 235, 0.4);

  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --card-radius: 12px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, monospace;
}

/* Dark Mode Tokens (Deep Space Slate) */
body.quarto-dark {
  --bg-main: #0d1117;
  --bg-surface: #161b22;
  --bg-subtle: #1f242c;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-strong: #f8fafc;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(96, 165, 250, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   2. Global Canvas & Typography
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.78;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Optimal Prose Measure on Large Displays */
main.content {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 1.5rem;
  padding-bottom: 4rem;
}

/* Headings Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-strong);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 2.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

h1.title {
  font-size: 2.45rem;
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-bottom: 0.45rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.quarto-dark h1.title {
  background: linear-gradient(135deg, #f8fafc 0%, #93c5fd 55%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p.subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.8rem;
  line-height: 1.5;
}

h2 {
  font-size: 1.58rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.26rem;
  margin-top: 1.8rem;
}

h4 {
  font-size: 1.08rem;
  font-weight: 650;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   3. Frosted Glass Navbar & Modern Sidebar
   -------------------------------------------------------------------------- */
.navbar {
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  background-color: #0f172a !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18) !important;
  transition: background-color 0.3s ease;
  z-index: 1030 !important;
}

body.quarto-dark .navbar {
  background-color: #0a0e17 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5) !important;
}

.navbar .navbar-brand,
.navbar-brand span {
  color: #ffffff !important;
  font-weight: 750 !important;
  letter-spacing: -0.02em;
}

.navbar .nav-link,
.navbar-nav .nav-link {
  color: rgba(241, 245, 249, 0.92) !important;
  font-weight: 550 !important;
  font-size: 0.93rem !important;
  padding: 0.5rem 0.85rem !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
}

.navbar .nav-link:hover,
.navbar-nav .nav-link:hover,
.navbar .nav-link:focus,
.navbar-nav .nav-link:focus {
  color: #38bdf8 !important;
}

.navbar-nav .dropdown-menu {
  background-color: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45) !important;
  padding: 0.5rem 0.4rem !important;
}

.navbar-nav .dropdown-item {
  color: #e2e8f0 !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  padding: 0.45rem 0.85rem !important;
  font-size: 0.9rem !important;
  transition: all 0.15s ease !important;
}

.navbar-nav .dropdown-item:hover {
  background-color: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
}

.navbar-nav .dropdown-divider {
  border-top-color: rgba(255, 255, 255, 0.12) !important;
}

.navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.navbar .navbar-toggler-icon {
  filter: invert(1) brightness(1.5) !important;
}

#quarto-search .aa-DetachedSearchButton,
.navbar #quarto-search .aa-Autocomplete {
  color: #ffffff !important;
}

.sidebar nav[role="doc-toc"] {
  border-left: 1px solid var(--border-light);
  padding-left: 0.85rem;
}

.sidebar nav[role="doc-toc"] ul > li > a {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 0.3rem 0;
  display: block;
  transition: all 0.15s ease;
}

.sidebar nav[role="doc-toc"] ul > li > a:hover {
  color: var(--text-strong);
}

.sidebar nav[role="doc-toc"] ul > li > a.active {
  color: var(--primary-accent) !important;
  font-weight: 650;
  position: relative;
}

/* --------------------------------------------------------------------------
   4. Anthropic / Linear Style Callouts
   -------------------------------------------------------------------------- */
.callout {
  border-radius: var(--card-radius) !important;
  border-left-width: 4px !important;
  border-top-width: 1px !important;
  border-right-width: 1px !important;
  border-bottom-width: 1px !important;
  box-shadow: var(--shadow-sm);
  margin: 1.8rem 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.callout:hover {
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-md);
}

.callout-header {
  font-weight: 650;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  padding: 0.75rem 1rem;
}

.callout-body {
  font-size: 0.94rem;
  line-height: 1.72;
  padding: 0.5rem 1rem 1rem 1rem;
}

/* Callout Note (Deep Azure) */
.callout-note {
  background-color: #f8fbff !important;
  border-color: #bfdbfe !important;
  border-left-color: #2563eb !important;
}

body.quarto-dark .callout-note {
  background-color: #121e33 !important;
  border-color: #1e3a8a !important;
  border-left-color: #60a5fa !important;
}

/* Callout Tip (Terracotta / Emerald) */
.callout-tip {
  background-color: #fbf8f5 !important;
  border-color: #fed7aa !important;
  border-left-color: var(--terracotta) !important;
}

body.quarto-dark .callout-tip {
  background-color: #251d18 !important;
  border-color: #7c2d12 !important;
  border-left-color: #fb923c !important;
}

/* Callout Important (Golden Amber) */
.callout-important {
  background-color: #fffdf5 !important;
  border-color: #fde68a !important;
  border-left-color: #d97706 !important;
}

body.quarto-dark .callout-important {
  background-color: #241f12 !important;
  border-color: #78350f !important;
  border-left-color: #fcd34d !important;
}

/* Callout Warning */
.callout-warning {
  background-color: #fff8f6 !important;
  border-color: #fecdd3 !important;
  border-left-color: #e11d48 !important;
}

body.quarto-dark .callout-warning {
  background-color: #26141a !important;
  border-color: #881337 !important;
  border-left-color: #fb7185 !important;
}

/* --------------------------------------------------------------------------
   5. macOS Style Code Blocks & Terminal Windows
   -------------------------------------------------------------------------- */
pre, code {
  font-family: var(--font-mono) !important;
}

div.sourceCode {
  position: relative;
  background-color: #f8fafc;
  border-radius: 12px !important;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin: 1.6rem 0;
  overflow: hidden;
}

body.quarto-dark div.sourceCode {
  background-color: #161b22;
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

/* macOS Terminal Top Dots */
div.sourceCode::before {
  content: "";
  display: block;
  height: 28px;
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--border-light);
  background-image: radial-gradient(circle, #ff5f56 5px, transparent 6px),
                    radial-gradient(circle, #ffbd2e 5px, transparent 6px),
                    radial-gradient(circle, #27c93f 5px, transparent 6px);
  background-size: 16px 16px;
  background-position: 12px center, 32px center, 52px center;
  background-repeat: no-repeat;
}

body.quarto-dark div.sourceCode::before {
  background-color: #1f242c;
  border-bottom-color: var(--border-light);
}

div.sourceCode pre {
  padding: 1rem 1.25rem !important;
  margin: 0 !important;
  background: transparent !important;
}

code:not(pre code) {
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  font-size: 0.88em;
  background-color: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  font-weight: 500;
}

body.quarto-dark code:not(pre code) {
  background-color: #1f242c;
  color: #38bdf8;
  border-color: #334155;
}

/* Floating Code Copy Button */
.code-copy-button {
  top: 6px !important;
  right: 10px !important;
  border-radius: 6px !important;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.code-copy-button:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   6. Editorial Grade Minimalist Tables
   -------------------------------------------------------------------------- */
.table-responsive,
div.quarto-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.8rem 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.94rem;
}

thead th {
  background-color: #f8fafc;
  color: var(--text-strong);
  font-weight: 650;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  letter-spacing: -0.01em;
}

body.quarto-dark thead th {
  background-color: #1e242d;
  color: #f8fafc;
  border-bottom-color: #334155;
}

tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-variant-numeric: tabular-nums;
}

body.quarto-dark tbody td {
  border-bottom-color: #1f242c;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.02);
}

body.quarto-dark tbody tr:hover {
  background-color: rgba(96, 165, 250, 0.04);
}

/* --------------------------------------------------------------------------
   7. Figure Cards & Image Framing
   -------------------------------------------------------------------------- */
.figure, figure, img {
  border-radius: 10px;
  max-width: 100%;
  height: auto;
}

.img-card {
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  margin: 2.2rem auto;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.img-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.img-card img {
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.figure-caption, figcaption, p.caption {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
  display: block;
}

/* --------------------------------------------------------------------------
   8. Anthropic Claude Warm Palette for Mermaid Diagrams
   -------------------------------------------------------------------------- */
:root {
  --mermaid-bg-color: #faf9f5 !important;
  --mermaid-node-bg-color: #ffffff !important;
  --mermaid-node-fg-color: #cc6644 !important;
  --mermaid-edge-color: #8c5e45 !important;
  --mermaid-label-fg-color: #262626 !important;
  --mermaid-label-bg-color: #faf9f5 !important;
  --mermaid-fg-color: #262626 !important;
  --mermaid-fg-color--lighter: #d97757 !important;
  --mermaid-fg-color--lightest: #f4efeb !important;
}

body.quarto-dark {
  --mermaid-bg-color: #151b22 !important;
  --mermaid-node-bg-color: #1f2630 !important;
  --mermaid-node-fg-color: #d97757 !important;
  --mermaid-edge-color: #cc7a5c !important;
  --mermaid-label-fg-color: #f3f4f6 !important;
  --mermaid-label-bg-color: #151b22 !important;
  --mermaid-fg-color: #f3f4f6 !important;
  --mermaid-fg-color--lighter: #6b7c8a !important;
  --mermaid-fg-color--lightest: #222b32 !important;
}

/* Mermaid Container Frame */
.cell-output-display .mermaid,
pre.mermaid {
  background-color: var(--mermaid-bg-color) !important;
  border: 1px solid #e5dfd5 !important;
  border-radius: 14px !important;
  padding: 1.8rem 1.5rem !important;
  margin: 2.2rem auto !important;
  box-shadow: var(--shadow-md) !important;
  text-align: center;
  overflow-x: auto;
  transition: box-shadow 0.2s ease;
}

body.quarto-dark .cell-output-display .mermaid,
body.quarto-dark pre.mermaid {
  border-color: #30363d !important;
}

.cell-output-display .mermaid:hover,
pre.mermaid:hover {
  box-shadow: var(--shadow-lg) !important;
}

.cell-output-display .mermaid svg,
pre.mermaid svg {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
}

/* Nodes & Boxes */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon,
.mermaid .node path {
  fill: #ffffff !important;
  stroke: #cc6644 !important;
  stroke-width: 1.6px !important;
  rx: 8px !important;
  ry: 8px !important;
}

body.quarto-dark .mermaid .node rect,
body.quarto-dark .mermaid .node circle,
body.quarto-dark .mermaid .node polygon,
body.quarto-dark .mermaid .node path {
  fill: #1f2630 !important;
  stroke: #d97757 !important;
}

.mermaid .node .label,
.mermaid .nodeLabel,
.mermaid .nodeLabel p,
.mermaid .label text,
.mermaid .labelText,
.mermaid .node foreignObject div {
  color: #262626 !important;
  fill: #262626 !important;
  font-family: var(--font-sans) !important;
  font-size: 13.5px !important;
  font-weight: 550 !important;
  line-height: 1.45 !important;
}

body.quarto-dark .mermaid .node .label,
body.quarto-dark .mermaid .nodeLabel,
body.quarto-dark .mermaid .nodeLabel p,
body.quarto-dark .mermaid .label text,
body.quarto-dark .mermaid .labelText,
body.quarto-dark .mermaid .node foreignObject div {
  color: #f3f4f6 !important;
  fill: #f3f4f6 !important;
}

/* Subgraphs / Clusters */
.mermaid .cluster rect {
  fill: #f5efeb !important;
  stroke: #d6cbc2 !important;
  stroke-width: 1.2px !important;
  rx: 10px !important;
  ry: 10px !important;
}

body.quarto-dark .mermaid .cluster rect {
  fill: #1a2228 !important;
  stroke: #374151 !important;
}

.mermaid .cluster span,
.mermaid .cluster text,
.mermaid .cluster text > tspan,
.mermaid .cluster .nodeLabel {
  color: #8c4325 !important;
  fill: #8c4325 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
}

body.quarto-dark .mermaid .cluster span,
body.quarto-dark .mermaid .cluster text,
body.quarto-dark .mermaid .cluster text > tspan,
body.quarto-dark .mermaid .cluster .nodeLabel {
  color: #f09a7d !important;
  fill: #f09a7d !important;
}

/* Edges & Arrows */
.mermaid .edgePath .path,
.mermaid .flowchart-link {
  stroke: #8c5e45 !important;
  stroke-width: 1.8px !important;
}

body.quarto-dark .mermaid .edgePath .path,
body.quarto-dark .mermaid .flowchart-link {
  stroke: #cc7a5c !important;
}

.mermaid .edgePath .arrowheadPath,
.mermaid marker path,
.mermaid #arrowhead path {
  fill: #8c5e45 !important;
  stroke: none !important;
}

body.quarto-dark .mermaid .edgePath .arrowheadPath,
body.quarto-dark marker path,
body.quarto-dark #arrowhead path {
  fill: #cc7a5c !important;
}

/* Edge Labels */
.mermaid .edgeLabel,
.mermaid .edgeLabel rect {
  background-color: var(--mermaid-bg-color) !important;
  fill: var(--mermaid-bg-color) !important;
  color: #55443b !important;
  font-size: 12.5px !important;
}

body.quarto-dark .mermaid .edgeLabel,
body.quarto-dark .mermaid .edgeLabel rect {
  color: #e2d9d2 !important;
}

/* Sequence Diagrams */
.mermaid .actor {
  stroke: #cc6644 !important;
  fill: #ffffff !important;
  stroke-width: 1.6px !important;
  rx: 8px !important;
  ry: 8px !important;
}

body.quarto-dark .mermaid .actor {
  stroke: #d97757 !important;
  fill: #1f2630 !important;
}

.mermaid text.actor > tspan {
  fill: #262626 !important;
  font-weight: 600 !important;
}

body.quarto-dark .mermaid text.actor > tspan {
  fill: #f3f4f6 !important;
}

.mermaid .messageLine0,
.mermaid .messageLine1 {
  stroke: #8c5e45 !important;
  stroke-width: 1.6px !important;
}

body.quarto-dark .mermaid .messageLine0,
body.quarto-dark .mermaid .messageLine1 {
  stroke: #cc7a5c !important;
}

.mermaid .messageText {
  fill: #262626 !important;
  stroke: none !important;
  font-size: 13px !important;
}

body.quarto-dark .mermaid .messageText {
  fill: #f3f4f6 !important;
}

.mermaid .note {
  stroke: #d6cbc2 !important;
  fill: #f5efeb !important;
}

body.quarto-dark .mermaid .note {
  stroke: #374151 !important;
  fill: #1a2228 !important;
}

.mermaid .noteText,
.mermaid .noteText > tspan {
  fill: #8c4325 !important;
  font-size: 12.5px !important;
}

body.quarto-dark .mermaid .noteText,
body.quarto-dark .mermaid .noteText > tspan {
  fill: #f09a7d !important;
}

/* --------------------------------------------------------------------------
   9. Native MathML Typography
   -------------------------------------------------------------------------- */
math {
  font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", KaTeX_Math, "Times New Roman", Times, serif;
  font-size: 1.05em;
  letter-spacing: normal;
  text-rendering: optimizeLegibility;
}

math[display="block"] {
  display: block;
  margin: 1.5rem auto;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 0.6rem 0.2rem;
  scrollbar-width: thin;
}

body.quarto-dark math {
  color: #f1f5f9;
}

/* --------------------------------------------------------------------------
   10. Custom Sleek Scrollbars
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

/* ==========================================================================
   Course Pagination Cards (Previous & Next Lesson Navigation)
   ========================================================================== */
.course-pagination {
  display: flex !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  gap: 1.25rem !important;
  margin: 3.5rem 0 2rem 0 !important;
  padding-top: 2rem !important;
  border-top: 1px solid var(--border-light) !important;
}

.pagination-link {
  flex: 1 1 48% !important;
  display: block !important;
  padding: 1.15rem 1.45rem !important;
  border-radius: var(--card-radius) !important;
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: var(--shadow-sm) !important;
  text-decoration: none !important;
  color: var(--text-main) !important;
  font-size: 0.96rem !important;
  font-weight: 550 !important;
  line-height: 1.5 !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease !important;
}

.pagination-link strong {
  display: block !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  color: var(--text-muted) !important;
  margin-bottom: 0.35rem !important;
  transition: color 0.2s ease !important;
}

.pagination-prev {
  text-align: left !important;
}

.pagination-next {
  text-align: right !important;
  margin-left: auto !important;
}

.pagination-link:hover {
  transform: translateY(-2.5px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--primary-accent) !important;
  color: var(--primary-accent) !important;
}

.pagination-link:hover strong {
  color: var(--primary-accent) !important;
}

body.quarto-dark .pagination-link {
  background-color: var(--bg-surface) !important;
  border-color: var(--border-light) !important;
}

body.quarto-dark .pagination-link:hover {
  border-color: #60a5fa !important;
  color: #60a5fa !important;
}

body.quarto-dark .pagination-link:hover strong {
  color: #60a5fa !important;
}

/* Native Quarto Page Navigation Footer Enhancement */
.page-navigation {
  margin-top: 2rem !important;
  padding-top: 1rem !important;
}

.page-navigation .nav-page {
  font-weight: 600 !important;
}

@media (max-width: 640px) {
  .course-pagination {
    flex-direction: column !important;
    gap: 0.85rem !important;
  }
  .pagination-link {
    width: 100% !important;
    text-align: center !important;
  }
}
