/* Estilos para o grid principal da página inicial com alinhamento consistente */
.featured-posts-container {
    display: flex;
    gap: 10px; /* Reduzido de 20px para aproximar mais os cards */
    margin-bottom: 20px; /* Reduzido de 30px */
}

.featured-post-main {
    flex: 0 0 50%;
    max-width: 50%;
}

.featured-posts-secondary {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reduzido de 20px para aproximar mais os cards secundários */
}

/* Estilo para o primeiro card secundário (topo direito) */
.featured-post-top {
    height: calc(50% - 5px); /* Reduzido de 10px */
    margin-bottom: 10px; /* Reduzido de 20px */
}

/* Estilo para o card único na parte inferior direita */
.featured-post-bottom {
    height: calc(50% - 5px); /* Reduzido de 10px */
}

.featured-post {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.featured-post:hover {
    transform: translateY(-5px);
}

.featured-post-image {
    position: relative;
    overflow: hidden;
}

.featured-post-main .featured-post-image {
    height: 400px; /* Imagem maior para o card principal */
}

.featured-post-top .featured-post-image,
.featured-post-bottom .featured-post-image {
    height: 180px;
}

.featured-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-post:hover .featured-post-image img {
    transform: scale(1.05);
}

.featured-post-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

.featured-post-category a {
    color: #fff;
}

/* Alinhamento consistente para o conteúdo de todos os cards */
.featured-post-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Garantir que os títulos estejam alinhados entre os cards */
.featured-post-title {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

.featured-post-title a {
    color: #404040;
}

.featured-post-main .featured-post-title {
    font-size: 24px;
}

.featured-post-top .featured-post-title,
.featured-post-bottom .featured-post-title {
    font-size: 18px;
}

.featured-post-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.featured-post-meta {
    font-size: 12px;
    color: #888;
    margin-top: 0;
}

/* Responsividade para o grid - MELHORADA */
@media (max-width: 992px) {
    .featured-posts-container {
        flex-direction: column;
        gap: 8px; /* Reduzido ainda mais para aproximar os cards */
    }
    
    .featured-post-main,
    .featured-posts-secondary {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .featured-post-main .featured-post-image {
        height: 56.25vw; /* Proporção 16:9 baseada na largura da viewport */
        max-height: 350px;
    }
    
    .featured-post-top {
        margin-top: 0; /* Eliminado para aproximar do card principal */
        margin-bottom: 8px; /* Reduzido para aproximar do card inferior */
        height: auto;
    }
    
    .featured-post-bottom {
        height: auto;
    }
    
    /* Garantir alinhamento consistente dos títulos no modo responsivo */
    .featured-post-content {
        padding: 15px; /* Manter padding consistente */
    }
    
    .featured-post-title {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Ajustar proporção das imagens secundárias */
    .featured-post-top .featured-post-image,
    .featured-post-bottom .featured-post-image {
        height: 40vw; /* Proporção baseada na largura da viewport */
        max-height: 250px;
    }
}

@media (max-width: 768px) {
    .featured-posts-container {
        gap: 6px; /* Ainda mais próximos em telas menores */
    }
    
    .featured-post-main .featured-post-image {
        height: 52vw; /* Ajustado para melhor proporção em telas médias */
    }
    
    .featured-post-top {
        margin-bottom: 6px; /* Ainda mais próximo do card inferior */
    }
    
    /* Ajustar proporção das imagens secundárias */
    .featured-post-top .featured-post-image,
    .featured-post-bottom .featured-post-image {
        height: 35vw; /* Proporção ajustada para telas médias */
    }
    
    /* Garantir que os títulos mantenham o alinhamento */
    .featured-post-main .featured-post-title,
    .featured-post-top .featured-post-title,
    .featured-post-bottom .featured-post-title {
        padding: 0;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 576px) {
    .featured-posts-container {
        gap: 4px; /* Mínimo espaçamento em telas pequenas */
    }
    
    .featured-post-main .featured-post-image {
        height: 48vw; /* Ajustado para melhor proporção em telas pequenas */
    }
    
    .featured-post-top {
        margin-bottom: 4px; /* Mínimo espaçamento do card inferior */
    }
    
    /* Ajustar proporção das imagens secundárias */
    .featured-post-top .featured-post-image,
    .featured-post-bottom .featured-post-image {
        height: 30vw; /* Proporção ajustada para telas pequenas */
    }
    
    /* Reduzir tamanho da fonte em telas muito pequenas */
    .featured-post-main .featured-post-title {
        font-size: 20px;
    }
    
    .featured-post-top .featured-post-title,
    .featured-post-bottom .featured-post-title {
        font-size: 16px;
    }
}



/* BEGIN Manus Customizations for 2px responsive spacing on home-featured-grid (Attempt 2) */

@media (max-width: 992px) {
    body.home .home-featured-grid-section .home-featured-grid {
        display: flex;
        flex-direction: column;
        gap: 2px; /* User requested 2px spacing */
        padding: 0; /* Reset padding if it interferes with gap */
    }

    body.home .home-featured-grid-section .home-featured-grid > .featured-grid-item,
    body.home .home-featured-grid-section .home-featured-grid > .featured-grid-column-small {
        margin: 0; /* Rely on gap for spacing */
        width: 100%; /* Ensure items take full width when stacked */
        max-width: 100%; /* Override any max-width that might prevent full width */
    }

    body.home .home-featured-grid-section .featured-grid-column-small {
        display: flex;
        flex-direction: column;
        gap: 2px; /* User requested 2px spacing for items within this column */
        width: 100%;
    }

    body.home .home-featured-grid-section .featured-grid-column-small > .featured-grid-item {
        margin: 0; /* Rely on gap for spacing */
        width: 100%;
        max-width: 100%;
    }
}

/* For even smaller screens, ensure the 2px gap is maintained if other rules try to override it. 
   Usually, styles from a wider breakpoint cascade down unless overridden by a more specific rule 
   or a rule in a narrower breakpoint. This explicit re-statement is for robustness. */

@media (max-width: 768px) {
    body.home .home-featured-grid-section .home-featured-grid {
        gap: 2px;
    }
    body.home .home-featured-grid-section .featured-grid-column-small {
        gap: 2px;
    }
}

@media (max-width: 576px) {
    body.home .home-featured-grid-section .home-featured-grid {
        gap: 2px;
    }
    body.home .home-featured-grid-section .featured-grid-column-small {
        gap: 2px;
    }
}

/* END Manus Customizations */

