/* ============================================================
   content.css — Rendered markdown content styles
   DSRCT Wiki / Knowledge Canvas
   Uses CSS custom properties from canvas.css (--bg, --surface, etc.)
   ============================================================ */

/* ─── 1. Page View ─── */

#page-view {
  position: relative;
  overflow-y: auto;
  cursor: auto;
  user-select: text;
}

.page-view-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 24px 0 48px;
  background: var(--overlay-bg-strong);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.page-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.page-back-btn:hover {
  background: var(--surface-hover);
  color: var(--text-bright);
  border-color: var(--border-active);
}

.page-view-header .page-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-view-header .category-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent);
  white-space: nowrap;
}

/* ── Sidenotes toggle button ── */
.sidenotes-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.sidenotes-toggle-btn:hover {
  background: var(--surface-hover);
  color: var(--text-bright);
  border-color: var(--border-active);
}
.sidenotes-toggle-btn .sidenotes-toggle-icon {
  font-size: 14px;
  line-height: 1;
}
/* Active state — sidenotes visible */
.sidenotes-toggle-btn:not(.collapsed) {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Collapsed sidenotes state ── */
body.sidenotes-collapsed .callout-sidenote,
body.sidenotes-collapsed .callout-marginnote,
body.sidenotes-collapsed .callout-infobox {
  display: none;
}
body.sidenotes-collapsed .sidenote-ref {
  display: none;
}
body.sidenotes-collapsed .page-content {
  max-width: 100%;
  width: 100%;
}

.page-content-wrap {
  max-width: none;
  margin: 0;
  padding: 32px 40px 64px 48px;
  overflow: visible;
}

.page-content {
  width: 1120px;
  max-width: 1120px;
  flex-shrink: 0;
  min-width: 0;
  margin: 0;
  overflow: visible;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}

.page-content h1 {
  font-size: 2em;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0 0 16px;
  line-height: 1.25;
}

.page-content h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 32px 0 12px;
}

.page-content h3 {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--text-bright);
  margin: 24px 0 8px;
}

.page-content h4 {
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 6px;
}

.page-content h5 {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text-dim);
  margin: 16px 0 4px;
}

.page-content h6 {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-dim);
  margin: 12px 0 4px;
}

/* Text-flow elements capped at 880px for readability;
   tables, code blocks, images, callouts stay at full 1120px container width */
.page-content p,
.page-content ul,
.page-content ol,
.page-content blockquote,
.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
  max-width: 880px;
}

.page-content p {
  margin-bottom: 14px;
}

.page-content a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dotted var(--link);
  transition: color 0.15s, border-color 0.15s;
}

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

.page-content ul,
.page-content ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.page-content li {
  margin-bottom: 4px;
}

.page-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  margin: 14px 0;
  color: var(--text-dim);
  font-style: italic;
}

.page-content code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

.page-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 14px 0;
}

.page-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85em;
  line-height: 1.6;
}

.page-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.page-content mark {
  background: rgba(241, 196, 15, 0.25);
  color: inherit;
  padding: 1px 3px;
  border-radius: 2px;
}

.page-content strong {
  font-weight: 600;
  color: var(--text-bright);
}

/* Page sidebar (meta, related) — hidden; margin space used for sidenotes */
.page-sidebar {
  display: none;
}

@media (max-width: 1100px) {
  .page-content {
    width: 100%;
    max-width: 780px;
  }
  .page-content-wrap {
    padding: 24px 20px 48px 24px;
  }
}


/* ─── 2. Obsidian Callouts ─── */

.callout {
  border-left: 4px solid var(--accent);
  background: rgba(108, 92, 231, 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0;
  margin: 16px 0;
  overflow: hidden;
  max-width: 880px;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.95em;
  cursor: default;
}

/* Collapsible callouts get a pointer cursor on the title */
.callout.is-collapsible > .callout-title {
  cursor: pointer;
}

.callout-title .callout-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.callout-title .callout-fold {
  margin-left: auto;
  font-size: 1em;
  opacity: 0.4;
  transition: transform 0.2s, opacity 0.2s;
  display: inline-block;
  padding: 2px 4px;
}
.callout.is-collapsible:hover > .callout-title > .callout-fold {
  opacity: 0.8;
}

/* Open state: chevron points down */
.callout.is-collapsible:not(.is-collapsed) > .callout-title > .callout-fold {
  transform: rotate(90deg);
}

/* Collapsed state: chevron points right (default ▸ orientation) */
.callout.is-collapsed > .callout-title > .callout-fold {
  transform: rotate(0deg);
}

.callout-content {
  padding: 0 14px 12px;
}

/* Collapsed callouts hide their content */
.callout.is-collapsed > .callout-content {
  display: none;
}

/* Callout type: note */
.callout-note {
  border-left-color: #448aff;
  background: rgba(68, 138, 255, 0.05);
}
.callout-note .callout-title {
  color: #448aff;
}

/* Callout type: abstract / summary / tldr */
.callout-abstract,
.callout-summary,
.callout-tldr {
  border-left-color: #00b8d4;
  background: rgba(0, 184, 212, 0.05);
}
.callout-abstract .callout-title,
.callout-summary .callout-title,
.callout-tldr .callout-title {
  color: #00b8d4;
}

/* Callout type: info */
.callout-info {
  border-left-color: #448aff;
  background: rgba(68, 138, 255, 0.05);
}
.callout-info .callout-title {
  color: #448aff;
}

/* Callout type: tip / hint / important */
.callout-tip,
.callout-hint,
.callout-important {
  border-left-color: #00bfa5;
  background: rgba(0, 191, 165, 0.05);
}
.callout-tip .callout-title,
.callout-hint .callout-title,
.callout-important .callout-title {
  color: #00bfa5;
}

/* Callout type: success / check / done */
.callout-success,
.callout-check,
.callout-done {
  border-left-color: #00c853;
  background: rgba(0, 200, 83, 0.05);
}
.callout-success .callout-title,
.callout-check .callout-title,
.callout-done .callout-title {
  color: #00c853;
}

/* Callout type: question / help / faq */
.callout-question,
.callout-help,
.callout-faq {
  border-left-color: #ffab00;
  background: rgba(255, 171, 0, 0.05);
}
.callout-question .callout-title,
.callout-help .callout-title,
.callout-faq .callout-title {
  color: #ffab00;
}

/* Callout type: warning / caution / attention */
.callout-warning,
.callout-caution,
.callout-attention {
  border-left-color: #ff9100;
  background: rgba(255, 145, 0, 0.05);
}
.callout-warning .callout-title,
.callout-caution .callout-title,
.callout-attention .callout-title {
  color: #ff9100;
}

/* Callout type: failure / fail / missing */
.callout-failure,
.callout-fail,
.callout-missing {
  border-left-color: #ff5252;
  background: rgba(255, 82, 82, 0.05);
}
.callout-failure .callout-title,
.callout-fail .callout-title,
.callout-missing .callout-title {
  color: #ff5252;
}

/* Callout type: danger / error */
.callout-danger,
.callout-error {
  border-left-color: #ff1744;
  background: rgba(255, 23, 68, 0.05);
}
.callout-danger .callout-title,
.callout-error .callout-title {
  color: #ff1744;
}

/* Callout type: bug */
.callout-bug {
  border-left-color: #f44336;
  background: rgba(244, 67, 54, 0.05);
}
.callout-bug .callout-title {
  color: #f44336;
}

/* Callout type: example */
.callout-example {
  border-left-color: #7c4dff;
  background: rgba(124, 77, 255, 0.05);
}
.callout-example .callout-title {
  color: #7c4dff;
}

/* Callout type: quote / cite */
.callout-quote,
.callout-cite {
  border-left-color: var(--text-dim);
  background: rgba(122, 122, 154, 0.05);
}
.callout-quote .callout-title,
.callout-cite .callout-title {
  color: var(--text-dim);
}

/* Custom callout: primer */
.callout-primer {
  border-left-color: #5c6bc0;
  background: rgba(92, 107, 192, 0.05);
}
.callout-primer .callout-title {
  color: #5c6bc0;
}

/* Custom callout: data */
.callout-data {
  border-left-color: #00acc1;
  background: rgba(0, 172, 193, 0.05);
}
.callout-data .callout-title {
  color: #00acc1;
}

/* Custom callout: clinical */
.callout-clinical {
  border-left-color: #66bb6a;
  background: rgba(102, 187, 106, 0.05);
}
.callout-clinical .callout-title {
  color: #66bb6a;
}

/* Custom callout: infobox — floats in right margin like Wikipedia */
.callout-infobox {
  float: right;
  clear: right;
  width: 300px;
  margin: 0 -332px 16px 0;  /* pull into right margin: 300 + 32px gap */
  border: 1px solid var(--border);
  border-left: 4px solid #3b82f6;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.9em;
}
.callout-infobox .callout-title {
  color: #3b82f6;
  font-size: 0.9em;
  border-bottom: 1px solid var(--border);
}
.callout-infobox .callout-content {
  padding: 10px 14px;
  font-size: 0.92em;
  line-height: 1.55;
}
.callout-infobox .callout-content p {
  margin: 6px 0;
}

/* Light theme infobox adjustments */
[data-theme="light"] .callout-infobox {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
  border-left-color: #3b82f6;
}

/* Responsive: infobox goes full-width on narrow screens */
@media (max-width: 1100px) {
  .callout-infobox {
    float: none;
    width: 100%;
    margin: 16px 0;
  }
}

/* Custom callout: mnemonic */
.callout-mnemonic {
  border-left-color: #7e57c2;
  background: rgba(126, 87, 194, 0.05);
}
.callout-mnemonic .callout-title {
  color: #7e57c2;
}

/* Custom callout: grid-left / grid-right (neutral, used in side-by-side) */
.callout-grid-left,
.callout-grid-right {
  border-left-color: var(--border-active);
  background: rgba(74, 74, 122, 0.05);
}
.callout-grid-left .callout-title,
.callout-grid-right .callout-title {
  color: var(--text-dim);
}


/* ─── 3. Section Bands ─── */

.section-band {
  width: 100%;
  padding: 8px 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin: 32px 0 16px;
  border-radius: 4px;
}

.section-band--green {
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
}

.section-band--yellow {
  background: rgba(243, 156, 18, 0.1);
  color: #f39c12;
}

.section-band--red {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}

.section-band--blue {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
}


/* ─── 4. Grid Layouts ─── */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.grid-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.callout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.callout-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

@media (max-width: 700px) {
  .grid-2,
  .grid-3,
  .callout-grid,
  .callout-grid-3 {
    grid-template-columns: 1fr;
  }
}


/* ─── 5. Custom Heading Classes ─── */

.alt-heading {
  color: var(--link);
  font-size: 1em;
  font-weight: 500;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  margin: 16px 0 8px;
}

.appendix-heading {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 32px;
}

.muted-heading {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.9em;
  font-weight: 400;
}

.highlight-heading {
  font-weight: 700;
  background: rgba(241, 196, 15, 0.15);
  padding: 4px 12px;
  border-radius: 4px;
}

.no-toc {
  /* Marker class for TOC exclusion; no unique visual style */
}


/* ─── 6. Collapsible Sections ─── */

details {
  margin: 12px 0;
}

details summary {
  cursor: pointer;
  font-weight: 500;
  padding: 8px 0;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 8px;
  font-size: 0.7em;
  transition: transform 0.2s;
}

details[open] summary::before {
  transform: rotate(90deg);
}

.info-collapse {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.info-collapse summary {
  padding: 10px 14px;
}

.info-collapse[open] > *:not(summary) {
  padding: 0 14px 14px;
}

.data-collapse {
  border-left: 3px solid var(--link);
  background: rgba(116, 185, 255, 0.04);
}

.data-collapse summary {
  padding: 10px 14px;
}

.data-collapse[open] > *:not(summary) {
  padding: 0 14px 14px;
}

.appendix-collapse {
  border-top: 1px solid var(--border);
}

.appendix-collapse summary {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 12px 0;
  color: var(--text-dim);
}


/* ─── 7. Typography Spans ─── */

.light-text {
  font-weight: 300;
}

.medium-text {
  font-weight: 500;
}

.black-text {
  font-weight: 900;
  color: var(--text-bright);
}

.small-caps {
  font-variant: small-caps;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.frac {
  font-variant-numeric: diagonal-fractions;
}

.ordn {
  font-variant-numeric: ordinal;
}

.sups {
  font-feature-settings: "sups";
}

.subs {
  font-feature-settings: "subs";
}

.quote-cite {
  display: block;
  text-align: right;
  font-size: 0.85em;
  color: var(--text-dim);
  margin-top: 4px;
  font-style: normal;
}


/* ─── 8. Image Classes ─── */

.img-25 {
  width: 25%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-33 {
  width: 33.333%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-50 {
  width: 50%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-66 {
  width: 66.666%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-75 {
  width: 75%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-100 {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-200 {
  width: 200px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-240 {
  width: 240px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-400 {
  width: 400px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-600 {
  width: 600px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-800 {
  width: 800px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.img-center {
  display: block;
  margin: 0 auto;
}


/* ─── 9. Book Card ─── */

.book-card {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

.book-card img {
  width: 80px;
  height: auto;
  border-radius: 4px;
  flex-shrink: 0;
}

.book-card-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-bright);
}

.book-card-meta {
  font-size: 0.9em;
  color: var(--text-dim);
  line-height: 1.5;
}

.book-card-actions {
  margin-top: 8px;
}

.book-card-actions a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--link);
  text-decoration: none;
  margin-right: 12px;
}

.book-card-actions a:hover {
  color: var(--link-hover);
}


/* ─── 10. Wiki Icons ─── */

.wiki-icon {
  display: inline-block;
  width: 2.5em;
  height: 2.5em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.3em;
  transition: transform 0.2s, opacity 0.2s;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  gap: 4px;
}

.icon-link:hover .wiki-icon {
  transform: translateY(-1px);
  opacity: 0.85;
}


/* ─── 11. Footnotes ─── */

.footnotes {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 0.9em;
  color: var(--text-dim);
  column-count: 2;
  column-gap: 32px;
}

.footnotes ol {
  padding-left: 20px;
}

.footnotes li {
  margin-bottom: 8px;
}

.footnote-ref {
  font-feature-settings: "sups";
  color: var(--link);
  text-decoration: none;
}

.footnote-ref:hover {
  color: var(--link-hover);
}

.footnote-backref {
  color: var(--link);
  text-decoration: none;
}

.footnote-backref:hover {
  color: var(--link-hover);
}

@media (max-width: 600px) {
  .footnotes {
    column-count: 1;
  }
}


/* ─── 12. Tables ─── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.95em;
}

th {
  background: var(--surface-hover);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

tr:hover td {
  background: rgba(26, 26, 46, 0.5);
}

.compact-table {
  font-size: 0.85em;
}

.compact-table th {
  padding: 6px 10px;
}

.compact-table td {
  padding: 6px 10px;
}


/* ─── 13. Tags ─── */

.page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.03em;
  white-space: nowrap;
}


/* ─── Page Sidebar Components ─── */

.page-meta-category {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.related-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-top: 20px;
  margin-bottom: 8px;
}

.related-link {
  display: block;
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s;
}

.related-link:hover {
  color: var(--link-hover);
}

/* ─── 14. Sidenotes & Margin Notes ─── */

/*
 * Sidenotes use callout syntax: > [!sidenote] 1
 * They become block-level divs (just like infobox) and float to the margin.
 * Inline references use {1} which renders as <sup class="sidenote-ref">1</sup>.
 *
 * Margin notes use: > [!marginnote] Optional title
 * Same float behavior, no numbered reference.
 */

/* Inline superscript reference number */
.sidenote-ref {
  font-size: 0.7em;
  font-weight: 600;
  color: var(--accent);
  cursor: default;
  margin: 0 1px;
}

/* Sidenote callout — floats in right margin, numbered */
.callout-sidenote {
  float: right;
  clear: right;
  width: 280px;
  margin: 0 -312px 14px 0;  /* push into right margin: 280 + 32px gap */
  border: none;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  background: transparent;
  font-size: 0.85em;
}
.callout-sidenote .callout-title {
  color: var(--accent);
  font-size: 0.85em;
  padding: 0 0 4px 12px;
}
.callout-sidenote .callout-title .callout-icon {
  display: none;
}
.callout-sidenote .callout-content {
  padding: 0 0 0 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88em;
  line-height: 1.5;
  color: var(--text-dim);
}
.callout-sidenote .callout-content p {
  margin: 4px 0;
}

/* Margin note callout — same float, no number */
.callout-marginnote {
  float: right;
  clear: right;
  width: 280px;
  margin: 0 -312px 14px 0;
  border: none;
  border-left: 2px solid var(--border);
  border-radius: 0;
  background: transparent;
  font-size: 0.85em;
}
.callout-marginnote .callout-title {
  display: none;
}
.callout-marginnote .callout-content {
  padding: 0 0 0 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88em;
  line-height: 1.5;
  color: var(--text-dim);
}
.callout-marginnote .callout-content p {
  margin: 4px 0;
}

/* Responsive: sidenotes/marginnotes go full-width on narrow screens */
@media (max-width: 1100px) {
  .callout-sidenote,
  .callout-marginnote {
    float: none;
    width: 100%;
    margin: 12px 0;
    border-left-width: 3px;
    background: var(--surface);
    border-radius: 0 4px 4px 0;
    padding: 8px 0;
  }
}


/* ─── 15. TOC (generated) ─── */

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}

.toc-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}

.toc ul {
  list-style: none;
  padding-left: 16px;
}

.toc > ul {
  padding-left: 0;
}

.toc li {
  margin: 4px 0;
}

.toc a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.15s;
}

.toc a:hover {
  color: var(--link);
}


/* ─── 16. Read More Link ─── */

.read-more {
  display: block;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--link);
  text-decoration: none;
  padding: 8px 0;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.read-more:hover {
  color: var(--link-hover);
}
