/* ============================================
   WHITEPAPER SHARED CSS — Truegility
   Reusable framework for all whitepaper pages
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --app-bg:           #F3F2F1;
  --surface-white:    #FFFFFF;
  --border:           #E5E7EB;
  --brand-purple:     #A855F7;
  --brand-purple-dark:#7C3AED;
  --text-primary:     #111827;
  --text-muted:       #6B7280;
  --dark-surface:     #111827;
  --dark-surface-mid: #1F2937;
  --green:            #34D399;
  --blue:             #0078D4;
  --red:              #EF4444;
  --amber:            #F59E0B;
}

html { scroll-behavior: smooth; }

body {
  background: var(--app-bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  line-height: 1.8;
}

/* ============================
   WHITEPAPER HERO
   ============================ */
.wp-hero {
  background: var(--dark-surface);
  padding: 140px 48px 96px;
  position: relative;
  overflow: hidden;
}

.wp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(168,85,247,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(168,85,247,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.wp-hero-ghost {
  position: absolute;
  bottom: -0.1em;
  right: -0.03em;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: clamp(80px, 16vw, 240px);
  color: transparent;
  -webkit-text-stroke: 1px rgba(168,85,247,0.08);
  line-height: 1;
  user-select: none;
  pointer-events: none;
  letter-spacing: -0.03em;
}

.wp-hero-inner {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.wp-hero-label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-purple);
  margin-bottom: 24px;
  display: block;
  opacity: 0;
  animation: wpFadeUp 0.8s 0.2s forwards;
}

.wp-hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 24px;
  opacity: 0;
  animation: wpFadeUp 0.8s 0.4s forwards;
}

.wp-hero-title em {
  color: var(--brand-purple);
  font-style: normal;
}

.wp-hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
  max-width: 600px;
  margin-bottom: 32px;
  opacity: 0;
  animation: wpFadeUp 0.8s 0.6s forwards;
}

.wp-hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  opacity: 0;
  animation: wpFadeUp 0.8s 0.8s forwards;
}

.wp-hero-meta-item {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wp-hero-meta-item svg {
  width: 14px;
  height: 14px;
  stroke: var(--brand-purple);
  fill: none;
  stroke-width: 2;
}

/* ============================
   CONTENT LAYOUT
   ============================ */
.wp-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 64px 48px;
}

.wp-section {
  margin-bottom: 64px;
}

/* ============================
   TYPOGRAPHY
   ============================ */
.wp-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  padding-top: 16px;
}

.wp-content h2 em {
  color: var(--brand-purple);
  font-style: normal;
}

.wp-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 16px;
  margin-top: 40px;
}

.wp-content p {
  font-size: 16px;
  line-height: 1.8;
  color: #374151;
  margin-bottom: 20px;
}

.wp-content p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.wp-content ul, .wp-content ol {
  margin: 0 0 24px 24px;
  line-height: 1.8;
  color: #374151;
}

.wp-content li {
  margin-bottom: 8px;
  font-size: 16px;
}

.wp-lead {
  font-size: 18px;
  line-height: 1.9;
  color: #4B5563;
  font-weight: 300;
}

/* ============================
   CALLOUT / PULL QUOTE
   ============================ */
.wp-callout {
  background: linear-gradient(135deg, #F3E8FF 0%, #EDE9FE 100%);
  border-left: 4px solid var(--brand-purple);
  border-radius: 0 12px 12px 0;
  padding: 28px 32px;
  margin: 32px 0;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #4C1D95;
  font-weight: 500;
}

.wp-callout em {
  font-style: normal;
  font-weight: 700;
}

/* ============================
   FUN FACT BOX
   ============================ */
.wp-funfact {
  background: var(--dark-surface);
  border-radius: 16px;
  padding: 32px 36px;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

.wp-funfact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 100% 0%, rgba(168,85,247,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.wp-funfact-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-purple);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.wp-funfact p {
  color: rgba(255,255,255,0.75);
  font-size: 15px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.wp-funfact p strong {
  color: #fff;
}

/* ============================
   COMPARISON TABLE
   ============================ */
.wp-table-wrap {
  margin: 32px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-white);
}

.wp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

.wp-table thead {
  background: var(--dark-surface);
}

.wp-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  border-bottom: 2px solid rgba(168,85,247,0.3);
}

.wp-table th:first-child {
  color: var(--brand-purple);
}

.wp-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F3F4F6;
  color: #374151;
  line-height: 1.5;
  vertical-align: top;
}

.wp-table tr:last-child td {
  border-bottom: none;
}

.wp-table tbody tr:hover {
  background: #FAFAFA;
}

.wp-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* Color-coded columns */
.wp-table .col-strength {
  color: #059669;
}

.wp-table .col-weakness {
  color: #DC2626;
}

.wp-table .col-advantage {
  color: var(--brand-purple);
}

/* ============================
   INFOGRAPHIC: SCORECARD
   ============================ */
.wp-scorecard {
  background: var(--surface-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  margin: 40px 0;
}

.wp-scorecard-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.wp-scorecard-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.wp-score-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #F3F4F6;
}

.wp-score-row:last-child {
  border-bottom: none;
}

.wp-score-label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.wp-score-bars {
  display: flex;
  gap: 4px;
}

.wp-score-dot {
  width: 100%;
  height: 28px;
  border-radius: 4px;
  background: #F3F4F6;
  position: relative;
}

.wp-score-dot.filled {
  background: linear-gradient(180deg, var(--brand-purple) 0%, var(--brand-purple-dark) 100%);
}

.wp-score-dot.filled.score-low {
  background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
}

.wp-score-dot.filled.score-mid {
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%);
}

.wp-score-dot.filled.score-high {
  background: linear-gradient(180deg, #34D399 0%, #059669 100%);
}

.wp-score-verdict {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.verdict-poor { color: #EF4444; }
.verdict-fair { color: #F59E0B; }
.verdict-good { color: #34D399; }

/* ============================
   INFOGRAPHIC: CATEGORY HEADER
   ============================ */
.wp-category-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 56px 0 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.wp-category-number {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-purple-dark));
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.wp-category-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ============================
   INFOGRAPHIC: PRO/CON LISTS
   ============================ */
.wp-procon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0;
}

.wp-pro, .wp-con {
  border-radius: 12px;
  padding: 24px;
}

.wp-pro {
  background: rgba(52,211,153,0.06);
  border: 1px solid rgba(52,211,153,0.2);
}

.wp-con {
  background: rgba(239,68,68,0.04);
  border: 1px solid rgba(239,68,68,0.15);
}

.wp-pro-title, .wp-con-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.wp-pro-title { color: #059669; }
.wp-con-title { color: #DC2626; }

.wp-pro ul, .wp-con ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-pro li, .wp-con li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 4px;
}

.wp-pro li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #059669;
  font-weight: 700;
}

.wp-con li::before {
  content: '✗';
  position: absolute;
  left: 0;
  color: #DC2626;
  font-weight: 700;
}

/* ============================
   INFOGRAPHIC: VERDICT BAR
   ============================ */
.wp-verdict {
  background: var(--surface-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.wp-verdict-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 20px;
}

.wp-verdict-text {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

.wp-verdict-text em {
  color: var(--brand-purple);
  font-style: normal;
  font-weight: 700;
}

/* ============================
   CHECKLIST SECTION
   ============================ */
.wp-checklist {
  background: var(--surface-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 36px;
  margin: 32px 0;
}

.wp-checklist-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.wp-checklist ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-checklist li {
  padding: 10px 0;
  padding-left: 32px;
  position: relative;
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  border-bottom: 1px solid #F9FAFB;
  margin-bottom: 0;
}

.wp-checklist li:last-child {
  border-bottom: none;
}

.wp-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--brand-purple);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 6.5L5.5 10L11 3' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}

/* ============================
   TOOLBAR (Print / Back)
   ============================ */
.wp-toolbar {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 48px 64px;
  max-width: 820px;
  margin: 0 auto;
}

.wp-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.wp-toolbar-btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #A855F7 0%, #8B2FD9 100%);
  box-shadow: 0 2px 8px rgba(147,51,234,0.25);
}

.wp-toolbar-btn.primary:hover {
  background: linear-gradient(180deg, #B87CF7 0%, #9333EA 100%);
  box-shadow: 0 4px 16px rgba(147,51,234,0.35);
  transform: translateY(-2px);
}

.wp-toolbar-btn.outline {
  color: var(--brand-purple);
  background: transparent;
  border: 1.5px solid var(--brand-purple);
}

.wp-toolbar-btn.outline:hover {
  background: rgba(168,85,247,0.08);
  transform: translateY(-1px);
}

.wp-toolbar-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ============================
   SECTION DIVIDER
   ============================ */
.wp-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), var(--brand-purple), var(--border), transparent);
  margin: 48px 0;
  border: none;
}

/* ============================
   ANIMATIONS
   ============================ */
@keyframes wpFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wp-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.wp-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   PRINT / PDF STYLES
   ============================ */
@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.6;
  }

  .nav, .nav-spacer, .footer, .cookie-banner,
  .contact-overlay, .back-btn, .wp-toolbar,
  .wp-hero-ghost, .sticky-cta, #exit-popup { display: none !important; }

  .wp-hero {
    background: #fff !important;
    padding: 40pt 0 24pt;
    page-break-after: avoid;
  }

  .wp-hero-label { color: #A855F7; opacity: 1; animation: none; }
  .wp-hero-title { color: #111827; opacity: 1; animation: none; font-size: 28pt; }
  .wp-hero-title em { color: #A855F7; }
  .wp-hero-subtitle { color: #666; opacity: 1; animation: none; font-size: 12pt; }
  .wp-hero-meta { opacity: 1; animation: none; }
  .wp-hero-meta-item { color: #999; }

  .wp-content { padding: 16pt 0; }
  .wp-section { margin-bottom: 24pt; }

  .wp-content h2 { font-size: 18pt; page-break-after: avoid; }
  .wp-content h3 { font-size: 14pt; page-break-after: avoid; }

  .wp-funfact {
    background: #F9FAFB !important;
    border: 1px solid #E5E7EB;
    page-break-inside: avoid;
  }
  .wp-funfact p { color: #374151; }
  .wp-funfact p strong { color: #111827; }

  .wp-callout {
    page-break-inside: avoid;
  }

  .wp-table-wrap, .wp-scorecard, .wp-procon,
  .wp-checklist, .wp-verdict {
    page-break-inside: avoid;
  }

  .wp-table thead { background: #F3F4F6 !important; }
  .wp-table th { color: #374151; border-bottom-color: #D1D5DB; }

  .wp-score-dot.filled {
    background: #A855F7 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .wp-score-dot.filled.score-low { background: #EF4444 !important; }
  .wp-score-dot.filled.score-mid { background: #F59E0B !important; }
  .wp-score-dot.filled.score-high { background: #34D399 !important; }

  .wp-category-number {
    background: #A855F7 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .wp-pro, .wp-con {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .wp-reveal { opacity: 1; transform: none; }

  a { color: inherit; text-decoration: none; }

  @page {
    margin: 0.75in;
    size: letter;
  }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  .wp-hero { padding: 120px 24px 64px; }
  .wp-content { padding: 48px 24px; }
  .wp-toolbar { padding: 0 24px 48px; }
  .wp-procon { grid-template-columns: 1fr; }
  .wp-score-row { grid-template-columns: 80px 1fr 60px; gap: 10px; }
  .wp-category-header { margin-top: 40px; }

  /* Reflow tables to stacked card layout on mobile */
  .wp-table-wrap { border: none; background: none; }
  .wp-table { border-collapse: separate; border-spacing: 0; }
  .wp-table thead { display: none; }
  .wp-table tbody tr {
    display: block;
    background: var(--surface-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
  }
  .wp-table tbody tr:hover { background: var(--surface-white); }
  .wp-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 13px;
  }
  .wp-table td:last-child { border-bottom: none; }
  .wp-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
    min-width: 90px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .wp-table td:first-child {
    font-weight: 700;
    font-size: 15px;
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 2px solid var(--border);
    display: block;
  }
  .wp-table td:first-child::before { display: none; }
}

@media (max-width: 480px) {
  .wp-hero { padding: 100px 16px 48px; }
  .wp-content { padding: 36px 16px; }
  .wp-toolbar { padding: 0 16px 36px; flex-direction: column; }
  .wp-toolbar-btn { justify-content: center; }
  .wp-score-row { grid-template-columns: 1fr; gap: 6px; }
  .wp-score-bars { max-width: 200px; }
  .wp-hero-meta { gap: 12px; }
  .wp-scorecard { padding: 24px 20px; }
}
