/* Estilo do container principal */
.custom-portal-container {
    padding: 40px 0;
    background-color: #f8f9fa;
}

/* Estilo da linha de notícias */
.custom-news-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px; /* Espaço entre as colunas */
    margin-bottom: 20px;
}

/* Estilo das colunas */
.custom-first-column,
.custom-second-column,
.custom-third-column {
    flex: 1;
    min-width: 300px; /* Largura mínima para evitar quebras */
}

/* Estilo das notícias médias (primeira e terceira colunas) */
.custom-news-medium {
    position: relative;
    height: 250px; /* Altura fixa para as notícias médias */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

/* Estilo da notícia grande (destaque) */
.custom-news-big {
    position: relative;
    height: 515px; /* Altura maior para a notícia de destaque */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

/* Estilo da imagem das notícias */
.custom-news-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.custom-news-big .custom-news-image {
    height: 420px;
}

/* Efeito de hover na imagem */
.custom-news-medium:hover, .custom-news-big:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Sombreado sobre a imagem */
.custom-news-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
}

/* Estilo das informações das notícias */
.custom-news-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    color: #fff;
    z-index: 2;
}

.custom-news-date {
    font-size: 12px;
    opacity: 0.8;
    display: block;
    margin-bottom: 5px;
}

.custom-news-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.custom-news-big .custom-news-title {
    font-size: 22px;
}

/* Estilo do link das notícias */
.custom-news-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Título da seção */
.section-title h2 {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.section-title h2:after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background-color: #0056b3;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Botão "Mais notícias" */
.news-more-btn {
    display: inline-block;
    background-color: #0056b3;
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,86,179,0.3);
}

.news-more-btn:hover {
    background-color: #003d82;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,86,179,0.4);
    text-decoration: none;
}

.news-more-btn span {
    margin-right: 10px;
}

.news-more-btn i {
    transition: transform 0.3s ease;
}

.news-more-btn:hover i {
    transform: translateX(5px);
}

/* Estilos para o gadget de galeria na página inicial */
.gallery-home {
    margin-bottom: 20px;
}

.gallery-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 15px;
}

.gallery-image-container img {
    width: 100%;
    transition: transform 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-link:hover .gallery-overlay {
    opacity: 1;
}

.gallery-link:hover .gallery-image-container img {
    transform: scale(1.05);
}

.gallery-info {
    text-align: center;
    color: white;
    padding: 15px;
}

.gallery-info h4 {
    margin: 0 0 5px 0;
    font-weight: bold;
}

.gallery-info p {
    margin: 0 0 15px 0;
}

.gallery-view-btn {
    display: inline-block;
    background: #fff;
    color: #333;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.gallery-view-btn:hover {
    background: #f0f0f0;
}

.gallery-thumbnails {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -5px;
}

.gallery-thumb {
    flex: 0 0 25%;
    padding: 0 5px;
    margin-bottom: 10px;
}

.gallery-thumb img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
}

/* Estilos para a página de listagem de notícias */
.news-page-header {
    text-align: center;
    margin: 40px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.news-page-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.news-page-header h1:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: #0056b3;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.news-page-header p {
    font-size: 18px;
    color: #666;
    margin-top: 20px;
}

.news-listing {
    margin-bottom: 50px;
}

.news-card {
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px; /* Espaçamento consistente entre cards */
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.news-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.1);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image-placeholder i {
    font-size: 50px;
    color: #ccc;
}

.news-date {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(0, 86, 179, 0.9);
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.news-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
    height: 50px; /* Altura fixa para o título */
    overflow: hidden; /* Esconde o texto que ultrapassar a altura */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limita a 2 linhas */
    -webkit-box-orient: vertical;
    line-clamp: 2; /* Propriedade padrão para compatibilidade */
}

.news-card-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-card-content h3 a:hover {
    color: #0056b3;
}

.news-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    height: 70px; /* Altura fixa para o trecho */
    overflow: hidden; /* Esconde o texto que ultrapassar a altura */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limita a 3 linhas */
    -webkit-box-orient: vertical;
    line-clamp: 3; /* Propriedade padrão para compatibilidade */
}

.read-more {
    align-self: flex-start;
    color: #0056b3;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    margin-top: auto;
}

.read-more i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.read-more:hover {
    color: #003d82;
    text-decoration: none;
}

.read-more:hover i {
    transform: translateX(5px);
}

.news-pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0 50px;
}

.news-pagination .pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-pagination .pagination li {
    margin: 0 5px;
}

.news-pagination .pagination li a,
.news-pagination .pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-pagination .pagination li.active span {
    background-color: #0056b3;
    color: #fff;
}

.news-pagination .pagination li a:hover {
    background-color: #e0e0e0;
}

.news-pagination .pagination li.disabled span {
    color: #999;
    cursor: not-allowed;
}

@media (max-width: 767px) {
    .news-card-image {
        height: 180px;
    }
    
    .news-page-header h1 {
        font-size: 28px;
    }
    
    .news-page-header p {
        font-size: 16px;
    }
}