/* Importar fuentes medievales desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=IM+Fell+DW+Pica:ital@0;1&family=Cinzel:wght@400;600;700&display=swap');

/* Variables de color */
:root {
    /* Colores pergamino */
    --parchment-base: #F4ECD8;
    --parchment-light: #FAF6ED;
    --parchment-dark: #E8DCC8;
    --parchment-edge: #D4C4A8;
    
    /* Colores texto */
    --ink-dark: #2B2416;
    --ink-medium: #3A2F1E;
    --ink-light: #5A4F3E;
    
    /* Colores decorativos */
    --illumination-gold: #C9A961;
    --illumination-red: #8B3A3A;
    --illumination-blue: #4A6FA5;
    
    /* Sombras */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IM Fell DW Pica', serif;
    background-color: #1a1612;
    color: var(--ink-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Contenedor principal */
.manuscript-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--parchment-dark) 0%, var(--parchment-base) 50%, var(--parchment-light) 100%);
}

/* Navegación discreta */
.manuscript-nav {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 100;
    pointer-events: none;
}

.nav-btn {
    background: rgba(244, 236, 216, 0.9);
    border: 1px solid var(--parchment-edge);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1rem;
    color: var(--ink-medium);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    pointer-events: auto;
    opacity: 0.7;
    box-shadow: var(--shadow-soft);
}

.nav-btn:hover:not(:disabled) {
    opacity: 1;
    background: var(--parchment-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

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

.nav-btn .icon {
    font-size: 1.3rem;
    font-weight: bold;
}

.nav-btn .label {
    font-style: italic;
    font-size: 1.05rem;
}

/* Paginación (folio) */
/* Paginación (folio) - Pie de página */
.folio-number {
    position: fixed;
    bottom: 20px; /* Movido abajo como pie de página */
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--ink-light);
    opacity: 1;
    letter-spacing: 0.15em;
    z-index: 90;
    padding: 8px 16px;
    background: rgba(244, 236, 216, 0.7);
    border-radius: 4px;
}

/* Área del pergamino */
.parchment-area {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 80px 80px;
    min-height: 100vh;
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.parchment-area.revealing {
    opacity: 0.3;
    filter: brightness(0.5);
}

.parchment-content {
    background: rgba(255, 255, 255, 0.3);
    padding: 60px;
    border-radius: 2px;
    box-shadow: 
        inset 0 0 30px rgba(212, 196, 168, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

/* Textura de pergamino sutil */
.parchment-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(212, 196, 168, 0.03) 2px,
            rgba(212, 196, 168, 0.03) 4px
        );
    pointer-events: none;
    border-radius: 2px;
}

/* Títulos */
.manuscript-title {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;
    color: var(--ink-dark);
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    line-height: 1.3;
}

.manuscript-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.7rem;
    font-weight: 400;
    text-align: center;
    color: var(--ink-medium);
    margin-bottom: 3rem;
    font-style: italic;
    letter-spacing: 0.03em;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2.3rem;
    font-weight: 600;
    color: var(--illumination-red);
    margin-bottom: 0.8rem;
    letter-spacing: 0.08em;
    text-align: center;
}

.section-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--ink-medium);
    margin-bottom: 2.5rem;
    font-style: italic;
    text-align: center;
}

/* Ilustración inicial (introducción) - Como capitular auténtica */
.initial-illustration {
    float: left;
    width: 180px;
    height: 180px;
    margin: 0 25px 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    shape-outside: margin-box;
}

.initial-illustration img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.initial-illustration-placeholder {
    font-family: 'Cinzel', serif;
    font-size: 5rem;
    font-weight: bold;
    color: var(--ink-dark);
}

/* Miniatura de sección (integrada como capitular) - Mismo tamaño que introducción */
.section-miniature {
    float: left;
    width: 180px;
    height: 180px;
    margin: 0 25px 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    shape-outside: margin-box;
}

.section-miniature img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.miniature-placeholder {
    font-family: 'Cinzel', serif;
    font-size: 5rem;
    font-weight: bold;
    color: var(--ink-dark);
}

/* Capitular (letra inicial decorada) */
.initial-capital {
    float: left;
    font-family: 'Cinzel', serif;
    font-size: 5.5rem;
    line-height: 0.9;
    font-weight: 700;
    color: #8B3A3A;
    margin: 0 8px 0 0;
    padding: 15px;
    shape-outside: margin-box;
    position: relative;
    background-image: url('img/filigrana-marco.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Párrafos */
.manuscript-text {
    font-size: 1.4rem;
    color: var(--ink-dark);
    text-align: justify;
    margin-bottom: 1.5rem;
    text-indent: 2em;
    hyphens: none;
    line-height: 1.8;
}

.manuscript-text:first-of-type {
    text-indent: 0;
}

/* Elementos HTML inline en texto manuscrito (v2.5.1) */
.manuscript-text em {
    font-style: italic;
    font-family: 'Crimson Text', serif; /* Asegurar fuente con cursiva */
}

.manuscript-text strong {
    font-weight: 600;
    color: var(--illumination-gold);
}

/* ═══════════════════════════════════════════════════════════ */
/* PÁGINA DE CRÉDITOS (COLOPHON)                               */
/* ═══════════════════════════════════════════════════════════ */

.credits-title {
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 0.3em;
}

.credits-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.credits-text {
    font-size: 1.3rem; /* Aumentado de 1.1rem */
    color: var(--ink-dark);
    margin: 0.5rem 0;
    line-height: 1.6;
}

.credits-text:first-child {
    font-weight: 600;
    margin-top: 1.5rem;
}

.credits-spacer {
    height: 1.5rem;
}

/* Copyright y texto legal más pequeño */
.credits-content p:nth-child(4),
.credits-content p:nth-child(5) {
    font-weight: 600;
    margin-top: 2rem;
}

.credits-content p:nth-child(7) {
    font-size: 1.1rem; /* Aumentado de 0.95rem */
    line-height: 1.5;
    margin: 1.5rem 0;
    text-align: justify;
    text-align-last: center;
}

/* Información de contacto */
.credits-content p:contains('Contacto:'),
.credits-content p:contains('Web:'),
.credits-content p:contains('Instagram:') {
    font-size: 1.2rem; /* Aumentado de 1rem */
    margin: 0.3rem 0;
}

/* Lugar y fecha al final */
.credits-content p:last-child,
.credits-content p:nth-last-child(2) {
    font-size: 1.15rem; /* Aumentado de 1rem */
    font-style: italic;
    margin-top: 2rem;
    color: var(--ink-medium);
}

.manuscript-text i {
    font-style: italic;
}

.manuscript-text b {
    font-weight: 600;
}

/* Botón revelar imagen - OCULTO en v2.0 (navegación integrada) */
.reveal-image-btn,
.reveal-image-btn::before,
.reveal-image-btn::after,
.reveal-icon {
    display: none !important; /* v2.0: Ya no se usa, imagen integrada en flujo */
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* Área de imagen */
.image-area {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.image-area.active {
    opacity: 1;
    visibility: visible;
}

.image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}

.image-area.active .image-container img {
    opacity: 1;
    transform: scale(1);
}

/* Controles de imagen */
.image-controls {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 210;
    display: flex;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-area.active .image-controls {
    opacity: 0.7;
}

.image-area.active .image-controls:hover {
    opacity: 1;
}

/* Navegación visible en modo imagen (v2.0) - DISCRETA */
.image-area.active ~ .manuscript-nav,
body:has(.image-area.active) .manuscript-nav {
    z-index: 250;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    padding: 15px 30px;
}

/* Ocultar botón Tabula en modo imagen */
.image-area.active ~ .manuscript-nav #tabulaBtn,
body:has(.image-area.active) .manuscript-nav #tabulaBtn {
    display: none;
}

/* Ocultar botón selector de idioma en modo imagen */
.image-area.active ~ .manuscript-nav #langSwitcher,
body:has(.image-area.active) .manuscript-nav #langSwitcher {
    display: none;
}

/* Botones de navegación discretos en imagen */
.image-area.active ~ .manuscript-nav .nav-btn,
body:has(.image-area.active) .manuscript-nav .nav-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    min-width: auto;
    opacity: 0.6;
    backdrop-filter: blur(5px);
}

/* Ocultar texto en modo imagen, solo iconos */
.image-area.active ~ .manuscript-nav .nav-btn .label,
body:has(.image-area.active) .manuscript-nav .nav-btn .label {
    display: none;
}

.image-area.active ~ .manuscript-nav .nav-btn .icon,
body:has(.image-area.active) .manuscript-nav .nav-btn .icon {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.4rem;
}

.image-area.active ~ .manuscript-nav .nav-btn:hover:not(:disabled),
body:has(.image-area.active) .manuscript-nav .nav-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(201, 169, 97, 0.8);
    opacity: 1;
    transform: scale(1.05);
}

.image-area.active ~ .manuscript-nav .nav-btn:disabled,
body:has(.image-area.active) .manuscript-nav .nav-btn:disabled {
    opacity: 0.2;
    background: rgba(0, 0, 0, 0.2);
}

/* Folio discreto en imagen */
.image-area.active ~ .manuscript-nav .folio-number,
body:has(.image-area.active) .manuscript-nav .folio-number {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.control-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.control-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

/* Tabula (índice) overlay */
.tabula-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 22, 18, 0.95);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.tabula-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.tabula-content {
    background: linear-gradient(135deg, var(--parchment-dark), var(--parchment-base));
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    padding: 50px;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow-y: auto;
}

.tabula-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--ink-dark);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.close-tabula {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--ink-medium);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.close-tabula:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ink-dark);
}

.tabula-index {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tabula-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 15px 20px;
    border-radius: 4px;
    border-left: 4px solid var(--illumination-red);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
}

.tabula-item:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(5px);
    border-left-color: var(--illumination-gold);
}

.tabula-item-number {
    font-size: 0.9rem;
    color: var(--ink-light);
    font-weight: 600;
    letter-spacing: 0.1em;
}

.tabula-item-title {
    font-size: 1.1rem;
    color: var(--ink-dark);
    margin-top: 4px;
}

/* Tabula responsive para móviles */
@media (max-width: 1280px) {  /* Móviles y tablets incluyendo S24+/Ultra */
    .tabula-content {
        padding: 30px 20px;
        max-height: 85vh;
        width: 95%;
    }
    
    .tabula-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .close-tabula {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    
    .tabula-item {
        padding: 18px 22px; /* Más padding para táctil */
    }
    
    .tabula-item-number {
        font-size: 1.4rem; /* Aumentado de 1.2rem */
    }
    
    .tabula-item-title {
        font-size: 1.8rem; /* Aumentado de 1.6rem */
    }
}

/* ═══════════════════════════════════════════════════════════ */
/* PANORÁMICAS v2.2                                             */
/* ═══════════════════════════════════════════════════════════ */

.panorama-wrapper {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    /* scroll-behavior: smooth; ELIMINADO - causa lag en móvil */
    -webkit-overflow-scrolling: touch;
    /* Permitir solo scroll horizontal en móvil */
    touch-action: pan-x;
    display: flex;
    align-items: center;
    /* Permitir foco pero sin outline visible */
    outline: none;
    /* Mejorar rendimiento scroll móvil */
    will-change: scroll-position;
}

.panorama-wrapper:active {
    cursor: grabbing;
}

.panorama-wrapper.dragging {
    cursor: grabbing;
    scroll-behavior: auto; /* Scroll inmediato durante drag */
}

.panorama-image {
    height: 1200px;
    width: auto;
    max-width: none !important;
    max-height: none !important;
    display: block;
    object-fit: none;
    flex-shrink: 0;
    /* Prevenir selección mientras se arrastra */
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    /* NO heredar transiciones de .image-container img */
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Scrollbar panorama (horizontal) */
.panorama-wrapper::-webkit-scrollbar {
    height: 12px;
}

.panorama-wrapper::-webkit-scrollbar-track {
    background: rgba(43, 36, 22, 0.3);
    border-radius: 6px;
    margin: 0 20px;
}

.panorama-wrapper::-webkit-scrollbar-thumb {
    background: var(--illumination-gold);
    border-radius: 6px;
    border: 2px solid rgba(43, 36, 22, 0.3);
}

.panorama-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--illumination-red);
}

/* Responsive panoramas */
@media (max-width: 1280px) {  /* Móviles y tablets incluyendo S24+/Ultra */
    .panorama-wrapper {
        height: 75vh; /* Altura optimizada para dispositivos táctiles */
    }
    
    .panorama-image {
        height: 700px; /* Altura intermedia */
    }
    
    .panorama-wrapper::-webkit-scrollbar {
        height: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════ */
/* CAROUSELS v2.4                                               */
/* ═══════════════════════════════════════════════════════════ */

.carousel-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    outline: none;
}

.carousel-images {
    width: 100%;
    height: calc(100% - 60px); /* Espacio para dots */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image {
    position: absolute;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s 0.5s;
    pointer-events: none;
    z-index: 1;
}

.carousel-image.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s 0s;
    pointer-events: auto;
    z-index: 2;
}

/* Dots indicadores */
.carousel-dots {
    display: flex;
    gap: 12px;
    padding: 20px;
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100; /* Mayor que imágenes (z-index: 1-2) */
    background: rgba(0, 0, 0, 0.3); /* Fondo semi-transparente para mejor visibilidad */
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--illumination-gold);
    background: rgba(255, 255, 255, 0.3); /* Fondo semi-transparente */
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5); /* Sombra para mejor contraste */
}

.carousel-dot:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--illumination-gold);
    box-shadow: 0 0 8px var(--illumination-gold);
}

/* Responsive carousels */
@media (max-width: 1280px) {  /* Móviles y tablets incluyendo S24+/Ultra */
    .carousel-images {
        height: calc(100% - 50px);
    }
    
    .carousel-image {
        max-width: 93%;
        max-height: 86%;
    }
    
    .carousel-dots {
        bottom: 20px;
        gap: 10px;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
}

/* Responsive */
/* Dispositivos táctiles (hover: none detecta móviles/tablets) */
@media (hover: none) and (pointer: coarse) {
    .manuscript-nav {
        padding: 0 15px;
        gap: 8px;
        top: 10px;
    }
    
    /* Ocultar texto de todos los botones en dispositivos táctiles */
    .nav-btn .label {
        display: none;
    }
    
    .nav-btn {
        padding: 10px;
        min-width: 44px;
        /* font-size controlado por media query específico S24+ al final del archivo */
    }
}

/* Móviles y tablets por ancho - ampliado a 1280px para S24+/Ultra */
@media (max-width: 1280px) {
    .manuscript-nav {
        padding: 0 15px;
        gap: 8px;
        top: 10px;
    }
    
    .nav-btn .label {
        display: none;
        font-size: 2.5rem;
    }

    .nav-btn .icon {
        font-size: 2.5rem;
    }

    /* Excepto el selector de idioma que SÍ necesita mostrar ES/EN */
    #langSwitcher .label {
        display: inline !important;
    }
    
    .nav-btn {
        padding: 10px;
        min-width: 44px;
        /* font-size controlado por media query específico S24+ al final del archivo */
    }
    
    .parchment-area {
        padding: 110px 25px 90px !important;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .parchment-content {
        padding: 30px 25px;
        max-height: calc(100vh - 190px); /* Ajustado para padding 70+90=160px más navegación */
        flex: 1;
    }
    
    .manuscript-title {
        font-size: 4rem; /* Aumentado de 3.5rem (+100% vs original 2rem) */
    }
    
    .manuscript-subtitle {
        font-size: 2.5rem; /* Aumentado de 2.2rem (+92% vs original 1.3rem) */
    }
    
    .section-title {
        font-size: 3.3rem; /* Aumentado de 3rem (+94% vs original 1.7rem) */
    }
    
    .section-subtitle {
        font-size: 2.3rem; /* Aumentado de 2.1rem (+92% vs original 1.2rem) */
    }
    
    .initial-capital {
        font-size: 6rem; /* Aumentado de 5.5rem (+50% vs original 4rem) */
        width: 130px; /* Aumentado de 120px */
        height: 130px;
        padding: 14px;
        margin: 0 8px 0 0;
    }
    
    .initial-illustration {
        width: 220px; /* Aumentado de 200px (+57% vs original 140px) */
        height: 220px;
        margin: 0 26px 16px 0;
    }
    
    .initial-illustration-placeholder {
        font-size: 6rem; /* Aumentado de 5.5rem */
    }
    
    .section-miniature {
        width: 220px; /* Aumentado de 200px (+57% vs original 140px) */
        height: 220px;
        margin: 0 26px 16px 0;
    }
    
    .miniature-placeholder {
        font-size: 6rem; /* Aumentado de 5.5rem */
    }
    
    .manuscript-text {
        font-size: 2.2rem; /* CRÍTICO: Aumentado de 2rem (+83% vs original 1.2rem) */
        line-height: 2.1; /* Más espacioso aún */
    }
    
    .tabula-content {
        padding: 40px 30px;
    }
    
    .folio-number {
        font-size: 0.8rem;
        bottom: 25px; /* Cerca del borde, no tapa contenido visible */
    }
    
    .reveal-image-btn::before {
        width: 50px;
        height: 50px;
        background-size: 100px 100px;
    }
    
    /* Créditos más grandes en móvil */
    .credits-title {
        font-size: 2.8rem; /* Más grande en móvil */
    }
    
    .credits-text {
        font-size: 2rem; /* Aumentado de 1.8rem para móvil */
    }
    
    .credits-content p:nth-child(7) {
        font-size: 1.7rem; /* Texto legal más grande en móvil */
    }
    
    .credits-content p:contains('Contacto:'),
    .credits-content p:contains('Web:'),
    .credits-content p:contains('Instagram:') {
        font-size: 1.8rem; /* Contacto más grande en móvil */
    }
    
    .credits-content p:last-child,
    .credits-content p:nth-last-child(2) {
        font-size: 1.7rem; /* Lugar/fecha más grande en móvil */
    }
}

/* Tablets y móviles grandes (override móvil con valores intermedios) */
@media (min-width: 769px) and (max-width: 1280px) {
    .parchment-area {
        max-width: 1000px;
        padding: 80px 60px 80px; /* Mantener padding grande abajo */
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .parchment-content {
        max-height: calc(100vh - 190px);
        flex: 1;
    }
    
    .folio-number {
        bottom: 30px; /* Cerca del borde en tablet */
    }
    
    .initial-illustration,
    .section-miniature {
        width: 160px;
        height: 160px;
    }
    
    .initial-illustration-placeholder,
    .miniature-placeholder {
        font-size: 4.5rem;
    }
    
    .initial-capital {
        font-size: 5rem;
        width: 100px;
        height: 100px;
        padding: 13px;
    }
}

/* S24+ y móviles grandes - tipografía y botones más grandes */
@media (min-width: 900px) and (max-width: 1280px) {
    /* Botones navegación - especificidad aumentada para S24+ */
    .manuscript-nav .nav-btn,
    button.nav-btn {
        padding: 18px 20px !important;
        min-width: 60px !important;
        font-size: 2.5rem !important;
    }
    
    /* Texto manuscrito - más grande que móvil normal (2.2rem) */
    .manuscript-text {
        font-size: 2.8rem !important;
        line-height: 2.1;
    }
    
    .manuscript-page {
        font-size: 2.8rem;
        line-height: 2.0;
    }
    
    /* Letras iniciales - más grandes que móvil normal (6rem) */
    .initial-letter {
        font-size: 7.5rem;
        line-height: 5.5rem;
    }
    
    .initial-capital {
        font-size: 7.5rem;
        width: 150px;
        height: 150px;
    }
    
    /* Títulos - más grandes que móvil normal (4rem) */
    .manuscript-title {
        font-size: 5rem !important;
    }
    
    .chapter-title {
        font-size: 3.0rem;
    }
    
    .section-header {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 4.0rem;
    }
    
    .manuscript-subtitle {
        font-size: 3.0rem;
    }
    
    .section-subtitle {
        font-size: 2.8rem;
    }
    
    /* Ilustraciones - más grandes que móvil */
    .initial-illustration {
        width: 240px;
        height: 240px;
        margin: 0 30px 18px 0;
    }
    
    .section-miniature {
        width: 240px;
        height: 240px;
        margin: 0 30px 18px 0;
    }
    
    /* Índice - más grande que móvil normal */
    #tabulaContent li {
        font-size: 2.0rem;
        padding: 14px 0;
    }
    
    /* Miniaturas */
    .miniature-caption {
        font-size: 1.8rem;
    }
    
    /* Créditos */
    .credits-title {
        font-size: 3.5rem;
    }
    
    .credits-text {
        font-size: 2.5rem;
    }
}

/* Scrollbar personalizado */
.parchment-content::-webkit-scrollbar,
.tabula-content::-webkit-scrollbar {
    width: 8px;
}

.parchment-content::-webkit-scrollbar-track,
.tabula-content::-webkit-scrollbar-track {
    background: var(--parchment-dark);
    border-radius: 4px;
}

.parchment-content::-webkit-scrollbar-thumb,
.tabula-content::-webkit-scrollbar-thumb {
    background: var(--illumination-gold);
    border-radius: 4px;
}

.parchment-content::-webkit-scrollbar-thumb:hover,
.tabula-content::-webkit-scrollbar-thumb:hover {
    background: var(--illumination-red);
}

/* S24+ botones - SUPER específico combinando TODAS las condiciones */
@media (min-width: 900px) and (max-width: 1280px) and (hover: none) and (pointer: coarse) {
    /* Este media query gana porque cumple MÁS condiciones que los otros */
    .manuscript-container .manuscript-nav .nav-btn,
    .manuscript-container button.nav-btn,
    button#prevBtn, 
    button#nextBtn, 
    button#tabulaBtn, 
    button#langSwitcher {
        padding: 18px 20px !important;
        min-width: 60px !important;
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
}
