/* ── PaperRun docs theme ── */

/* Typography */
:root {
  --md-text-font: "Inter";
  --md-code-font: "JetBrains Mono";
}

/* PaperRun brand colors:
   Inkwell Navy:     #262667
   Parchment Cream:  #FFF7EA
   Postlight Blue:   #96D0FF
   Courier Crimson:  #D70500
*/

/* Palette overrides */
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #262667;
  --md-primary-bg-color: #FFF7EA;
  --md-accent-fg-color: #96D0FF;
  --md-default-fg-color--light: #3a3a6e;
  --md-typeset-a-color: #262667;
}

/* Tighter body copy */
.md-typeset {
  font-size: 0.82rem;
  line-height: 1.7;
}

/* Headings */
.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4em;
}

.md-typeset h2 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset h3 {
  font-weight: 600;
}

/* Tables – clean Stripe style */
.md-typeset table:not([class]) {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 0.78rem;
}

.md-typeset table:not([class]) th {
  background: var(--md-default-fg-color--lightest);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.7em 1em;
}

.md-typeset table:not([class]) td {
  padding: 0.65em 1em;
}

.md-typeset table:not([class]) tr:not(:last-child) td {
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

/* Code blocks */
.md-typeset pre > code {
  border-radius: 8px;
  font-size: 0.78rem;
}

.md-typeset code {
  border-radius: 4px;
  font-size: 0.82em;
  padding: 0.15em 0.4em;
}

/* Admonitions – softer */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  border-width: 1px;
  border-left-width: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  font-size: 0.8rem;
}

/* Mermaid diagrams – more breathing room */
.md-typeset .mermaid {
  margin: 1.5em 0;
  text-align: center;
}

/* ── System flow diagram ── */
.system-flow-diagram {
  margin: 2em 0;
  padding: 2em 1.5em;
  background: linear-gradient(135deg, #fafafe 0%, #f5f3ff 100%);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
}

.system-flow-diagram .mermaid {
  margin: 0;
}

/* Clickable nodes get pointer cursor + hover lift */
.system-flow-diagram .mermaid .node {
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.system-flow-diagram .mermaid .node:hover {
  filter: brightness(0.95) drop-shadow(0 2px 8px rgba(38, 38, 103, 0.15));
}

/* Subgraph titles */
.system-flow-diagram .mermaid .cluster-label {
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: 0.02em;
}

/* Subgraph boxes – rounder, more padding */
.system-flow-diagram .mermaid .cluster rect {
  rx: 12 !important;
  ry: 12 !important;
}

/* Database (cylinder) nodes with dark fill – force white text */
.system-flow-diagram .mermaid .node.state .label div,
.system-flow-diagram .mermaid .node.state span,
.system-flow-diagram .mermaid .node.state p,
.system-flow-diagram .mermaid .node.state foreignObject div {
  color: #fff !important;
}

/* Dashed lines for external services */
.system-flow-diagram .mermaid .flowchart-link {
  stroke-width: 1.5px;
}

/* External service label styling */
.ext-label {
  font-size: 0.8em;
  opacity: 0.7;
}

/* ── Left sidebar: page navigation ── */
.md-sidebar--primary {
  border-right: 2px solid #262667;
}

.md-sidebar--primary .md-nav__link {
  font-size: 0.78rem;
  font-weight: 500;
}

.md-sidebar--primary .md-nav__item--nested > .md-nav__link {
  font-weight: 700;
  color: #262667;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.md-sidebar--primary .md-nav__item--active > .md-nav__link {
  color: #262667;
  border-left: 3px solid #262667;
  padding-left: 0.5em;
  font-weight: 600;
}

/* ── Right sidebar: on-page TOC ── */
.md-sidebar--secondary {
  border-left: 1px solid var(--md-default-fg-color--lightest);
}

.md-sidebar--secondary .md-nav__link {
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
  opacity: 0.7;
}

.md-sidebar--secondary .md-nav__link--active {
  color: #262667;
  opacity: 1;
  font-weight: 600;
}

.md-sidebar--secondary .md-nav__title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-default-fg-color--lighter);
  font-weight: 600;
}

/* Content area max-width for readability */
.md-content {
  max-width: 52rem;
}

/* Footer – subtle */
.md-footer {
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

/* Smooth page transitions (with instant loading) */
.md-content {
  transition: opacity 120ms ease;
}

/* Tab labels */
.md-typeset .tabbed-labels > label {
  font-size: 0.78rem;
  font-weight: 500;
}

/* Search bar */
.md-search__input {
  border-radius: 8px;
}

