/* Estilos modernos para apresentação de posts */

/* Estilo base para cards de posts */
.post-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background-color: #ffffff;
    height: 100%;
    position: relative;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Container da imagem com proporção fixa */
.post-img-container {
    position: relative;
    overflow: hidden;
    padding-top: 65%; /* Proporção 16:10 */
    background-color: #f8f9fa;
}

.post-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.6s ease;
}

.post-card:hover .post-img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

/* Gradiente sobre a imagem para melhor legibilidade das categorias */
.post-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 40%);
    z-index: 1;
}

/* Estilo para o corpo do card */
.post-body {
    padding: 1.5rem;
    position: relative;
}

/* Título do post */
.post-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: #212529;
    transition: color 0.3s ease;
    font-size: 1.25rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-card:hover .post-title {
    color: #0d6efd;
}

/* Resumo do post */
.post-excerpt {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Metadados do post */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: auto;
}

.post-date, .post-category, .post-author, .post-comments {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Badge para categorias */
.post-category-badge-list{
    position: absolute;
    top: 1rem;
    left: 1rem;
}
.post-category-badge,
.post-category-badge-list {
    z-index: 2;
    background-color: rgba(0, 156, 45, 0.85);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.post-card:hover .post-category-badge {
    background-color: rgba(13, 110, 253, 1);
}

/* Indicador de tempo de leitura */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Estilo para posts sem imagem destacada */
.no-thumbnail .post-img-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.no-thumbnail .post-img-container::after {
    content: '\f15c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.2);
}

/* Efeito de carregamento lazy para imagens */
.lazy-load {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy-loaded {
    opacity: 1;
}

/* Animações para os cards */
.post-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.post-card-visible {
    opacity: 1;
    transform: translateY(0);
}

.post-card-hover {
    z-index: 2;
}

/* Estilo para termos destacados na busca */
.search-highlight {
    background-color: rgba(255, 230, 0, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* Responsividade */
@media (max-width: 991.98px) {
    .post-img-container {
        padding-top: 60%;
    }
}

@media (max-width: 767.98px) {
    .post-body {
        padding: 1.25rem;
    }
    
    .post-title {
        font-size: 1.15rem;
    }
}

@media (max-width: 575.98px) {
    .post-img-container {
        padding-top: 56.25%; /* Proporção 16:9 para telas menores */
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* "Saiba mais" link style */
.post-saiba-mais {
    margin-top: 0.75rem;
}

.saiba-mais-link {
    color: #0d6efd;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.post-card:hover .saiba-mais-link {
    color: #0a58ca;
    padding-left: 5px;
}

.saiba-mais-link i {
    transition: transform 0.3s ease;
}

.post-card:hover .saiba-mais-link i {
    transform: translateX(3px);
}

/* Single post featured image - display full image without cropping */
/* Target only direct child post-img-container (main featured image), not nested ones (related posts) */
article > .post-img-container {
    padding-top: 0 !important;
}

article > .post-img-container .post-img {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

article > .post-img-container .post-img-overlay {
    display: none;
}