/* ===== TECING - Estilo profesional para artículos HTML ===== */
/* Versión 2.0 - Actualizado con secciones colapsables y estilos mejorados */

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

:root {
  --tecing-blue: #1976D2;
  --tecing-gray: #616161;
  --tecing-light-gray: #F5F5F5;
  --tecing-dark: #212121;
  --tecing-border: #E0E0E0;
  --orcid-green: #A6CE39;
  --link-blue: #1976D2;
  --background-white: #FFFFFF;
  --text-primary: #333333;
  --text-secondary: #666666;
}

/* Configuración del body */
body {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: #FAFAFA;
  margin: 0;
  padding: 20px;
  font-size: 16px;
}

/* Contenedor principal del artículo */
article, main, .main-content {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--background-white);
  padding: 40px 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* Encabezado del artículo */
header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--tecing-blue);
}

/* Título principal del artículo */
h1.title {
  color: var(--tecing-blue);
  font-size: 2.5em;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.3em 0;
  text-align: center;
  letter-spacing: -0.5px;
}

/* Título en inglés (subtítulo) */
p.subtitle {
  font-size: 2.5em;
  font-style: normal;
  color: #999999;
  text-align: center;
  margin: 0 0 1.5em 0;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.5px;
}

/* Información de autores */
.author {
  text-align: center;
  font-size: 1.1em;
  margin-bottom: 1em;
  color: var(--text-primary);
}

.author a {
  color: var(--orcid-green);
  text-decoration: none;
}

.author a:hover {
  text-decoration: underline;
}

/* Afiliaciones */
.affiliation {
  text-align: center;
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 1em;
  font-style: italic;
}

/* Metadatos del artículo (fechas y autor) */
.article-meta {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  padding: 12px 18px;
  border: 2px solid var(--tecing-blue);
  border-radius: 8px;
  margin: 20px 0;
  font-size: 0.8em;
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(25, 118, 210, 0.2);
}

.article-meta p {
  margin: 4px 0;
}

.article-meta strong {
  color: var(--tecing-blue);
  font-weight: 600;
}

/* Encabezados de Resumen y Abstract */
h2.resumen-header, h2.abstract-header {
  color: var(--tecing-blue);
  font-size: 1.1em;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sección de resumen y abstract */
.resumen, .abstract {
  background-color: var(--tecing-light-gray);
  padding: 20px 25px;
  margin: 0 0 25px 0;
  border-radius: 4px;
  border-left: 4px solid var(--tecing-blue);
  text-align: justify;
  line-height: 1.7;
}

.resumen p, .abstract p {
  margin: 0;
}

/* Ocultar divs vacíos de resumenES y abstractEN */
.resumenES, .abstractEN {
  display: none;
}

/* Palabras clave */
.keywords, .keywords-en {
  margin: 15px 0;
  padding: 10px 15px;
  background-color: #FAFAFA;
  border-radius: 3px;
  font-size: 0.95em;
}

.keywords strong, .keywords-en strong {
  color: var(--tecing-blue);
  font-weight: 600;
}

/* Encabezados de secciones (h1 en el contenido del artículo) */
h1:not(.title) {
  color: var(--tecing-blue);
  font-size: 1.4em;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.8em;
  padding: 0.5em 0.8em;
  border-bottom: 2px solid var(--tecing-border);
  cursor: pointer;
  background-color: var(--tecing-light-gray);
  border-radius: 4px;
  transition: background-color 0.3s ease;
  user-select: none;
}

h1:not(.title):hover {
  background-color: #E3F2FD;
}

h1:not(.title)::before {
  content: "▼ ";
  font-size: 0.8em;
  display: inline-block;
  transition: transform 0.3s ease;
}

h1:not(.title).collapsed::before {
  transform: rotate(-90deg);
}

/* Contenedor de sección colapsable */
.section-content {
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
}

.section-content.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

h2 {
  color: var(--tecing-blue);
  font-size: 1.5em;
  font-weight: 700;
  margin-top: 1.3em;
  margin-bottom: 0.6em;
}

h3 {
  color: var(--tecing-gray);
  font-size: 1.2em;
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}

/* Párrafos */
p {
  margin: 1em 0;
  text-align: justify;
  line-height: 1.7;
}

/* Enlaces */
a {
  color: var(--link-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1565C0;
  text-decoration: underline;
}

a:visited {
  color: #5E35B1;
}

/* Enlaces en referencias bibliográficas */
.references a, #refs a {
  color: var(--link-blue);
  text-decoration: none;
}

.references a:hover, #refs a:hover {
  text-decoration: underline;
}

/* Figuras */
figure {
  margin: 2em 0;
  text-align: center;
  page-break-inside: avoid;
}

figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--tecing-border);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

figcaption {
  margin-top: 10px;
  font-size: 0.9em;
  color: var(--text-secondary);
  text-align: justify;
  line-height: 1.5;
}

/* Etiqueta de figura (Figura 1, Figura 2, etc.) */
figcaption strong {
  color: var(--tecing-blue);
  font-weight: 700;
  font-style: normal;
}

/* Asegurar que el caption se vea bien */
figcaption::before {
  content: "";
  font-weight: 700;
  color: var(--tecing-blue);
}

/* Tablas */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.95em;
}

table caption {
  caption-side: top;
  font-weight: 600;
  color: var(--tecing-blue);
  margin-bottom: 10px;
  font-size: 1em;
}

thead {
  background-color: var(--tecing-blue);
  color: white;
}

th {
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--tecing-border);
}

tbody tr:nth-child(even) {
  background-color: var(--tecing-light-gray);
}

tbody tr:hover {
  background-color: #E3F2FD;
}

/* Ecuaciones matemáticas */
.math {
  font-size: 1.1em;
  margin: 1.5em 0;
}

.math.display {
  text-align: center;
  margin: 2em 0;
}

/* Listas */
ul, ol {
  margin: 1em 0;
  padding-left: 2em;
  line-height: 1.8;
}

li {
  margin: 0.5em 0;
}

/* Código */
code {
  background-color: var(--tecing-light-gray);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  color: #D32F2F;
}

pre {
  background-color: var(--tecing-light-gray);
  padding: 15px 20px;
  border-radius: 4px;
  border-left: 4px solid var(--tecing-blue);
  overflow-x: auto;
  margin: 1.5em 0;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.85em;
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--tecing-blue);
  padding-left: 20px;
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: italic;
  background-color: var(--tecing-light-gray);
  padding: 15px 20px;
  border-radius: 0 4px 4px 0;
}

/* Referencias bibliográficas */
#referencias, #references, .references, #refs {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 3px solid var(--tecing-blue);
}

#referencias h1, #references h1, .references h1 {
  color: var(--tecing-blue);
  font-size: 1.8em;
  margin-bottom: 1em;
}

.csl-entry, .references li, #refs .csl-entry {
  margin-bottom: 1em;
  line-height: 1.6;
  text-align: left;
  padding-left: 2em;
  text-indent: -2em;
}

.csl-left-margin {
  float: left;
  padding-right: 0.5em;
  color: var(--tecing-blue);
  font-weight: 600;
}

.csl-right-inline {
  display: block;
  margin-left: 2em;
}

/* Pie de página */
footer {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid var(--tecing-border);
  text-align: center;
  font-size: 0.85em;
  color: var(--text-secondary);
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  article, main, .main-content {
    padding: 20px 30px;
  }

  h1.title {
    font-size: 1.6em;
  }

  p.subtitle {
    font-size: 1.1em;
  }

  h1 {
    font-size: 1.5em;
  }

  h2 {
    font-size: 1.3em;
  }

  h3 {
    font-size: 1.1em;
  }

  figure img {
    max-width: 100%;
  }

  table {
    font-size: 0.85em;
  }

  th, td {
    padding: 8px 10px;
  }
}

/* Impresión */
@media print {
  body {
    background-color: white;
    color: black;
  }

  article, main, .main-content {
    box-shadow: none;
    max-width: 100%;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  figure {
    page-break-inside: avoid;
  }
}

/* Estilo especial para el encabezado de información de la revista */
.journal-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, var(--tecing-blue) 0%, #1565C0 100%);
  color: white;
  border-radius: 4px;
}

.journal-header h2 {
  color: white;
  margin: 0;
  font-size: 1.5em;
}

.journal-header p {
  margin: 5px 0;
  font-size: 0.95em;
  opacity: 0.95;
}

/* Licencia Creative Commons */
.license {
  margin-top: 2em;
  padding: 15px 20px;
  background-color: var(--tecing-light-gray);
  border-left: 4px solid var(--orcid-green);
  border-radius: 4px;
  font-size: 0.9em;
}

.license img {
  height: 1.5em;
  vertical-align: middle;
  margin-right: 10px;
}
