        :root {
            --bg-dark: #120808;
            --page-bg: #fcf9f9;
            --primary-color: #5c1111;
            --text-color: #2d3748;
        }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--bg-dark);
            color: var(--text-color);
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }

        /* Contenedor tipo libro con perspectiva 3D */
        .book-viewport {
            perspective: 1500px;
            width: 100%;
            max-width: 450px;
            height: 650px;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
        }

        .magazine-book {
            width: 100%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
        }

        /* Estilo de cada página individual vertical */
        .page {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background-color: var(--page-bg);
            border: 2px solid var(--primary-color);
            border-radius: 6px;
            box-shadow: -5px 0 15px rgba(0,0,0,0.15), 0 15px 35px rgba(0,0,0,0.5);
            padding: 22px 25px;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            backface-visibility: hidden;
            transform-origin: left center;
            
            /* Transición lenta y fluida de 1.8s sincronizada */
            transition: transform 1.8s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 1.8s ease;
            
            z-index: 1;
            opacity: 0;
            pointer-events: none;
        }

        /* Página activa (visible) */
        .page.active {
            opacity: 1;
            pointer-events: auto;
            transform: rotateY(0deg);
            z-index: 20;
        }

        /* Páginas que ya pasaron (giradas hacia la izquierda) */
        .page.turned {
            transform: rotateY(-180deg);
            opacity: 0;
            pointer-events: none;
            z-index: 5;
        }

        /* Estilo exclusivo para la Portada inicial */
        .page.cover-page {
            padding: 0;
            background: #000;
            border: 2px solid #000;
        }

        .cover-container {
            width: 100%;
            height: 100%;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .cover-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: top center;
            display: block;
        }

        /* Tipografías y componentes internos */
        h2 {
            color: var(--primary-color);
            font-size: 1.1em;
            border-bottom: 2px solid var(--primary-color);
            padding-bottom: 3px;
            margin-top: 0;
            margin-bottom: 6px;
            flex-shrink: 0;
        }

        p {
            font-size: 0.76em;
            text-align: justify;
            line-height: 1.3;
            margin-bottom: 5px;
            flex-shrink: 0;
        }

        ul {
            padding-left: 15px;
            margin-bottom: 5px;
            font-size: 0.75em;
        }
        ul li {
            margin-bottom: 3px;
        }

        .image-container {
            text-align: center;
            margin: auto 0;
            flex-shrink: 0;
        }

        .image-container img {
            max-width: 100%;
            max-height: 170px;
            border-radius: 4px;
            border: 2px solid #ddd;
            object-fit: contain;
        }

        .image-caption {
            font-size: 0.65em;
            color: #666;
            font-style: italic;
            margin-top: 3px;
        }

        .page-num {
            text-align: center;
            font-size: 0.75em;
            color: #777;
            margin-top: auto;
            flex-shrink: 0;
            padding-top: 4px;
        }
        
        .page-centered {
            display: flex !important;
            flex-direction: column !important;
            justify-content: center !important;
            align-items: center !important;
            text-align: center !important;
        }

/* Opcional: asegurarte de que el contenedor de texto no se pegue al fondo */
.page-centered-content {
    margin: auto 0;
    width: 100%;
}

        /* Estilos específicos restaurados para los DIRECTORES (Idénticos al diseño original) */
        .contenedor-tarjetas-directores {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: stretch;
            gap: 10px;
            margin: auto 0;
            flex-shrink: 0;
            width: 100%;
        }

        .tarjeta-director {
            background: #fff;
            border: 1px solid #e2d8d8;
            border-radius: 6px;
            padding: 8px;
            text-align: center;
            flex: 1;
            max-width: 48%;
            box-shadow: 0 3px 6px rgba(0,0,0,0.05);
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .tarjeta-director img {
            width: 100%;
            height: 150px;           /* Reducido de 170px para que no toque los bordes superiores */
            object-fit: contain;     /* Mantiene la foto completa sin recortarla contra el marco */
            border-radius: 4px;
            border: 1px solid #ddd;
            background: #f8f8f8;
            padding: 3px;            /* Pequeño espacio interno para que respire la imagen */
            box-sizing: border-box;
        }

        .nombre-dir {
            font-size: 0.65rem;
            font-weight: bold;
            color: var(--primary-color);
            margin-top: 6px;
            text-transform: uppercase;
            line-height: 1.1;
        }

        .periodo-dir {
            font-size: 0.6rem;
            color: #666;
            font-style: italic;
            margin-top: 3px;
        }

        .badge-fallecido {
            position: absolute;
            top: 5px;
            right: 5px;
            background-color: #2d3748;
            color: white;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.65rem;
            z-index: 2;
        }

        /* Controles de navegación inferiores */
        .viewer-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            max-width: 450px;
            margin-top: 15px;
        }

        .nav-btn {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 10px 24px;
            border-radius: 4px;
            font-weight: bold;
            cursor: pointer;
            transition: background 0.2s;
        }

        .nav-btn:hover:not(:disabled) {
            background-color: #7a1717;
        }

        .nav-btn:disabled {
            background-color: #3a2222;
            color: #777;
            cursor: not-allowed;
        }

        .status-indicator {
            color: #e2e8f0;
            font-weight: 600;
            font-size: 0.9em;
        }

        /* Grids para docentes y demás secciones */
        .grid-docentes {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
            max-height: 420px;
            overflow-y: auto;
            padding-right: 4px;
            margin: auto 0;
        }

        .tarjeta-profesor-db {
            background: #fff;
            border: 1px solid #e2d8d8;
            border-radius: 6px;
            padding: 5px;
            text-align: center;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            position: relative;
        }

        .tarjeta-profesor-db img {
            width: auto;
            max-width: 100%;
            height: 55px;
            object-fit: contain;
            display: block;
            margin: 0 auto;
            border-radius: 4px;
            border: 1px solid #ddd;
            background-color: #f8f8f8;
        }

        .profesor-nombre {
            font-size: 0.58rem;
            font-weight: bold;
            color: var(--primary-color);
            margin-top: 3px;
            text-transform: uppercase;
        }
        
        .cover-container {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        
        .cover-image {
          width: 100%;
          height: 100%;
          /* Cambiamos de 'cover' a 'contain' para mostrar la imagen completa sin recortes */
          object-fit: contain; 
          object-position: center;
        }