/* news-home.css */

.news-section {
    padding: 0 64px;
    background-color: #ffffff !important;
    justify-content: flex-start !important;
    margin: 50px 0 80px;
}

.news-container {
    max-width: 1500px;
    margin: 0 auto;
}

.news-sidebar,
.news-main,
.news-agencies {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    /* Cor e espessura da borda */
    padding: 20px;
    max-height: 747px;
    /* Ajuste conforme necessário */
    overflow-y: auto;
    /* Adiciona rolagem vertical */
}

.news-sidebar ul {
    list-style: none;
    padding: 0;
    justify-content: flex-start !important;
}

.news-sidebar li {
    margin-bottom: 15px;
}

.news-sidebar li span {
    display: block;
    font-size: 12px;
    color: #888;
}

.news-sidebar li p {
    margin: 5px 0;
    font-size: 14px;
    font-weight: 500 !important;
}

.news-sidebar a {
    color: #d32f2f;
    text-decoration: none;
    font-size: 14px;
}

/* Mantém o banner "news-ad" sempre no fim da sidebar */
.news-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-sidebar-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.recent-news-list {
    flex: 1;
    min-height: 0;
    margin-bottom: 0;
}

.news-ad {
    position: relative;
    max-width: auto;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    /* empurra para o final quando a lista tem poucas linhas */
    padding: 20px;
}

.news-ad .hub-banner-link {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.news-ad img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}

.news-ad p {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
    padding: 15px;
    color: #fff !important;
    text-align: center;
    border-radius: 0 0 10px 10px;
    box-sizing: border-box;
}

.highlight {
    font-size: 20px;
    /* Ajuste conforme necessário */
    font-weight: bold;
    /* Opcional */
}

.highlight-image {
    position: relative;
    overflow: hidden;
    /* Garante que elementos filhos não saiam dos limites */
    border-radius: 8px;
    /* Bordas arredondadas para o contêiner */
}

.highlight-image .img-fluid {
    width: 100%;
    height: 373px;
    object-fit: cover;
    /* Adapta a imagem ao contêiner sem distorção */
    border-radius: 8px;
    /* Bordas arredondadas para a imagem */
}

.highlight-image .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.7) 85%, rgb(0, 0, 0) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
}

/* *** CORREÇÃO AQUI: Tamanho da fonte e line-clamp para o título principal *** */
.highlight-image .overlay h2.titulo {
    /* Use 'h2.titulo' para especificidade, se 'titulo' é a classe */
    font-size: 16px;
    /* Tamanho da fonte para 16px */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Limita a 3 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Reticências no final */
}

.highlight-image .overlay p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.highlight-image .overlay span {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: #CED4DA !important;
}

/* *** CORREÇÃO AQUI: Espaçamento entre os cards secundários (gap) *** */
#secondary-highlight-cards>.d-flex {
    gap: 15px;
    /* Espaçamento de 15px entre os itens flex */
    /* Remova o 'justify-content-between' do JS se quiser apenas 'gap' */
    /* Caso contrário, 'justify-content-between' vai distribuir o espaço restante */
}


.news-cards .card-news,
.news-cards .card-news-meio {
    position: relative;
    width: 290px;
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
    display: block;
    box-shadow: none;
}

.news-cards .card-news-meio {
    margin: 0 15px;
}

.news-cards .card-news img,
.news-cards .card-news-meio img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border: none;
}

.news-cards .card-body p {
    font-weight: 500;
    margin-bottom: 10px !important;
    /* JÁ TINHA: font-size: 16px; display: -webkit-box; -webkit-line-clamp: 3; etc. */
    font-size: 16px;
    /* Confirmando explicitamente */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-cards .card-body {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.7) 85%, rgb(0, 0, 0) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
}

.news-cards .card-body span {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: #CED4DA !important;
}

/* Esta regra pode ser redundante se a regra acima para .news-cards .card-body p já cobre */
.news-cards .card-news p,
.news-cards .card-news-meio p {
    font-size: 16px;
    margin: 0;
}

.news-agencies select {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
}

.news-agencies ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-agencies li {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
    list-style: none;
}

.news-agencies li span {
    display: block;
    font-size: 16px;
    color: #333;
    font-weight: normal;
}

.news-agencies li p {
    margin: 5px 0;
    font-size: 14px;
}

.agency-item {
    display: flex;
    align-items: center;
    padding-bottom: 10px;
}

.agency-logo {
    width: 20px;
    height: 18px;
    margin-right: 10px;
    border-radius: 5px;
}

.col-lg-3 .inner-content .news-agencies .list-unstyled .agency-item .agency-name {
    font-size: 14px;
    color: #333;
    font-weight: 400;
}

#agency-filter:focus {
    outline: none;
}

.news-agencies p {
    margin: 5px 0;
}

.news-agencies .news-title {
    font-size: 16px;
    font-weight: 500;
    color: #212529;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-agencies .news-title:hover {
    color: #000000;
}

.news-agencies .news-date {
    font-size: 14px;
    color: #757575;
}

.news-agencies .text-muted {
    font-size: 12px;
    color: #888;
}

.custom-container {
    max-width: 1400px;
    margin: 0 auto;
}

.news-section .row {
    display: flex;
}

.news-section .col-lg-3,
.news-section .col-lg-6 {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-section .col-lg-6 {
    width: 100%;
    height: 100%;
}

li.mb-3 {
    background-color: transparent !important;
}

.news-section .news-sidebar,
.news-section .news-agencies {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.inner-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Telas grandes (lg+): coluna "Notícias Recentes" acompanha a altura da linha
   e o .news-ad fica sempre no rodapé (flex + margin-top:auto só funciona se o pai tiver altura real). */
@media (min-width: 992px) {
    .news-section .row {
        align-items: stretch;
    }

    .news-section .row>.col-lg-3:first-child {
        display: flex;
        flex-direction: column;
        align-self: stretch;
        min-height: 0;
    }

    .news-section .row>.col-lg-3:first-child>.inner-content {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .news-section .row>.col-lg-3:first-child .news-sidebar {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        height: auto;
        overflow: visible;
    }

    .news-section .row>.col-lg-3:first-child .news-sidebar-body {
        flex: 1 1 auto;
        min-height: 0;
    }

    .news-section .row>.col-lg-3:first-child .recent-news-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.news-sidebar h2 {
    font-weight: bold;
    font-size: 18px;
    padding: 0px 15px 0px 15px;
    margin-bottom: 0px !important;
}

.news-sidebar .mb-3 .destaques {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 6px !important;
    padding: 0px !important;
}

.disclaimer h4 {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 5px;
    color: #212529;
}

.disclaimer p {
    font-size: 14px;
    font-style: italic;
    color: #858E96;
    margin: 0;
    font-weight: 400;
}

ul.list-unstyled {
    padding: 0;
    margin: 0;
    list-style-type: none;
    padding: 0 5px;
}

ul.list-unstyled li {
    margin-bottom: 0px !important;
    padding: 14px 10px;
    border-bottom: 1px solid #ddd;
}

ul.list-unstyled li:last-child {
    border-bottom: 1px solid #ddd;
}

ul.list-unstyled .text-muted {
    font-size: 14px;
    color: #888;
}

ul.list-unstyled p {
    font-size: 16px;
    color: #212529;
    padding: 5px 0px 5px 0px;
    font-weight: 500;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

ul.list-unstyled a.text-danger {
    font-size: 12px;
    color: #F15F56;
    text-decoration: none;
    padding: 10px 0px 10px 0px;
    font-weight: 600;
}

ul.list-unstyled a.text-danger:hover {
    text-decoration: underline;
}

ul.list-unstyled a.text-danger i {
    margin-left: 6px;
}



/* Para telas médias e menores: empilha as colunas */
@media (max-width: 1024px) {
    .news-section .row {
        display: flex;
        flex-direction: column !important;
        gap: 50px;
    }

    .news-section .col-lg-3,
    .news-section .col-lg-6,
    .news-section .col-md-4,
    .news-section .col-md-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .news-sidebar,
    .news-main,
    .news-agencies {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {

    .news-section {
        padding: 0 34px;
    }

    /* Empilha as 3 cards secundárias */
    #secondary-highlight-cards .d-flex.justify-content-between.gap-3 {
        flex-direction: column !important;
        gap: 16px !important;
        align-items: stretch !important;
    }

    #secondary-highlight-cards .card-news {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Garante que o destaque principal também ocupe 100% */
    .highlight-image {
        width: 100% !important;
        margin-bottom: 16px;
    }
}

@media (max-width: 1200px) {

    /* HOME: preservar banner news-ad completo em telas menores */
    .news-ad {
        /* Mantém centralização também em telas menores */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .news-ad img {
        height: auto;
        width: auto;
        object-fit: contain;
        display: block;
    }
}