/**
 * Archivo: wp-content/plugins/elementor-posts-grid/assets/posts-grid.css
 * Estilos para el widget Posts Grid
 */

.posts-grid-wrapper {
    position: relative;
}

.posts-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.posts-grid-item {
    background: #ffffff;
    
   
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/*.posts-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}*/

.posts-grid-image {
    position: relative;
    overflow: hidden;
}

.posts-grid-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.posts-grid-image:hover img {
    transform: scale(1.05);
}

.posts-grid-content {
    padding-top: 5px;
}

.posts-grid-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;

    display: -webkit-box;
  -webkit-line-clamp: 1;         /* Número de líneas (ajústalo según el tamaño del texto) */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.posts-grid-title a {
    color: #333333;
    text-decoration: none!important;
    transition: color 0.3s ease;
}

.posts-grid-title a:hover {
    color: #007cba;
}

.posts-grid-excerpt {
    color: #666666;
    font-size: 14px;
    /*line-height: 1.6;*/
    margin: 0;
}

/* Paginación */
.posts-grid-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    /*margin-top: 30px;*/
}

.posts-grid-page-btn {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    color: #333333;
    padding: 10px 15px;
    border-radius: 0px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 35px;
}

.posts-grid-page-btn:hover {
    background: #3AA3BE;
    border-color: #30AAC6;
    color: #fff;
}

.posts-grid-page-btn.active {
    background: #3AA3BE;
    border-color: #30AAC6;
    color: #ffffff;
}

.posts-grid-page-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading */
.posts-grid-loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666666;
}

.posts-grid-loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .posts-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .posts-grid-content {
        padding: 15px;
    }
    
    .posts-grid-title {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .posts-grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .posts-grid-image img {
        height: 180px;
    }
    
    .posts-grid-pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .posts-grid-page-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .posts-grid-content {
        padding: 12px;
    }
    
    .posts-grid-title {
        font-size: 15px;
    }
    
    .posts-grid-excerpt {
        font-size: 13px;
    }
    
    .posts-grid-image img {
        height: 160px;
    }
}

/* Estados de transición */
.posts-grid-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.posts-grid-item {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejoras visuales adicionales */
.posts-grid-item .posts-grid-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.posts-grid-item:hover .posts-grid-image::after {
    opacity: 1;
}

/* Estilos para diferentes tamaños de imagen */
.posts-grid-item[data-image-size="thumbnail"] .posts-grid-image img {
    height: 150px;
}

.posts-grid-item[data-image-size="small"] .posts-grid-image img {
    height: 180px;
}

.posts-grid-item[data-image-size="medium"] .posts-grid-image img {
    height: 220px;
}

.posts-grid-item[data-image-size="large"] .posts-grid-image img {
    height: 280px;
}

.posts-grid-item[data-image-size="full"] .posts-grid-image img {
    height: auto;
    min-height: 200px;
}