/* ==========================================================================
   EVE Docs — shared light theme (docs.eveaicore.com)

   Loaded only on docs pages that do NOT carry their own hand-written
   [data-theme="light"] overrides. Those pages all share the same dark
   variable palette (--bg:#06080f, --panel:#0c111d, --ink:#eef2fb, ...) so
   flipping the variables covers nearly every surface. Dark remains the
   default; light is opt-in via the floating toggle
   (js/docs-theme-toggle.js), persisted in localStorage 'eve-site-theme'.

   The site header intentionally KEEPS its dark "light-mode shield"
   (css/eve-header.css) — do not restyle .hdr here.

   Code / terminal surfaces stay DARK in light mode, matching the
   enterprise-bands precedent ("pin code surfaces dark in light theme").
   ========================================================================== */

html[data-theme="light"] {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --surface: #ffffff;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --hair: rgba(15, 23, 42, .08);
  --border: #e2e8f0;
  --ink: #0f172a;
  --ink-2: #35435c;
  --mut: #5b6b84;
  --muted: #5b6b84;
  --text: #35435c;
  --heading: #0f172a;
  /* accents darkened for contrast on white */
  --a1: #2f6fd0;
  --a2: #7c3aed;
  --accent: #2f6fd0;
  --ok: #16a34a;
  --green: #16a34a;
  --warn: #dc2626;
  --red: #dc2626;
  --amber: #b45309;
  --allow: #16a34a;
  --modify: #b45309;
  --block: #e11d48;
  /* !important beats transparency.html's `html,body{...!important}` guard */
  background: #f0f2f5 !important;
  color: #0f172a !important;
}

html[data-theme="light"] body {
  background: var(--bg) !important;
  color: var(--ink-2);
}

/* Several pages hardcode the dark-palette text colors (#eef2fb headings,
   #aeb9cd body copy) instead of using the vars — flip them at the element
   level, same technique the older docs pages use in their own light CSS.
   Code/terminal artifacts are re-pinned dark further down. */
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4 { color: var(--ink) !important; }

html[data-theme="light"] p,
html[data-theme="light"] li,
html[data-theme="light"] td { color: var(--ink-2) !important; }

/* ...but never inside the dark-pinned code/terminal artifacts */
html[data-theme="light"] .code-block p,
html[data-theme="light"] .code-block li,
html[data-theme="light"] .install-cmd p,
html[data-theme="light"] .diagram-block p,
html[data-theme="light"] .pipeline-diagram p,
html[data-theme="light"] pre p { color: #aeb9cd !important; }

/* Table-of-contents cards hardcode a dark fill — flip them to a light card */
html[data-theme="light"] .toc {
  background: #ffffff;
  border-color: var(--line);
}
html[data-theme="light"] .toc h4 { color: #1d4ed8 !important; }
html[data-theme="light"] .toc a { color: #35435c; }
html[data-theme="light"] .toc a:hover { color: #1d4ed8; }

/* Terminal / .code-block artifacts keep their hardcoded dark fill (#06080f);
   re-scope the text tokens back to the dark palette INSIDE them so rules like
   ".code-block pre { color: var(--ink) }" stay light-on-dark. */
html[data-theme="light"] .code-block,
html[data-theme="light"] .install-cmd,
html[data-theme="light"] .diagram-block,
html[data-theme="light"] .base-url-block,
html[data-theme="light"] .pipeline-diagram,
html[data-theme="light"] pre {
  --ink: #eef2fb;
  --ink-2: #aeb9cd;
  --mut: #7f8caa;
  --muted: #7f8caa;
  --text: #aeb9cd;
  --heading: #eef2fb;
  --a1: #5b9ee8;
  --accent: #5b9ee8;
}

/* Inline code chips are tuned for dark surfaces (light-blue text on a
   translucent fill) — flip them to a solid light chip with dark-blue text.
   Code inside pre / .code-block terminals is excluded (stays dark). */
html[data-theme="light"] code:not(pre code):not(.code-block code) {
  background: rgba(37, 99, 235, .08);
  border-color: rgba(37, 99, 235, .25);
  color: #1d4ed8;
}

/* Eyebrow tags / parameter pills / breadcrumbs hardcode pale dark-surface
   colors — darken them. .doc-tag needs !important to beat the API reference
   page's own !important contrast tuning. */
html[data-theme="light"] .doc-tag {
  color: #1d4ed8 !important;
  background: rgba(37, 99, 235, .08);
  border-color: rgba(37, 99, 235, .25);
}
html[data-theme="light"] .pill-req { color: #b91c1c; }
html[data-theme="light"] .pill-opt { color: #1d4ed8; }
html[data-theme="light"] .doc-breadcrumb,
html[data-theme="light"] .doc-breadcrumb a { color: var(--mut); }
html[data-theme="light"] .doc-breadcrumb a:hover { color: #1d4ed8; }

/* policy-packs verdict pills hardcode pale text — darken for white cards */
html[data-theme="light"] .label-block.block { color: #be123c; }
html[data-theme="light"] .label-block.modify { color: #92400e; }
html[data-theme="light"] .label-block.allow { color: #15803d; }

/* Panels built as gradients from the palette pick up the flipped vars
   automatically; soften the near-black glow shadows that leak through. */
html[data-theme="light"] .docs-card {
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 14px 32px -24px rgba(15, 23, 42, .25);
}

/* index.html closer card mixes var(--panel) with a hardcoded #080c16 */
html[data-theme="light"] .docs-closer {
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(47, 111, 208, .10), transparent 60%),
    linear-gradient(180deg, #ffffff, #eef2f7) !important;
}

/* Mono badges tuned for dark surfaces -> readable on white */
html[data-theme="light"] .docs-badge {
  color: #1d4ed8;
  background: rgba(37, 99, 235, .08);
  border-color: rgba(37, 99, 235, .25);
}

html[data-theme="light"] .docs-badge.ok {
  color: #15803d;
  background: rgba(34, 197, 94, .10);
  border-color: rgba(34, 197, 94, .30);
}

/* ==========================================================================
   2026-07-08 — LIGHT is now the docs default (see per-page early-theme
   scripts). This section: (1) repairs washed-out muted text on white,
   (2) keeps the left rail, site footer, code/terminal, and API signature
   blocks DARK in light mode. Rules use html[data-theme="light"] (0,2,x) so
   they beat the legacy pages' inline [data-theme="light"] (0,2,0) overrides.
   ORDER MATTERS: generic text-darkening comes first; the "keep dark"
   surface re-pins come AFTER so they win inside those surfaces.
   ========================================================================== */

/* --- (1) Washed muted text: pages hardcode #9cc2f5 / #bfd2f2 / #7f8caa /
   #8a98b5 that disappear on white. Darken eyebrows, kickers, muted spans. --- */
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .kicker,
html[data-theme="light"] .doc-badge:not(.ok):not(.warn) { color: #2f6fd0 !important; }
html[data-theme="light"] .mut,
html[data-theme="light"] .muted,
html[data-theme="light"] .subtitle,
html[data-theme="light"] .sub,
html[data-theme="light"] .meta,
html[data-theme="light"] small { color: #55637a !important; }
/* numbered step chips: pages put white text on an accent circle whose fill
   didn't flip — restore a solid accent fill (never the JSON .num token in code) */
html[data-theme="light"] .step .num,
html[data-theme="light"] .num-badge,
html[data-theme="light"] .step-num { background: #2f6fd0 !important; color: #ffffff !important; }

/* --- (2a) Left rail stays DARK (beats inline `.doc-sidebar{#eef0f4}` flip) --- */
html[data-theme="light"] .doc-sidebar {
  background: #0b1120 !important;
  border-color: #1b2536 !important;
}
html[data-theme="light"] .doc-sidebar-title { color: #8a98b5 !important; }
html[data-theme="light"] .doc-sidebar a { color: #b7c2d6 !important; }
html[data-theme="light"] .doc-sidebar a:hover,
html[data-theme="light"] .doc-sidebar a.active { color: #9cc2f5 !important; }
html[data-theme="light"] .doc-sidebar hr { border-color: #1b2536 !important; }

/* --- (2b) Site footer is dark by design; the global h/p flip turns its text
   dark-on-dark — re-pin it back to the light-on-dark palette. --- */
html[data-theme="light"] .eve-ftr h1,
html[data-theme="light"] .eve-ftr h2,
html[data-theme="light"] .eve-ftr h3,
html[data-theme="light"] .eve-ftr h4,
html[data-theme="light"] .eve-ftr strong { color: #eef2fb !important; }
html[data-theme="light"] .eve-ftr p,
html[data-theme="light"] .eve-ftr li,
html[data-theme="light"] .eve-ftr td,
html[data-theme="light"] .eve-ftr a,
html[data-theme="light"] .eve-ftr span,
html[data-theme="light"] .eve-ftr .muted { color: #aeb9cd !important; }
html[data-theme="light"] .eve-ftr a:hover { color: #eef2fb !important; }

/* --- (2c) API signature blocks stay DARK ("keep api/code cards dark") --- */
html[data-theme="light"] .endpoint-block,
html[data-theme="light"] .base-url-block {
  background: #06080f !important;
  border-color: #1b2536 !important;
}
html[data-theme="light"] .endpoint-block .endpoint-path,
html[data-theme="light"] .base-url-block,
html[data-theme="light"] .base-url-block code { color: #eef2fb !important; }
html[data-theme="light"] .endpoint-block .endpoint-desc { color: #aeb9cd !important; }
html[data-theme="light"] .http-badge {
  background: rgba(91, 158, 232, .12) !important;
  border-color: rgba(91, 158, 232, .30) !important;
  color: #9cc2f5 !important;
}
html[data-theme="light"] .endpoint-method.method-get { background: rgba(74, 222, 128, .12) !important; color: #7ee0a0 !important; }
html[data-theme="light"] .endpoint-method.method-post { background: rgba(91, 158, 232, .14) !important; color: #9cc2f5 !important; }

/* --- (3) Accent text on pale same-hue fills (verdict chips + callout titles):
   bright #4ade80/#c8a84e/#f87171 wash out on the pale pill — darken them. --- */
html[data-theme="light"] .as-chip.allow { color: #15803d !important; }
html[data-theme="light"] .as-chip.mod   { color: #b45309 !important; }
html[data-theme="light"] .as-chip.block { color: #be123c !important; }
html[data-theme="light"] .callout .callout-title { color: #1d4ed8 !important; }
html[data-theme="light"] .callout.success .callout-title { color: #15803d !important; }
html[data-theme="light"] .callout.warning .callout-title { color: #b45309 !important; }

/* HTTP method pills (api.html uses .method.get/.post/... on pale tinted fills) —
   bright #10b981/#2563eb wash out; darken the text for legibility on the pill. */
html[data-theme="light"] .method.get { color: #166534 !important; }
html[data-theme="light"] .method.post { color: #1d4ed8 !important; }
html[data-theme="light"] .method.delete { color: #be123c !important; }
html[data-theme="light"] .method.put,
html[data-theme="light"] .method.patch { color: #b45309 !important; }
