/* ============================================================
 * TraceByte · Editorial Overlay
 * Apply by adding [data-editorial="on"] to <body>
 * Scope: replace boxy/AI-templated chrome with editorial typography
 * ============================================================ */

/* ===== HERO (article-hero or .hero) ===== */
body[data-editorial="on"] .article-hero::before,
body[data-editorial="on"] .hero::before { display: none !important; }

body[data-editorial="on"] .article-hero,
body[data-editorial="on"] .hero {
  background: linear-gradient(180deg, #0A1B33 0%, #0A1B33 100%) !important;
}

body[data-editorial="on"] .article-tag,
body[data-editorial="on"] .hero-tag {
  background: transparent !important;
  color: var(--gold-2, #E5C26B) !important;
  border: none !important;
  padding: 0 !important;
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-style: italic !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  font-size: 14px !important;
  margin-bottom: 18px !important;
}
body[data-editorial="on"] .article-tag::before,
body[data-editorial="on"] .hero-tag::before {
  content: '— ';
  margin-right: 4px;
  color: var(--gold, #C9A24B);
}

body[data-editorial="on"] h1.article-title,
body[data-editorial="on"] .hero h1 {
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-weight: 500 !important;
  font-size: clamp(40px, 5.4vw, 60px) !important;
  letter-spacing: -0.012em !important;
  line-height: 1.08 !important;
  max-width: 820px !important;
}

body[data-editorial="on"] .article-lead,
body[data-editorial="on"] .hero p,
body[data-editorial="on"] .hero .lead {
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-style: italic !important;
  font-weight: 400 !important;
  font-size: clamp(18px, 1.4vw, 21px) !important;
  line-height: 1.6 !important;
  color: rgba(255,255,255,0.78) !important;
  max-width: 700px !important;
}

body[data-editorial="on"] .byline {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 18px;
  margin-top: 26px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

/* ===== BODY TYPOGRAPHY ===== */
body[data-editorial="on"] article.prose p {
  font-size: 17.5px;
  line-height: 1.78;
  color: #2C2C2E;
  margin-bottom: 22px;
}

/* H2 — serif italic numbers + thin hairline below */
body[data-editorial="on"] article.prose h2 {
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-weight: 500 !important;
  font-size: clamp(26px, 2.8vw, 32px) !important;
  letter-spacing: -0.008em !important;
  color: var(--navy, #0B1F3A) !important;
  margin: 72px 0 26px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--line, #E5E7EB) !important;
  line-height: 1.25 !important;
}
body[data-editorial="on"] article.prose h2 .num {
  font-family: 'Lora', Georgia, serif !important;
  font-style: italic !important;
  font-weight: 400 !important;
  color: var(--muted-2, #9CA3AF) !important;
  margin-right: 14px !important;
  font-size: 17px !important;
  letter-spacing: 0.04em !important;
  vertical-align: 0.18em !important;
  background: none !important;
}
body[data-editorial="on"] article.prose h3 {
  font-family: 'Inter', 'Noto Sans SC', sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--navy, #0B1F3A) !important;
  margin: 34px 0 12px !important;
  letter-spacing: -0.005em !important;
}

/* ===== CALLOUT (side-bar A) ===== */
body[data-editorial="on"] .callout {
  background: transparent !important;
  border: none !important;
  border-left: 3px solid var(--gold, #C9A24B) !important;
  border-radius: 0 !important;
  padding: 4px 0 4px 22px !important;
  margin: 28px 0 !important;
}
body[data-editorial="on"] .callout::before { display: none !important; }
body[data-editorial="on"] .callout strong {
  color: var(--navy, #0B1F3A) !important;
  text-transform: none !important;
  font-family: 'Inter', 'Noto Sans SC', sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  letter-spacing: -0.005em !important;
  margin-bottom: 6px !important;
  display: block !important;
}
body[data-editorial="on"] .callout p {
  font-size: 16px !important;
  color: var(--ink-2, #374151) !important;
  line-height: 1.7 !important;
  margin: 0 !important;
}
body[data-editorial="on"] .callout.warn { border-left-color: var(--red, #DC2626) !important; }
body[data-editorial="on"] .callout.warn strong { color: var(--red, #DC2626) !important; }
body[data-editorial="on"] .callout.info { border-left-color: #2563EB !important; }
body[data-editorial="on"] .callout.info strong { color: #2563EB !important; }

/* ===== CASES — newspaper-list layout ===== */
body[data-editorial="on"] .case-card {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--line, #E5E7EB) !important;
  border-radius: 0 !important;
  padding: 28px 0 24px !important;
  margin: 0 !important;
  box-shadow: none !important;
}
body[data-editorial="on"] .case-card:first-of-type {
  border-top: 2px solid var(--navy, #0B1F3A) !important;
}
body[data-editorial="on"] .case-fold .case-card:first-of-type {
  border-top: 1px solid var(--line, #E5E7EB) !important;
}
body[data-editorial="on"] .case-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px !important;
  flex-wrap: wrap;
}
body[data-editorial="on"] .case-head h3 {
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-size: 22px !important;
  font-weight: 500 !important;
  color: var(--navy, #0B1F3A) !important;
  margin: 0 !important;
  letter-spacing: -0.008em !important;
  line-height: 1.3 !important;
  flex: 1;
  min-width: 280px;
}
body[data-editorial="on"] .case-fine {
  background: transparent !important;
  color: var(--red, #DC2626) !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: -0.005em !important;
  white-space: nowrap !important;
}
body[data-editorial="on"] .case-fine.civil { color: var(--amber, #D97706) !important; }
body[data-editorial="on"] .case-body p {
  font-size: 15.5px !important;
  color: var(--ink-3, #4B5563) !important;
  margin-bottom: 8px !important;
  line-height: 1.72 !important;
}
body[data-editorial="on"] .case-tags { margin-top: 14px !important; }
body[data-editorial="on"] .case-tag {
  background: transparent !important;
  border: 1px solid var(--line, #E5E7EB) !important;
  color: var(--muted, #6B7280) !important;
  padding: 3px 10px !important;
  font-size: 11px !important;
  border-radius: 2px !important;
  letter-spacing: 0.02em !important;
}

/* Case toggle */
body[data-editorial="on"] .case-toggle {
  background: none !important;
  border: none !important;
  border-top: 1px solid var(--line, #E5E7EB) !important;
  border-radius: 0 !important;
  width: 100% !important;
  padding: 22px 0 !important;
  margin: 0 !important;
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-style: italic !important;
  font-size: 15px !important;
  color: var(--muted, #6B7280) !important;
  text-align: left !important;
  justify-content: flex-start !important;
}
body[data-editorial="on"] .case-toggle:hover {
  background: none !important;
  border-color: var(--navy, #0B1F3A) !important;
  color: var(--navy, #0B1F3A) !important;
}

/* ===== STAT ROW ===== */
body[data-editorial="on"] .stat-row {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--line, #E5E7EB) !important;
  border-bottom: 1px solid var(--line, #E5E7EB) !important;
  border-radius: 0 !important;
  padding: 28px 0 !important;
  margin: 38px 0 !important;
}
body[data-editorial="on"] .stat-item .num {
  font-family: 'Lora', Georgia, serif !important;
  font-weight: 500 !important;
  font-size: 30px !important;
  color: var(--navy, #0B1F3A) !important;
}
body[data-editorial="on"] .stat-item .lbl {
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--muted, #6B7280) !important;
}

/* ===== COMPARE TABLE ===== */
body[data-editorial="on"] table.compare {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--navy, #0B1F3A) !important;
  border-bottom: 1px solid var(--navy, #0B1F3A) !important;
  border-radius: 0 !important;
}
body[data-editorial="on"] table.compare th {
  background: transparent !important;
  color: var(--navy, #0B1F3A) !important;
  padding: 14px 18px 14px 0 !important;
  font-size: 11px !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid var(--navy, #0B1F3A) !important;
  font-weight: 600 !important;
}
body[data-editorial="on"] table.compare th:last-child { padding-right: 0 !important; }
body[data-editorial="on"] table.compare td {
  padding: 13px 18px 13px 0 !important;
  background: transparent !important;
  border-bottom: 1px solid var(--line, #E5E7EB) !important;
}
body[data-editorial="on"] table.compare td:last-child { padding-right: 0 !important; }
body[data-editorial="on"] table.compare tr:last-child td { border-bottom: none !important; }

/* ===== ADVISORY / DATA — service & download cards ===== */
body[data-editorial="on"] .svc-grid,
body[data-editorial="on"] .dl-grid {
  gap: 0 !important;
}
body[data-editorial="on"] .svc-card,
body[data-editorial="on"] .dl-card {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--line, #E5E7EB) !important;
  border-radius: 0 !important;
  padding: 32px 0 28px !important;
  box-shadow: none !important;
}
body[data-editorial="on"] .svc-grid > .svc-card:nth-child(3n+1),
body[data-editorial="on"] .dl-grid > .dl-card:nth-child(2n+1) {
  padding-right: 28px !important;
}
body[data-editorial="on"] .svc-card:hover,
body[data-editorial="on"] .dl-card:hover {
  transform: none !important;
  box-shadow: none !important;
  border-top-color: var(--navy, #0B1F3A) !important;
}
body[data-editorial="on"] .svc-icon,
body[data-editorial="on"] .dl-icon {
  width: 36px !important; height: 36px !important;
  background: transparent !important;
  border: 1px solid var(--navy, #0B1F3A) !important;
  color: var(--navy, #0B1F3A) !important;
  border-radius: 50% !important;
  font-size: 16px !important;
}
body[data-editorial="on"] .svc-title,
body[data-editorial="on"] .dl-title {
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  letter-spacing: -0.008em !important;
}

body[data-editorial="on"] .dl-badge,
body[data-editorial="on"] .dl-badge.curated,
body[data-editorial="on"] .dl-badge.educational {
  background: transparent !important;
  border: 1px solid var(--line, #E5E7EB) !important;
  color: var(--muted, #6B7280) !important;
  border-radius: 2px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
}

/* ===== SECTION HEADS — strip the "eyebrow + h2 + sub" pattern's noise ===== */
body[data-editorial="on"] .section-tag {
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-style: italic !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  color: var(--muted, #6B7280) !important;
}
body[data-editorial="on"] .section-tag::before {
  content: '— ';
  color: var(--gold, #C9A24B);
}

body[data-editorial="on"] section h2 {
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-weight: 500 !important;
}

body[data-editorial="on"] .section-sub {
  font-family: 'Lora', 'Noto Serif SC', Georgia, serif !important;
  font-style: italic !important;
  font-weight: 400 !important;
  color: var(--ink-3, #4B5563) !important;
}

/* ===== FLOATING TOGGLE BUTTON ===== */
.ed-toggle {
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 200;
  background: var(--navy, #0B1F3A);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(11,31,58,0.30);
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ed-toggle:hover { background: #1B3A5C; transform: translateY(-2px); }
.ed-toggle .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted, #6B7280);
  transition: background .2s, box-shadow .2s;
}
body[data-editorial="on"] .ed-toggle .dot {
  background: var(--gold, #C9A24B);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.25);
}
