/*
 * Same CSS custom properties as the React app's src/index.css, so the
 * Tailwind CDN color config in functions.php (bg-brand, text-yes, etc.)
 * resolves to identical colors. Dark mode toggles via a `.dark` class on
 * <html>, same as the app.
 */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --surface-3: #e1eaf2;
  --border: #dfe6ee;
  --border-strong: #ccd7e2;
  --text: #14181f;
  --text-soft: #37444f;
  --muted: #66717d;
  --brand: #1074b7;
  --brand-strong: #0c5c93;
  --brand-soft: rgba(16, 116, 183, 0.1);
  --yes: #0ea472;
  --yes-soft: rgba(14, 164, 114, 0.12);
  --no: #e5405e;
  --no-soft: rgba(229, 64, 94, 0.12);
  --whale: #ff6541;
  --whale-soft: rgba(255, 101, 65, 0.14);
  --shadow: 0 1px 2px rgba(16, 21, 29, 0.04), 0 8px 24px rgba(16, 21, 29, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 21, 29, 0.14);
}

.dark {
  --bg: #08131e;
  --surface: #0f1e2c;
  --surface-2: #16293a;
  --surface-3: #203a4e;
  --border: #203a4e;
  --border-strong: #2d4a61;
  --text: #e8eff6;
  --text-soft: #b2c2d1;
  --muted: #7c8ea0;
  --brand: #1a86cf;
  --brand-strong: #34bbfc;
  --brand-soft: rgba(52, 187, 252, 0.15);
  --yes: #22c98a;
  --yes-soft: rgba(34, 201, 138, 0.15);
  --no: #fb5f76;
  --no-soft: rgba(251, 95, 118, 0.15);
  --whale: #ff7a5c;
  --whale-soft: rgba(255, 122, 92, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.5);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/*
 * Renders a market post's raw post_content (AI article or plain summary)
 * on single.php — Tailwind's typography plugin isn't loaded via the CDN
 * build, so these tags get plain rules instead of `prose` utility classes.
 *
 * !important is used deliberately here: Tailwind's CDN script compiles and
 * injects its own <style> tag into <head> at runtime, after this static
 * stylesheet — its Preflight reset (which strips default table/list/heading
 * styling) otherwise wins the cascade tie and this content renders as an
 * unstyled wall of text.
 */
.eb-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
}
.eb-content > *:first-child {
  margin-top: 0 !important;
}
.eb-content h2,
.eb-content h3 {
  margin: 1.75em 0 0.6em !important;
  padding-bottom: 0.4em !important;
  border-bottom: 1px solid var(--border) !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  color: var(--text) !important;
}
.eb-content p {
  margin: 0.85em 0 !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  color: var(--text-soft) !important;
}
.eb-content ul {
  margin: 0.85em 0 !important;
  padding-left: 1.4em !important;
  list-style: disc !important;
}
.eb-content li {
  margin: 0.4em 0 !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: var(--text-soft) !important;
}
.eb-content li::marker {
  color: var(--brand) !important;
}
.eb-content strong {
  color: var(--text) !important;
  font-weight: 700 !important;
}
.eb-content a {
  color: var(--brand) !important;
  text-decoration: underline !important;
}
.eb-content table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1em 0 !important;
  font-size: 13px !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}
.eb-content th,
.eb-content td {
  border: 1px solid var(--border) !important;
  border-width: 0 0 1px 0 !important;
  padding: 8px 12px !important;
  text-align: left !important;
  color: var(--text-soft) !important;
}
.eb-content tr:last-child td {
  border-bottom: 0 !important;
}
.eb-content tr:nth-child(even) td {
  background: var(--surface-2) !important;
}
.eb-content th {
  background: var(--surface-3) !important;
  font-weight: 700 !important;
  color: var(--text) !important;
}

/* Range slider used by the Prediction Simulator on single.php */
.eb-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
.eb-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--brand) 0 calc(var(--fill, 0) * 1%),
    var(--surface-3) calc(var(--fill, 0) * 1%) 100%
  );
}
.eb-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -6px;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow);
}
.eb-range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}
.eb-range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}
.eb-range::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: var(--shadow);
}

/* dual-thumb variant used by the "Yes odds" filter — transparent track,
   the colored fill between the two thumbs is drawn by a sibling div. */
.eb-range-dual {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}
.eb-range-dual::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
}
.eb-range-dual::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  margin-top: -6px;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.eb-range-dual::-moz-range-track {
  height: 6px;
  background: transparent;
}
.eb-range-dual::-moz-range-thumb {
  pointer-events: auto;
  height: 16px;
  width: 16px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: var(--shadow);
  cursor: pointer;
}
