/* Folha de impressão / PDF — escondida na tela, visível só ao imprimir */
.folha-impressao {
  display: none;
}

/* Modal de opções de impressão */
.modal-pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-pdf {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 340px;
}

.modal-pdf h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.modal-pdf label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  cursor: pointer;
  color: var(--text-secondary);
}

/* Ajustes de impressão dentro do modal */
.mpf-ajustes {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.mpf-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mpf-linha.mpf-col {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.mpf-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.mpf-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mpf-stepper b {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.mpf-nota {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.modal-pdf-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-pdf-acoes button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
}

.modal-pdf-acoes button.primary {
  background: var(--azul);
  color: #fff;
  border: none;
  font-weight: 600;
}

@media print {
  @page {
    size: A4;
    margin: 12mm 10mm 16mm;
  }

  #navbar,
  main#app,
  .site-footer,
  #video-floating-container,
  .video-flutuante-reabrir,
  .modal-pdf-overlay {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  .folha-impressao {
    display: block;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-family: 'JetBrains Mono', 'Roboto Mono', ui-monospace, 'Courier New', monospace;
  }

  /* Marca d'água (repete em todas as páginas) */
  .print-marca {
    position: fixed;
    top: 42%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 64pt;
    font-weight: 800;
    color: #1f83d8;
    opacity: 0.06;
    transform: rotate(-22deg);
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: 0.05em;
    pointer-events: none;
    z-index: 0;
  }

  /* Rodapé (repete em todas as páginas) */
  .print-rodape {
    position: fixed;
    bottom: 4mm;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8.5pt;
    color: #555;
    font-family: 'Inter', system-ui, sans-serif;
  }

  /* CTA do canal/site (topo da folha, antes do cabeçalho) */
  .print-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 8.5pt;
    color: #333;
  }

  .print-cta-logo {
    width: 15px;
    height: 15px;
    border-radius: 50%;
  }

  .print-cta b {
    color: #1f83d8;
  }

  /* Cabeçalho (só no topo, antes do corpo) */
  .print-cabecalho {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 14px;
  }

  .print-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 13pt;
    color: #16202e;
  }

  .print-logo .logo-keys {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 18px;
  }

  .print-logo .logo-key {
    width: 6px;
    height: 18px;
    background: #1f83d8;
    border-radius: 2px;
  }

  .print-logo .logo-key:nth-child(2) {
    height: 12px;
    background: #f7931a;
  }

  .print-logo span.laranja {
    color: #f7931a;
  }

  .print-cabecalho h1 {
    font-size: 19pt;
    margin: 8px 0 2px;
    font-family: 'Inter', system-ui, sans-serif;
    color: #000;
  }

  .print-sub {
    font-size: 11pt;
    font-family: 'Inter', system-ui, sans-serif;
    color: #333;
  }

  /* Diagramas de acordes (opcional) */
  .print-diagramas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
  }

  .print-diagrama {
    text-align: center;
  }

  .print-diagrama-nome {
    font-weight: 700;
    font-size: 10pt;
    color: #1f83d8;
    font-family: 'Inter', system-ui, sans-serif;
  }

  .print-diagrama .diagrama-acorde .diagrama-linha {
    stroke: #333;
  }
  .print-diagrama .diagrama-acorde .diagrama-pestana {
    fill: #000;
  }
  .print-diagrama .diagrama-acorde .diagrama-ponto {
    fill: #1f83d8;
  }
  .print-diagrama .diagrama-acorde .diagrama-xo,
  .print-diagrama .diagrama-acorde .diagrama-fret-label {
    fill: #555;
  }

  /* Corpo em DUAS COLUNAS — cada coluna usa a renderização fluida (mobile) */
  .print-corpo {
    column-count: 2;
    column-gap: 26px;
    column-fill: auto;
    column-rule: 1px solid #ddd;
    font-size: 12pt;
    line-height: 1.85;
    position: relative;
    z-index: 1;
  }

  .print-corpo .par-fluido,
  .print-corpo .linha-letra-fluida,
  .print-corpo .linha-texto-fluida,
  .print-corpo .linha-secao {
    break-inside: avoid;
  }

  .print-corpo .linha-secao {
    color: #000 !important;
    font-weight: 700;
    border-left: 3px solid #1f83d8;
    break-after: avoid;
    margin-top: 0.8em;
  }

  .print-corpo .par-fluido .tok-ac .chord,
  .print-corpo .chord {
    color: #1f83d8 !important;
    font-weight: 700;
  }

  /* Fonte sem negrito real (ex.: Lucida Console): acordes em peso normal para o
     negrito falso não alargar o glifo e desalinhar a posição em `ch`. */
  .print-corpo.fonte-sem-negrito .par-fluido .tok-ac .chord,
  .print-corpo.fonte-sem-negrito .chord {
    font-weight: 400;
  }

  .print-corpo .par-fluido .tok-ac .chord-anotacao {
    color: #777 !important;
    font-style: italic;
  }
}
