/* Estilos para Política de Tratamiento de Datos - Normas APA */

/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Times New Roman", Times, serif;
  font-size: 12pt;
  line-height: 2;
  color: #000;
  background-color: #fff;
  margin: 0;
  padding: 2.54cm; /* Márgenes de 1 pulgada según APA */
}

/* Header */
header {
  width: 100%;
  text-align: center;
  margin-bottom: 5%;
  padding-bottom: 3%;
  border-bottom: 1px solid #ccc;
}

header div {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

header div div {
  width: 30%;
  max-width: 300px;
}

header img {
  width: 100%;
  height: auto;
  max-width: 250px;
}

/* Main container */
main {
  max-width: 85%;
  margin: 0 auto;
  padding: 0 5%;
}

/* Títulos según normas APA */
h1 {
  font-size: 16pt;
  font-weight: bold;
  text-align: justify;
  margin: 5% 0 4% 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  page-break-after: avoid;
}

h2 {
  font-size: 14pt;
  font-weight: bold;
  text-align: justify;
  margin: 4% 0 2% 0;
  text-transform: uppercase;
  page-break-after: avoid;
}

h3 {
  font-size: 12pt;
  font-weight: bold;
  text-align: justify;
  margin: 3% 0 1.5% 0;
  page-break-after: avoid;
}

h4 {
  font-size: 12pt;
  font-weight: bold;
  font-style: italic;
  text-align: justify;
  margin: 2.5% 0 1% 0;
  page-break-after: avoid;
}

/* Párrafos */
p {
  margin-bottom: 2%;
  text-align: justify;
  text-indent: 0; /* Sin sangría por defecto */
  orphans: 2;
  widows: 2;
}

/* Sangría solo para párrafos que no son el primero en su contenedor */
p + p {
  text-indent: 1.27cm; /* Sangría de media pulgada según APA solo en párrafos consecutivos */
}

/* Asegurar que ciertos párrafos no tengan sangría */
h1 + section p:first-child,
h2 + p,
h3 + p,
h4 + p,
section > p:first-child,
article > p:first-child {
  text-indent: 0 !important;
}

/* Secciones */
section {
  margin-bottom: 4%;
  page-break-inside: avoid;
}

/* Artículos dentro de secciones */
article {
  margin: 2% 0;
  margin-left: 2%;
}

article h3 {
  margin-left: -2%;
}

/* Listas */
ul, ol {
  margin: 2% 0 2% 5%;
  padding-left: 3%;
}

li {
  margin-bottom: 1%;
  text-align: justify;
}

/* Listas anidadas */
ul ul, ol ol, ul ol, ol ul {
  margin: 1% 0 1% 3%;
}

/* Espaciado para definiciones */
section:has(h2:contains("DEFINICIONES")) article {
  margin-bottom: 3%;
}

/* Numeración de secciones */
section h2::before {
  counter-increment: section-counter;
}

/* Contador para secciones numeradas */
main {
  counter-reset: section-counter;
}

/* Estilos para impresión */
@media print {
  body {
    font-size: 12pt;
    margin: 2.54cm;
  }
  
  header {
    page-break-after: avoid;
  }
  
  h1, h2, h3, h4 {
    page-break-after: avoid;
  }
  
  section {
    page-break-inside: avoid;
  }
  
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Responsive para dispositivos móviles */
@media screen and (max-width: 768px) {
  body {
    padding: 5%;
  }
  
  main {
    max-width: 95%;
    padding: 0 2.5%;
  }
  
  header div div {
    width: 30%;
  }
  
  h1 {
    font-size: 14pt;
  }
  
  h2 {
    font-size: 12pt;
  }
  
  p {
    text-indent: 5%;
  }
}

@media screen and (max-width: 480px) {
  header div div {
    width: 40%;
  }
  
  main {
    max-width: 98%;
    padding: 0 1%;
  }
  
  h1 {
    font-size: 13pt;
    margin: 6% 0 5% 0;
  }
  
  h2 {
    font-size: 11pt;
  }
  
  ul, ol {
    margin-left: 8%;
  }
}