/* =============================================================================
   REVISTA REDICYT (DINÁMICA & OPTIMIZADA)
   ============================================================================= */

#ucateba-redicyt {
    font-family: 'Poppins', sans-serif;
    color: #1e293b;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    box-sizing: border-box;
}

/* --- 1. SECCIÓN HERO (Encabezado azul) --- */
.redicyt-hero {
    background: linear-gradient(135deg, #0D2A6E 0%, #081d4e 100%);
    padding: 4rem 2rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 5px solid #F47920;
}

.redicyt-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(244, 121, 32, .15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.redicyt-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, .04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.redicyt-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.redicyt-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(244, 121, 32, .15);
    border: 1px solid #F47920;
    color: #F47920;
    padding: .4rem 1.2rem;
    border-radius: 50px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
}

.redicyt-title {
    color: #ffffff !important;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    text-shadow: 0 4px 15px rgba(0, 0, 0, .3);
}

.redicyt-orange {
    color: #F47920 !important;
}

.redicyt-subtitle {
    color: rgba(255, 255, 255, .88) !important;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 580px;
    margin: 0 auto;
}

/* --- 2. ÁREA DE BIBLIOTECA (La cuadrícula) --- */
.redicyt-content {
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
    background: #f8fafc;
}

.redicyt-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    /* Espacio entre los diferentes libros */
    justify-content: center;
    max-width: 1200px;
}

.redicyt-portada-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* --- 3. EL LIBRO 3D --- */
.redicyt-libro {
    position: relative;
    width: 250px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform .4s ease;
    filter: drop-shadow(0 20px 40px rgba(13, 42, 110, .15));
}

.redicyt-libro:hover {
    transform: perspective(1000px) rotateY(-8deg) translateY(-8px);
    filter: drop-shadow(0 30px 50px rgba(13, 42, 110, .25));
}

.redicyt-libro-lomo {
    position: absolute;
    left: -16px;
    top: 4px;
    width: 16px;
    height: calc(100% - 8px);
    background: linear-gradient(180deg, #0a1e52 0%, #0D2A6E 40%, #0a1e52 100%);
    border-radius: 3px 0 0 3px;
    transform: skewY(-0.5deg);
}

.redicyt-libro-cover {
    position: relative;
    width: 100%;
    border-radius: 0 6px 6px 0;
    overflow: hidden;
    box-shadow: inset -3px 0 8px rgba(0, 0, 0, .2);
}

.redicyt-libro-cover img {
    width: 100%;
    display: block;
    min-height: 350px;
    object-fit: cover;
}

.redicyt-cover-placeholder {
    width: 100%;
    min-height: 350px;
    background: linear-gradient(135deg, #0D2A6E 0%, #1a3d8f 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
}

.redicyt-cover-placeholder i {
    font-size: 4rem;
    color: #F47920;
}

.redicyt-cover-placeholder span {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.redicyt-cover-shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, .04) 40%, transparent 60%);
}

.redicyt-cover-hover {
    position: absolute;
    inset: 0;
    background: rgba(13, 42, 110, .8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    opacity: 0;
    transition: opacity .3s ease;
}

.redicyt-libro:hover .redicyt-cover-hover {
    opacity: 1;
}

.redicyt-cover-hover i {
    font-size: 2.5rem;
    color: #F47920;
}

.redicyt-cover-hover span {
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
}

.redicyt-libro-sombra {
    position: absolute;
    bottom: -20px;
    left: 10px;
    right: 0;
    height: 20px;
    background: radial-gradient(ellipse, rgba(13, 42, 110, .2) 0%, transparent 70%);
    filter: blur(6px);
}

/* --- 4. INFORMACIÓN DEBAJO DEL LIBRO --- */
.redicyt-portada-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
}

.redicyt-edicion-tag {
    background: rgba(244, 121, 32, .1);
    border: 1px solid rgba(244, 121, 32, .3);
    color: #d4610d;
    padding: .25rem .85rem;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.redicyt-portada-titulo {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0D2A6E !important;
    margin: 0;
}

.redicyt-portada-btns {
    display: flex;
    gap: .5rem;
    margin-top: .5rem;
}

.redicyt-btn-abrir {
    display: inline-flex;
    align-items: center;
    padding: .6rem 1.25rem;
    background: #0D2A6E;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s;
    box-shadow: 0 4px 12px rgba(13, 42, 110, .2);
}

.redicyt-btn-abrir:hover {
    background: #F47920;
    transform: translateY(-2px);
}

.redicyt-btn-descargar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    color: #0D2A6E !important;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    font-size: 1rem;
    transition: all .3s;
}

.redicyt-btn-descargar:hover {
    border-color: #F47920;
    color: #F47920 !important;
}

/* =============================================================================
   5. VISOR MODAL (Para leer el PDF)
   ============================================================================= */
.redicyt-modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 29, 78, .92);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.redicyt-modal.active {
    opacity: 1;
    pointer-events: all;
}

.redicyt-modal-box {
    background: #2b2b2b;
    border-radius: 1rem;
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 80px rgba(0, 0, 0, .6);
    animation: modalIn .35s cubic-bezier(.34, 1.4, .64, 1);
    border: 1px solid rgba(255, 255, 255, .1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- HEADER DEL MODAL --- */
.redicyt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #18181b;
    flex-shrink: 0;
    border-bottom: 2px solid #F47920;
}

.redicyt-modal-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.redicyt-modal-title i {
    color: #F47920;
    font-size: 1.2rem;
}

.redicyt-modal-actions {
    display: flex;
    gap: .5rem;
}

.redicyt-modal-btn,
.redicyt-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .1);
    color: #fff !important;
    text-decoration: none !important;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s;
}

.redicyt-modal-btn:hover {
    background: rgba(255, 255, 255, .2);
}

.redicyt-modal-close:hover {
    background: rgba(239, 68, 68, .8);
}

/* --- CUERPO DEL MODAL (El PDF) --- */
.redicyt-modal-body {
    flex: 1;
    display: flex;
    background: #525659;
}

.redicyt-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* --- RESPONSIVE (Móviles y Tablets) --- */
@media(max-width: 768px) {
    .redicyt-modal {
        padding: 1rem;
    }

    .redicyt-modal-box {
        height: 95vh;
    }

    .redicyt-modal-title span {
        font-size: 0.85rem;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media(max-width: 480px) {
    .redicyt-hero {
        padding: 3rem 1.25rem 2rem;
    }

    .redicyt-libro {
        width: 180px;
    }

    .redicyt-libro-cover img {
        min-height: 250px;
    }

    .redicyt-cover-placeholder {
        min-height: 250px;
    }

    .redicyt-portada-btns {
        flex-direction: column;
        width: 100%;
    }

    .redicyt-btn-abrir,
    .redicyt-btn-descargar {
        justify-content: center;
        width: 100%;
        border-radius: 50px;
    }
}