/**
 * Blog Article Styles - Otimizado para imagens 400x250
 */

/* Container da imagem principal */
.article-image {
    margin-bottom: 3rem;
    text-align: center; /* Centraliza a imagem */
}

/* Imagem principal do artigo */
.article-image img {
    width: 100%;
    max-width: 400px; /* Largura máxima de 400px */
    height: auto; /* Altura automática para manter proporção */
    aspect-ratio: 16/10; /* Mantém proporção 400x250 */
    object-fit: cover; /* Cobre o espaço sem distorcer */
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    margin: 0 auto; /* Centraliza horizontalmente */
    display: block;
}

/* Mobile - Ajustes para telas pequenas */
@media (max-width: 480px) {
    .article-image {
        margin-bottom: 2rem;
        padding: 0 1rem; /* Adiciona padding lateral */
    }
    
    .article-image img {
        max-width: 100%; /* Usa largura total disponível */
        height: auto;
        aspect-ratio: 16/10; /* Mantém proporção */
        object-fit: contain; /* Mostra imagem completa no mobile */
        border-radius: 8px;
    }
}

/* Tablet - Ajustes para telas médias */
@media (min-width: 481px) and (max-width: 768px) {
    .article-image img {
        max-width: 360px; /* Levemente menor em tablets */
    }
}

/* Animação suave ao carregar */
.article-image img {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback para imagens quebradas */
.article-image img[src*="placeholder"] {
    object-fit: contain;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

/* Container para múltiplas imagens no conteúdo */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem auto;
    display: block;
}

/* Legenda de imagem (se houver) */
.article-image figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.75rem;
    font-style: italic;
}

/**
 * Artigos Relacionados - Estilos globais
 */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.related-articles h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.related-card {
    background: white;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.related-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.related-card h4 {
    color: #1f2937;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.4;
}

.related-card p {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .related-articles {
        margin-top: 2rem;
    }
}

/**
 * Containers de Anúncios nos Artigos
 */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    min-height: 90px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
}

.ad-header {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.ad-in-content {
    margin: 3rem 0;
}

.ad-footer {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

/* Mobile adjustments for ads */
@media (max-width: 768px) {
    .ad-container {
        margin: 1.5rem -1rem;
        border-radius: 0;
    }
    
    .ad-header {
        margin-bottom: 2rem;
    }
}