/* ══════════════════════════════════════════════════════════════
   PRESET actas_comunidad · Comunidad de Propietarios y Documentos Jurídicos
   Soporta dos modalidades complementarias:
   1. Actas de Reunión, Sesiones de Trabajo y Acuerdos (.header, .punto, .acuerdo)
   2. Estatutos, Reglamentos de Régimen Interno y Textos Articulados (.doc-header, .titulo-seccion, .articulo-titulo, .tabla-fincas)
   Tipografía: 'Inter' (títulos, metadatos, tablas y cajas) + 'Merriweather' (cuerpo editorial Serif)
   Paleta: Azul institucional #1B3A5C, azul secundario #2B6CB0, texto #1A202C / #2D3748
══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

@page {
  size: A4 portrait;
  margin: 15mm 18mm 16mm 18mm;
  @top-left {
    content: "[Comunidad / Ámbito del documento]";
    font-family: 'Inter', sans-serif;
    font-size: 6.8pt;
    font-weight: 600;
    letter-spacing: 1.2pt;
    text-transform: uppercase;
    color: #718096;
    vertical-align: bottom;
    padding-bottom: 3.5mm;
  }
  @top-right {
    content: "[Tipo de documento]";
    font-family: 'Inter', sans-serif;
    font-size: 6.8pt;
    font-weight: 600;
    letter-spacing: 1.2pt;
    text-transform: uppercase;
    color: #718096;
    vertical-align: bottom;
    padding-bottom: 3.5mm;
  }
  @bottom-left {
    content: "[Subtítulo legal o referencia de la Comunidad]";
    font-family: 'Inter', sans-serif;
    font-size: 6.8pt;
    color: #A0AEC0;
  }
  @bottom-right {
    content: "Página " counter(page) " de " counter(pages);
    font-family: 'Inter', sans-serif;
    font-size: 7.2pt;
    font-weight: 600;
    color: #4A5568;
  }
}

@page :first {
  @top-left  { content: none; }
  @top-right { content: none; }
}

body {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 9pt;
  line-height: 1.48;
  color: #1A202C;
  background: #ffffff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  orphans: 2;
  widows: 2;
}

.page-container {
  max-width: 210mm;
  margin: 0 auto;
}
@media screen {
  .page-container { padding: 15mm 18mm; }
}

.nueva-pagina {
  page-break-before: always;
  break-before: always;
}

.keep-together {
  page-break-inside: avoid;
  break-inside: avoid;
}

/* ── CABECERA INSTITUCIONAL (Actas y Estatutos) ── */
.header,
.doc-header {
  text-align: center;
  border-bottom: 2px solid #1B3A5C;
  padding-bottom: 5pt;
  margin-bottom: 7pt;
}
.header-label,
.doc-header-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 6.8pt;
  font-weight: 700;
  letter-spacing: 2.2pt;
  text-transform: uppercase;
  color: #1B3A5C;
  margin-bottom: 2pt;
}
.header-title,
.doc-title {
  font-family: 'Inter', sans-serif;
  font-size: 13pt;
  font-weight: 700;
  color: #0D1F33;
  line-height: 1.2;
  margin-bottom: 2pt;
}
.doc-title {
  text-transform: uppercase;
  letter-spacing: 0.4pt;
}
.header-subtitle,
.doc-sublegal {
  font-family: 'Inter', sans-serif;
  font-size: 8.2pt;
  font-weight: 500;
  color: #4A5568;
  line-height: 1.25;
}
.doc-sublegal {
  font-style: italic;
}

/* ── FICHA DE METADATOS (Filas o Cuadrícula de 2 columnas) ── */
.metadata-card {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 3.5px solid #1B3A5C;
  padding: 5pt 9pt;
  margin-bottom: 6pt;
  border-radius: 0 3pt 3pt 0;
  font-family: 'Inter', sans-serif;
  font-size: 7.6pt;
  color: #2D3748;
  line-height: 1.36;
  page-break-inside: avoid;
  break-inside: avoid;
}
.metadata-card.grid-2,
.metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5pt 12pt;
}
.metadata-card strong {
  color: #1B3A5C;
  font-weight: 700;
}
.metadata-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 1.5pt;
}
.metadata-row:last-child { margin-bottom: 0; }
.metadata-label {
  font-weight: 700;
  color: #1B3A5C;
  width: 75pt;
  flex-shrink: 0;
}
.metadata-value { color: #2D3748; }

/* ── PREÁMBULO Y EXPOSITIVOS ── */
.preamble {
  margin-bottom: 6pt;
  text-align: justify;
  hyphens: auto;
}
.preambulo-card {
  background: #FAFBFD;
  border: 1px solid #EDF2F7;
  border-radius: 3pt;
  padding: 5pt 9pt;
  margin-bottom: 6pt;
}
.preamble p,
.preambulo-card p {
  font-size: 8.5pt;
  line-height: 1.42;
  color: #334155;
  margin-bottom: 3.5pt;
  text-align: justify;
  text-wrap: pretty;
  page-break-inside: avoid;
  break-inside: avoid;
}
.preamble p:last-child,
.preambulo-card p:last-child { margin-bottom: 0; }

/* ── TIPOGRAFÍA GENERAL DE PÁRRAFOS Y LISTAS ── */
p {
  text-align: justify;
  hyphens: auto;
  text-wrap: pretty;
  margin-bottom: 4pt;
  font-size: 8.8pt;
  line-height: 1.46;
  color: #2D3748;
  page-break-inside: avoid;
  break-inside: avoid;
}

ul {
  list-style: none;
  margin: 2.5pt 0 4.5pt 6pt;
}
li {
  position: relative;
  padding-left: 11pt;
  margin-bottom: 2.5pt;
  text-align: justify;
  hyphens: auto;
  text-wrap: pretty;
  font-size: 8.7pt;
  line-height: 1.42;
  color: #2D3748;
  page-break-inside: avoid;
  break-inside: avoid;
}
li::before {
  content: '■';
  position: absolute;
  left: 0;
  font-size: 4pt;
  top: 4pt;
  color: #2B6CB0;
}

/* ══════════════════════════════════════════════════════════════
   MODALIDAD A: ACTAS DE JUNTA, SESIONES Y ACUERDOS (.punto)
══════════════════════════════════════════════════════════════ */
.section-divider {
  font-family: 'Inter', sans-serif;
  font-size: 10pt;
  font-weight: 700;
  color: #1B3A5C;
  border-bottom: 1.5px solid #CBD5E0;
  padding-bottom: 2.5pt;
  margin-top: 7pt;
  margin-bottom: 5pt;
  page-break-after: avoid;
  break-after: avoid;
}

.punto {
  margin-bottom: 7pt;
  padding-top: 5pt;
  border-top: 1px solid #E2E8F0;
}
.punto:first-of-type,
.punto.nueva-pagina { border-top: none; padding-top: 0; }

.punto-header {
  display: flex;
  align-items: center;
  margin-bottom: 3.5pt;
  page-break-after: avoid;
  break-after: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
}
.punto-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #1B3A5C;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 7.5pt;
  min-width: 15pt;
  height: 15pt;
  border-radius: 50%;
  margin-right: 6pt;
  flex-shrink: 0;
}
.punto-titulo {
  font-family: 'Inter', sans-serif;
  font-size: 9.2pt;
  font-weight: 700;
  color: #0D1F33;
  line-height: 1.25;
}
.punto-ref {
  font-weight: 500;
  color: #718096;
  font-size: 8pt;
}
.punto p:last-child { margin-bottom: 0; }

/* Importante: no aplicar break-inside al ul completo, solo a cada li */
.punto ul {
  margin: 3pt 0 4pt 10pt;
  list-style: none;
}
.punto ul li {
  position: relative;
  padding-left: 11pt;
  margin-bottom: 2.5pt;
  text-align: justify;
  page-break-inside: avoid;
  break-inside: avoid;
}
.punto ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 8.5pt;
  color: #1B3A5C;
  font-weight: 700;
}

.acuerdo {
  background: #EDF2F7;
  border-left: 3px solid #2B6CB0;
  padding: 4.5pt 8.5pt;
  margin: 4pt 0 2pt 0;
  font-family: 'Inter', sans-serif;
  font-size: 8pt;
  color: #1A365D;
  line-height: 1.4;
  border-radius: 0 2.5pt 2.5pt 0;
  page-break-inside: avoid;
  break-inside: avoid;
}
.acuerdo strong {
  font-weight: 700;
  color: #2B6CB0;
}

.cierre {
  margin-top: 4pt;
  text-align: justify;
}
.compromisos-sub {
  font-family: 'Inter', sans-serif;
  font-size: 8.5pt;
  font-weight: 700;
  color: #1B3A5C;
  margin-top: 6pt;
  margin-bottom: 2.5pt;
  page-break-after: avoid;
  break-after: avoid;
}
.compromisos-lista {
  margin: 1.5pt 0 4pt 8pt;
  list-style: none;
}
.compromisos-lista li {
  position: relative;
  padding-left: 10pt;
  margin-bottom: 2.5pt;
  text-align: justify;
  page-break-inside: avoid;
  break-inside: avoid;
}
.compromisos-lista li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 8pt;
  color: #1B3A5C;
  font-weight: 700;
}

.nota-final {
  page-break-inside: avoid;
  break-inside: avoid;
  margin-top: 12pt;
  padding: 6pt 10pt;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 3pt;
  font-family: 'Inter', sans-serif;
  font-size: 7.5pt;
  color: #4A5568;
  line-height: 1.45;
  text-align: justify;
}
.nota-final strong { color: #1B3A5C; }

/* ══════════════════════════════════════════════════════════════
   MODALIDAD B: ESTATUTOS, REGLAMENTOS Y ARTICULADO NORMATIVO
══════════════════════════════════════════════════════════════ */
.titulo-seccion {
  font-family: 'Inter', sans-serif;
  font-size: 9pt;
  font-weight: 700;
  color: #1B3A5C;
  text-transform: uppercase;
  letter-spacing: 0.8pt;
  border-bottom: 1.5px solid #CBD5E0;
  padding-bottom: 2pt;
  margin-top: 8pt;
  margin-bottom: 4pt;
  page-break-after: avoid;
  break-after: avoid;
}

.articulo-titulo {
  font-family: 'Inter', sans-serif;
  font-size: 8.6pt;
  font-weight: 700;
  color: #0D1F33;
  margin-top: 5.5pt;
  margin-bottom: 2pt;
  page-break-after: avoid;
  break-after: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
}
.articulo-titulo .art-num { color: #1B3A5C; }

.subapartado-titulo {
  font-family: 'Inter', sans-serif;
  font-size: 8.3pt;
  font-weight: 700;
  color: #2B6CB0;
  background: #F8FAFC;
  border-left: 2.5px solid #2B6CB0;
  padding: 1.5pt 5pt;
  margin-top: 4.5pt;
  margin-bottom: 2.5pt;
  border-radius: 0 2pt 2pt 0;
  page-break-after: avoid;
  break-after: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
}

.cuadro-coeficientes,
.caja-resalte {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-left: 3.5px solid #1B3A5C;
  padding: 4.5pt 8pt;
  margin: 4pt 0 5pt 0;
  border-radius: 0 3pt 3pt 0;
  page-break-inside: avoid;
  break-inside: avoid;
}
.caja-resalte p {
  color: #1E3A8A;
  font-size: 8.2pt;
  margin-bottom: 0;
}

.resumen-plantas,
.grid-zonas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4.5pt;
  margin: 3.5pt 0 5pt 0;
  font-family: 'Inter', sans-serif;
  page-break-inside: avoid;
  break-inside: avoid;
}
.card-planta,
.zona-box {
  background: #F8FAFC;
  border: 1px solid #CBD5E0;
  border-top: 2.5px solid #2B6CB0;
  padding: 4pt 6.5pt;
  border-radius: 2pt;
  font-size: 7.3pt;
  color: #4A5568;
  line-height: 1.38;
}
.card-planta-title,
.zona-box strong {
  font-weight: 700;
  color: #1B3A5C;
  display: block;
  margin-bottom: 1.5pt;
}

/* ── TABLA DE FINCAS / COEFICIENTES / PRESUPUESTOS ── */
.tabla-fincas {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 7pt;
  margin: 4pt 0 5pt 0;
  page-break-inside: avoid;
  break-inside: avoid;
}
.tabla-fincas th {
  background: #1B3A5C;
  color: #ffffff;
  font-weight: 600;
  padding: 2.5pt 4pt;
  border: 1px solid #1B3A5C;
  text-transform: uppercase;
  letter-spacing: 0.2pt;
  text-align: center;
}
.tabla-fincas td {
  padding: 1.8pt 4pt;
  border: 1px solid #CBD5E0;
  color: #2D3748;
  text-align: center;
}
.tabla-fincas td.td-left { text-align: left; }
.tabla-fincas td.td-blank { color: #A0AEC0; }
.tabla-fincas tr:nth-child(even) { background: #F8FAFC; }
.tabla-fincas tr.fila-total td {
  background: #EDF2F7;
  font-weight: 700;
  color: #1A365D;
  border-top: 1.5px solid #1B3A5C;
}

/* ── DILIGENCIA DE CIERRE Y BLOQUES DE FIRMAS ── */
.diligencia-cierre {
  margin-top: 8pt;
  padding: 5.5pt 8.5pt;
  background: #F8FAFC;
  border-top: 1.5px solid #1B3A5C;
  border-bottom: 1.5px solid #1B3A5C;
  font-family: 'Inter', sans-serif;
  font-size: 7.5pt;
  color: #2D3748;
  line-height: 1.42;
  text-align: justify;
  page-break-inside: avoid;
  break-inside: avoid;
}
.diligencia-cierre strong { color: #1B3A5C; }

.seccion-firmas {
  margin-top: 14pt;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24pt;
  font-family: 'Inter', sans-serif;
  page-break-inside: avoid;
  break-inside: avoid;
}
.bloque-firma {
  text-align: center;
  border-top: 1px dashed #718096;
  padding-top: 4pt;
}
.firma-espacio { height: 34pt; }
.firma-cargo {
  font-size: 7.8pt;
  font-weight: 700;
  color: #1B3A5C;
  text-transform: uppercase;
}
.firma-entidad {
  font-size: 6.8pt;
  color: #718096;
  margin-top: 1pt;
}
.lugar-fecha {
  font-family: 'Inter', sans-serif;
  font-size: 7.5pt;
  color: #4A5568;
  text-align: right;
  margin-top: 7pt;
}