/* =========================================================
   LAYOUT DE IMPRESSÃO DAS PROGRAMAÇÕES (PDF)
   Usado por print-schedules.js.
   A4 RETRATO (vertical) · uma semana por página.
========================================================= */
@media print{
  /* A folha padrão é retrato (definida em activities.css, que é
     carregado depois deste arquivo). Aqui só ajustamos a margem. */
  @page{ margin: 12mm 12mm 14mm; }

  html, body{ width: 210mm; }

  .ps-sheet{ font-family: var(--font-ui), Arial, sans-serif; color: #111; width: 100%; }

  /* ---------- Uma semana por página ---------- */
  .ps-page{
    break-after: page; page-break-after: always;
    break-inside: auto;            /* se a semana for maior que a folha, deixa continuar */
  }
  .ps-page:last-child{ break-after: auto; page-break-after: auto; }

  /* Cabeçalho (repetido em cada página) */
  .ps-head{
    display: flex; align-items: center; gap: 10pt;
    border-bottom: 2pt solid #0B2A63; padding-bottom: 6pt; margin-bottom: 9pt;
    break-inside: avoid; break-after: avoid;
  }
  .ps-head img{ width: 32pt; height: 32pt; border-radius: 8pt; flex-shrink: 0; }
  .ps-head-text{ flex: 1; }
  .ps-head .ps-cong{
    margin: 0; font-size: 9pt; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: #0B2A63;
  }
  .ps-head h1{ margin: 1pt 0 2pt; font-size: 13.5pt; line-height: 1.15; color: #0B2A63; }
  .ps-head .ps-period{ margin: 0; font-size: 9.5pt; color: #444; }
  .ps-head-date{ font-size: 8pt; color: #555; text-align: right; line-height: 1.4; }

  /* Faixa com o período da semana */
  .ps-week-head{
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10pt; border-left: 3pt solid #0B2A63; padding: 2pt 0 2pt 7pt; margin-bottom: 6pt;
    break-after: avoid; page-break-after: avoid; break-inside: avoid;
  }
  .ps-week-head h2{ margin: 0; font-size: 11pt; color: #0B2A63; }
  .ps-week-head span{ font-size: 9pt; color: #555; }

  /* Nunca partir uma linha ao meio */
  .ps-table tr{ break-inside: avoid; page-break-inside: avoid; }
  .ps-band td{ break-after: avoid; }

  .ps-cancelled{
    margin: 0; padding: 7pt 9pt; font-size: 9.5pt; color: #7a4a06;
    background: #FEF3E0; border: .75pt solid #E3C08A; border-radius: 4pt;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  /* Tabela da programação */
  .ps-table{ width: 100%; border-collapse: collapse; font-size: 8.4pt; line-height: 1.25; }
  .ps-table td, .ps-table th{ border: .6pt solid #B9C2CE; padding: 1.9pt 5pt; vertical-align: top; text-align: left; }
  .ps-table thead th{
    background: #EEF2F7; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .04em; color: #333;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ps-row td:last-child{ font-weight: 600; }
  .ps-row td:first-child{ color: #222; }
  .ps-sub td{ padding-left: 14pt; font-size: 8.4pt; color: #444; background: #FAFBFC;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-n{ display: inline-block; min-width: 13pt; font-weight: 700; color: #0B2A63; }
  /* O detalhe (“10 min·De casa em casa”) fica na MESMA linha do título:
     é o que faz a semana inteira caber em uma folha. */
  .ps-meta{ display: inline; font-size: 7.6pt; color: #666; font-weight: 400; }
  .ps-meta:not(:empty)::before{ content: ' \00b7 '; color: #9AA3AF; }
  .ps-empty{ color: #999; font-style: italic; font-weight: 400; }

  /* Faixas de seção com as cores da apostila */
  .ps-band td{
    font-size: 7.6pt; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 1.9pt 5pt; color: #fff;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ps-band-treasures  td{ background: #4A6FA5; }
  .ps-band-ministry   td{ background: #C08A2E; }
  .ps-band-christlife td{ background: #8C3A3A; }
  .ps-band-weekend    td{ background: #2F6B52; }
  .ps-band-duties     td{ background: #4A5568; }

  .ps-table-fs .ps-row td:last-child{ font-weight: 600; }

  /* A caixa de escolha do período nunca sai no papel */
  .pr-overlay{ display: none !important; }
}
