/* ========================================
   1. VARIABLES Y CONFIGURACIÓN GENERAL
======================================== */

:root {
    /* Paleta de colores */
    --color-primary: #234b55;
    --color-primary-dark: #183640;
    --color-accent: #b28c57;

    --color-text: #39464c;
    --color-muted: #65737a;
    --color-border: #e0e5e8;
    --color-background: #f2f4f5;
    --color-surface: #ffffff;
    --color-surface-subtle: #f5f7f7;

    /* Tipografías */
    --font-heading: Arial, Helvetica, sans-serif;
    --font-body: Georgia, "Times New Roman", serif;

    /* Dimensiones */
    --content-width: 900px;
    --container-width: 1100px;

    /* Bordes */
    --radius: 6px;
}


/* ========================================
   2. ESTRUCTURA PRINCIPAL
======================================== */

body {
    margin: 0;
    padding: 40px 20px;

    background-color: var(--color-background);
    color: var(--color-text);

    font-family: var(--font-heading);
    font-size: 16px;
    line-height: 1.7;
}

.document-container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding: 55px 70px;

    box-sizing: border-box;

    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

/* Garantiza que el padding no aumente el ancho */
.document-container *,
.document-container *::before,
.document-container *::after {
    box-sizing: border-box;
}


/* ========================================
   3. TÍTULO PRINCIPAL
======================================== */

.title {
    margin-bottom: 35px;
    padding: 15px 20px 30px;

    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.title h1 {
    max-width: 850px;
    margin: 15px auto 0;

    color: var(--color-primary-dark);
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.035em;

    text-wrap: balance;
}

/* Detalle decorativo dorado */

.title::after {
    content: "";
    display: block;

    width: 48px;
    height: 2px;
    margin: 24px auto 0;

    background-color: var(--color-accent);
}


/* ========================================
   4. INFORMACIÓN DEL AUTOR
======================================== */

.author {
    display: flex;
    justify-content: center;

    margin: 30px auto 45px;
    padding: 0 15px;

    text-align: center;
}

.author-info {
    width: 100%;
    max-width: 600px;
    padding: 0;

    background: transparent;
    border: none;
}

.author-name {
    margin: 0 0 4px;

    color: var(--color-primary-dark);
    font-size: 1.1rem;
    font-weight: 700;
}

.author-institution {
    margin: 0 0 12px;

    color: var(--color-muted);
    font-size: 0.9rem;
}

.author-email {
    margin-bottom: 8px;
}

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

.author-email a:hover,
.author-orcid a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.author-orcid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    color: var(--color-muted);
    font-size: 0.85rem;
}

.orcid-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}


/* ========================================
   5. CONTENIDO DE LA INVESTIGACIÓN
======================================== */

.research-content {
    width: 100%;
    max-width: var(--content-width);
    margin-inline: auto;
    padding: 0;

    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.08rem;
    line-height: 1.9;

    text-align: justify;
    overflow-wrap: break-word;
}

/* Párrafos */

.research-content p {
    margin: 0 0 1.35rem;

    text-indent: 1.5em;
    hyphens: auto;
}

/* Títulos principales */

.research-content h2 {
    margin: 3.2rem 0 1.4rem;
    padding-bottom: 0.65rem;

    color: var(--color-primary-dark);
    font-size: 1.55rem;
    line-height: 1.4;

    /*border-bottom: 1px solid var(--color-border);*/
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: center;
}

/* Subtítulos */

.research-content h3 {
    margin: 2.3rem 0 1rem;

    color: var(--color-primary);
    font-size: 1.2rem;
    line-height: 1.45;
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: left;
}

/* Subtítulos de tercer nivel */

.research-content h4 {
    margin: 1.8rem 0 0.8rem;

    color: var(--color-primary);
    font-size: 1.05rem;
    line-height: 1.5;
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: left;
}


/* ========================================
   6. CITAS TEXTUALES
======================================== */

.research-content blockquote {
    margin: 2rem 0;
    padding: 0.5rem 1.5rem;

    color: var(--color-muted);
    border-left: 2px solid var(--color-accent);

    font-size: 0.98rem;
    line-height: 1.8;
}

.research-content blockquote p {
    text-indent: 0;
}

.research-content blockquote p:last-child {
    margin-bottom: 0;
}


/* ========================================
   7. TABLAS
======================================== */

.research-content table {
    width: 100%;
    margin: 2rem 0;

    border-collapse: collapse;
    font-family: var(--font-heading);
    font-size: 0.92rem;
}

.research-content th,
.research-content td {
    padding: 0.85rem 1rem;

    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.research-content th {
    color: var(--color-primary-dark);
    background-color: var(--color-surface-subtle);
    font-weight: 700;
}


/* ========================================
   8. ENLACES Y REFERENCIAS
======================================== */

.research-content a {
    color: var(--color-primary);
    text-decoration: none;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.research-content a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Llamadas a notas al pie */

.research-content a[href^="#Footnote"],
.research-content a[href^="#footnote"] {
    text-decoration: none;
}

/* Evita subrayar los números de las notas */

.research-content a[href^="#Footnote"]:hover,
.research-content a[href^="#footnote"]:hover {
    color: var(--color-accent);
    text-decoration: none;
}


/* ========================================
   9. LISTAS
======================================== */

.research-content ul,
.research-content ol {
    margin: 1.2rem 0 1.6rem;
    padding-left: 2rem;
}

.research-content li {
    margin-bottom: 0.55rem;
}

.research-content li p {
    text-indent: 0;
}


/* ========================================
   10. NOTAS AL PIE
======================================== */

.footnote {
    width: 100%;
    max-width: var(--content-width);
    margin: 4rem auto 0;
    padding: 1.5rem 0 0;

    color: var(--color-text);
    background: transparent;

    border: none;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: none;

    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Encabezado de las notas */

.footnote h2 {
    margin: 0 0 1.4rem;
    padding: 0;

    color: var(--color-primary-dark);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;

    border: none;
}

/* Párrafos de las notas */

.footnote p {
    margin: 0 0 0.8rem;

    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    text-indent: 0;

    overflow-wrap: anywhere;
}

/* Enlaces de las notas */

.footnote a {
    color: var(--color-primary);
    text-decoration: none;
}

.footnote a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ========================================
   11. DISEÑO RESPONSIVO
======================================== */

@media (max-width: 992px) {
    body {
        padding: 25px 15px;
    }

    .document-container {
        padding: 40px 35px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .document-container {
        padding: 30px 22px;
        border-radius: 4px;
    }

    .title {
        margin-bottom: 25px;
        padding: 10px 5px 25px;
    }

    .title h1 {
        font-size: clamp(1.65rem, 6vw, 2rem);
        letter-spacing: -0.02em;
    }

    .author {
        margin: 25px auto 35px;
        padding: 0;
    }

    .research-content {
        font-size: 1rem;
        line-height: 1.8;
        text-align: left;
    }

    .research-content h2 {
        margin-top: 2.5rem;
        font-size: 1.35rem;
    }

    .research-content h3 {
        font-size: 1.12rem;
    }

    .research-content p {
        text-indent: 1em;
    }

    .research-content blockquote {
        padding-left: 1rem;
    }

    /* Permite desplazamiento horizontal de tablas anchas */

    .research-content table {
        display: block;
        overflow-x: auto;
    }

    .footnote {
        margin-top: 3rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .document-container {
        padding: 25px 18px;
        border: none;
        border-radius: 0;
    }

    .title h1 {
        font-size: 1.65rem;
    }

    .research-content h2 {
        font-size: 1.25rem;
    }

    .research-content h3 {
        font-size: 1.08rem;
    }

    .footnote {
        font-size: 0.875rem;
    }
}


/* ========================================
   12. IMPRESIÓN Y EXPORTACIÓN A PDF
======================================== */

@media print {
    @page {
        size: A4;
        margin: 2.2cm;
    }

    body {
        padding: 0;

        color: #222222;
        background: #ffffff;

        font-family: var(--font-body);
        font-size: 11pt;
        line-height: 1.6;
    }

    .document-container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;

        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .title h1,
    .research-content h2,
    .research-content h3,
    .research-content h4,
    .footnote h2 {
        color: #222222;
    }

    .title,
    .author {
        break-inside: avoid;
    }

    .research-content h2,
    .research-content h3,
    .research-content h4,
    .footnote h2 {
        break-after: avoid;
    }

    .research-content p,
    .research-content blockquote,
    .footnote p {
        orphans: 3;
        widows: 3;
    }

    .research-content blockquote {
        border-left-color: #999999;
    }

    .research-content a,
    .footnote a {
        color: inherit;
        text-decoration: none;
    }
}


/* Citas textuales en bloque */
.p10 {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #173b4a;
    background-color: #f5f7f8;
    color: #343a40;
    font-size: 0.96rem;
    line-height: 1.8;
    text-align: justify;
}

/* Párrafos dentro de la cita */
.p10 p {
    margin-bottom: 0.75rem;
}

.p10 p:last-child {
    margin-bottom: 0;
}

/* Citas en pantallas pequeñas */
@media (max-width: 576px) {
    .p10 {
        padding: 0.85rem 1rem;
        margin: 1.25rem 0;
        font-size: 0.92rem;
    }
}