/* ==========================================================================
   Padrão de encontro — botão de exportação em PDF, ficha do encontro e
   folha de impressão A4 das páginas de aula.
   Carregado explicitamente por cada página de aula, pois nem todas importam
   css/inteli-styles.css. Ver .claude/skills/padrao-encontro/SKILL.md
   ========================================================================== */

/* Botão flutuante de exportação */
.pdf-export-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(46, 38, 64, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  color: var(--inteli-dark-purple);
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(46, 38, 64, 0.14);
  transition: transform 0.15s, box-shadow 0.15s;
}

.pdf-export-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(46, 38, 64, 0.22);
}

/* Ficha do encontro — objetivo, estratégia e estrutura */
.encontro-meta {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid var(--inteli-green);
  border-radius: 14px;
  padding: 22px 26px;
  margin: 0 0 28px;
  font-family: 'Manrope', sans-serif;
}

.encontro-meta > h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--inteli-dark-purple);
  margin: 0 0 4px;
}

.encontro-meta .encontro-ref {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 16px;
}

.encontro-item + .encontro-item {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.encontro-item h3 {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2f8f78;
  margin: 0 0 6px;
}

.encontro-item p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: #374151;
}

.encontro-item ol {
  margin: 0;
  padding-left: 1.2rem;
}

.encontro-item li {
  font-size: 0.94rem;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 4px;
}

/* Ficha do encontro dentro de um deck de slides */
.slide .encontro-meta,
.lesson-slide .encontro-meta {
  margin: 0;
  max-height: 100%;
  overflow: hidden;
}

/* ==========================================================================
   Impressão — documento A4 retrato.
   As páginas do acervo são feitas para tela: deck em 16:9, material em
   coluna larga, tudo com altura presa ao viewport. Na impressão o documento
   é remontado como texto corrido em A4, um slide por página nos decks.
   Os seletores usam especificidade alta (html body …) porque o CSS inline de
   cada página é carregado depois deste arquivo.
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 16mm 14mm 18mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, html body {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
    font-size: 10.5pt !important;
  }

  /* Navegação e controles não pertencem ao documento impresso. */
  .pdf-export-btn,
  .slide-footer,
  .lesson-footer,
  #float-nav,
  #progress-bar,
  .top-nav,
  .back-button,
  .nav-wrapper,
  .fullscreen-btn,
  .cover-particles,
  .mat-sidebar,
  .mat-header .btn,
  .material-header .btn,
  .mat-head a,
  .plan-head a,
  .lesson-nav,
  .slide-counter {
    display: none !important;
  }

  /* ── Decks: um slide por página, conteúdo em fluxo ── */
  html body .slide-container,
  html body .lesson-deck,
  html body .lesson-slides {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    position: static !important;
    overflow: visible !important;
  }

  /* O conteúdo flui: dois blocos cabem na mesma folha quando couberem. Cada
     slide é indivisível, de modo que nenhum bloco é partido entre páginas. */
  html body .slide,
  html body .lesson-slide {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 0 7mm !important;
    padding: 0 !important;
    overflow: visible !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  html body .slide + .slide,
  html body .lesson-slide + .lesson-slide {
    padding-top: 7mm !important;
    border-top: 0.4mm solid #e8ecf2;
  }

  /* A ficha do encontro fecha o documento em folha própria. */
  html body .slide.encontro-slide,
  html body .lesson-slide.encontro-slide {
    break-before: page;
    border-top: 0 !important;
  }

  html body .slide .sc {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: 10.5pt !important;
    line-height: 1.5 !important;
  }

  /* Capas: o gradiente vira faixa de abertura em vez de página inteira. */
  html body .slide.cover-bg,
  html body .lesson-slide.lesson-cover {
    padding: 9mm 8mm !important;
    border-radius: 3mm;
    break-inside: avoid;
  }

  html body .slide.cover-bg .cv-title { font-size: 24pt !important; margin-bottom: 3mm !important; }
  html body .slide.cover-bg .cv-sub   { font-size: 12pt !important; margin-bottom: 4mm !important; }
  html body .cv-badge, html body .cv-tag { font-size: 9pt !important; }
  html body .cv-badge, html body .cv-title, html body .cv-sub, html body .cv-tag {
    opacity: 1 !important;
    transform: none !important;
  }

  /* ── Tipografia do documento ── */
  html body h1 { font-size: 19pt !important; }
  html body h2, html body .st { font-size: 14pt !important; line-height: 1.25 !important; }
  html body h3 { font-size: 11.5pt !important; }
  html body .ss { font-size: 9.5pt !important; }
  html body p, html body li, html body td, html body th { font-size: 10.5pt !important; line-height: 1.5 !important; }

  h1, h2, h3, h4, .sh { break-after: avoid; }

  /* ── Blocos que não podem ser partidos entre páginas ── */
  .box, .card, .callout, .rule, .encontro-meta, .encontro-item,
  .mermaid, pre, table, figure, .lesson-card, .lesson-callout, .mat-table,
  .sh, .g2, .g3, .g4, .lesson-grid, .lesson-split, .mermaid-wrap {
    break-inside: avoid;
  }

  /* Cabeçalho de bloco nunca fica órfão no pé da página. */
  html body .sh { break-after: avoid; }

  html body .mermaid svg,
  html body img,
  html body svg {
    max-width: 100% !important;
    max-height: 105mm !important;
    height: auto !important;
  }

  /* ── Páginas de texto: coluna única, sem sumário lateral ── */
  html body .mat-layout {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  html body .mat-section { margin-bottom: 8mm !important; }
  html body .mat-header, html body .material-header, html body .mat-head, html body .plan-head {
    padding: 8mm 6mm !important;
    border-radius: 3mm;
  }

  /* Sombras e desfoques não se traduzem em papel. */
  html body * {
    box-shadow: none !important;
    backdrop-filter: none !important;
    text-shadow: none !important;
  }

  /* Grades largas empilham em uma coluna; duas colunas ficam ilegíveis em A4. */
  html body .g3, html body .g4, html body .lesson-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  html body .lesson-split { grid-template-columns: 1fr !important; }

  html body a { text-decoration: none !important; color: inherit !important; }
}
