/* ==========================================================================
   DESTAQUES DA CAPA (proposta, desktop e tablet)
   Só a manchete é foto grande com o título sobre ela. O destaque da direita
   deixa de ser um segundo cartão de foto grande e vira o primeiro item da lista
   de últimas notícias, com horário. Sem foto real, a manchete cai no modo só texto.
   Para voltar ao desenho anterior, apague este arquivo e o carregamento dele em functions.php.
   ========================================================================== */
@media (min-width: 769px) {
    /* Manchete: foto 16:8 com raio do portal e título sobre ela */
    body .ct-hero-showcase-cover { position: relative; display: block; overflow: hidden; border-radius: var(--ct-img-radius, 8px); }
    body .ct-hero-showcase-cover img {
        display: block; width: 100%; height: auto;
        aspect-ratio: var(--ct-img-ratio, 16 / 8);
        object-fit: cover; object-position: var(--ct-img-foco, center 30%);
        border-radius: var(--ct-img-radius, 8px);
    }
    body .ct-hero-showcase-cover img[src*="sem-foto"] { display: none; }
    body .ct-hero-showcase-cover .ct-hero-showcase-overlay {
        position: absolute; left: 0; right: 0; bottom: 0; top: auto; height: auto;
        padding: 80px 28px 24px;
        background: linear-gradient(to top, rgba(10, 14, 22, .9) 0%, rgba(10, 14, 22, .55) 55%, rgba(10, 14, 22, 0) 100%);
    }
    body .ct-hero-showcase-chapeu { display: inline-flex; margin-bottom: 10px; }
    body .ct-hero-showcase-principal .ct-hero-showcase-title {
        margin: 0; font-size: 42px; line-height: 1.1; letter-spacing: -.02em;
        color: #fff !important; text-decoration: none !important; -webkit-line-clamp: 3;
    }
    body a.ct-hero-showcase-principal:hover .ct-hero-showcase-title { color: #fff !important; text-decoration: underline !important; text-underline-offset: 4px; }
    /* Sem foto real: modo só texto */
    body .ct-hero-showcase-cover:has(img[src*="sem-foto"]) { overflow: visible; border-radius: 0; }
    body .ct-hero-showcase-cover:has(img[src*="sem-foto"]) .ct-hero-showcase-overlay { position: static; padding: 4px 0 18px; background: none; }
    body .ct-hero-showcase-cover:has(img[src*="sem-foto"]) .ct-hero-showcase-chapeu { display: none; }
    body .ct-hero-showcase-cover:has(img[src*="sem-foto"]) .ct-hero-showcase-principal .ct-hero-showcase-title { font-size: 56px; color: #17191d !important; }
    body .ct-hero-showcase .ct-hero-sub-grid { margin-top: 18px; }

    /* Direita: o cartão grande vira item de lista (foto pequena à esquerda, texto e horário à direita) */
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque {
        display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start;
        position: static; height: auto; aspect-ratio: auto; border-radius: 0; overflow: visible; background: none;
        padding: 0 0 14px; margin: 0 0 14px; border-bottom: 1px solid #e6e9ee;
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque img {
        position: static; width: 112px; height: 74px; aspect-ratio: auto; object-fit: cover;
        border-radius: var(--ct-img-radius, 8px);
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque::before, body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque::after { display: none; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-texto { position: static; padding: 0; background: none; color: #17191d; display: block; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-titulo { font-family: var(--font-serif, Georgia, serif); font-size: 16px; line-height: 1.25; font-weight: 700; color: #17191d !important; margin: 4px 0 0; text-shadow: none; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque .ct-side-feed-pilula { position: static; display: inline-block; }
}
@media (min-width: 769px) and (max-width: 1100px) {
    body .ct-hero-showcase-principal .ct-hero-showcase-title { font-size: 30px; }
}

/* O primeiro item da lista tem o mesmo tamanho dos demais (foto 130x100, título 17 px, mesmo respiro) */
@media (min-width: 769px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque { grid-template-columns: 130px minmax(0, 1fr); gap: 14px; padding: 13px 0; margin: 0; align-items: start; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque img { width: 130px; height: 100px; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-titulo { font-size: 17px; }
}
@media (min-width: 769px) { body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque { border-bottom-color: #f1f5f9; } }

/* ==========================================================================
   Coluna da direita: 3 últimas na altura da foto da manchete e, no espaço que sobra
   (ao lado dos 3 cartões), o banner lateral. A altura da foto vem de --ct-foto-h,
   medida por capa.js; sem JavaScript vale o 320px do padrão.
   ========================================================================== */
@media (min-width: 1101px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col { display: flex; flex-direction: column; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list { height: var(--ct-foto-h, 320px); flex: none; display: flex; flex-direction: column; overflow: hidden; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque {
        flex: 1 1 0; min-height: 0; margin: 0; padding: 8px 0;
        display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center;
        border-bottom: 1px solid #f1f5f9;
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a:last-child { border-bottom: 0; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a .ct-side-feed-thumb { width: 112px; height: 78px; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a img,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque img { width: 112px; height: 78px; object-fit: cover; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list .ct-side-feed-title,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-titulo { font-size: 15.5px; line-height: 1.22; -webkit-line-clamp: 3; }
}

/* Alinhamento exato: a lista tem 3 linhas iguais; a foto da 1ª começa no topo da foto da manchete e a da 3ª termina na base dela. */
@media (min-width: 1101px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 14px; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque {
        display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px;
        align-items: stretch; padding: 0; margin: 0; border: 0; min-height: 0; flex: none;
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a .ct-side-feed-thumb,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque > img { width: 130px; height: 100%; min-height: 0; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a img,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque img { width: 130px; height: 100%; object-fit: cover; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a .ct-side-feed-info,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-texto { align-self: start; overflow: visible; }
}

/* Foto das últimas no tamanho original do portal (130 x 100); o espaço que sobra vai entre as linhas, sem mexer nas pontas. */
@media (min-width: 1101px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list { grid-template-rows: repeat(3, 100px); align-content: space-between; gap: 0; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a .ct-side-feed-thumb,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque > img,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a img,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque img { width: 130px; height: 100px; }
}

/* ==========================================================================
   DESTAQUE DA CAPA (banner da primeira tela, espaço home_lateral, 480 x 225 px, proporção fixa: a altura acompanha a largura)
   Fica abaixo das 3 últimas, ao lado dos 3 cartões, com o topo alinhado ao topo das fotos
   deles (18px do bloco + 18px de respiro + 1px da linha = 37px) e a largura da coluna.
   Abaixo de 1101px ele desce para depois dos cartões.
   ========================================================================== */
.ct-hero-banner-lateral { margin-top: 18px; }
/* Celular: o banner ocupa a largura da coluna, alinhado às laterais das notícias; a arte de 300 x 250 só cresce, sem cortar. */
@media (max-width: 768px) {
    body .ct-hero-banner-lateral .ct-ad-slot { width: 100%; max-width: none; height: auto; aspect-ratio: 300 / 250; }
}
@media (min-width: 1101px) {
    .ct-hero-banner-lateral { flex: 1 1 auto; margin-top: 0; padding-top: 37px; }
    .ct-hero-banner-lateral .ct-ad-slot { width: 100%; max-width: none; height: auto; aspect-ratio: 480 / 225; }
}

/* Achados nos testes: foto clara some no fundo branco da página (fio fino nas bordas) e a manchete sem foto precisa
   ocupar a mesma altura da lista de últimas, para os cartões e o banner continuarem alinhados. */
@media (min-width: 769px) {
    body .ct-hero-showcase-cover:not(:has(img[src*="sem-foto"])) { outline: 1px solid rgba(23, 25, 29, .09); outline-offset: -1px; }
}
@media (min-width: 1101px) {
    body .ct-hero-showcase-cover:has(img[src*="sem-foto"]) { min-height: var(--ct-foto-h, 320px); }
    body .ct-hero-showcase-cover:has(img[src*="sem-foto"]) .ct-hero-showcase-principal .ct-hero-showcase-title { font-size: 64px; line-height: 1.05; }
}

/* Sem foto: o título fica no meio da altura do bloco, alinhado à esquerda. */
@media (min-width: 1101px) {
    body .ct-hero-showcase-cover:has(img[src*="sem-foto"]) { display: flex; align-items: center; }
    body .ct-hero-showcase-cover:has(img[src*="sem-foto"]) .ct-hero-showcase-overlay { width: 100%; padding: 0; }
}

/* ==========================================================================
   TABLET (769 a 1100px)
   Manchete com foto e os 3 cartões em largura total (como no computador); abaixo deles, uma fileira:
   as 3 últimas em lista à esquerda e o banner retangular à direita, os dois com 225px de altura.
   Abaixo de 880px o banner desce para baixo da lista.
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1100px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list {
        display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr));
        gap: 12px; height: 225px; margin: 0; padding: 0;
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque {
        grid-column: auto; grid-row: auto;
        display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; align-items: stretch;
        padding: 0; margin: 0; border: 0; min-height: 0;
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a .ct-side-feed-thumb,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a img,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque img { width: 100px; height: 100%; object-fit: cover; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a .ct-side-feed-info,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-texto { align-self: start; overflow: visible; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-title,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-titulo { font-size: 15px; line-height: 1.22; -webkit-line-clamp: 3; margin: 0; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-chapeu, body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-pilula { display: none; }
    body .ct-hero-banner-lateral { margin: 0; padding: 0; }
    body .ct-hero-banner-lateral .ct-ad-slot { width: 100%; max-width: 480px; height: auto; aspect-ratio: 480 / 225; }
}
@media (min-width: 880px) and (max-width: 1100px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col { grid-template-columns: minmax(0, 1fr) 480px; }
}

/* Tablet: as regras antigas da capa (card grande em duas colunas) têm especificidade alta; estas as anulam para as 3 últimas. */
@media (min-width: 769px) and (max-width: 1100px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-feed-item {
        grid-column: 1; grid-row: auto; align-self: stretch;
        height: auto; min-height: 0; aspect-ratio: auto; margin: 0; padding: 0; border: 0;
        display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; position: relative;
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque > img { position: static; width: 100px; height: 100%; object-fit: cover; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque::after { display: none; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-feed-item ~ .ct-side-feed-item { padding: 0; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-texto { position: static; padding: 0; background: none; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-titulo { color: #17191d !important; text-shadow: none; }
}
@media (min-width: 769px) and (max-width: 1100px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-feed-item { grid-template-rows: minmax(0, 1fr); overflow: hidden; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > a img { height: 100%; min-height: 0; max-height: 100%; }
}
@media (min-width: 769px) and (max-width: 1100px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-title,
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-titulo { font-size: 14.5px; line-height: 1.2; -webkit-line-clamp: 2; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-hora, body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list time, body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list [class*="hora"] { display: none; }
}

/* ==========================================================================
   CELULAR (até 768px)
   Manchete (título e foto), 3 cartões e a lista de últimas como no resto: o primeiro item da lista deixa de ser um
   cartão de foto grande com título por cima (repetia a manchete) e vira item de lista igual aos outros dois.
   ========================================================================== */
@media (max-width: 768px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque {
        display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: start;
        position: static; height: auto; min-height: 0; aspect-ratio: auto; border-radius: 0; overflow: visible; background: none;
        margin: 0; padding: 14px 0; border-bottom: 1px solid #f1f5f9;
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque > img {
        position: static; width: 112px; height: 112px; aspect-ratio: auto; object-fit: cover; border-radius: var(--ct-img-radius, 8px);
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque::after { display: none; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-texto { position: static; padding: 0; background: none; color: #17191d; display: block; }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque-titulo {
        font-family: var(--font-serif, Georgia, serif); font-size: 17px; line-height: 1.22; font-weight: 700;
        color: #17191d !important; text-shadow: none; margin: 4px 0 0;
    }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-destaque .ct-side-feed-pilula { position: static; display: inline-block; }
    body .ct-hero-banner-lateral { margin-top: 18px; }
}
@media (max-width: 768px) {
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque { grid-template-columns: 140px minmax(0, 1fr); }
    body .ct-hero-magazine-grid > .ct-hero-side-col .ct-side-feed-list > .ct-side-destaque > img { width: 140px; height: 112px; }
}

/* ANÚNCIO DA CASA ao lado do bloco do Guia (template-parts/guia-anuncio-casa.php): o portal promovendo o Guia, sem banner de terceiros. */
.ct-guia-casa { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 26px 24px; border-radius: 12px; background: linear-gradient(135deg, #0c3764 0%, #07233f 100%); color: #fff; }
.ct-guia-casa-kicker { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #ffb020; }
.ct-guia-casa h3 { margin: 0; font-family: var(--font-serif, Georgia, serif); font-size: 24px; font-weight: 800; line-height: 1.15; color: #fff; }
.ct-guia-casa-texto { margin: 0; font-size: 14px; line-height: 1.45; color: #cfe0f2; }
.ct-guia-casa-preco { margin: 4px 0 0; font-size: 14px; color: #cfe0f2; }
.ct-guia-casa-preco strong { font-family: var(--font-serif, Georgia, serif); font-size: 30px; font-weight: 800; color: #ffb020; }
.ct-guia-casa-botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; padding: 12px 18px; border-radius: 999px; background: linear-gradient(90deg, #e8401c 0%, #ff9a1f 100%); font-size: 14.5px; font-weight: 800; color: #fff; text-decoration: none; }
.ct-guia-casa-botao:hover { filter: brightness(1.07); }
@media (max-width: 992px) { .ct-guia-casa { width: 100%; } }
