/* =========================================
   RANKING – BIBLIOTECA CENTRAL UNU
========================================= */

.rank-scope * {
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ===== CONTENEDOR ===== */
.rank-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
    margin: 40px auto;
    max-width: 1100px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ===== CABECERA ===== */
.rank-header {
    background: #f9fafb;
    border-left: 4px solid #059669;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 32px;
    transition: transform 0.3s ease;
}

.rank-header:hover {
    transform: translateX(4px);
}

.rank-header h3 {
    margin: 0 0 8px;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 24px;
}

.rank-muted {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* ===== GRID ===== */
.rank-grid--three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    padding: 0 8px;
}

/* ===== TARJETA ===== */
.rank-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.rank-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #059669;
}

/* ===== BLOQUE SUPERIOR (MEDALLA) ===== */
.rank-media {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 16px;
    /* 👈 separación real */
}

.rank-position {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}

.rank-name {
    margin: 12px 16px 6px;
    /* 👈 aire arriba */
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
    text-align: center;
}

.rank-code,
.rank-facultad {
    margin: 4px 16px;
    font-size: 14px;
    color: #4b5563;
    text-align: center;
}

.rank-media::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }

    50% {
        transform: translate(0, 0) scale(1.2);
        opacity: 1;
    }
}

.rank-media--gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.rank-media--silver {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

.rank-media--bronze {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* ===== CONTENIDO ===== */
.rank-card h4 {
    margin: 18px 16px 6px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 0 8px;
}

.rank-card p {
    margin: 8px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

/* ===== BADGE ===== */
.rank-badge {
    display: inline-block;
    margin: 14px auto 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

/* ===== FOOTER ===== */
.rank-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    background: #fafafa;
}

/* ==========================
   RESPONSIVE – CELULARES
========================== */
@media (max-width: 768px) {

    .rank-name {
        font-size: 17px;
        margin-top: 14px;
    }

    .rank-media {
        height: 110px;
        margin-bottom: 18px;
    }

    .rank-container {
        padding: 24px 20px;
        border-radius: 12px;
        margin: 24px 16px;
    }

    .rank-header {
        text-align: center;
        border-left: none;
        border-top: 4px solid #059669;
        padding: 18px 16px;
    }

    .rank-header h3 {
        font-size: 22px;
    }

    .rank-muted {
        font-size: 13px;
    }

    .rank-grid--three {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0;
    }

    .rank-card {
        max-width: 360px;
        margin: 0 auto;
    }

    .rank-media {
        height: 110px;
    }

    .rank-card h4 {
        font-size: 17px;
        margin: 16px 12px 6px;
    }

    .rank-card p {
        font-size: 13px;
        margin: 6px 12px;
    }

    .rank-footer {
        font-size: 13px;
        padding: 14px 16px;
    }
}

/* ==========================
   TABLET
========================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .rank-grid--three {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .rank-container {
        padding: 28px 24px;
    }
}