/**
 * CARD DE NOTÍCIA - COMPONENTE REUTILIZÁVEL
 * CSS Global para cards de notícias em todo o site
 * Design moderno, responsivo e acessível
 */

/* Link wrapper (remove estilos de link) */
.noticia-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Card principal */
.noticia-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.noticia-card:hover {
    transform: translateY(-10px);
    border-color: var(--radio-primary, #FF8C00);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Wrapper da imagem */
.noticia-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f8f9fa;
}

/* Imagem */
.noticia-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.noticia-card:hover .noticia-card-image {
    transform: scale(1.05);
}

/* Placeholder quando não há imagem */
.noticia-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--radio-primary, #FF8C00) 0%, var(--radio-secondary, #FFA500) 100%);
}

.noticia-card-placeholder i {
    font-size: 4rem;
    color: white;
    opacity: 0.5;
}

/* Badge de categoria */
.noticia-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2;
    /* Cor padrão: usa cor primária do sistema como fallback */
    background: var(--radio-primary, #FF8C00);
}

/* Se a categoria tiver cor específica, ela será aplicada via style inline */

/* Conteúdo do card */
.noticia-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Título */
.noticia-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.noticia-card:hover .noticia-card-title {
    color: var(--radio-primary, #FF8C00);
}

/* Resumo/Excerpt */
.noticia-card-excerpt {
    color: #6c757d;
    margin-bottom: 1rem;
    flex: 1;
    font-size: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta informações */
.noticia-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.noticia-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
}

.noticia-card-meta-item i {
    font-size: 1rem;
}

/* Indicador de "Ler mais" */
.noticia-card-read-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    color: var(--radio-primary, #FF8C00);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.noticia-card:hover .noticia-card-read-more {
    background: var(--radio-primary, #FF8C00);
    color: white;
}

.noticia-card-read-more i {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.noticia-card:hover .noticia-card-read-more i {
    transform: translateX(5px);
}

/* Variante compacta */
.noticia-card-compact .noticia-card-image-wrapper {
    height: 180px;
}

.noticia-card-compact .noticia-card-title {
    font-size: 1.25rem;
}

.noticia-card-compact .noticia-card-content {
    padding: 1rem;
}

/* Variante horizontal */
.noticia-card-horizontal {
    flex-direction: row;
}

.noticia-card-horizontal .noticia-card-image-wrapper {
    width: 40%;
    height: auto;
    min-height: 250px;
}

.noticia-card-horizontal .noticia-card-content {
    width: 60%;
}

/* Variante destaque (maior) */
.noticia-card-featured .noticia-card-image-wrapper {
    height: 350px;
}

.noticia-card-featured .noticia-card-title {
    font-size: 2rem;
}

.noticia-card-featured .noticia-card-excerpt {
    font-size: 1.125rem;
    -webkit-line-clamp: 4;
}

/* Grid de cards - 3 por linha */
.noticias-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Responsivo */
@media (max-width: 1200px) {
    .noticias-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .noticias-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .noticia-card-image-wrapper {
        height: 200px;
    }
    
    .noticia-card-title {
        font-size: 1.25rem;
    }
    
    .noticia-card-excerpt {
        font-size: 0.9375rem;
    }
    
    .noticia-card-horizontal {
        flex-direction: column;
    }
    
    .noticia-card-horizontal .noticia-card-image-wrapper {
        width: 100%;
        height: 200px;
    }
    
    .noticia-card-horizontal .noticia-card-content {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .noticia-card-content {
        padding: 1.25rem;
    }
    
    .noticia-card-image-wrapper {
        height: 180px;
    }
    
    .noticia-card-category {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Estados de loading */
.noticia-card-skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Acessibilidade */
.noticia-card:focus-within {
    outline: 3px solid var(--radio-primary, #FF8C00);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .noticia-card,
    .noticia-card-image,
    .noticia-card-read-more i {
        transition: none;
    }
    
    .noticia-card:hover {
        transform: none;
    }
    
    .noticia-card:hover .noticia-card-image {
        transform: none;
    }
}

/* ========================================
   PAGINAÇÃO DE NOTÍCIAS
   ======================================== */

.noticias-pagination {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

.noticias-pagination .pagination {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.noticias-pagination .page-item {
    margin: 0;
}

.noticias-pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.noticias-pagination .page-link:hover {
    background: var(--radio-primary, #FF8C00);
    border-color: var(--radio-primary, #FF8C00);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.noticias-pagination .page-item.active .page-link {
    background: var(--radio-primary, #FF8C00);
    border-color: var(--radio-primary, #FF8C00);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.noticias-pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ========================================
   HEADER E FILTROS DE NOTÍCIAS
   ======================================== */

.noticias-header {
    background: linear-gradient(135deg, var(--radio-primary, #FF8C00) 0%, var(--radio-secondary, #FF6B00) 100%);
    padding: 60px 0;
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.noticias-header h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.noticias-header p {
    font-size: 1.25rem;
    opacity: 0.9;
}

.filtros-noticias {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.btn-categoria {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-categoria:hover {
    background: var(--radio-primary, #FF8C00);
    border-color: var(--radio-primary, #FF8C00);
    color: white;
    transform: translateY(-2px);
}

.btn-categoria.active {
    background: var(--radio-primary, #FF8C00);
    border-color: var(--radio-primary, #FF8C00);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.filtros-noticias .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 0.95rem;
}

.filtros-noticias .form-control:focus {
    border-color: var(--radio-primary, #FF8C00);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.filtros-noticias .btn-primary {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
}

/* Mensagem de sem notícias */
.sem-noticias {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.sem-noticias i {
    font-size: 5rem;
    opacity: 0.3;
}

.sem-noticias h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
}

.sem-noticias p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Responsivo para paginação */
@media (max-width: 576px) {
    .noticias-pagination .page-link {
        min-width: 40px;
        height: 40px;
        padding: 0 10px;
        font-size: 0.9rem;
    }
    
    .noticias-pagination .pagination {
        gap: 5px;
    }
}

/* Responsivo para header e filtros */
@media (max-width: 768px) {
    .noticias-header h1 {
        font-size: 2rem;
    }
    
    .noticias-header p {
        font-size: 1rem;
    }
    
    .filtros-noticias {
        padding: 1.5rem;
    }
    
    .btn-categoria {
        font-size: 0.85rem;
        padding: 8px 15px;
    }
}
