:root {
    --bg-color: #FDFCF8;
    --text-color: #2C2C2C;
    --accent-color: #8B4513; /* SaddleBrown for elegant accents */
    --muted-color: #6B6B6B;
    --border-color: #E0DDD5;
    --container-width: 720px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Lora', serif;
    line-height: 1.8;
    font-size: 1.1rem;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    padding: 4rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

#site-title {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-style: italic;
    color: var(--muted-color);
    font-size: 1.2rem;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 3px;
    background: transparent;
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 100%;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.4s ease;
}

/* Main Content */
#app {
    min-height: 60vh;
}

#chapter-content {
    animation: fadeIn 0.8s ease-in-out;
}

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

#chapter-content h3 {
    margin-top: 2.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
}

#chapter-content p {
    margin-bottom: 1.6rem;
    text-align: justify;
}

#chapter-content blockquote {
    border-left: 3px solid var(--accent-color);
    padding-left: 20px;
    margin: 2rem 0;
    font-style: italic;
    color: var(--muted-color);
}

#chapter-content a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: all 0.3s ease;
}

#chapter-content a:hover {
    background-color: rgba(139, 69, 19, 0.05);
}

/* Navigation */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin: 4rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.nav-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Footer */
.main-footer {
    padding: 4rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted-color);
    border-top: 1px solid var(--border-color);
}

.footer-projects {
    margin-top: 1rem;
}

.footer-projects a {
    color: var(--muted-color);
    margin: 0 10px;
    text-decoration: none;
    font-weight: 600;
}

.footer-projects a:hover {
    color: var(--accent-color);
}

/* Floating Index Drawer */
.index-drawer {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.index-toggle {
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

.index-toggle:hover {
    transform: scale(1.05);
}

.index-content {
    position: absolute;
    bottom: 4rem;
    right: 0;
    background: var(--bg-color);
    width: 280px;
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: none;
    animation: slideUp 0.3s ease-out;
}

.index-drawer.active .index-content {
    display: block;
}

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

.index-content h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

#chapter-list {
    list-style: none;
}

.chapter-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-color);
    cursor: pointer;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.chapter-item:hover {
    color: var(--accent-color);
}

.chapter-item.active {
    font-weight: 700;
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    #site-title { font-size: 1.8rem; }
    body { font-size: 1rem; }
    .nav-btn { padding: 8px 15px; font-size: 0.9rem; }
    .img-inmersiva {
        width: 100%;
        margin: 2rem auto 0.8rem auto;
    }
}

/* === Estilo de Imágenes Inmersivas === */
.img-inmersiva {
    display: block;
    width: 90%;
    max-width: 850px;
    margin: 3.5rem auto 1rem auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.img-inmersiva:hover {
    transform: scale(1.01);
}

.img-caption {
    display: block;
    text-align: center;
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    font-style: italic;
    color: #7f8c8d;
    margin-bottom: 3.5rem;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}
