/**
 * Estilos para Posts Relacionados
 * Baseado no design das imagens de referência
 */

.pixwell-related-posts {
    margin: 20px 0 30px 0;
    padding: 10px 0 0 0;
    background: #fff;
    position: relative;
    z-index: 1;
    clear: both;
}

.related-posts-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0 0 20px 0;
    padding: 0;
    line-height: 1.4;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.related-posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
}

.related-post-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
    min-height: 120px;
    position: relative;
    z-index: 2;
}

.related-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-post-thumbnail {
    flex-shrink: 0;
    width: 300px;
    height: 300px;
    overflow: hidden;
    position: relative;
    z-index: 3;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.related-post-item:hover .related-post-thumbnail img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 15px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-post-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    color: #333;
}

.related-post-title a {
    color: inherit !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-title a:hover {
    color: #0066cc;
}

.related-post-meta {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.related-post-date {
    font-weight: normal;
}

/* Responsividade */
@media (max-width: 768px) {
    .related-posts-list {
        flex-direction: column;
        gap: 10px;
    }
    
    .related-post-item {
        min-width: 100%;
        max-width: 100%;
    }
    
    .related-post-thumbnail {
        width: 120px;
        height: 120px;
        margin-right: 12px;
        border-radius: 4px;
        overflow: hidden;
        flex-shrink: 0;
    }
    
    .related-post-title {
        font-size: 13px;
    }
    
    .related-post-content {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .pixwell-related-posts {
        margin: 15px 0;
        padding: 15px 0;
    }
    
    .related-posts-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .related-post-thumbnail {
        width: 100px;
        height: 100px;
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .related-post-title {
        font-size: 12px;
    }
    
    .related-post-meta {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .related-post-thumbnail {
        width: 80px;
        height: 80px;
        margin-right: 8px;
    }
    
    .related-post-title {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .related-post-content {
        padding: 6px 8px;
    }
}

/* Desktop - baseado na imagem Desktop.png */
@media (min-width: 769px) {
    .related-posts-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .related-post-item {
        flex-direction: column;
        min-height: 280px;
    }
    
    .related-post-thumbnail {
        width: 100%;
        height: 160px;
    }
    
    .related-post-content {
        padding: 15px;
        height: 120px;
        justify-content: flex-start;
    }
    
    .related-post-title {
        font-size: 15px;
        line-height: 1.3;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Estilo alternativo - Lista simples (mantido para compatibilidade) */
.pixwell-related-posts.simple-style .related-posts-list {
    display: block;
}

.pixwell-related-posts.simple-style .related-post-item {
    display: block;
    border: none;
    background: transparent;
    margin-bottom: 8px;
    padding: 0;
    min-width: auto;
}

.pixwell-related-posts.simple-style .related-post-item:hover {
    box-shadow: none;
}

.pixwell-related-posts.simple-style .related-post-thumbnail {
    display: none;
}

.pixwell-related-posts.simple-style .related-post-content {
    padding: 0;
}

.pixwell-related-posts.simple-style .related-post-title {
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

.pixwell-related-posts.simple-style .related-post-title a {
    color: #0066cc;
    text-decoration: underline;
}

.pixwell-related-posts.simple-style .related-post-title a:hover {
    text-decoration: none;
}

.pixwell-related-posts.simple-style .related-post-meta {
    display: none;
}



/* Prevenção de sobreposição com elementos acima */
.pixwell-related-posts::before {
    content: "";
    display: block;
    height: 0px;
    width: 100%;
    clear: both;
}

/* Garantir que elementos acima não sejam sobrepostos */
.post-meta,
.post-author,
.post-share,
.social-share {
    position: relative;
    z-index: 10;
    margin-bottom: 20px;
}

/* Ajuste específico para mobile para evitar sobreposição */
@media (max-width: 768px) {
    .pixwell-related-posts {
        margin-top: 20px;
        padding-top: 10px;
    }
    
    .related-post-item {
        align-items: flex-start;
    }
}

