/* =================================================================== */
/* CSS COMPLETO DO PROJETO
/* =================================================================== */


/* =================================================================== */
/* 1. ESTILOS PARA A PÁGINA DE LISTAGEM DE NOTÍCIAS
/* =================================================================== */

/* --- Estilos Gerais (Reaproveitados de outras páginas) --- */
.page-hero-section {
    height: 500px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.page-hero-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.page-title-section {
    padding: 30px 20px 0px 20px;
    text-align: center;
}

.page-title-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--heavy-text);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.page-title-section h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--primary-blue);
    margin: 20px auto 0;
}

.page-title-section .subtitle {
    font-size: 1.2rem;
    color: var(--primary-blue);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    margin-bottom: 50px;
}

/* --- Abas de Filtragem --- */
.filter-tabs-section {
    padding-bottom: 40px;
}

.filter-tabs-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.filter-tab {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 500;
    padding: 10px 25px;
    border-radius: 50px;
    background-color: #f0f0f0;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.filter-tab:hover {
    background-color: #e0e0e0;
    color: var(--heavy-text);
}

.filter-tab.active {
    background-color: var(--primary-blue);
    color: #fff;
    font-weight: 600;
    border-color: var(--primary-blue);
}


/* --- Grelha de Notícias --- */
.news-grid-section {
    padding: 0 20px 80px;
}

.news-grid-section .news-card {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.news-grid-section .news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.news-grid-section .news-card-image-container {
    position: relative;
    height: 250px;
    background-size: cover;
    background-position: center;
}

.news-grid-section .news-icon {
    position: absolute;
    bottom: -25px;
    left: 20px;
    background-color: var(--azul-mais-escuro);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
}

.news-icon img {
    /* Define um tamanho para a imagem, por exemplo, 60% do tamanho do círculo pai */
    width: 100%;
    height: 100%;
    /* Garante que a imagem não fica distorcida se as proporções não forem perfeitas */
    object-fit: contain;
}

.news-grid-section .news-card-content {
    padding: 40px 25px 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #f9f9f9;
}

.news-grid-section .news-card-date {
    color: #888;
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.news-grid-section .news-card-title {
    font-size: 1.10rem;
    font-weight: 400;
    color: #32a1d7;
    line-height: 1.3;
    margin-bottom: 15px;
    min-height: 55px;
}

.news-grid-section .news-card-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: #32a1d7;
    margin-top: 12px;
}

.news-grid-section .news-card-description {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.news-grid-section .news-card-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: auto;
}

.news-grid-section .news-card-link {
    color: #555;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s;
}

.news-grid-section .news-card-link:hover {
    color: #32a1d7;
}

.news-grid-section .news-card-link .arrow-circle {
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.news-grid-section .news-card-link:hover .arrow-circle {
    background-color: #32a1d7;
    border-color: #32a1d7;
    color: white;
}


/* --- Paginação --- */
.pagination-container {
    margin-top: 60px;
}

.pagination .page-item .page-link {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    border: 1px solid #ddd;
    color: var(--primary-blue);
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}

.pagination .page-item .page-link:hover {
    background-color: #e9ecef;
    border-color: #ddd;
}

.pagination .page-item.active .page-link:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.pagination .page-item.disabled .page-link {
    color: #ccc;
    background-color: transparent;
}



/* =================================================================== */
/* 2. ESTILOS PARA A PÁGINA DE DETALHE DA NOTÍCIA (NOVA ESTRUTURA)
/* =================================================================== */

/* --- Wrapper geral para dar espaço ao header --- */

/* --- Breadcrumbs --- */
.breadcrumbs-container {
    /* Propriedades para fixar a barra */
    position: -webkit-sticky;
    /* Para Safari */
    position: sticky;
    top: 155px;
    /* IMPORTANTE: Ajuste para a altura do seu header */
    z-index: 998;

    /* Estilos visuais que você já tinha */
    background-color: var(--primary-blue);
    color: #ffffff;
    padding: 15px 0;
    font-size: 0.85rem;
    font-weight: 500;

    /* Sombra subtil que aparece apenas quando a barra está "colada" */
    /* Adicionada aqui para evitar conflito com o fundo azul */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.breadcrumbs-container .container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 85px;
}

.breadcrumbs-container a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs-container a:hover {
    color: #000;
}

.breadcrumbs-container span {
    color: #ffffff;
}

.breadcrumbs-container span.active {
    font-weight: 600;
    color: #ffffff;
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- Container Principal da Notícia --- */
.noticia-detalhe-container {
    padding-top: 40px;
    padding-bottom: 60px;
}


/* --- A. Bloco do Cabeçalho (Título e Data) - LARGURA TOTAL --- */
.noticia-topo {
    width: 100%;
    margin-bottom: 40px;
    /* Espaço entre o título e a grelha de conteúdo */
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    /* Linha separadora subtil */
    margin-top: 150px;
}

.noticia-topo .data {
    font-size: 0.9rem;
    color: var(--azul-claro);
    margin-bottom: 8px;
    font-weight: 500;
}

.noticia-topo .titulo {
    font-size: 2.8rem;
    /* Título bem destacado */
    line-height: 1.2;
    margin: 0;
    color: var(--azul-mais-escuro);
}


/* --- B. Grelha de Conteúdo (Imagem + Texto) --- */
.noticia-conteudo {
    display: grid;
    grid-template-columns: 40% 1fr;
    /* 40% para imagem, 60% para texto */
    gap: 50px;
    /* Espaço entre as colunas */
    align-items: flex-start;
    /* Alinha os itens no topo */
}

.noticia-conteudo.layout-texto-completo {
    /* Altera a grelha para ter apenas UMA coluna que ocupa 100% do espaço */
    grid-template-columns: 1fr;
}

/* Coluna 1: Imagem Principal */
.noticia-imagem-principal img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Coluna 2: Texto Completo */
/* Coluna 2: Texto Completo */
.noticia-coluna-texto {
    text-align: justify;
}

.noticia-texto-completo {
    font-size: 1.1rem;
    /* Ajustado para melhor legibilidade em textos longos */
    line-height: 1.7;
    /* Aumentado para mais espaço entre linhas */
    color: var(--dark-text, #555);
}

/* --- ESTILOS GERAIS PARA ELEMENTOS DO CKEDITOR --- */

.noticia-texto-completo p {
    margin-bottom: 1.5em;
}

.noticia-texto-completo h1,
.noticia-texto-completo h2,
.noticia-texto-completo h3,
.noticia-texto-completo h4 {
    color: var(--heavy-text, #4a4a4a);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    text-align: left;
    /* Títulos geralmente ficam melhor alinhados à esquerda */
}

.noticia-texto-completo ul,
.noticia-texto-completo ol {
    padding-left: 25px;
    /* Usar padding em vez de margin para indentação correta */
    margin-bottom: 1.5em;
}

.noticia-texto-completo li {
    margin-bottom: 0.5rem;
}

.noticia-texto-completo strong {
    font-weight: 600;
}

.noticia-texto-completo a {
    color: var(--primary-blue);
    text-decoration: underline;
}

.noticia-texto-completo img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 4px;
    /* Opcional: bordas arredondadas para imagens no texto */
}

.noticia-texto-completo blockquote {
    border-left: 4px solid var(--primary-blue);
    padding: 10px 20px;
    margin: 25px 0;
    background-color: #f9f9f9;
    font-style: italic;
}

/* --- ESTILOS PARA TABELAS (O que faltava!) --- */
.noticia-texto-completo table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95rem;
    /* Ligeiramente menor para caber mais info */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    /* Garante que o box-shadow se aplica bem */
    border-radius: 4px;
    /* Cantos arredondados na tabela */
}

.noticia-texto-completo th,
.noticia-texto-completo td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
    /* Alinha o conteúdo verticalmente ao centro */
}

.noticia-texto-completo th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: var(--heavy-text, #333);
}

/* Linhas com cores alternadas para melhor leitura */
.noticia-texto-completo tbody tr:nth-of-type(even) {
    background-color: #fdfdfd;
}

/* Responsividade para tabelas em ecrãs pequenos */
@media screen and (max-width: 768px) {
    .noticia-texto-completo table {
        display: block;
        overflow-x: auto;
        /* Permite scroll horizontal na tabela */
        white-space: nowrap;
        /* Impede que o texto quebre dentro das células */
        border: 1px solid #ddd;
    }
}

@media screen and (max-width: 768px) {
    .noticia-texto-completo table {
        display: block;
        overflow-x: auto;
        /* Permite scroll horizontal na tabela */
        white-space: nowrap;
        /* Impede que o texto quebre dentro das células */
        border: 1px solid #ddd;
    }
}



/* --- C. Galeria de Imagens Secundárias --- */
.noticia-galeria {
    margin-top: 80px;
}

.noticia-galeria h3 {
    text-align: center;
    color: var(--azul-mais-escuro, #004b87);
    font-weight: 600;
    margin-bottom: 40px;
    /* Espaçamento igual ao primeiro */
    text-transform: uppercase;
    font-size: 2.2rem;
    /* Tamanho igual ao primeiro */
    position: relative;
    /* Necessário para posicionar a linha */
    padding-bottom: 15px;
}

.noticia-galeria h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    /* Centraliza a linha */
    width: 60px;
    /* Largura da linha curta */
    height: 4px;
    /* Grossura da linha */
    background-color: var(--azul-mais-escuro, #004b87);
    /* Mesma cor do título */
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.galeria-item {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    position: relative;
}

.galeria-item::after {
    content: '\f002';
    /* Código do ícone de pesquisa do Font Awesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.galeria-item:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.galeria-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.galeria-item:hover img {
    transform: scale(1.08);
    filter: brightness(0.6);
}


/* =================================================================== */
/* 3. ESTILOS DIVERSOS E RESPONSIVIDADE
/* =================================================================== */

/* --- Banner de Avisos (mantido do seu original) --- */
.bottom-banner .aviso-texto-wrapper2 {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
    min-width: 0;
    color: rgb(255, 255, 255) !important;
}

.bottom-banner .aviso-texto-wrapper2>i {
    font-size: 20px;
    color: rgb(0, 0, 0);
    width: 38px;
    height: 38px;
    border: 2px solid rgb(0, 0, 0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bottom-banner .aviso-texto-wrapper2 p {
    font-weight: 300 !important;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: larger;
    color: rgb(0, 0, 0);
}

.bottom-banner .btn-aviso2 {
    color: rgb(0, 0, 0);
    font-size: 1.0rem;
    flex-shrink: 0;
}

.bottom-banner .avisos-slider {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}


/* --- Media Queries (Responsividade) --- */

/* Para ecrãs grandes (Ajuste dos Breadcrumbs) */
@media (max-width: 1360px) {
    .breadcrumbs-container .container {
        margin-left: 25px !important;
    }
}

/* Para Tablets e ecrãs médios */
@media (max-width: 992px) {
    .galeria-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .page-title-section h1 {
        font-size: 1.5rem;
    }

    .page-hero-section img {
        width: 100%;
        height: 80%;
        object-fit: cover;
        object-position: center;
    }

    .page-hero-section {
        height: 350px !important;
        /* Reduz a caixa de 500px para 220px no mobile */
    }

    /* 2. Obriga a imagem a preencher sempre 100% da nova altura do pai, sem deixar espaço em branco */
    .page-hero-section img {
        height: 100% !important;
        /* Ocupa os 220px inteiros do pai */
        width: 100% !important;
        object-fit: cover !important;
        /* Garante que a imagem não fica distorcida */
        object-position: center !important;
    }
}

/* Para telemóveis e ecrãs pequenos */
@media (max-width: 768px) {
    .noticia-topo .titulo {
        font-size: 1.3rem;
        /* Título ligeiramente menor em mobile */
    }

    /* A grelha de conteúdo passa a ter uma única coluna */
    .noticia-conteudo {
        grid-template-columns: 1fr;
        gap: 30px;
        /* Espaço entre imagem e texto quando empilhados */
    }

    .noticia-topo {
        margin-top: 150px;
        /* Título ligeiramente menor em mobile */
    }

    .noticia-texto-completo {
        font-size: 0.9rem;
    }

}

/* O contentor principal que alinha os elementos */
.partilha-social-container-home-style {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Espaço entre o texto "Partilhar:" e os ícones */
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* O texto "Partilhar:" */
.partilha-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

/* O container dos ícones. Reutiliza a classe da home. */
.hero-social-fixed {
    /* (As regras de 'position', 'top', 'right' não são aplicadas aqui porque
       o container não tem a classe .hero-slider como parente. Isso é bom!) */
    display: flex;
    gap: 15px;
    z-index: 10;
}

/* MODIFICADOR: para quando os ícones são horizontais */
.hero-social-fixed.horizontal {
    flex-direction: row;
    /* Força a direção horizontal */
    position: static;
    /* Anula qualquer posicionamento absoluto que possa herdar */
    transform: none;
    /* Anula qualquer transformação */
}

/* ESTILOS DOS ÍCONES (copiados e adaptados da sua home) */
.hero-social-fixed a {
    background-color: transparent;
    color: var(--primary-blue);
    /* Cor do ícone */
    border: 1px solid #e0e0e0;
    /* Cor da borda */
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
    /* Adicionado para garantir o tamanho do ícone */
    text-decoration: none;
}

.hero-social-fixed a:hover {
    background-color: var(--primary-blue);
    /* Cor de fundo no hover */
    border-color: var(--primary-blue);
    /* Cor da borda no hover */
    color: white;
    /* Cor do ícone no hover */
    transform: scale(1.1);
    /* Efeito de zoom suave */
}

.news-slider.owl-theme .owl-dots .owl-dot.active span,
.news-slider.owl-theme .owl-dots .owl-dot:hover span {
    background: var(--primary-blue) !important;
}

/* =================================================================== */
/* FILTROS RESPONSIVOS (Geral ou Específico para Notícias)
/* =================================================================== */

/* Por defeito (Desktop/Tablet): Mostra abas, esconde selects mobile */
.filters-desktop2 {
    display: block;
}

.filters-mobile2 {
    display: none;
}

/* 
   Em ecrãs muito pequenos (< 415px) 
   Altera a visibilidade para mostrar o Select 
*/
@media (max-width: 415px) {
    .filters-desktop2 {
        display: none;
    }

    .filters-mobile2 {
        display: block;
        background-color: #ffffff;
        padding: 15px 0;
        /* Ajuste de padding */
    }

    .filters-mobile2 .form-label {
        font-weight: 500;
        color: #6c757d;
        font-size: 0.85rem;
        text-transform: uppercase;
        margin-bottom: 8px;
    }

    /* Estilo para os selects ficarem com a cor da marca ao focar */
    .filters-mobile2 .form-select:focus {
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 0.25rem rgba(50, 161, 215, 0.25);
    }
}

/* Remove o ícone de imagem quebrada e o texto "preview" feio */
.croppie-container img.cr-image {
    opacity: 0.6;
    /* Deixa o logo ligeiramente transparente para parecer mesmo uma marca de água */
}

/* Garante que o fundo da zona de corte seja suave */
.cr-boundary {
    background-color: #f4f4f4 !important;
    border: 1px solid #ddd;
    border-radius: 4px;
}