/* Estilos específicos para a página de notícias */

/* Header da página */
.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 0;
    background: linear-gradient(135deg, #C20C21, #a00a1a);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(194, 12, 33, 0.3);
}

.page-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Main container */
.noticias-main {
    min-height: calc(100vh - 200px);
    padding: 50px 0;
    background-color: #f8f9fa;
}

/* Grid de notícias - copiado da home */
.noticias-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* Cards de notícias - copiado da home e adaptado */
.noticia-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: left;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 520px; /* Altura aumentada de 480px para 520px */
}

.noticia-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Imagem das notícias - ALTURA AUMENTADA */
.noticia-imagem {
    width: 100%;
    height: 240px; /* Altura aumentada de 200px para 240px */
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.noticia-imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.noticia-card:hover .noticia-imagem img {
    transform: scale(1.05);
}

/* Placeholder para imagens - igual à home */
.noticia-placeholder {
    background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Conteúdo das notícias - altura ajustada */
.noticia-conteudo {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 280px; /* Mantida a mesma altura */
}

/* Título das notícias - igual à home */
.noticia-titulo {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1em;
    color: #C20C21;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.3;
    height: 2.6em; /* Altura fixa para 2 linhas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Data das notícias - igual à home */
.noticia-data {
    background-color: #C20C21;
    color: white;
    padding: 6px 12px;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

/* Descrição das notícias - igual à home */
.noticia-descricao {
    font-size: 0.85em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    flex-grow: 1;
    height: 6.4em; /* Altura fixa para 4 linhas */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status das notícias - igual à home */
.noticia-status {
    background: linear-gradient(135deg, #666, #777);
    color: white;
    padding: 5px 10px;
    font-size: 0.7em;
    font-weight: 500;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading */
.loading-container {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #C20C21;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    color: #666;
    font-size: 1.1em;
}

/* Error message */
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.error-message i {
    font-size: 3em;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-message p {
    font-size: 1.1em;
}

/* Overlay para card expandido - copiado da home */
.noticia-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.noticia-overlay.ativo {
    opacity: 1;
}

/* CORREÇÃO RADICAL: Card expandido com tamanho flexível */
.noticia-card-expandido {
    background: white;
    border-radius: 15px;
    max-width: 95vw; /* Usa quase toda a largura da tela */
    max-height: 95vh;
    width: auto; /* Largura automática baseada no conteúdo */
    min-width: 300px; /* Largura mínima */
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(50px);
    transition: transform 0.3s ease;
    position: relative;
}

.noticia-card-expandido.ativo {
    transform: translateY(0);
}

/* Header do card expandido */
.noticia-header-expandido {
    padding: 30px;
    background: linear-gradient(135deg, #C20C21, #8B0A1A);
    color: white;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.btn-fechar-noticia {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
}

.btn-fechar-noticia:hover {
    background: rgba(255, 255, 255, 0.3);
}

.noticia-data-expandido {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

.noticia-titulo-expandido {
    font-family: 'Oswald', sans-serif;
    font-size: 2em;
    margin: 0;
    line-height: 1.2;
}

/* CORREÇÃO RADICAL: Container da imagem sem limites rígidos */
.noticia-imagem-expandido {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    max-height: none; /* Remove totalmente o limite de altura */
    min-height: 80vh; /* Altura mínima apenas */
}

.noticia-imagem-expandido img {
    width: auto;
    height: auto;
    max-width: 90vw; /* Pode usar até 90% da largura da tela */
    max-height: 80vh; /* Pode usar até 80% da altura da tela */
    object-fit: contain; /* GARANTE que a imagem inteira aparece */
    object-position: center;
    display: block;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Estilos específicos - AGORA MAIS PERMISSIVOS */
.noticia-imagem-expandido.imagem-horizontal img {
    max-width: 85vw;
    max-height: 75vh;
}

.noticia-imagem-expandido.imagem-vertical img {
    max-width: 80vw;
    max-height: 85vh;
}

.noticia-imagem-expandido.imagem-muito-vertical img {
    max-width: 75vw;
    max-height: 90vh;
}

.noticia-imagem-expandido.imagem-quadrada img {
    max-width: 70vw;
    max-height: 80vh;
}

/* Conteúdo do card expandido */
.noticia-conteudo-expandido {
    padding: 40px 50px;
    min-height: 150px;
}

.noticia-categoria-expandido {
    background: #C20C21;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.noticia-descricao-expandido {
    line-height: 1.8;
    font-size: 1.2em;
    color: #333;
    margin-bottom: 40px;
    text-align: justify;
}

.noticia-detalhes-extras {
    border-top: 2px solid #f0f0f0;
    padding-top: 25px;
    margin-top: 25px;
}

.noticia-detalhes-extras h4 {
    color: #C20C21;
    font-family: 'Oswald', sans-serif;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.noticia-contato {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.noticia-contato p {
    margin: 8px 0;
    color: #555;
}

.noticia-contato strong {
    color: #C20C21;
}

/* Estilos para paginação */
.controle-paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #666;
}

.items-per-page label {
    font-weight: 500;
}

.select-noticias-por-pagina {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    color: #333;
    font-size: 0.9em;
    cursor: pointer;
}

.paginacao-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.btn-paginacao {
    padding: 10px 15px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9em;
    font-family: inherit;
    min-width: 44px;
}

.btn-paginacao:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #C20C21;
    color: #C20C21;
    transform: translateY(-1px);
}

.btn-paginacao.ativo {
    background: #C20C21;
    color: white;
    border-color: #C20C21;
    font-weight: 600;
}

.btn-paginacao:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.dots-paginacao {
    padding: 10px 5px;
    color: #999;
    font-weight: bold;
}

/* Responsividade */
@media (max-width: 768px) {
    .noticias-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }

    .noticia-card {
        height: 460px; /* Altura ajustada para mobile (era 420px) */
        margin-bottom: 20px;
    }

    .noticia-imagem {
        height: 200px; /* Altura aumentada no mobile (era 180px) */
    }

    .noticia-conteudo {
        padding: 16px;
        height: 240px; /* Altura ajustada para mobile */
    }

    .noticia-titulo {
        font-size: 1.0em;
        height: 2.4em;
    }

    .noticia-data {
        font-size: 0.7em;
        padding: 4px 8px;
    }

    .noticia-descricao {
        font-size: 0.8em;
        height: 4.8em;
        -webkit-line-clamp: 3;
    }

    .page-header {
        padding: 30px 15px;
        margin-bottom: 30px;
    }

    .page-header h1 {
        font-size: 2.2em;
    }

    /* CORREÇÃO: Modal responsivo - IMAGEM SEM CORTES */
    .noticia-overlay {
        padding: 10px;
    }

    .noticia-card-expandido {
        max-width: 98vw; /* Quase toda a largura no mobile */
        max-height: 98vh;
        border-radius: 10px;
    }

    .noticia-header-expandido {
        padding: 20px;
        border-radius: 10px 10px 0 0;
    }

    .noticia-titulo-expandido {
        font-size: 1.5em;
    }

    .noticia-conteudo-expandido {
        padding: 20px;
    }

    /* IMAGEM NO MOBILE - SEM LIMITES RÍGIDOS */
    .noticia-imagem-expandido {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .noticia-imagem-expandido img {
        max-width: 95vw; /* Pode usar quase toda a largura */
        max-height: 85vh; /* Pode usar quase toda a altura */
    }
    
    .noticia-imagem-expandido.imagem-horizontal img {
        max-width: 90vw;
        max-height: 80vh;
    }
    
    .noticia-imagem-expandido.imagem-vertical img {
        max-width: 85vw;
        max-height: 90vh;
    }
    
    .noticia-imagem-expandido.imagem-muito-vertical img {
        max-width: 80vw;
        max-height: 95vh;
    }
    
    .noticia-imagem-expandido.imagem-quadrada img {
        max-width: 80vw;
        max-height: 80vh;
    }

    .btn-fechar-noticia {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    /* Responsividade da paginação */
    .controle-paginacao {
        margin: 20px 0 15px 0;
        padding: 15px;
    }

    .paginacao-container {
        gap: 5px;
        margin: 20px 0;
    }

    .btn-paginacao {
        padding: 8px 12px;
        font-size: 0.8em;
        min-width: 40px;
    }

    .items-per-page {
        font-size: 0.8em;
    }
}

/* CORREÇÃO ADICIONAL: Para telas muito pequenas */
@media (max-width: 480px) {
    .noticia-imagem-expandido {
        padding: 10px;
    }
    
    .noticia-imagem-expandido img {
        max-width: 98vw;
        max-height: 90vh;
    }
    
    .noticia-imagem-expandido.imagem-vertical img,
    .noticia-imagem-expandido.imagem-muito-vertical img {
        max-width: 90vw;
        max-height: 95vh;
    }

    .noticia-conteudo-expandido {
        padding: 15px;
    }
    
    .noticia-descricao-expandido {
        font-size: 1.1em;
        line-height: 1.6;
    }
}

/* Sistema de Paginação */
.pagination-controls {
    margin-top: 50px;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.pagination-info {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #666;
}

.items-per-page select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    color: #333;
    font-size: 0.9em;
}

.pagination-stats {
    font-size: 0.9em;
    color: #666;
}

.pagination-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 15px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #C20C21;
    color: #C20C21;
}

.pagination-btn.active {
    background: #C20C21;
    color: white;
    border-color: #C20C21;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.pagination-btn:disabled:hover {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-ellipsis {
    padding: 10px 5px;
    color: #999;
}

/* Responsividade da paginação */
@media (max-width: 768px) {
    .pagination-controls {
        margin-top: 30px;
        padding: 20px 10px;
    }

    .pagination-info {
        flex-direction: column;
        gap: 15px;
    }

    .pagination-navigation {
        gap: 5px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 0.8em;
    }

    .pagination-numbers {
        gap: 3px;
    }

    .items-per-page {
        font-size: 0.8em;
    }

    .pagination-stats {
        font-size: 0.8em;
    }
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.noticia-card {
    animation: fadeInUp 0.6s ease-out;
}

.noticia-card:nth-child(2) {
    animation-delay: 0.1s;
}

.noticia-card:nth-child(3) {
    animation-delay: 0.2s;
}

.noticia-card:nth-child(4) {
    animation-delay: 0.3s;
}