/*
Theme Name: Car Accident Injury Calculator
Theme URI: https://caraccidentinjurycalculator.com
Author: PI Network
Author URI: https://myinjurycalculator.com
Description: Professional personal injury calculator theme with lead generation optimization, AdSense zones, and full mobile responsiveness.
Version: 1.0.0
License: Private
Text Domain: myinjurycalculator
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Brand Colors */
  --color-primary: #1B3A6B;
  --color-primary-dark: #122952;
  --color-primary-light: #2A5299;
  --color-accent: #E85D04;
  --color-accent-dark: #C24E03;
  --color-accent-light: #FF7A2B;

  /* Neutrals */
  --color-white: #FFFFFF;
  --color-bg: #FFFFFF;
  --color-bg-light: #F7F9FC;
  --color-bg-section: #EEF2F8;
  --color-text: #2D3748;
  --color-text-light: #4A5568;
  --color-text-muted: #718096;
  --color-border: #E2E8F0;
  --color-border-dark: #CBD5E0;

  /* Semantic */
  --color-success: #1E7E34;
  --color-warning: #F5A623;
  --color-error: #C53030;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans Pro', 'Segoe UI', sans-serif;
  --font-mono: 'Courier New', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 800px;
  --header-height: 90px;
  --border-radius: 8px;
  --border-radius-lg: 16px;
  --border-radius-pill: 50px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(27,58,107,0.12);
  --shadow-lg: 0 8px 32px rgba(27,58,107,0.16);
  --shadow-xl: 0 16px 48px rgba(27,58,107,0.20);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

/* ============================================================
   GLOBAL OVERFLOW FIX — prevents horizontal scroll on mobile
   ============================================================ */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

* {
  box-sizing: border-box;
  min-width: 0; /* Prevents flex/grid children from overflowing */
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-dark); }
ul, ol { padding-left: 1.5rem; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.625rem); }
h4 { font-size: 1.25rem; }
p { margin-bottom: var(--space-md); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding: var(--space-4xl) 0; }
.section--sm { padding: var(--space-2xl) 0; }
.section--bg { background: var(--color-bg-light); }
.section--dark { background: var(--color-primary); color: var(--color-white); }
.section--dark h2, .section--dark h3 { color: var(--color-white); }

.text-center { text-align: center; }
.text-accent { color: var(--color-accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.875rem 1.75rem;
  border-radius: var(--border-radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-accent);
  color: var(--color-primary);
  border-color: var(--color-accent);
}
.btn--primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}
.btn--outline:hover {
  background: var(--color-white);
  color: var(--color-primary);
}
.btn--lg { padding: 1rem 2.25rem; font-size: 1.125rem; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

/* SVG logo — header (constrained height, auto width) */
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  max-width: 300px;
  flex-shrink: 0;
}
/* Target WordPress custom logo anchor and image */
.site-logo a,
.site-logo .custom-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.site-logo img,
.site-logo svg,
.site-logo .custom-logo,
.site-logo .custom-logo-link img,
.site-logo a img {
  height: 70px !important;
  width: auto !important;
  max-width: 280px !important;
  max-height: 70px !important;
  object-fit: contain;
  display: block;
}
.site-logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

/* Footer logo — force white so it shows on dark background */
.site-footer .site-logo a,
.site-footer .site-logo .custom-logo-link {
  display: flex;
  align-items: center;
  line-height: 0;
}
.site-footer .site-logo img,
.site-footer .site-logo svg,
.site-footer .site-logo .custom-logo,
.site-footer .site-logo .custom-logo-link img,
.site-footer .site-logo a img {
  height: 60px !important;
  width: auto !important;
  max-width: 260px !important;
  max-height: 60px !important;
  filter: brightness(0) invert(1);
  object-fit: contain;
  display: block;
}
.site-footer .site-logo-text { color: var(--color-white); }

.site-nav { display: flex; align-items: center; gap: var(--space-xl); }
.site-nav a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.site-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-sm);
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  transition: all var(--transition);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 60%, #1e4d8c 100%);
  padding: var(--space-4xl) 0;
  position: relative;
  overflow: hidden; /* Clip decorative pseudo-elements only */
  margin-top: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245,166,35,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-light) 50%, var(--color-accent) 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}

.hero-content { color: var(--color-white); }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(245,166,35,0.2);
  border: 1px solid rgba(245,166,35,0.4);
  color: var(--color-accent-light);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--border-radius-pill);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  color: var(--color-white);
  font-size: clamp(2rem, 4vw, 3.25rem);
  margin-bottom: var(--space-lg);
  line-height: 1.15;
}

.hero h1 span { color: var(--color-accent); }

.hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.hero-trust {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
}

.hero-trust-item svg { color: var(--color-accent); flex-shrink: 0; }

/* Hero Calculator Panel */
.hero-calculator {
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* critical for grid children */
}

.calc-header {
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
}
.calc-header h3 { color: var(--color-white); margin: 0; font-size: 1.125rem; }

.calc-body { padding: var(--space-xl); }

/* ============================================================
   TRUST SIGNALS BAR
   ============================================================ */
.trust-bar {
  background: var(--color-primary);
  padding: var(--space-lg) 0;
  width: 100%;
  overflow: hidden;
}

.trust-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  width: 100%;
}

.trust-stat {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-xl);
  position: relative;
  flex-shrink: 0;
}

.trust-stat + .trust-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.25);
}

.trust-stat-icon {
  width: 36px;
  height: 36px;
  background: rgba(245,166,35,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-accent);
}

.trust-stat-text strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}
.trust-stat-text span { font-size: 0.8125rem; color: rgba(255,255,255,0.75); }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(16.666% + 28px);
  right: calc(16.666% + 28px);
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-light) 50%, var(--color-accent) 100%);
  z-index: 0;
}

.step-card {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto var(--space-lg);
  border: 3px solid var(--color-accent);
  position: relative;
  z-index: 2;
}

.step-card h3 { font-size: 1.125rem; margin-bottom: var(--space-sm); }
.step-card p { color: var(--color-text-light); font-size: 0.9375rem; margin: 0; }

/* ============================================================
   CASE TYPE CARDS
   ============================================================ */
.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.section-header p { color: var(--color-text-light); font-size: 1.0625rem; max-width: 600px; margin: 0 auto; }

.case-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.case-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.case-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.case-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.case-card:hover::before { transform: scaleX(1); }

.case-icon {
  width: 56px;
  height: 56px;
  background: var(--color-bg-section);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  color: var(--color-primary);
  font-size: 1.5rem;
  transition: all var(--transition);
}
.case-card:hover .case-icon {
  background: var(--color-primary);
  color: var(--color-white);
}

.case-card h3 {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
}

.case-card p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ============================================================
   WHY USE US
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.feature-item {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(245,166,35,0.12);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-dark);
  flex-shrink: 0;
}

.feature-text h3 { font-size: 1.0625rem; margin-bottom: var(--space-xs); }
.feature-text p { font-size: 0.9375rem; color: var(--color-text-light); margin: 0; }

/* ============================================================
   TESTIMONIALS / STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  text-align: center;
}

.stat-item strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}
.stat-item span { font-size: 0.9375rem; color: rgba(255,255,255,0.75); }

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-banner {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  padding: var(--space-3xl) 0;
  text-align: center;
}

.cta-banner h2 { color: var(--color-primary); margin-bottom: var(--space-md); }
.cta-banner p { color: rgba(27,58,107,0.8); font-size: 1.0625rem; margin-bottom: var(--space-xl); max-width: 600px; margin-left: auto; margin-right: auto; }
.cta-banner .btn--primary { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); }
.cta-banner .btn--primary:hover { background: var(--color-primary-dark); }

/* ============================================================
   BLOG PREVIEW
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.blog-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all var(--transition);
}
.blog-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.blog-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-bg-section);
}

.blog-card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-bg-section) 0%, var(--color-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.blog-card-body { padding: var(--space-lg); }
.blog-card-meta { font-size: 0.8125rem; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.blog-card-body h3 { font-size: 1.0625rem; margin-bottom: var(--space-sm); line-height: 1.35; }
.blog-card-body h3 a { color: var(--color-primary); }
.blog-card-body h3 a:hover { color: var(--color-accent-dark); }
.blog-card-body p { font-size: 0.9rem; color: var(--color-text-light); margin-bottom: var(--space-md); }
.blog-card-link { font-size: 0.875rem; font-weight: 600; color: var(--color-primary); display: inline-flex; align-items: center; gap: 4px; }
.blog-card-link:hover { color: var(--color-accent-dark); }

/* ============================================================
   ADSENSE ZONES (empty until activated)
   ============================================================ */
.ad-zone {
  width: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Hide empty ad zones completely — no white space when ads not active */
.ad-zone:empty { display: none; padding: 0; margin: 0; }
.ad-zone--leaderboard { max-width: 728px; min-height: 0; margin: 0 auto; }
.ad-zone--leaderboard:not(:empty) { min-height: 90px; }
.ad-zone--rectangle { max-width: 336px; min-height: 0; }
.ad-zone--rectangle:not(:empty) { min-height: 280px; }
.ad-zone--sidebar { max-width: 300px; min-height: 0; }
.ad-zone--sidebar:not(:empty) { min-height: 250px; }
.ad-zone--half-page { max-width: 300px; min-height: 0; }
.ad-zone--half-page:not(:empty) { min-height: 600px; }
/* Hide ad wrapper divs when zone is empty */
.ad-wrapper:has(.ad-zone:empty) { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.75);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand .site-logo-text { color: var(--color-white); font-size: 1.125rem; margin-bottom: var(--space-md); display: block; }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; margin-bottom: var(--space-lg); }

.footer-col h4 {
  color: var(--color-white);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  font-family: var(--font-body);
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: var(--space-sm); }
.footer-col ul li a {
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--color-accent); }

.footer-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-bottom: var(--space-xl);
}

.footer-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  max-width: 700px;
}

.footer-legal {
  display: flex;
  gap: var(--space-lg);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.footer-legal a {
  color: rgba(255,255,255,0.55);
  font-size: 0.8125rem;
  transition: color var(--transition);
}
.footer-legal a:hover { color: var(--color-accent); }

.footer-copyright {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin-top: var(--space-md);
}

/* ============================================================
   BLOG POST TEMPLATE
   ============================================================ */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-2xl);
  align-items: start;
  padding: var(--space-2xl) 0 var(--space-4xl);
}

.post-header { margin-bottom: var(--space-xl); }
.post-meta { display: flex; gap: var(--space-lg); flex-wrap: wrap; margin-bottom: var(--space-md); }
.post-meta span { font-size: 0.875rem; color: var(--color-text-muted); display: flex; align-items: center; gap: 4px; }
.post-title { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: var(--space-md); }
.post-subtitle { font-size: 1.125rem; color: var(--color-text-light); }

/* Table of Contents */
.toc {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}
.toc h4 { font-size: 0.9375rem; margin-bottom: var(--space-md); font-family: var(--font-body); font-weight: 700; color: var(--color-primary); }
.toc ol { margin: 0; padding-left: var(--space-lg); }
.toc li { margin-bottom: var(--space-xs); }
.toc a { font-size: 0.9rem; color: var(--color-text); }
.toc a:hover { color: var(--color-primary); }

/* Post Content */
.post-content h2 { margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: 1px solid var(--color-border); }
.post-content h3 { margin-top: var(--space-xl); }
.post-content p { margin-bottom: var(--space-lg); }
.post-content ul, .post-content ol { margin-bottom: var(--space-lg); }
.post-content li { margin-bottom: var(--space-xs); }
.post-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-light);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--color-text-light);
}

/* Data Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-xl) 0;
  font-size: 0.9375rem;
}
.post-content th {
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-md);
  text-align: left;
  font-weight: 600;
}
.post-content td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}
.post-content tr:nth-child(even) td { background: var(--color-bg-light); }
.post-content .table-source {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: calc(-1 * var(--space-md));
  margin-bottom: var(--space-xl);
}

/* CTA Boxes in Post */
.cta-inline {
  background: linear-gradient(135deg, var(--color-bg-section) 0%, #dce6f5 100%);
  border: 1px solid var(--color-border-dark);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--border-radius);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.cta-inline p { margin: 0; font-weight: 600; color: var(--color-primary); flex: 1; }

.cta-banner-post {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  text-align: center;
  margin: var(--space-xl) 0;
}
.cta-banner-post h3 { color: var(--color-white); margin-bottom: var(--space-sm); }
.cta-banner-post p { color: rgba(255,255,255,0.8); margin-bottom: var(--space-lg); font-size: 0.9375rem; }
.cta-banner-post small { display: block; margin-top: var(--space-sm); color: rgba(255,255,255,0.6); font-size: 0.8125rem; }

/* FAQ Section */
.faq-section { margin: var(--space-2xl) 0; }
.faq-section h2 { margin-bottom: var(--space-xl); }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-md);
  overflow: hidden;
}
.faq-question {
  padding: var(--space-lg);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-bg-light);
  font-weight: 600;
  color: var(--color-primary);
  font-size: 1rem;
  transition: background var(--transition);
}
.faq-question:hover { background: var(--color-bg-section); }
.faq-question svg { flex-shrink: 0; transition: transform var(--transition); }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
  padding: 0 var(--space-lg);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 500px;
  padding: var(--space-lg);
}
.faq-answer p { margin: 0; font-size: 0.9375rem; color: var(--color-text-light); }

/* Author Box */
.author-box {
  display: flex;
  gap: var(--space-lg);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  margin-top: var(--space-2xl);
}
.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--color-accent);
}
.author-info h4 { font-size: 1rem; margin-bottom: var(--space-xs); }
.author-title { font-size: 0.8125rem; color: var(--color-accent-dark); font-weight: 600; margin-bottom: var(--space-sm); }
.author-bio { font-size: 0.875rem; color: var(--color-text-light); margin: 0; }

/* Post Disclaimer */
.post-disclaimer {
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.6;
}

/* Sidebar */
.post-sidebar { position: sticky; top: calc(var(--header-height) + var(--space-xl)); }

.sidebar-widget {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}
.sidebar-widget h4 {
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
  font-family: var(--font-body);
  font-weight: 700;
}

.sidebar-cta {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  text-align: center;
}
.sidebar-cta h4 { color: var(--color-white); margin-bottom: var(--space-sm); font-family: var(--font-body); font-size: 1rem; }
.sidebar-cta p { font-size: 0.875rem; color: rgba(255,255,255,0.8); margin-bottom: var(--space-lg); }
.sidebar-cta .btn { width: 100%; justify-content: center; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  background: var(--color-bg-light);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}
.breadcrumbs-inner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .separator { color: var(--color-border-dark); }
.breadcrumbs .current { color: var(--color-text); font-weight: 500; }

/* ============================================================
   CALCULATOR WIDGET STYLES
   ============================================================ */
.calculator-widget {
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

.calc-widget-header {
  background: var(--color-primary);
  padding: var(--space-lg) var(--space-xl);
  color: var(--color-white);
  text-align: center;
}
.calc-widget-header h3 { color: var(--color-white); margin: 0; font-size: 1.125rem; }

.calc-widget-body {
  padding: var(--space-xl);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.calc-field { margin-bottom: var(--space-lg); width: 100%; }
.calc-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.calc-field select,
.calc-field input[type="number"],
.calc-field input[type="text"] {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem var(--space-md);
  border: 1.5px solid var(--color-border-dark);
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}
.calc-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231B3A6B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.calc-field select:focus,
.calc-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27,58,107,0.1);
}

.calc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.calc-results {
  background: var(--color-primary);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  color: var(--color-white);
  margin-top: var(--space-lg);
  display: none;
}
.calc-results.visible { display: block; }

.calc-result-range {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.calc-result-label { font-size: 0.875rem; color: rgba(255,255,255,0.75); margin-bottom: var(--space-xs); }
.calc-result-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
}
.calc-result-subtext { font-size: 0.8125rem; color: rgba(255,255,255,0.6); }

.calc-result-breakdown {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: var(--space-lg);
  margin-top: var(--space-lg);
}
.calc-result-breakdown h4 { color: var(--color-white); font-size: 0.9375rem; margin-bottom: var(--space-md); font-family: var(--font-body); }

.calc-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.calc-breakdown-row:last-child { border-bottom: none; font-weight: 700; color: var(--color-accent); }

.calc-state-note {
  background: rgba(245,166,35,0.15);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  margin-top: var(--space-lg);
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.85);
}

.calc-cta {
  margin-top: var(--space-lg);
  text-align: center;
}
.calc-cta .btn { width: 100%; justify-content: center; }
.calc-disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  margin-top: var(--space-sm);
  font-style: italic;
}

/* ============================================================
   MOBILE NAVIGATION
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-white);
  z-index: 999;
  padding: var(--space-xl);
  flex-direction: column;
  gap: var(--space-md);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-calculator { max-width: 100%; width: 100%; min-width: 0; }
  .hero-content { min-width: 0; }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
}

@media (max-width: 768px) {
  :root {
    --space-4xl: 2.5rem;
    --space-3xl: 2rem;
    --header-height: 70px;
  }

  /* CRITICAL: Prevent ALL horizontal overflow at root level */
  body { overflow-x: hidden; }
  .hero { overflow: hidden; } /* Re-enable clipping on mobile */
  .hero::before { display: none; } /* Hide decorative element on mobile */
  .hero::after { display: none; }

  /* All containers strictly width-bound */
  .container { padding: 0 1rem; width: 100%; }
  .hero-inner { 
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    padding: 0;
  }
  .hero-content { min-width: 0; width: 100%; }
  
  /* Hero */
  .hero { padding: 2rem 0 2.5rem; }
  .hero h1 { font-size: 1.875rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-badge { font-size: 0.75rem; }
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
  }
  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }
  .hero-trust { gap: 0.75rem; flex-wrap: wrap; }
  .hero-trust-item { font-size: 0.8125rem; }

  /* Header */
  .site-nav { display: none; }
  .header-cta .btn { display: none; }
  .hamburger { display: flex; }

  /* Calculator — fully contained, no overflow possible */
  .hero-calculator { 
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
  }
  .calculator-widget { 
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .calc-widget-body { 
    padding: 1rem;
    width: 100%;
    overflow: hidden;
  }
  .calc-widget-header { padding: 1rem; }
  .calc-widget-header h3 { font-size: 1rem; }
  .calc-form { width: 100%; }
  .calc-field { width: 100%; }
  .calc-field-row { 
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
  }
  .calc-field select,
  .calc-field input[type="number"],
  .calc-field input[type="text"] {
    width: 100%;
    max-width: 100%;
    font-size: 16px; /* Prevents iOS zoom */
    box-sizing: border-box;
  }
  .calc-submit {
    width: 100%;
    font-size: 0.9rem;
    white-space: normal;
    text-align: center;
    padding: 0.875rem 1rem;
  }

  /* Trust bar — 2x2 grid */
  .trust-bar { padding: 0; overflow: hidden; }
  .trust-bar-inner {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100%;
    gap: 0;
  }
  .trust-stat {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 0.5rem;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
  }
  .trust-stat + .trust-stat::before { display: none; }
  .trust-stat-text strong { font-size: 1.1rem; }
  .trust-stat-text span { font-size: 0.75rem; }

  /* Steps */
  .steps-grid { grid-template-columns: 1fr; }
  .steps-grid::before { display: none; }

  /* Case cards — 2 cols */
  .case-grid { 
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .case-card { padding: 1rem 0.75rem; }
  .case-icon { width: 44px; height: 44px; }
  .case-card h3 { font-size: 0.875rem; }
  .case-card p { font-size: 0.75rem; }

  /* Features */
  .features-grid { grid-template-columns: 1fr; }

  /* Stats — 2x2 */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .stat-item strong { font-size: 2rem; }

  /* CTA banner — prevent button overflow */
  .cta-banner { padding: 2rem 0; text-align: center; }
  .cta-banner h2 { font-size: 1.375rem; }
  .cta-banner p { font-size: 0.9375rem; margin-left: 1rem; margin-right: 1rem; }
  .cta-banner .btn {
    font-size: 0.875rem;
    padding: 0.875rem 1.25rem;
    white-space: normal;
    display: inline-flex;
    max-width: calc(100vw - 2rem);
    text-align: center;
    justify-content: center;
  }

  /* All buttons — prevent overflow */
  .btn {
    white-space: normal;
    word-break: normal;
    max-width: 100%;
  }

  /* Blog */
  .blog-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; }
  .footer-legal { justify-content: flex-start; flex-wrap: wrap; }

  .section { padding: 2.5rem 0; }
}

@media (max-width: 480px) {
  /* Case cards — single column on very small screens */
  .case-grid { grid-template-columns: 1fr; }
  
  /* Stats — keep 2 cols */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  
  /* Hero text */
  .hero h1 { font-size: 1.625rem; }
  .hero-subtitle { font-size: 0.9375rem; }

  /* Logo */
  .site-logo img,
  .site-logo .custom-logo-link img,
  .site-logo a img {
    max-width: 160px !important;
  }
}

/* ============================================================
   LEGAL PAGE STYLES (Privacy Policy, Disclaimer, Cookie Policy)
   ============================================================ */
.legal-content h2 {
  font-size: 1.375rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-primary);
}
.legal-content h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.legal-content h3 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.legal-content p { font-size: 0.9875rem; line-height: 1.75; color: var(--color-text-light); }
.legal-content ul, .legal-content ol { margin-bottom: 1.25rem; }
.legal-content li { font-size: 0.9875rem; line-height: 1.75; color: var(--color-text-light); margin-bottom: 0.375rem; }
.legal-content strong { color: var(--color-text); }
.legal-content hr { border: none; border-top: 1px solid var(--color-border); margin: 2rem 0; }
.legal-content a { color: var(--color-primary); text-decoration: underline; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.875rem; }
.legal-content th { background: var(--color-primary); color: white; padding: 0.75rem 1rem; text-align: left; font-weight: 600; }
.legal-content td { padding: 0.625rem 1rem; border-bottom: 1px solid var(--color-border); }
.legal-content tr:nth-child(even) td { background: var(--color-bg-light); }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .site-header, .site-footer, .sidebar-cta, .cta-inline, .cta-banner-post { display: none; }
  .post-layout { grid-template-columns: 1fr; }
  .ad-zone { display: none; }
}

/* ============================================================
   TARGETED MOBILE FIXES — Trust Bar + CTA Button
   ============================================================ */

/* Trust bar — force single column vertical stack on mobile */
@media (max-width: 768px) {
  .trust-bar-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 0.5rem 0 !important;
  }
  .trust-stat {
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 280px !important;
    padding: 0.875rem 1rem !important;
    gap: 1rem !important;
  }
  .trust-stat + .trust-stat {
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .trust-stat + .trust-stat::before { display: none !important; }

  /* CTA banner button — prevent overflow */
  .cta-banner {
    overflow: hidden;
  }
  .cta-banner .btn {
    max-width: calc(100vw - 3rem) !important;
    width: auto !important;
    display: inline-flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
    padding: 0.875rem 1.5rem !important;
    font-size: 0.9rem !important;
    gap: 0.25rem !important;
  }
  .cta-banner .btn span {
    display: inline;
  }
}
