/*
 * obsidian.css - Obsidian default theme.
 *
 * Follows Obsidian's own base-xx grey ramp, its colour palette, its callout
 * shape (tinted panel, tinted title row, rounded, icon in the accent colour)
 * and its Prism token mapping (--code-keyword -> pink, --code-string -> green,
 * --code-function -> yellow, --code-property -> cyan, --code-value -> purple).
 *
 * Deliberate deviation: Obsidian's light-mode accents are tuned for its own
 * off-white canvas and several of them (green, cyan, yellow) land near 2.5:1
 * on white, which is exactly the "hard to read" problem this project exists to
 * fix. Light-mode accents below keep Obsidian's hue but are darkened to clear
 * WCAG AA for body text. Dark mode keeps Obsidian's values except blue
 * (#027aff -> #4a9eff), which is under 3.5:1 on Obsidian's own #1e1e1e.
 */

.strata-root[data-strata-theme='obsidian'] {
  --strata-font-body: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --strata-font-heading: var(--strata-font-body);
  --strata-font-mono: 'JetBrains Mono', 'Source Code Pro', ui-monospace, Menlo, Consolas, monospace;
  --strata-font-size: 16px;
  --strata-line-height-base: 1.55;
  --strata-block-gap-base: 16px;

  /* Obsidian's modular heading scale. */
  --strata-h1-size: 1.802em;
  --strata-h2-size: 1.602em;
  --strata-h3-size: 1.424em;
  --strata-h4-size: 1.266em;
  --strata-h5-size: 1.125em;
  --strata-h6-size: 1em;
  --strata-heading-weight: 600;
  --strata-h1-weight: 700;
  --strata-heading-color: var(--strata-text);
  --strata-h1-rule-width: 0;
  --strata-h1-rule-space: 0;
  --strata-h2-rule-width: 0;
  --strata-h2-rule-space: 0;

  --strata-radius-sm: 4px;
  --strata-radius-md: 8px;
  --strata-radius-lg: 12px;
  --strata-list-indent: 1.9em;
  --strata-list-item-gap: 3px;

  --strata-code-radius: 8px;
  --strata-code-padding: 14px 16px;
  --strata-code-line-height: 1.5;
  --strata-code-font-size: 0.875em;

  /* Callouts: tinted panel with a tinted title row and no accent bar. */
  --strata-callout-bg-alpha: 0.1;
  --strata-callout-title-bg-alpha: 0.1;
  --strata-callout-border-width: 0px;
  --strata-callout-accent-width: 0px;
  --strata-callout-radius: 8px;
  --strata-callout-title-padding: 10px 14px;
  --strata-callout-content-padding: 2px 14px 12px;
  --strata-callout-title-weight: 600;
  --strata-callout-fold-closed-pad: 10px;

  --strata-quote-padding: 2px 0 2px 16px;
  --strata-quote-border-width: 3px;
  --strata-quote-radius: 0;
}

/* Obsidian's own hue choices for the types it ships. */
.strata-root[data-strata-theme='obsidian'] .strata-callout[data-callout='tip'],
.strata-root[data-strata-theme='obsidian'] .strata-callout[data-callout='important'] {
  --strata-callout-rgb: var(--strata-color-cyan);
}

/* ---------------------------------------------------------- Obsidian light */

.strata-root[data-strata-theme='obsidian'][data-strata-mode='light'] {
  --strata-bg: #ffffff;
  --strata-bg-elevated: #f6f6f6;
  --strata-bg-hover: #ebebeb;
  --strata-text: #222222;
  --strata-text-muted: #5a5a5a;
  --strata-text-faint: #999999;
  --strata-border: #e0e0e0;
  --strata-border-strong: #cfcfcf;
  --strata-link: #7852ee;
  --strata-link-hover: #5f36d6;
  --strata-on-accent: #ffffff;

  /* Obsidian hues, darkened for contrast on white (see header note). */
  --strata-color-blue: 8, 104, 214;
  --strata-color-cyan: 0, 128, 126;
  --strata-color-green: 7, 128, 58;
  --strata-color-yellow: 154, 108, 0;
  --strata-color-orange: 179, 92, 0;
  --strata-color-red: 207, 31, 54;
  --strata-color-purple: 115, 70, 232;
  --strata-color-pink: 192, 42, 114;
  --strata-color-gray: 107, 107, 107;

  --strata-code-bg: #f6f6f6;
  --strata-code-text: #222222;
  --strata-code-border: #ececec;
  --strata-code-header-bg: #efefef;
  --strata-code-header-border: #e0e0e0;
  --strata-code-gutter-text: #a3a3a3;
  --strata-code-gutter-border: #e0e0e0;
  --strata-code-line-hover: rgba(0, 0, 0, 0.03);
  --strata-code-inline-bg: #f2f3f5;
  --strata-code-inline-text: #222222;
  --strata-code-inline-border: #e3e3e3;

  --strata-quote-bg: transparent;
  --strata-quote-border-color: #7852ee;
  --strata-quote-text: #5a5a5a;

  --strata-table-border: #e0e0e0;
  --strata-table-header-bg: #f6f6f6;
  --strata-table-stripe-bg: transparent;
  --strata-table-hover-bg: #fafafa;

  --strata-scrollbar-thumb: #d4d4d4;
  --strata-mermaid-bg: var(--strata-bg-elevated);
  --strata-mark-alpha: 0.4;

  /* Prism token mapping used by Obsidian's default theme. */
  --strata-syn-comment: #757575;
  --strata-syn-keyword: #c02a72;
  --strata-syn-type: #00807e;
  --strata-syn-entity: #8a6000;
  --strata-syn-constant: #7346e8;
  --strata-syn-attr: #00807e;
  --strata-syn-operator: #cf1f36;
  --strata-syn-string: #07803a;
  --strata-syn-regexp: #07803a;
  --strata-syn-variable: #b35c00;
  --strata-syn-builtin: #b35c00;
  --strata-syn-tag: #cf1f36;
  --strata-syn-property: #00807e;
  --strata-syn-punctuation: #5a5a5a;
  --strata-syn-section: #8a6000;
  --strata-syn-bullet: #b35c00;
  --strata-syn-link: #0868d6;
  --strata-syn-addition: #07803a;
  --strata-syn-addition-bg: rgba(7, 128, 58, 0.12);
  --strata-syn-deletion: #cf1f36;
  --strata-syn-deletion-bg: rgba(207, 31, 54, 0.12);
}

/* ----------------------------------------------------------- Obsidian dark */

.strata-root[data-strata-theme='obsidian'][data-strata-mode='dark'] {
  --strata-bg: #1e1e1e;
  --strata-bg-elevated: #262626;
  --strata-bg-hover: #2d2d2d;
  --strata-text: #dadada;
  --strata-text-muted: #b3b3b3;
  --strata-text-faint: #7a7a7a;
  --strata-border: #3a3a3a;
  --strata-border-strong: #4d4d4d;
  --strata-link: #a882ff;
  --strata-link-hover: #c0a5ff;
  --strata-on-accent: #ffffff;

  --strata-color-blue: 74, 158, 255;
  --strata-color-cyan: 83, 223, 221;
  --strata-color-green: 68, 207, 110;
  --strata-color-yellow: 224, 222, 113;
  --strata-color-orange: 233, 151, 63;
  --strata-color-red: 251, 70, 76;
  --strata-color-purple: 168, 130, 255;
  --strata-color-pink: 250, 153, 205;
  --strata-color-gray: 153, 153, 153;

  --strata-code-bg: #161616;
  --strata-code-text: #dadada;
  --strata-code-border: #2b2b2b;
  --strata-code-header-bg: #1f1f1f;
  --strata-code-header-border: #2f2f2f;
  --strata-code-gutter-text: #6b6b6b;
  --strata-code-gutter-border: #2f2f2f;
  --strata-code-line-hover: rgba(255, 255, 255, 0.04);
  --strata-code-inline-bg: #2a2a2a;
  --strata-code-inline-text: #dadada;
  --strata-code-inline-border: transparent;

  --strata-quote-bg: transparent;
  --strata-quote-border-color: #a882ff;
  --strata-quote-text: #b3b3b3;

  --strata-table-border: #3a3a3a;
  --strata-table-header-bg: #262626;
  --strata-table-stripe-bg: transparent;
  --strata-table-hover-bg: #242424;

  --strata-scrollbar-thumb: #4a4a4a;
  --strata-mermaid-bg: var(--strata-bg-elevated);
  --strata-mark-alpha: 0.3;

  --strata-syn-comment: #8a8a8a;
  --strata-syn-keyword: #fa99cd;
  --strata-syn-type: #53dfdd;
  --strata-syn-entity: #e0de71;
  --strata-syn-constant: #a882ff;
  --strata-syn-attr: #53dfdd;
  --strata-syn-operator: #fb464c;
  --strata-syn-string: #44cf6e;
  --strata-syn-regexp: #44cf6e;
  --strata-syn-variable: #e9973f;
  --strata-syn-builtin: #e9973f;
  --strata-syn-tag: #fb464c;
  --strata-syn-property: #53dfdd;
  --strata-syn-punctuation: #b3b3b3;
  --strata-syn-section: #e0de71;
  --strata-syn-bullet: #e9973f;
  --strata-syn-link: #4a9eff;
  --strata-syn-addition: #44cf6e;
  --strata-syn-addition-bg: rgba(68, 207, 110, 0.14);
  --strata-syn-deletion: #fb464c;
  --strata-syn-deletion-bg: rgba(251, 70, 76, 0.14);
}
