/*
Theme Name: GeneratePress Child
Template: generatepress
*/

/*==========================================
=   1) Fuentes personalizadas               =
==========================================*/

@font-face {
  font-family: 'BrusselsCondensed';
  src: url('fonts/brbrcvt0.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'BrusselsCondensed';
  src: url('fonts/brbrcbt0.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

/*==========================================
=   2) Ocultar enlaces y elementos del tema =
==========================================*/

.tablepress-table-edit-link,
a.tablepress-edit-link {
  display: none !important;
}

body.single-certificado_digital header.site-header,
body.single-certificado_digital footer.site-footer,
body.page-template-page-certificado-imprimible header.site-header,
body.page-template-page-certificado-imprimible footer.site-footer {
  display: none !important;
}
/*========================================================
=   CERTIFICADO A4 (210 × 277 mm) – Imprimible Compacto   =
========================================================*/

.certificado-a4 {
  width: 210mm;
  height: 277mm;
  padding: 5mm 5mm;
  margin: 0 auto;
  box-sizing: border-box;
  background: #fff;
  font-family: 'Calibri', sans-serif;
  font-size: 10pt;
  line-height: 1.25;
  position: relative;
}

/* Encabezado */
.header-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 5mm;
}
.header-table thead {
  display: table-header-group; /* 🔑 se repite en cada página */
}
.header-table td {
  vertical-align: middle;
  padding: 0;
  text-align: center;
}
.col-30 { width: 30%; }
.col-70 { width: 70%; }

/* Logo */
.certificado-logo img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Título azul */
.titulo-certificado {
  margin: 0;
  font-size: 20pt;
  line-height: 1.1;
  color: #002060;
  font-family: 'BrusselsCondensed', sans-serif;
  font-weight: bold;
  text-align: center;
}
/* Número rojo */
.cert-num {
  margin-top: 2px;
  font-family: Cambria, serif;
  font-size: 18pt;
  color: #E41D26;
  display: block;
  text-align: center;
}

/* Texto fijo + dinámico (derecha, fila 2) */
.col-70 {
  font-family: Calibri, sans-serif;
  font-size: 9.5pt;
  color: #002060;
  font-style: italic;
  text-align: center;
  padding: 1mm 0;
}

/* Paginación automática (izquierda, fila 2) */
.paginacion {
  text-align: center;
  padding: 1mm 0;
}
@media print {
  .paginacion::after {
    content: "Página " counter(page);
    font-size: 9pt;
    color: #333;
  }
}

/* Tablas internas */
.certificado-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2mm 0;
  font-size: 9pt;
}
.certificado-table th,
.certificado-table td {
  border: 0.5px solid #333;
  padding: 2px 3px;
  vertical-align: top;
}
.certificado-table th {
  background: #f0f0f0;
  font-weight: bold;
  font-style: italic;
  text-align: center;
}
.certificado-table td:nth-child(odd) {
  font-style: italic;
  font-weight: bold;
  white-space: nowrap;
}
.certificado-table td:nth-child(even) {
  font-style: italic;
  font-weight: normal;
  text-align: left;
}

/* Encabezados de secciones */
.seccion {
  margin: 2mm 0 1.5mm;
}
.certificado-a4 h5 {
  font-family: Calibri, sans-serif;
  font-size: 10.5pt;
  font-weight: bold;
  font-style: italic;
  color: #002060;
  text-align: center;
  margin: 1.5mm 0;
}
.certificado-a4 h6 {
  font-family: Calibri, sans-serif;
  font-size: 9pt;
  font-weight: bold;
  font-style: italic;
  color: #002060;
  text-align: center;
  margin: 1mm 0;
}

/* Notas 1–5 (con etiqueta Nota#, sin tabla) */
.notas-grupo {
  margin: 2mm 0;
}
.nota-texto {
  font-family: Calibri, sans-serif;
  font-size: 9pt;
  font-style: italic;
  text-align: justify;
  margin: 1.5mm 0;
}

/* Tabla de firmas */
.firmas-wrapper {
  width: 100%;
  text-align: center;
  margin: 6mm 0;
}
.firmas-table {
  width: 50%;              /* 40% del ancho de la hoja */
  margin: 0 auto;          /* centrada */
  border-collapse: collapse;
}
.firmas-table td {
  width: 50%;
  text-align: center;
  vertical-align: bottom;
  padding: 4mm;
  border: 1px solid #000;            /* sin bordes */
}
.firma-espacio {
  height: 25mm;            /* espacio alto para firmas */
  border-bottom: 0.5px solid #000; /* línea para firmar */
}
.firma-nombre {
  font-weight: bold;
  margin-top: 2mm;
}
.firma-cargo {
  font-size: 8pt;
  font-style: italic;
}

/* Notas 6–8 (solo contenido, sin etiqueta) */
.notas-grupo:last-of-type .nota-texto {
  text-indent: 0;
  font-style: italic;
}

/* Impresión A4 */
@media print {
  @page {
    size: 210mm 277mm;
    margin: 10mm;
  }
  .certificado-a4 {
    box-shadow: none;
    margin: 0 auto;
  }
  .certificado-table,
  .certificado-table tbody,
  .certificado-table tr {
    page-break-inside: avoid;
  }
}

/*========================================================
=   4) CERTIFICADO A5 (con watermark) – Otro formato      =
========================================================*/

.certificado-a5 {
  position: relative;
  background-color: #fff;

  /* Marca de agua repetida con SVG */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120' viewBox='0 0 200 120'><text x='100' y='80' text-anchor='middle' font-size='36' font-family='Arial, sans-serif' fill='black' opacity='0.06' transform='rotate(-30 100 60)'>PTSB</text></svg>");
  background-repeat: repeat;
  background-size: 220px 140px;
  background-position: 0 0;

  min-height: 100vh;
}

.certificado-container {
  position: relative;
  z-index: 1;
}

@media print {
  .certificado-a5 {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}


body.sin-header-footer header,
body.sin-header-footer footer {
  display: none !important;
}

@media screen and (max-width: 768px) {
  .certificado-a4 {
    padding: 10px;
    box-sizing: border-box;
  }

  .certificado-a4 table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    overflow-x: auto;
    display: block;
  }

  .certificado-a4 td {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
  }

  .certificado-logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  .titulo-certificado {
    font-size: 18px;
    text-align: center;
    margin-top: 10px;
  }

  .cert-num {
    display: block;
    text-align: center;
    font-size: 16px;
    margin-top: 5px;
  }

  img[alt="QR del certificado"] {
    display: block;
    margin: 10px auto;
    max-width: 150px;
    height: auto;
  }
}

/*==========================================
=   5) Estilos institucionales + Bootstrap =
==========================================*/

/* Bootstrap: ya cargado vía CDN en front-page.php */

/* Encabezado institucional */
.encabezado-institucional {
  text-align: center;
  padding: 30px 20px;
  background-color: #ffffff;
}
.encabezado-institucional img {
  max-width: 225px;
  height: auto;
  margin-bottom: 10px;
}
.encabezado-institucional h6 {
  font-size: 16px;
  margin: 5px 0;
  color: #333;
}
.encabezado-institucional p {
  font-size: 20px;
  font-weight: bold;
  color: #007b5e;
}

/* Títulos principales */
.section-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: #007b5e;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  font-size: 1.5rem;
  color: #555;
}

/* Clientes destacados */
.logo-clientes img {
  max-width: 200px;
  margin: 15px;
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.1));
}

/* Sección institucional */
.bg-laboratorio {
  background-color: #007b5e;
  color: #fff;
}
.bg-laboratorio h2 {
  font-size: 28px;
  margin-bottom: 20px;
}
.bg-laboratorio p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}

/* Pie institucional */
footer.institucional {
  font-size: 0.9rem;
  color: #888;
  text-align: center;
  padding: 20px;
  background-color: #f8f8f8;
}
