/*
Theme Name: Data Trade Systems
Theme URI: https://example.com/data-trade-systems
Description: Lightweight presentation theme for the Data Trade Systems data-driven trading guide. All custom functionality lives in the Python analytics service.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: data-trade-systems
*/

:root {
  --plane: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash: #cde2fb;
  --header: #0d366b;
  --radius: 12px;
  --max: 1120px;
  --prose: 760px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.65 var(--font);
  color: var(--ink);
  background: var(--plane);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* full-bleed sections use 100vw, which includes the scrollbar */
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

/* ------------------------------------------------------------ header */
.site-header { background: var(--header); color: #fff; position: sticky; top: 0; z-index: 10; }
.site-header .inner {
  max-width: var(--max); margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.brand:hover { color: #fff; }
.brand-mark { width: 28px; height: 28px; }
.brand small { font-weight: 400; font-size: 13px; opacity: .75; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 14px; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a { color: #dbe8f8; text-decoration: none; font-size: 14.5px; padding: 6px 10px; border-radius: 6px; display: block; }
.site-nav a:hover, .site-nav .current_page_item > a, .site-nav .current-menu-item > a { background: rgba(255,255,255,.12); color: #fff; }

/* ------------------------------------------------------------ layout */
.site-main { max-width: var(--max); margin: 0 auto; padding: 40px 16px 64px; }
.page-header { max-width: var(--prose); margin: 0 auto 28px; }
.page-header h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
.page-header .lede { font-size: 19px; color: var(--ink-2); margin: 0; }
.entry-content { max-width: var(--prose); margin: 0 auto; }
.entry-content h2 { font-size: 27px; line-height: 1.25; margin: 48px 0 12px; letter-spacing: -.01em; }
.entry-content h3 { font-size: 20px; margin: 32px 0 8px; }
.entry-content p, .entry-content li { color: #1f1f1d; }
.entry-content code { background: #efeee9; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.entry-content pre { background: #10233f; color: #e6eefb; padding: 16px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.entry-content pre code { background: none; padding: 0; color: inherit; }
.entry-content blockquote { margin: 24px 0; padding: 4px 20px; border-left: 4px solid var(--accent); color: var(--ink-2); }

/* Wide elements break out of the prose column */
.dts-chart, .dts-lab, .dts-wide { width: min(var(--max) - 32px, 100vw - 32px); margin-left: 50%; transform: translateX(-50%); }

/* ------------------------------------------------------------ figures */
.dts-figure { margin: 32px 0; }
.dts-figure img { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.dts-photo img { max-height: 520px; object-fit: cover; }
.dts-figure figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.dts-figure figcaption strong { color: var(--ink-2); }
.dts-figure figcaption a { color: var(--ink-2); }

/* ------------------------------------------------------------ components */
.dts-callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 14px 18px; margin: 24px 0; }
.dts-callout.warn { border-left-color: #ec835a; }
.dts-callout p:last-child { margin-bottom: 0; }
.dts-callout p:first-child { margin-top: 0; }

.dts-formula { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 19px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 20px 0; overflow-x: auto; }

.dts-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: block; overflow-x: auto; }
.dts-table th, .dts-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dts-table thead th { background: #f0efec; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.dts-thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; }

.dts-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 28px 0; }
.dts-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.dts-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.dts-card .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); font-weight: 700; }
.dts-card h3 { margin: 0; font-size: 19px; }
.dts-card p { margin: 0; color: var(--ink-2); font-size: 15px; }

.dts-steps { counter-reset: step; list-style: none; padding: 0; }
.dts-steps li { counter-increment: step; position: relative; padding-left: 44px; margin: 14px 0; }
.dts-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-wash); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; font-size: 14px; }

.dts-lab iframe { width: 100%; height: 1320px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--plane); }

.dts-sources { font-size: 14.5px; border-top: 1px solid var(--line); margin-top: 48px; padding-top: 12px; color: var(--ink-2); }
.dts-sources h2 { font-size: 18px; margin-top: 12px; }

/* ------------------------------------------------------------ front page */
.home .site-main { padding-top: 0; }
.dts-hero { width: 100vw; margin-left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #0d366b 0%, #184f95 55%, #256abf 100%); color: #fff; padding: 72px 16px 64px; margin-bottom: 40px; }
.dts-hero .inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.dts-hero h1 { font-size: clamp(34px, 5.5vw, 56px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -.025em; color: #fff; }
.dts-hero p { font-size: 19px; color: #dbe8f8; margin: 0 0 24px; }
.dts-hero .dts-figure { margin: 0; }
.dts-hero .dts-figure img { border: 0; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.dts-hero .dts-figure figcaption, .dts-hero .dts-figure figcaption a { color: #b7d3f6; }
.dts-btn { display: inline-block; background: #fff; color: var(--header); font-weight: 700; padding: 11px 20px; border-radius: 8px; text-decoration: none; margin-right: 10px; }
.dts-btn:hover { background: var(--accent-wash); color: var(--header); }
.dts-btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.dts-btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.home .entry-content { max-width: var(--max); }
.home .entry-content > p, .home .entry-content > h2, .home .entry-content > ul, .home .entry-content > .dts-callout { max-width: var(--prose); margin-left: auto; margin-right: auto; }
.home .dts-chart { width: 100%; margin-left: 0; transform: none; }

/* ------------------------------------------------------------ footer */
.site-footer { background: #10233f; color: #b7c4d6; font-size: 14px; }
.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: 32px 16px; display: grid; gap: 10px; }
.site-footer a { color: #dbe8f8; }
.site-footer .disclaimer { color: #8fa3bf; font-size: 13px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 860px) {
  .dts-hero .inner { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; margin-left: 0; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .dts-lab iframe { height: 1650px; }
}
