/* =========================================
   PUB_REVISTAS
   ========================================= */

:root {
    --primary-blue: #1565c0;
    --bg-light: #f4f6f8;
    --accent-cyan: #00bcd4;
}

body {
    background-color: var(--bg-light);
    font-family: 'Montserrat', sans-serif;
    color: #333;
}


.dropbtn.active {
    color: var(--accent-cyan);
    border-bottom: 2px solid var(--accent-cyan);
    padding-bottom: 5px;
}

/* =========================================
   1. HERO SECTION (PORTADA)
   ========================================= */
.repo-hero {
    background-image: url('hero_tesis.png'); 
    background-size: cover;
    background-position: center;
    height: 260px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}
.hero-overlay { background: rgba(21, 101, 192, 0.85); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.hero-content { color: white; text-align: center; }
.hero-content h1 { font-family: 'Merriweather', serif; font-size: 3.5rem; margin: 5px 0; white-space: nowrap; }
.hero-content p { color: #bbdefb; font-size: 1.1rem; }
.hero-content h5 { letter-spacing: 2px; text-transform: uppercase; font-weight: 600; color: #e3f2fd; }

.main-container { max-width: 1300px; margin: 40px auto; padding: 0 20px; }

/* =========================================
   2. TOOLBAR (BUSCADOR Y FILTROS)
   ========================================= */
.toolbar-container {
    display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 30px; justify-content: space-between; align-items: center;
    background: white; padding: 12px 25px; border-radius: 50px; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.search-wrapper { position: relative; flex-grow: 1; max-width: 450px; }
.search-wrapper i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #999; }
.search-wrapper input { width: 100%; padding: 10px 15px 10px 40px; border: 1px solid #ddd; border-radius: 30px; outline: none; background: #f9f9f9; font-family: 'Montserrat', sans-serif; }


.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-btn {
    background: transparent; border: none; padding: 8px 16px; border-radius: 20px;
    cursor: pointer; color: #666; font-weight: 600; transition: 0.2s; font-family: 'Montserrat', sans-serif;
}
.filter-btn:hover, .filter-btn.active { background: var(--primary-blue); color: white; }


.filter-dropdown { position: relative; display: inline-block; }
.icon-btn { font-size: 1.2rem; padding: 6px 14px; }
.filter-dropdown-content {
    display: none; position: absolute; right: 0; top: 100%;
    background-color: white; min-width: 130px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-radius: 10px; z-index: 100; padding: 8px 0; overflow: hidden;
}
.filter-dropdown:hover .filter-dropdown-content { display: block; }
.filter-dropdown-content button {
    display: block; width: 100%; text-align: left; padding: 10px 20px;
    border: none; background: white; cursor: pointer; color: #444; font-weight: 500;
}
.filter-dropdown-content button:hover { background: #f0f4f8; color: var(--primary-blue); }

/* =========================================
   3. LISTA 
   ========================================= */




#lista-articulos {
    display: grid;
    
    grid-template-columns: 100% !important; 
    gap: 15px;
    max-width: 1250px;
    margin: 0 auto;
    
    
    width: 100%;
    align-content: start; 
    justify-items: stretch; 
    justify-content: start;
}


.pub-card.compact-mode {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px; 
    border-left: 5px solid var(--primary-blue); 
    
    display: flex; 
    flex-direction: column; 
    
    padding: 18px 25px; 
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    
    height: auto;
    width: auto; 
    box-sizing: border-box; 
}


.pub-card.compact-mode:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #e0e0e0;
}


.pub-title {
    margin: 0 0 12px 0;
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
}
.pub-title a { text-decoration: none; color: #2c3e50; transition: color 0.2s; }
.pub-title a:hover { color: var(--primary-blue); }


.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}


.pub-authors {
    margin: 0;
    color: #78909c;
    font-size: 0.85rem;
    font-family: 'Montserrat', sans-serif;
    
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}


.read-link {
    color: var(--primary-blue);
    font-size: 0.75rem; 
    font-weight: 800;  
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1.2px; 
    
    display: inline-flex; 
    align-items: center; 
    gap: 6px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}


.read-link i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.read-link:hover {
    color: #0d47a1; 
    text-decoration: underline; 
}

.read-link:hover i {
    transform: translateX(4px); 
}


html {
    overflow-y: scroll;
}
.main-container {
    min-height: 80vh; 
}

/* =========================================
   4. PAGINACIÓN
   ========================================= */
.pagination-wrapper { display: flex; justify-content: center; margin-top: 40px; gap: 15px; align-items: center; }
.btn-page { background: white; border: 1px solid #ddd; padding: 8px 18px; cursor: pointer; border-radius: 20px; font-weight: 600; color: #555; }
.btn-page:hover:not(:disabled) { background: var(--primary-blue); color: white; }
.btn-page:disabled { opacity: 0.5; cursor: not-allowed; }


/* =========================================
   5. VENTANA MODAL
   ========================================= */
.modal-overlay {
    display: none; position: fixed; z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(21, 101, 192, 0.85);
    backdrop-filter: blur(5px);
    justify-content: center; align-items: center;
    animation: fadeIn 0.3s ease-out;
}
.academic-paper-modal {
    background-color: #ffffff; width: 90%; max-width: 900px;
    border-radius: 8px; box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    position: relative; overflow: hidden; display: flex; flex-direction: column;
    max-height: 90vh; animation: slideUp 0.4s;
}
.close-modal {
    position: absolute; top: 15px; right: 20px; font-size: 2.5rem; color: #aaa; cursor: pointer; z-index: 10; line-height: 1; transition: 0.2s;
}
.close-modal:hover { color: var(--primary-blue); }
.paper-header { padding: 35px 40px 25px 40px; background: #fafafa; border-bottom: 1px solid #eee; }
.degree-badge {
    display: inline-block; padding: 5px 10px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: white; margin-bottom: 15px;
}
.paper-header h2 { font-family: 'Merriweather', serif; font-size: 1.5rem; color: var(--primary-blue); margin: 0 0 20px 0; line-height: 1.3; }
.paper-meta { display: flex; flex-wrap: wrap; gap: 30px; }
.meta-item { display: flex; align-items: center; }
.meta-item i { font-size: 1.4rem; color: #90a4ae; margin-right: 12px; }
.meta-item span { display: block; font-size: 0.75rem; color: #78909c; font-weight: 700; text-transform: uppercase; }
.meta-item strong { font-family: 'Merriweather', serif; font-size: 1rem; color: #333; }
.paper-body { padding: 30px 40px; overflow-y: auto; flex-grow: 1; }
.paper-body h4 { font-size: 0.9rem; color: #90a4ae; text-transform: uppercase; margin: 0 0 15px 0; letter-spacing: 1px; }
.paper-body p { font-family: 'Merriweather', serif; font-size: 1rem; line-height: 1.8; color: #444; text-align: justify; white-space: normal; margin: 0; }
.paper-footer { padding: 20px 40px; background: #fafafa; border-top: 1px solid #eee; text-align: right; }
.repo-btn { display: inline-block; background: var(--primary-blue); color: white; padding: 10px 25px; border-radius: 30px; text-decoration: none; font-weight: 700; transition: 0.3s; }
.repo-btn:hover { background: #0d47a1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.card-title a {
    text-decoration: none;
    color: #263238;
    transition: color 0.2s;

    
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}



@media (max-width: 500px) {
    .pub-card.compact-mode {
        flex-direction: column; 
        align-items: flex-start;
        padding: 20px;
    }
    .pub-action {
        align-self: flex-end; 
        margin-top: 10px;
    }
}