/* ───────────────────────────────────────────────
   University Coursework — Quarto Notebook Polish
   Layered on top of cosmo / darkly themes
   ─────────────────────────────────────────────── */

/* ── Headings ────────────────────────────────── */

.quarto-title h1.title,
h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin-top: 2rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid rgba(29, 43, 68, 0.2);
}

h3 {
  color: #1D2B44;
}

[data-bs-theme="dark"] h3 {
  color: #E8601C;
}

/* ── Title block ─────────────────────────────── */

.quarto-title-meta {
  border-left: 3px solid #1D2B44;
  padding-left: 1rem;
  margin-top: 1rem;
}

/* ── Code blocks ─────────────────────────────── */

div.sourceCode {
  border-radius: 8px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-bs-theme="dark"] div.sourceCode {
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

pre.sourceCode {
  border-radius: 8px !important;
  padding: 1rem 1.2rem !important;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* code-fold button */
details > summary > span {
  font-size: 0.82rem;
}

/* inline code */
p code, li code, td code {
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  background: rgba(29, 43, 68, 0.07);
  color: #141d30;
}

[data-bs-theme="dark"] p code,
[data-bs-theme="dark"] li code,
[data-bs-theme="dark"] td code {
  background: rgba(232, 96, 28, 0.1);
  color: #F0935A;
}

/* ── Output / cell output ────────────────────── */

.cell-output pre {
  border-radius: 8px;
  border-left: 3px solid #1D2B44;
  background: rgba(29, 43, 68, 0.03);
}

[data-bs-theme="dark"] .cell-output pre {
  background: rgba(232, 96, 28, 0.04);
  border-left-color: #E8601C;
}

/* ── Tables ──────────────────────────────────── */

.table {
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background: #1D2B44;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: none;
}

[data-bs-theme="dark"] .table thead th {
  background: #141d30;
}

.table tbody tr:hover {
  background: rgba(29, 43, 68, 0.04);
}

[data-bs-theme="dark"] .table tbody tr:hover {
  background: rgba(232, 96, 28, 0.06);
}

/* ── Callout boxes ───────────────────────────── */

.callout {
  border-radius: 8px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.callout-header {
  font-weight: 600;
}

/* ── TOC ─────────────────────────────────────── */

nav#TOC a {
  text-decoration: none;
  transition: color 0.2s;
}

nav#TOC a:hover {
  color: #1D2B44;
}

nav#TOC .active {
  font-weight: 600;
  border-left: 2px solid #1D2B44;
}

/* ── Figures ─────────────────────────────────── */

.quarto-figure {
  border-radius: 8px;
  overflow: hidden;
}

.figure-caption,
figcaption {
  font-size: 0.88rem;
  color: #64748b;
  font-style: italic;
  margin-top: 0.5rem;
}

.quarto-figure img,
.cell-output-display img {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .quarto-figure img,
[data-bs-theme="dark"] .cell-output-display img {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Links ───────────────────────────────────── */

a {
  transition: color 0.2s, opacity 0.2s;
}

a:hover {
  opacity: 0.85;
}

/* ── Misc ────────────────────────────────────── */

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* smooth scroll */
html {
  scroll-behavior: smooth;
}

/* back-to-top button */
#quarto-back-to-top {
  border-radius: 50%;
}

/* math formulas */
.math.display {
  overflow-x: auto;
  padding: 0.5rem 0;
}

/* ── PDF download button ─────────────────────── */

.pdf-download-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  background: #1D2B44;
  color: #ffffff !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(29, 43, 68, 0.3);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  z-index: 1050;
}

.pdf-download-btn:hover {
  background: #C74E14;
  box-shadow: 0 6px 16px rgba(29, 43, 68, 0.4);
  transform: translateY(-2px);
  color: #ffffff !important;
}

.pdf-download-btn svg {
  flex-shrink: 0;
}

[data-bs-theme="dark"] .pdf-download-btn {
  background: #141d30;
  box-shadow: 0 4px 12px rgba(29, 43, 68, 0.4);
}

[data-bs-theme="dark"] .pdf-download-btn:hover {
  background: #1D2B44;
  box-shadow: 0 6px 16px rgba(29, 43, 68, 0.5);
}
