/* THE 1870 PROJECT — DESIGN TOKENS
   Single source of truth. All colors, spacing, and typography live here.
   Usage in JS: element.style.background = 'var(--brand-mahogany)'
   Usage in CSS: background: var(--brand-mahogany)
*/
:root {
  /* Brand */
  --brand-mahogany: #8B4513;
  --brand-oak:      #A0522D;
  --brand-gold:     #D4A574;
  --brand-emerald:  #2d5a3d;

  /* Backgrounds */
  --bg-parchment: #FAF8F3;
  --bg-warm:      #FAF3E8;
  --bg-card:      #FFFFFF;

  /* Borders */
  --border-subtle: #D4C5A9;

  /* Typography */
  --text-dark: #1A1A1A;
  --text-body: #5D3A1A;
  --text-muted: #999999;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);

  /* Shadows */
  --shadow-card: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-brand: 0 8px 24px rgba(139,69,19,0.3);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Dossier — Detective's Notepad forensic theme */
  --dossier-bg:        #1C1008;   /* near-black espresso — file folder dark */
  --dossier-surface:   #2C1A0E;   /* mahogany dark — card surface */
  --dossier-border:    rgba(212,165,116,0.30);  /* gold at 30% — subtle rule lines */
  --dossier-gold:      #D4A574;   /* gold accent — priority pills, labels */
  --dossier-urgent:    #C0392B;   /* deep crimson — URGENT pill */
  --dossier-high:      #A0522D;   /* burnt orange-brown — HIGH pill */
  --dossier-info:      #4A6741;   /* muted forest — INFO pill */
  --dossier-text:      rgba(255,255,255,0.88);  /* primary text on dark */
  --dossier-muted:     rgba(255,255,255,0.50);  /* secondary text */
  --dossier-insight:   #FFF8E1;   /* warm cream — AI insight banner bg */
  --dossier-insight-border: #D4A574; /* gold border on insight banner */

  /* Doubt Directive severity colors */
  --doubt-caution:      #D4A574;   /* same as --brand-gold — caution level */
  --doubt-warning:      #f59e0b;   /* amber-orange — warning level */
  --doubt-lock-bg:      linear-gradient(135deg, #2C1A0E 0%, #4A2010 100%); /* route lock background — same as brick wall */

  --brand-sienna: #8D6E63;    /* Onboarding warm brown — softer than mahogany, 55+ UI */
  --brand-sienna-dark: #6D4C41;
  --bg-linen: #F5F1E8;         /* Onboarding background warm */
  --bg-linen-dark: #E8DFD0;

  /* Legacy aliases — do not remove, referenced by existing code */
  --primary-color:    #8B4513;
  --secondary-color:  #A0522D;
  --accent-color:     #D4A574;
  --text-primary:     #1A1A1A;
  --text-inverse:     #FFFFFF;
  --bg-primary:       #FFFFFF;
  --bg-secondary:     #FAF8F3;
  --gradient-primary: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
  --shadow-md:        0 4px 12px rgba(0,0,0,0.15);
  --radius-md:        8px;
}

/* ==========================================================================
   CSS FIREWALL — Third-party bleed protection
   Prevents injected stylesheets (Soro, embeds, widgets) from overriding
   native SVG sizes and breaking the global header/nav layout.
   All rules use !important to win the specificity war against third-party
   injected <style> tags which land after this file in the cascade.
   ========================================================================== */

/* ── 1. Lock native UI SVGs to their intended sizes ─────────────────────── */
/* Targets every SVG in the header, nav, footer, buttons, and icon system.   */
/* The .icon class is the canonical icon wrapper used site-wide.             */
#site-header svg,
#site-header img,
nav svg,
nav img,
footer svg,
footer img,
.icon,
svg.icon,
.mobile-menu-btn svg,
.mobile-dropdown svg,
.token-display svg,
.logo-container svg,
.logo-container img,
.hero-card svg,
.btn-cta svg,
button svg {
  width: 1em !important;
  height: 1em !important;
  max-width: 24px !important;
  max-height: 24px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

/* Logo image is larger — override the 24px cap specifically */
.logo-container img.logo,
#site-header img.logo {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
}

/* ── 2. Sandbox the Soro embed container ─────────────────────────────────── */
/* Hard bounding box: nothing inside can cause horizontal scroll blowout.    */
#soro-blog,
.blog-card {
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

/* Contain all descendant elements inside the Soro container */
#soro-blog *,
#soro-blog img,
#soro-blog svg,
#soro-blog video,
#soro-blog iframe {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Soro injects .soro-blog img rules — ensure they cannot escape the container */
.soro-blog img {
  max-width: 100% !important;
  height: auto !important;
}

/* Soro card images have explicit pixel sizes — preserve them inside the box */
.soro-blog-card-image {
  max-width: 140px !important;
  width: 140px !important;
  height: 100px !important;
  object-fit: cover !important;
}

@media (max-width: 600px) {
  .soro-blog-card-image {
    max-width: 100% !important;
    width: 100% !important;
    height: 180px !important;
  }
}

/* ── 3. Global img safety net ────────────────────────────────────────────── */
/* Prevents any injected stylesheet from making images overflow their parent */
body img:not(.logo):not([class*="portrait"]):not([class*="showcase"]) {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   END CSS FIREWALL
   ========================================================================== */

/* Primary CTA button — use on all major action buttons */
.btn-cta {
  display: inline-block;
  width: 100%;
  padding: 1.1rem 2rem;
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-brand);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(139,69,19,0.4);
}
.btn-cta:active {
  transform: translateY(0);
}
.btn-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-cta-sm {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  width: auto;
}
