/* =========================================================
   ESTILOS GENERALES
   ========================================================= */

body {
    font-family: 'Raleway', sans-serif;
    color: white;
    margin: 0;
    padding: 0;
    background-color: #00C160;
    background-image: url('images/IntentoCC_4b.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

main {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    padding: 10px 40px 40px 40px;
}

/* =========================================================
   CABECERA
   ========================================================= */

header {
    background-color: transparent;
    color: white;
    text-align: center;
    padding: 0.2em 0;
    font-size: 2em;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 52px;
    letter-spacing: 2px;
    text-align: center;
    color: #ffffff;
    margin-top: 50px;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: fadeTitle 1.5s ease;
}

header h1::after {
    content: "";
    display: block;
    width: 120px;
    height: 2px;
    background: #ffffff;
    margin: 15px auto 0;
    opacity: 0.6;
}

@keyframes fadeTitle {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   MENÚ LATERAL PRINCIPAL
   ========================================================= */

.sidebar {
    position: fixed;
    left: 40px;
    top: 110px;
    width: 220px;

    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
}

.sidebar ul {
    list-style: none;
}

.menu-divider::before {
    content: none !important;
}

.sidebar a {
    display: block;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: color 0.3s ease, padding-left 0.3s ease, border-color 0.3s ease;
}

.sidebar a:hover {
    color: #ffffff;
    padding-left: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.sidebar h2 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    color: #ffffff;
}

.menu-toggle {
    display: none;
    position: relative;
    top: 20px;
    left: 20px;
    font-size: 28px;
    color: white;
    cursor: pointer;
    z-index: 20;
    text-align: left;
}

.sidebar.active {
    display: block;
}

/* =========================================================
   MENÚ DE CAPÍTULOS
   ========================================================= */

.article-nav {
    width: 220px;
    max-width: 220px;
    flex-shrink: 0;
    margin-top: 10px;
    position: relative;
    z-index: 50;
}

.article-nav ul,
.article-nav li,
.article-nav a {
    position: relative;
    pointer-events: auto;
}

.article-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-nav ul li {
    margin-bottom: 6px;
}

.article-nav ul li a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 12px;
    line-height: 1.25;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.article-nav ul li a:hover,
.article-nav ul li a.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.7);
}

.chapter {
    display: none !important;
}

.chapter.active {
    display: block !important;
    animation: fadeChapter 0.4s ease;
}

@keyframes fadeChapter {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =========================================================
   RECUADRO CENTRAL Y TEXTO
   ========================================================= */

.transparent-box {
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.5);
    padding: 35px 25px;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 600px;
    margin: 0 0 40px 0;
    backdrop-filter: blur(10px);
    animation: fadeIn 1.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-box {
    position: relative;
    z-index: 1;
    height: 58vh;
    max-height: 58vh;
    overflow-y: auto;
}

.text-content {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    line-height: 1.8;
    color: #e8e8e8;
    text-align: justify;
    max-width: 650px;
    margin: 0 auto;
}

.text-content h2 {
    font-size: 35px;
    font-weight: bold;
    margin-top: 25px;
    color: #00747E;
}

.text-content h3 {
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    margin-top: 25px;
    margin-bottom: 10px;
    letter-spacing: 1px;
    color: #ffffff;
}

.text-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow:
        -1px -1px 0 rgba(200, 170, 80, 0.6),
         1px -1px 0 rgba(200, 170, 80, 0.6),
        -1px  1px 0 rgba(200, 170, 80, 0.6),
         1px  1px 0 rgba(200, 170, 80, 0.6);
}

.text-content p {
    margin-bottom: 20px;
}

.text-content p::first-letter {
    font-size: 32px;
    font-weight: 500;
    float: left;
    line-height: 1;
    margin-right: 6px;
    color: #ffffff;
}

.text-content ul {
    margin: 15px 0;
    padding-left: 40px;
    list-style-type: disc;
}

.text-content li {
    color: #dddddd;
    margin-bottom: 8px;
}

.text-content a {
    color: #d4b56a;
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 181, 106, 0.5);
    transition: all 0.3s ease;
}

.text-content a:hover {
    color: #ffffff;
    border-bottom: 1px solid #ffffff;
}

.no-dropcap {
    margin-bottom: 20px;
}

.no-dropcap::first-letter {
    font-size: inherit;
    float: none;
    margin: 0;
}

/* =========================================================
   IMÁGENES Y GALERÍAS
   ========================================================= */

.align-under-heading {
    display: block;
    margin: 0 auto;
    width: 100%;
    height: auto;
}

.align-left {
    width: 40%;
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
}

.image-text-container {
    clear: both;
    margin-bottom: 20px;
}

.image-text-container p {
    text-align: justify;
    font-size: 16px;
}

.image-row-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.image-row-container a {
    display: block;
}

.image-row-container img {
    width: 180px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.float-image-left {
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
    width: 180px;
}

.float-image-right {
    float: right;
    margin-left: 20px;
    margin-bottom: 10px;
    width: 180px;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 620px;
    margin: 0 auto;
}

.gallery-container a {
    display: block;
    overflow: hidden;
    border-radius: 6px;
}

.gallery-container img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-container img:hover {
    transform: scale(1.04);
    opacity: 0.9;
}

.gallery-box {
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 12px;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    max-width: 520px;
    margin: 20px auto;
}

.gallery a {
    width: 150px;
    display: block;
}

.gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.gallery img:hover {
    transform: scale(1.04);
}

.collage-container {
    display: grid;
    gap: 8px;
    margin: 0 auto 45px auto;
}

.collage-4x4 {
    grid-template-columns: repeat(4, 1fr);
}

.collage-5x5 {
    grid-template-columns: repeat(5, 1fr);
}

.collage-container img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* =========================================================
   TABLAS Y CATÁLOGO
   ========================================================= */

table {
    width: 100%;
    border-collapse: collapse;
}

table,
th,
td {
    border: 0 solid #ddd;
}

td {
    padding: 8px;
    text-align: left;
}

th {
    padding: 10px;
    text-align: left;
}

td:nth-child(1),
td:nth-child(2) {
    width: 25%;
}

td:nth-child(3) {
    width: 10%;
}

td:nth-child(4),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7) {
    width: 5%;
    text-align: center;
}

#obrasTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #e8e8e8;
}

#obrasTable th {
    text-align: left;
    padding: 10px;
    font-weight: 500;
    color: #d4b56a;
    border-bottom: 1px solid rgba(212, 181, 106, 0.4);
    background: rgba(0, 0, 0, 0.55);
}

#obrasTable td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#obrasTable tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

#obrasTable tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.04);
}

#obrasTable tr:nth-child(odd) {
    background: rgba(0, 0, 0, 0.12);
}

#obrasTable img {
    width: 18px;
    height: auto;
}

#obrasTable td:nth-child(6) img {
    filter: invert(1);
}

.search-bar,
.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.search-bar label,
.sort-options label {
    color: #d4b56a;
    font-size: 12px;
    white-space: nowrap;
}

.search-bar input,
.sort-options select {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #ffffff;
    padding: 8px;
    border-radius: 6px;
    width: auto;
    min-width: 220px;
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(212, 181, 106, 0.5);
    border-radius: 3px;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */

.message-textarea {
    width: 90%;
    max-width: 500px;
    padding: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    resize: vertical;
}

.contact-form {
    margin-top: 20px;
}

.contact-form label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
    color: #d4b56a;
    text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid rgba(212, 181, 106, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 14px;
}

.contact-form textarea {
    resize: vertical;
    min-height: 140px;
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.form-buttons input {
    width: auto;
    cursor: pointer;
    color: #ffffff;
}

/* =========================================================
   IDIOMAS
   ========================================================= */

h2.english {
    display: none;
}

h2.spanish {
    display: block;
}

html[lang="en"] h2.spanish {
    display: none;
}

html[lang="en"] h2.english {
    display: block;
}

/* =========================================================
   PIE DE PÁGINA
   ========================================================= */

footer {
    background-color: transparent;
    color: white;
    text-align: center;
    padding: 1em 0;
    position: fixed;
    width: 100%;
    bottom: 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    main {
        display: block;
        padding: 10px 0 40px 0;
    }

    .menu-toggle {
        display: block;
        position: fixed;
        top: 18px;
        left: 18px;
        font-size: 30px;
        color: white;
        z-index: 99999;
        cursor: pointer;
    }

    .sidebar {
        display: none;
    }

    .sidebar.active {
        display: block;
        position: fixed !important;
        top: 58px;
        left: 18px;
        width: 210px;
        z-index: 9998;
        background: rgba(0, 0, 0, 0.85);
        padding: 14px;
        border-radius: 12px;
    }

    .sidebar.active a {
        display: block;
        padding: 8px 4px;
        color: #ffffff;
        text-decoration: none;
    }

    .sidebar.active h2 {
        font-size: 12px;
        color: #ffffff;
    }

    .sidebar.active a:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 6px;
    }

    .article-nav {
        width: 100%;
        max-width: 100%;
        margin: 8px auto 12px auto;
        position: relative;
        z-index: 10;
    }

    .article-nav ul {
        display: grid;
        grid-template-columns: repeat(4, 78px);
        justify-content: center;
        gap: 5px;
        padding: 0;
        margin: 0;
    }

    .article-nav ul li {
        margin: 0;
    }

    .article-nav ul li a {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 48px;
        font-size: 8.5px !important;
        line-height: 1.1;
        padding: 4px !important;
        text-align: center;
        color: #ffffff;
        text-decoration: none;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.35);
        background: rgba(0, 0, 0, 0.35);
        cursor: pointer;
    }

    .article-nav ul li a.active,
    .article-nav ul li a:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(255, 255, 255, 0.8);
    }

    .transparent-box {
        position: relative;
        z-index: 1;
        width: auto;
        max-width: calc(100% - 36px);
        margin: 8px auto 35px auto;
        padding: 24px 18px;
    }

    .scroll-box {
        height: 60vh;
        max-height: 60vh;
        overflow-y: auto;
}

    .text-content {
        font-size: 16px;
        line-height: 1.7;
    }

    .text-title {
        font-size: 24px;
    }

    .text-content a:hover {
        color: #ffffff;
        border-bottom: 1px solid #ffffff;
    }

    .catalog-box {
        width: auto;
        max-width: calc(100% - 24px);
        overflow: hidden;
    }

    .catalog-content {
        max-width: 100%;
    }

    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        display: block;
        -webkit-overflow-scrolling: touch;
    }

    #obrasTable {
        width: max-content;
        min-width: 620px;
        table-layout: auto;
    }

    #obrasTable th,
    #obrasTable td {
        padding: 2px 4px;
        text-align: center;
        line-height: 1.2;
    }

    #obrasTable td:nth-child(1),
    #obrasTable th:nth-child(1) {
        width: 120px;
    }

    #obrasTable td:nth-child(2),
    #obrasTable th:nth-child(2) {
        width: 170px;
    }

    #obrasTable td:nth-child(3),
    #obrasTable th:nth-child(3) {
        width: 65px;
    }

    #obrasTable td:nth-child(4),
    #obrasTable th:nth-child(4) {
        width: 50px;
    }

    #obrasTable td:nth-child(5),
    #obrasTable th:nth-child(5),
    #obrasTable td:nth-child(6),
    #obrasTable th:nth-child(6) {
        width: 45px;
        padding: 2px;
    }

    #obrasTable img {
        width: 14px;
        height: auto;
    }

    .gallery-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .gallery {
        max-width: 100%;
        gap: 10px;
    }

    .gallery a {
        width: 42%;
    }

    .collage-4x4,
    .collage-5x5 {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .gallery-box {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .float-image-left,
    .float-image-right {
        float: none;
        display: block;
        margin: 10px auto;
        width: 80%;
    }

    .form-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
}

.writing-item {
    margin-bottom: 42px;
}
/* =========================================================
   PARA EL SCROLL RECUADRO CENTRAL
   ========================================================= */

.scroll-box {
    height: 58vh;
    max-height: 58vh;
    overflow-y: auto;
}

.download-thumb {
    width: 180px;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 24px auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.download-thumb:hover {
    transform: scale(1.04);
    opacity: 0.9;
}
.downloads-section {
    margin-top: 60px;
}



/* =========================================================
   SEGURIDAD Y ACEPTACIÓN DE ENTRADA EN DOWNLOADS
   ========================================================= */
#download-warning {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.warning-box {
    width: 90%;
    max-width: 520px;
    background: rgba(20,20,20,0.96);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    color: white;
}

.warning-box h2 {
    margin-bottom: 24px;
}

.warning-box p {
    margin-bottom: 18px;
    line-height: 1.6;
}

.warning-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
}

.warning-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* =========================================================
   DONACIONES
   ========================================================= */
.support-section {
    margin-top: 100px;
}
/* =========================================================
   SEPARACIÓN DE SECCIONES EN DESCARGAS
   ========================================================= */
.section-divider {
    width: 280px;
    height: 1px;
    margin: 80px auto;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255,255,255,0.35),
        transparent
    );
}

.menu-divider {
    width: 180px;
    height: 2px;
    margin: 70px auto;

    background: linear-gradient(
        to right,
        transparent,
        rgba(236, 160, 98, 0.85),
        transparent
    );
}

.sidebar ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.sidebar li {
    list-style: none !important;
}

.sidebar li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 6px;
}

.sidebar li.menu-divider {
    padding-left: 0;
}

.sidebar li.menu-divider::before {
    content: none !important;
}

.menu-divider {
    margin: 70px auto;
    padding-left: 0 !important;
}

/* FIJACIÓN DEFINITIVA DEL MENÚ LATERAL EN ESCRITORIO */

body .sidebar {
    position: fixed !important;
    left: 40px !important;
    top: 110px !important;
    width: 220px !important;

    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
}

body .sidebar ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
}

body .sidebar li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 6px;
    list-style: none !important;
}

body .sidebar li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 8px;
    color: rgba(255,255,255,0.45);
     font-size: 17px;
    font-weight: bold;
}

body .sidebar li.menu-divider {
    padding-left: 0 !important;
    margin: 70px auto !important;
}

body .sidebar li.menu-divider::before {
    content: none !important;
}

@media (max-width: 768px) {
    body .sidebar {
        display: none;
    }

    body .sidebar.active {
        display: block;
        position: fixed !important;
        top: 58px !important;
        left: 18px !important;
        width: 210px !important;
    }
}


.header-subtitle {
    margin-top: -10px;
    margin-bottom: 10px;

    text-align: center;

    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;

    color: rgba(255,255,255,0.72);
}

/* CONTACTO - anular letra capitular */

body .text-content p.contact-email::first-letter,
body .transparent-box .text-content p.contact-email::first-letter {
    font-size: inherit !important;
    color: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: none !important;
}

/* CONTACTO CYGNUS */

.platform-contact {
    margin-top: 45px;
    margin-bottom: 10px;
    text-align: center;
}

.platform-contact p {
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: none;
    color: rgba(255,255,255,0.62);
}

.platform-contact a {
    color: rgba(210,170,110,0.88);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.platform-contact a:hover {
    opacity: 0.75;
}
/* Evitar letra capitular heredada */

.platform-contact p::first-letter,
.platform-contact a::first-letter {
    font-size: 11px !important;
    line-height: inherit !important;
    color: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: none !important;
}
body .chapter p.proemio-end {
    margin-bottom: 62px !important;
}
