/* ===== Playbook Styles ===== */

/* Hero */
.playbook-hero {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.playbook-badge {
  display: inline-block;
  background: rgba(42, 181, 160, 0.2);
  color: var(--color-accent-light);
  padding: 0.4rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 1.5rem;
}

.playbook-hero h1 {
  max-width: 800px;
  margin: 0 auto 1.25rem;
  font-size: 2.5rem;
  line-height: 1.15;
}

.playbook-hero-sub {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.playbook-hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.playbook-hero-stat {
  text-align: center;
}

.playbook-hero-stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--color-accent-light);
  margin-bottom: 0.25rem;
}

.playbook-hero-stat span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Intro */
.playbook-intro {
  max-width: 700px;
}

.playbook-intro h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.playbook-intro p {
  color: var(--color-text-light);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.playbook-what-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.playbook-what-list li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  color: var(--color-text-light);
  font-size: 1.05rem;
}

.playbook-what-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* Table of Contents */
.toc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.toc-item:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(42, 181, 160, 0.1);
}

.toc-item.toc-bonus {
  border-style: dashed;
}

.toc-number {
  width: 36px;
  height: 36px;
  background: var(--color-primary-dark);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.toc-item strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.toc-difficulty {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  display: inline-block;
}

.toc-difficulty.easy { background: #d4edda; color: #155724; }
.toc-difficulty.easy-med { background: #d4edda; color: #155724; }
.toc-difficulty.medium { background: #fff3cd; color: #856404; }
.toc-difficulty.advanced { background: #f8d7da; color: #721c24; }

/* Automation Sections */
.playbook-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.auto-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.auto-number {
  width: 48px;
  height: 48px;
  background: var(--color-primary-dark);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.auto-number.bonus {
  background: var(--color-accent);
}

.auto-header h2 {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.auto-difficulty {
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-block;
}

.auto-difficulty.easy { color: #155724; }
.auto-difficulty.easy-med { color: #155724; }
.auto-difficulty.medium { color: #856404; }
.auto-difficulty.advanced { color: #721c24; }

/* Stats Bar */
.auto-stats-bar {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.auto-stat {
  flex: 1;
  min-width: 160px;
  background: var(--color-bg-alt);
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.auto-stat strong {
  display: block;
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}

/* Problem Block */
.auto-problem {
  margin-bottom: 2.5rem;
}

.auto-problem h3,
.auto-solution h3,
.auto-tools h3,
.auto-diy h3 {
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.auto-problem p {
  color: var(--color-text-light);
  line-height: 1.7;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.auto-kicker {
  font-weight: 600;
  color: var(--color-primary) !important;
  font-size: 1.05rem !important;
  margin-top: 1rem !important;
  padding-left: 1rem;
  border-left: 3px solid var(--color-accent);
}

/* Solution Steps */
.auto-solution {
  margin-bottom: 2.5rem;
}

.auto-steps {
  padding-left: 1.25rem;
}

.auto-steps li {
  padding: 0.5rem 0;
  color: var(--color-text-light);
  line-height: 1.6;
}

.auto-steps em {
  display: block;
  background: rgba(42, 181, 160, 0.06);
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  margin-top: 0.35rem;
  font-style: normal;
  color: var(--color-text);
  font-size: 0.9rem;
  border-left: 3px solid var(--color-accent);
}

/* Tools */
.auto-tools {
  margin-bottom: 2.5rem;
}

.tool-tiers {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.tool-tier {
  background: var(--color-bg-alt);
  border-radius: var(--border-radius);
  padding: 1.25rem 1.5rem;
}

.tool-tier-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.tool-tier-label.budget { color: #155724; }
.tool-tier-label.custom { color: #856404; }
.tool-tier-label.allinone { color: var(--color-primary); }

.tool-tier p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.tool-tier p:last-child {
  margin-bottom: 0;
}

.tool-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

/* DIY */
.auto-diy {
  background: rgba(42, 181, 160, 0.04);
  border: 1px solid rgba(42, 181, 160, 0.15);
  border-radius: var(--border-radius);
  padding: 1.5rem 2rem;
}

.auto-diy h3 {
  color: var(--color-accent) !important;
}

.auto-diy ul,
.auto-diy ol {
  padding-left: 1.25rem;
}

.auto-diy li {
  padding: 0.4rem 0;
  color: var(--color-text-light);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Summary */
.playbook-summary {
  background: var(--color-primary-dark);
  color: #fff;
}

.playbook-summary h2 {
  color: #fff;
  text-align: center;
  margin-bottom: 2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.summary-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
}

.summary-card h3 {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.summary-big {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent-light);
  margin-bottom: 0.75rem;
}

.summary-card p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
}

.summary-closing {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.summary-closing p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

/* Tool Reference Table */
.tool-table-wrap {
  overflow-x: auto;
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tool-table th {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

.tool-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-light);
}

.tool-table tr:hover td {
  background: var(--color-bg-alt);
}

/* Print / PDF Styles */
@media print {

  /* --- Hide chrome --- */
  .header, .footer, .nav {
    display: none !important;
  }

  .btn {
    display: none !important;
  }

  section {
    padding: 1.5rem 0 !important;
  }

  /* --- Color fixes for white paper --- */
  .playbook-hero {
    background: #fff !important;
    color: #000 !important;
    padding: 2rem 0;
  }

  .playbook-hero h1 {
    color: #000;
    font-size: 2rem;
  }

  .playbook-hero-sub {
    color: #333 !important;
  }

  .playbook-hero-stat strong {
    color: #000 !important;
  }

  .playbook-badge {
    background: #eee !important;
    color: #333 !important;
  }

  .auto-kicker {
    color: #000 !important;
  }

  .playbook-summary {
    background: #f5f5f5 !important;
    color: #000 !important;
  }

  .playbook-summary h2 { color: #000 !important; }
  .summary-card { background: #eee !important; }
  .summary-card h3 { color: #555 !important; }
  .summary-big { color: #000 !important; }
  .summary-card p { color: #333 !important; }
  .summary-closing p { color: #333 !important; }

  /* --- Page break rules --- */

  /* TOC ("What's Inside") starts on its own page */
  .playbook-toc {
    break-before: page;
    page-break-before: always;
  }

  /* Each automation section starts on a fresh page */
  .playbook-section {
    break-before: page !important;
    page-break-before: always !important;
    /* Remove the old avoid - these sections are longer than a page */
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  /* Summary section starts fresh */
  .playbook-summary {
    break-before: page;
    page-break-before: always;
  }

  /* --- Keep logical blocks together --- */

  /* Intro paragraph + its bullet list */
  .playbook-intro {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .playbook-what-list {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* TOC grid */
  .toc-grid {
    grid-template-columns: repeat(3, 1fr);
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Automation header - never orphaned at page bottom */
  .auto-header {
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Stats bar stays with whatever follows it */
  .auto-stats-bar {
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Problem block stays together (usually short) */
  .auto-problem {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Individual steps don't split mid-step */
  .auto-steps li {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Each pricing tier stays together */
  .tool-tier {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* DIY section stays together */
  .auto-diy {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .auto-diy li {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Headings never orphaned at page bottom */
  h2, h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Summary cards */
  .summary-cards {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Tool reference table - rows don't split */
  .tool-ref-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .playbook-hero h1 {
    font-size: 1.75rem;
  }

  .playbook-hero-stats {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .toc-grid {
    grid-template-columns: 1fr;
  }

  .auto-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .auto-stats-bar {
    flex-direction: column;
  }

  .auto-stat {
    min-width: auto;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-big {
    font-size: 2rem;
  }

  .auto-diy {
    padding: 1.25rem;
  }

  .tool-tier {
    padding: 1rem;
  }
}
