/* Top Posts Widget Styles */
.top-posts-container {
    background-color: #1e3a5f;
    padding: 30px;
    /*max-width: 400px;*/
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

.top-posts-header {
    margin-bottom: 25px;
}

.top-posts-main-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.top-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.top-posts-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.top-posts-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.top-posts-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.top-posts-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /*border-radius: 4px;*/
}

.top-posts-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.top-posts-placeholder {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-posts-placeholder::before {
    content: "📷";
    font-size: 24px;
    opacity: 0.5;
}

.top-posts-content {
    flex: 1;
    min-width: 0;
}

.top-posts-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.3;
}

.top-posts-title a {
    color: #ffffff;
    text-decoration: none!important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.top-posts-title a:hover {
    text-decoration: underline;
}

.top-posts-excerpt {
    color: #cccccc;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    text-align: justify;

    display: -webkit-box;
  -webkit-line-clamp: 3;         /* Número de líneas (ajústalo según el tamaño del texto) */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pagination Styles */
.top-posts-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.pagination-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-link,
.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    text-decoration: none!important;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination-link {
    color: #cccccc;
    background-color: transparent;
    border: 1px solid #cccccc;
}

.pagination-link:hover {
    background-color: #ffffff;
    color: #1e3a5f;
    border-color: #ffffff;
}

.pagination-current {
    background-color: #ffffff;
    color: #1e3a5f;
    font-weight: bold;
    border: 1px solid #ffffff;
}

.pagination-prev,
.pagination-next,
.pagination-last {
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-posts-container {
        padding: 20px;
        max-width: 100%;
    }
    
    .top-posts-main-title {
        font-size: 16px;
        text-align: center;
    }
    
    .top-posts-item {
        gap: 12px;
    }
    
    .top-posts-image {
        width: 70px;
        height: 70px;
    }
    
    .top-posts-title {
        font-size: 13px;
    }
    
    .top-posts-excerpt {
        font-size: 11px;
    }
    
    .pagination-link,
    .pagination-current {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .top-posts-container {
        padding: 15px;
    }
    
    .top-posts-image {
        width: 60px;
        height: 60px;
    }
    
    .top-posts-title {
        font-size: 12px;
    }
    
    .top-posts-excerpt {
        font-size: 10px;
    }
    
    .pagination-wrapper {
        gap: 5px;
    }
    
    .pagination-link,
    .pagination-current {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* Loading Animation */
.top-posts-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}