/* ============================================
   HERO LATEST POSTS - VERSIÓN CON MÁXIMA NITIDEZ
   Imágenes en alta calidad | Formato 1:1 cuadrado
   ============================================ */

/* Contenedor principal */
.hero-posts-wrapper {
    margin: 15px auto;
    max-width: 1200px;
    width: 100%;
}

/* Grid principal - 50% - 50% */
.hero-posts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
}

/* ========== POST GRANDE (IZQUIERDA) ========== */
.hero-posts-large {
    display: flex;
    height: 100%;
}

.hero-posts-large .hero-post {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: box-shadow 0.3s ease;
}

.hero-posts-large .hero-post:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Thumbnail post grande - formato 1:1 cuadrado */
.hero-posts-large .hero-post-thumbnail {
    width: 100%;
    padding-bottom: 100%; /* Cuadrado perfecto 1:1 */
    position: relative;
    background: #ffffff;
    overflow: hidden;
}

.hero-posts-large .hero-post-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hero-posts-large .hero-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #ffffff;
    transition: transform 0.3s ease;
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
}

.hero-posts-large .hero-post:hover .hero-post-thumbnail img {
    transform: scale(1.02);
}

/* Contenido post grande */
.hero-posts-large .hero-post-content {
    padding: 10px 12px 12px 12px;
    background: #ffffff;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Título post grande - SIN CAMBIO DE COLOR AL HOVER */
.hero-posts-large .hero-post-title {
    margin: 0 0 6px 0;
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-posts-large .hero-post-title a {
    text-decoration: none;
    color: #2c3e50;
    transition: none;
}

.hero-posts-large .hero-post-title a:hover {
    color: #2c3e50;
    text-decoration: none;
}

/* Extracto post grande */
.hero-posts-large .hero-post-excerpt {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    line-height: 1.2;
    color: #7f8c8d;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Meta (fecha) post grande */
.hero-posts-large .hero-post-meta {
    margin-top: auto;
    font-size: 0.7rem;
    color: #95a5a6;
    border-top: 1px solid #ecf0f1;
    padding-top: 8px;
    display: flex;
    align-items: center;
}

/* ========== POSTS PEQUEÑOS (DERECHA - GRID 2x2) ========== */
.hero-posts-small-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    height: 100%;
}

.hero-posts-small-grid .hero-post {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}

.hero-posts-small-grid .hero-post:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: none;
}

/* Thumbnail posts pequeños - formato 1:1 cuadrado */
.hero-posts-small-grid .hero-post-thumbnail {
    width: 100%;
    padding-bottom: 100%; /* Cuadrado perfecto 1:1 */
    position: relative;
    background: #ffffff;
    overflow: hidden;
}

.hero-posts-small-grid .hero-post-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hero-posts-small-grid .hero-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #ffffff;
    transition: transform 0.3s ease;
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
}

.hero-posts-small-grid .hero-post:hover .hero-post-thumbnail img {
    transform: scale(1.03);
}

/* Contenido posts pequeños */
.hero-posts-small-grid .hero-post-content {
    padding: 8px 8px 8px 8px;
    background: #ffffff;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Título posts pequeños - SIN CAMBIO DE COLOR AL HOVER */
.hero-posts-small-grid .hero-post-title {
    margin: 0 0 4px 0;
    font-size: 0.8rem;
    line-height: 1.2;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.9em;
}

.hero-posts-small-grid .hero-post-title a {
    text-decoration: none;
    color: #2c3e50;
    transition: none;
}

.hero-posts-small-grid .hero-post-title a:hover {
    color: #2c3e50;
    text-decoration: none;
}

/* Extracto posts pequeños */
.hero-posts-small-grid .hero-post-excerpt {
    margin: 0 0 6px 0;
    font-size: 0.65rem;
    line-height: 1.2;
    color: #7f8c8d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.2em;
}

/* Meta (fecha) posts pequeños */
.hero-posts-small-grid .hero-post-meta {
    margin-top: auto;
    font-size: 0.55rem;
    color: #95a5a6;
    border-top: 1px solid #ecf0f1;
    padding-top: 5px;
    display: flex;
    align-items: center;
}

/* ========== ESTILOS COMUNES ========== */
.hero-post-meta time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.hero-post-meta time::before {
    content: "📅";
    font-size: 0.65rem;
}

/* Placeholder para cuando no hay imagen */
.hero-post-no-image {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.no-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.5;
}

.no-image-placeholder::after {
    content: "📰";
}

/* Placeholder para posts faltantes */
.hero-post-placeholder {
    background: transparent;
}

/* ========== MEJORAS DE NITIDEZ ========== */
.hero-post-thumbnail img {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Forzar renderizado con calidad optimizada */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-post-thumbnail img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ========== RESPONSIVE ========== */

/* Tablets (768px - 992px) */
@media (max-width: 992px) {
    .hero-posts-container {
        gap: 10px;
    }
    
    .hero-posts-large .hero-post-title {
        font-size: 1.1rem;
    }
    
    .hero-posts-large .hero-post-excerpt {
        font-size: 0.8rem;
    }
    
    .hero-posts-small-grid {
        gap: 10px;
    }
    
    .hero-posts-small-grid .hero-post-title {
        font-size: 0.75rem;
    }
}

/* Móviles - Los 4 posts pequeños se muestran en UNA SOLA COLUMNA VERTICAL */
@media (max-width: 768px) {
    .hero-posts-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hero-posts-large .hero-post-title {
        font-size: 1.2rem;
    }
    
    /* Los 4 posts pequeños ahora en una sola columna vertical */
    .hero-posts-small-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .hero-posts-small-grid .hero-post {
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    
    /* Mantener formato cuadrado 1:1 en móvil */
    .hero-posts-small-grid .hero-post-thumbnail {
        width: 100%;
        padding-bottom: 100%;
    }
    
    .hero-posts-small-grid .hero-post-content {
        padding: 10px 12px 12px 12px;
    }
    
    .hero-posts-small-grid .hero-post-title {
        font-size: 0.9rem;
        margin: 0 0 6px 0;
    }
    
    .hero-posts-small-grid .hero-post-excerpt {
        font-size: 0.75rem;
        margin: 0 0 8px 0;
    }
    
    .hero-posts-small-grid .hero-post-meta {
        font-size: 0.65rem;
        padding-top: 8px;
    }
}

/* Móviles pequeños (480px) */
@media (max-width: 480px) {
    .hero-posts-wrapper {
        margin: 10px auto;
    }
    
    .hero-posts-container {
        gap: 12px;
    }
    
    .hero-posts-large .hero-post-content {
        padding: 8px 10px 10px 10px;
    }
    
    .hero-posts-large .hero-post-title {
        font-size: 1rem;
    }
    
    .hero-posts-large .hero-post-excerpt {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    .hero-posts-large .hero-post-meta {
        font-size: 0.65rem;
    }
    
    .hero-posts-small-grid {
        gap: 10px;
    }
    
    .hero-posts-small-grid .hero-post-content {
        padding: 8px 10px 10px 10px;
    }
    
    .hero-posts-small-grid .hero-post-title {
        font-size: 0.85rem;
    }
    
    .hero-posts-small-grid .hero-post-excerpt {
        font-size: 0.7rem;
        -webkit-line-clamp: 2;
    }
    
    .hero-posts-small-grid .hero-post-meta {
        font-size: 0.6rem;
        padding-top: 6px;
    }
    
    .hero-post-meta time::before {
        font-size: 0.6rem;
    }
}

/* ========== MODO OSCURO ========== */
@media (prefers-color-scheme: dark) {
    .hero-posts-large .hero-post,
    .hero-posts-small-grid .hero-post {
        background: #1a1a1a;
    }
    
    .hero-posts-large .hero-post-content,
    .hero-posts-small-grid .hero-post-content {
        background: #1a1a1a;
    }
    
    .hero-posts-large .hero-post-title a,
    .hero-posts-small-grid .hero-post-title a {
        color: #ecf0f1;
    }
    
    .hero-posts-large .hero-post-title a:hover,
    .hero-posts-small-grid .hero-post-title a:hover {
        color: #ecf0f1;
    }
    
    .hero-posts-large .hero-post-excerpt,
    .hero-posts-small-grid .hero-post-excerpt {
        color: #bdc3c7;
    }
    
    .hero-posts-large .hero-post-meta,
    .hero-posts-small-grid .hero-post-meta {
        color: #7f8c8d;
        border-top-color: #2c3e50;
    }
    
    .hero-post-no-image {
        background: linear-gradient(135deg, #2c2c2c 0%, #252525 100%);
    }
}

/* ========== ANIMACIONES ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-post {
    animation: fadeIn 0.3s ease-out forwards;
}

.hero-post:nth-child(1) { animation-delay: 0.05s; }
.hero-post:nth-child(2) { animation-delay: 0.1s; }
.hero-post:nth-child(3) { animation-delay: 0.15s; }
.hero-post:nth-child(4) { animation-delay: 0.2s; }
.hero-post:nth-child(5) { animation-delay: 0.25s; }