/* ==========================================
   RESET Y VARIABLES GENERALES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0f0f0f;
    --card-bg: #161619;
    --text-primary: #f4f4f5;
    --text-secondary: #94a3b8;
    --accent-color: #a855f7; /* Tono morado principal */
    --accent-glow: rgba(168, 85, 247, 0.15);
    --border-color: #26262a;
    --font-heading: 'Cormorant Garamond', serif;
    --font-sans: 'DM Sans', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
}

/* ==========================================
   LAYOUT DE DOS CAJAS (1/3 Izquierda, 2/3 Derecha)
   ========================================== */
.three-col-layout {
    display: grid;
    grid-template-columns: 1fr 4fr; /* 1 parte (1/3) y 2 partes (2/3) */
    gap: 2.5rem;
    max-width: 1500px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ==========================================
   CAJA IZQUIERDA: Índice en tono morado (Ocupa 1/3)
   ========================================== */
.col-left {
    position: relative;
}

.col-sticky {
    position: sticky;
    top: 2.5rem;
    height: calc(100vh - 5rem);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.col-sticky::-webkit-scrollbar {
    width: 3px;
}
.col-sticky::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.col-heading {
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.col-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-color);
    font-weight: 600;
}

.index-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.index-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.index-num {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--accent-color);
    opacity: 0.7;
}

.index-item:hover {
    color: var(--text-primary);
    background-color: var(--accent-glow);
}

/* Estado activo resaltado en morado */
.index-item.active {
    color: var(--text-primary);
    background-color: var(--accent-glow);
    border-left: 3px solid var(--accent-color);
    font-weight: 500;
}

.index-item.active .index-num {
    opacity: 1;
}

/* ==========================================
   CAJA DERECHA: Contenido y PDFs (Ocupa 2/3)
   ========================================== */
.col-center {
    display: flex;
    flex-direction: column;
    gap: 3.5rtem;
}

/* Ocultamos la columna derecha anterior si quedó rastro en el HTML */
.col-right {
    display: none; 
}

.doc-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin-bottom: 3.5rem;
}

.doc-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-number {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--accent-color);
    font-weight: 300;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--text-primary);
}

/* Tarjetas contenedoras de los documentos */
.doc-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.doc-card-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pdf-wrapper, .video-wrapper {
    width: 100%;
}

.pdf-wrapper iframe {
    display: block;
    border: none;
    background: #ffffff;
}

.pdf-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.video-wrapper video {
    width: 100%;
    display: block;
    background: #000;
}

/* Sección de Audio */
.audio-bg {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.audio-bg .bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.12;
    z-index: 1;
}

.audio-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.audio-content audio {
    width: 100%;
    margin-top: 1.2rem;
}

/* ==========================================
   PIE DE PÁGINA (FOOTER)
   ========================================== */
.footer {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    color: var(--text-secondary);
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.footer-heart {
    color: #ef4444;
}

.footer-note {
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* ==========================================
   DISEÑO RESPONSIVO (Móviles y Tablets)
   ========================================== */
@media (max-width: 1024px) {
    .three-col-layout {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .col-left {
        display: none; 
    }
}