/* Dynamic Posts Grid Plugin Styles */
.dynamic-posts-grid {
    display: flex;
    gap: 0;
    height: var(--grid-height, 400px);
    margin: 0;
    overflow: hidden;
}

.dynamic-grid-item {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.item-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
}

.dynamic-grid-item:hover .item-overlay {
    opacity: 1;
    transform: translateY(0);
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.75) 50%,
        rgba(0, 0, 0, 0.95) 100%
    );
}

.item-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: white;
    text-align: center;
    gap: 15px;
}

/* Nuevo orden: Título */
.item-title {
    font-size: 1.4em;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    order: 1;
}

.item-title a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.item-title a:hover {
    color: #ffffff;
}

/* Autor y fecha en una línea */
.item-meta-line {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.85em;
    order: 2;
}

.item-author {
    display: flex;
    align-items: center;
    gap: 5px;
}

.author-label {
    opacity: 0.7;
    font-weight: 300;
}

.author-name {
    color: white;
    font-weight: 500;
}

.item-date {
    font-size: 1em;
    opacity: 0.9;
    font-weight: 300;
}

/* Excerpt */
.item-excerpt {
    font-size: 0.95em;
    line-height: 1.4;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
    max-width: 100%;
    order: 3;
}

/* Botón */
.item-read-more {
    background: #e69624;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    order: 4;
    position: static;
}

.item-read-more:hover {
    background: #d4851f;
    transform: scale(1.05);
    color: white;
}

/* Estados de Hover - Flex approach para mantener una línea */
.dynamic-posts-grid:not(:hover) .dynamic-grid-item {
    flex: 1;
}

.dynamic-posts-grid:hover .dynamic-grid-item {
    flex: 0.5;
    filter: brightness(0.7) blur(1px);
}

.dynamic-posts-grid:hover .dynamic-grid-item:hover {
    flex: 2.5;
    filter: brightness(1) blur(0);
}

.dynamic-grid-item:hover .item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.dynamic-grid-item:hover .item-background {
    transform: scale(1.05);
}

.dynamic-grid-item:hover .item-read-more {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.2s;
}

/* Ajustes para elementos pequeños cuando no tienen hover */
.dynamic-posts-grid:hover .dynamic-grid-item:not(:hover) .item-content {
    padding: 15px 10px;
}

.dynamic-posts-grid:hover .dynamic-grid-item:not(:hover) .item-overlay {
    opacity: 0;
}

.dynamic-posts-grid:hover .dynamic-grid-item:not(:hover) .item-excerpt,
.dynamic-posts-grid:hover .dynamic-grid-item:not(:hover) .item-meta-line {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dynamic-posts-grid:hover .dynamic-grid-item:not(:hover) .item-title {
    font-size: 1rem;
    line-height: 1.2;
}

.dynamic-posts-grid:hover .dynamic-grid-item:not(:hover) .item-read-more {
    display: none;
}

/* Mobile Responsive - Cambiar a columnas */
@media (max-width: 768px) {
    .dynamic-posts-grid {
        flex-direction: column;
        height: auto;
        gap: 0;
    }
    
    .dynamic-grid-item {
        height: 250px;
        flex: none !important;
        filter: none !important;
    }
    
    .item-overlay {
        opacity: 1 !important;
        transform: translateY(0) !important;
        background: linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.4) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0.8) 100%
        );
    }
    
    .item-read-more {
        opacity: 1;
        transform: translateX(0);
    }
    
    .item-main-content {
        padding: 15px 0;
    }
    
    .item-title {
        font-size: 1.2em;
    }
    
    .item-excerpt {
        font-size: 0.9em;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .item-meta-line {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .item-read-more {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .item-overlay {
        padding: 15px;
    }
    
    .item-main-content {
        padding: 10px 0;
    }
    
    .item-title {
        font-size: 1.1em;
    }
    
    .item-meta-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .item-meta-line {
        gap: 15px;
    }
}

/* Tablet - Flexbox simple */
@media (min-width: 769px) and (max-width: 1024px) {
    .dynamic-posts-grid {
        gap: 0;
    }
    
    .dynamic-posts-grid:hover .dynamic-grid-item:hover {
        flex: 2;
    }
    
    .dynamic-posts-grid:hover .dynamic-grid-item:not(:hover) {
        flex: 0.6;
    }
}

/* Estados adicionales para mejor experiencia */
.no-posts-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-style: italic;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-size: 1.1em;
}

/* Animaciones de entrada */
.dynamic-grid-item {
    opacity: 0;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.dynamic-grid-item:nth-child(1) { animation-delay: 0.1s; }
.dynamic-grid-item:nth-child(2) { animation-delay: 0.2s; }
.dynamic-grid-item:nth-child(3) { animation-delay: 0.3s; }
.dynamic-grid-item:nth-child(4) { animation-delay: 0.4s; }
.dynamic-grid-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}