/*
Theme Name: ABW Claudinho
Theme URI: 
Author: ABW
Author URI: 
Description: Tema desenvolvido sob medida, otimizado para performance (LCP/CLS) e focado em SEO.
Version: 1.0.1
Requires PHP: 7.4
Text Domain: abw-claudinho
*/

:root {
    --primary-color: #0d52bc; /* Azul do Soledad original */
    --text-color: #333333;
    --meta-color: #888888;
    --bg-body: #f4f4f4; /* Cinza claro externo */
    --bg-content: #ffffff; /* Branco interno */
    --container-width: 1200px;
    --font-main: "Open Sans", system-ui, -apple-system, Arial, sans-serif;
    --font-heading: "Open Sans", system-ui, -apple-system, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: var(--font-main); 
    color: var(--text-color); 
    background: var(--bg-body); 
    line-height: 1.5; 
    font-size: 14px; 
}
a { text-decoration: none; color: var(--text-color); transition: color 0.2s ease; }
a:hover { color: var(--primary-color); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* Container com fundo branco em volta de tudo (padrão box) ou solto? O Soledad da imagem parece ter fundo branco no header e meio. */
.site-wrapper {
    background: var(--bg-body);
}
.container { 
    max-width: 1140px; /* Reduzido levemente para ficar mais elegante e próximo à referência */
    margin: 0 auto; 
    padding: 0 15px; 
}
.content-bg {
    background: var(--bg-content);
    padding: 0; /* Removido padding excessivo do background branco */
    margin: 0 auto;
    max-width: var(--container-width);
}

/* ==========================================================================
   TOP BAR (TICKER E REDES SOCIAIS)
   ========================================================================== */
.top-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #eeeeee;
    font-size: 11px;
    font-weight: 700;
}
.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-ticker {
    display: flex;
    align-items: center;
}
.ticker-label {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 8px 15px;
    margin-right: 10px;
    text-transform: uppercase;
}
.ticker-controls {
    display: flex;
    gap: 5px;
    margin-right: 15px;
}
.ticker-prev, .ticker-next {
    background: transparent;
    border: none;
    color: #999;
    font-size: 10px;
    cursor: pointer;
}
.ticker-content {
    overflow: hidden;
    white-space: nowrap;
    max-width: 400px;
}
.ticker-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ticker-list li {
    display: none;
}
.ticker-list li:first-child {
    display: block;
}
.ticker-list a {
    color: #666;
    text-decoration: none;
    text-transform: uppercase;
}
.ticker-list a:hover {
    color: var(--primary-color);
}
.top-bar-socials {
    display: flex;
    gap: 12px;
}
.social-icon {
    color: var(--primary-color);
}
.social-icon.rss {
    color: #f26522;
}
.social-icon:hover {
    opacity: 0.8;
}

.site-header {
    background: #ffffff;
    padding: 30px 0;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-logo {
    flex: 0 0 350px; /* Logo ainda maior */
}
.site-logo img {
    width: 100%;
    height: auto;
}
.header-search {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 40px;
}
.header-search form {
    display: flex;
    width: 100%;
    max-width: 700px;
    background-color: #f5f5f5; /* Fundo cinza como na ref */
}
.header-search input[type="text"] {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
}
.header-search button {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-search button:hover {
    opacity: 0.9;
}
.header-right-menu {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}
.hamburger-icon {
    display: flex; /* Visível no desktop tb! */
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}
.hamburger-icon:hover {
    color: var(--primary-color);
}

/* Menu Principal (Azul) */
.main-navigation-bar {
    background: var(--primary-color);
}
.main-nav ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.main-nav ul li a {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 16px 22px;
    display: block;
}
.main-nav ul li a:hover {
    background: rgba(0,0,0,0.1);
}

/* ==========================================================================
   CARROSSEL DE PUBLICIDADES TOPO
   ========================================================================== */
.top-ads-section {
    background: #ffffff;
    padding: 20px 0 10px;
}
.top-ads-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    padding: 10px 0;
    scroll-behavior: smooth;
}
.top-ads-carousel::-webkit-scrollbar { display: none; }
.abw-ad-block {
    flex: 0 0 calc(20% - 12px); /* 5 banners por linha exatos */
    aspect-ratio: 1 / 1; /* Força um quadrado perfeito (~218x218px no desktop) */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff; /* Fundo branco caso a imagem não preencha 100% */
}
.abw-ad-block .ad-link {
    display: block;
    width: 100%;
    height: 100%;
}
.abw-ad-block img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mantém a imagem inteira dentro do quadrado sem cortar */
}

/* Base Slider Wrap */
.abw-slider-wrap {
    position: relative;
    width: 100%;
}
.abw-slider-prev, .abw-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8); /* Fundo mais escuro para destaque */
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 999; /* Garante que fique acima da imagem sempre */
    font-size: 16px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    transition: background 0.3s;
}
.abw-slider-prev:hover, .abw-slider-next:hover {
    background: var(--primary-color);
}
.abw-slider-prev { left: 5px; }
.abw-slider-next { right: 5px; }

/* ==========================================================================
   MOSAICO DE DESTAQUES (1 PRINCIPAL + 6 SECUNDÁRIAS)
   ========================================================================== */
.featured-news {
    background: #ffffff;
}
.mosaic-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1fr; /* Coluna principal ligeiramente maior */
    grid-template-rows: 210px 210px; /* Altura estrita para forçar corte paisagem nas imagens e evitar estouro de altura */
    gap: 4px;
    margin-bottom: 40px;
}
.mosaic-item {
    position: relative;
    overflow: hidden;
    height: 100%; /* Preencher a grid */
}
.mosaic-item-main {
    grid-column: span 1; /* Ocupa a coluna 2fr (metade da tela) */
    grid-row: span 2;    /* Ocupa as duas linhas (altura total) */
    position: relative;
}
.abw-mosaic-slider .mosaic-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.abw-mosaic-slider .mosaic-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}
.mosaic-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mosaic-thumb {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.mosaic-thumb::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); /* Escurece os thumbnails inativos */
    transition: background 0.3s ease;
    pointer-events: none;
}
.mosaic-thumb.active::after, .mosaic-thumb:hover::after {
    background: rgba(0,0,0,0); /* Clareia o ativo e o hover */
}
.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.mosaic-item:hover img {
    transform: scale(1.03);
}
.post-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.post-content-overlay .post-cat {
    color: #f7d417; /* Data/Categoria amarela na referência */
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 5px;
    display: inline-block;
}
.post-content-overlay .post-title {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
}
.mosaic-item-main .post-content-overlay .post-title {
    font-size: 22px;
}
.post-content-overlay a {
    color: #ffffff;
}
.post-content-overlay a:hover {
    color: #f7d417;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (LISTAGEM + SIDEBAR)
   ========================================================================== */
.home-main-section {
    display: flex;
    gap: 40px;
    background: #ffffff; /* Fundo branco garantido para todo o bloco de conteúdo */
    padding: 30px; /* Padding interno para desgarrar do cinza */
}
.latest-news-wrap {
    flex: 1;
    min-width: 0;
}
.sidebar-wrap {
    width: 320px; /* Largura um pouco maior conforme a referência original */
    flex-shrink: 0;
}

/* Título de Seção "Últimas Postagens" */
.section-heading {
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 30px;
    display: flex;
}
.section-heading span {
    background: #222222;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 15px;
    letter-spacing: 0.5px;
}

/* Itens da Listagem */
.post-list-item {
    display: flex;
    gap: 20px; /* Respiro entre imagem e texto */
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eeeeee;
}
.post-list-item:last-child {
    border-bottom: none;
}
.post-thumb {
    width: 42%; /* Aumentado de 33% para deixar a foto maior, conforme solicitado */
    flex-shrink: 0;
}
.post-thumb img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}
.post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.post-info .post-cat {
    color: #4da6e7; /* Azul mais claro para categoria */
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
    display: inline-block;
}
.post-info .post-title {
    font-size: 20px; /* Título maior */
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: 10px;
}
.post-info .post-title a {
    color: #222222;
}
.post-info .post-title a:hover {
    color: var(--primary-color);
}
.post-meta {
    font-size: 11px;
    color: #aaaaaa;
    margin-bottom: 15px;
    text-transform: uppercase;
}
.post-meta span:not(:last-child)::after {
    content: '-';
    margin: 0 6px;
}
.post-meta .author { color: #888888; font-weight: 600; }
.post-excerpt {
    font-size: 13px;
    color: #555555;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1; /* Joga os ícones pro final */
}
/* Ícones Sociais Pequenos */
.post-social {
    display: flex;
    gap: 10px;
}
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
}
.social-btn:hover { opacity: 0.8; color: #fff; }
.social-btn.facebook { background: #3b5998; }
.social-btn.twitter { background: #1da1f2; }
.social-btn.whatsapp { background: #25d366; }
/* ==========================================================================
   CONTEÚDO DA NOTÍCIA (SINGLE POST)
   ========================================================================== */
.single-content {
    font-size: 17px;
    line-height: 1.8;
    color: #444444;
}
.single-content p {
    margin-bottom: 20px;
}
.single-content a {
    color: var(--primary-color, #0056b3);
    text-decoration: underline;
}
.single-content h1, .single-content h2, .single-content h3, .single-content h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #222;
}

/* Alinhamento nativo de Imagens do WordPress */
.single-content img {
    max-width: 100%;
    height: auto;
}
.aligncenter {
    clear: both;
    display: block;
    margin: 15px auto 25px auto;
    text-align: center;
}
img.aligncenter,
.single-content img.aligncenter {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}
.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}
.alignnone {
    margin: 15px 0 25px 0;
}
.wp-caption {
    max-width: 100%;
    margin-bottom: 25px;
}
.wp-caption img[class*="wp-image-"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.wp-caption-text {
    text-align: center;
    font-size: 13px;
    color: #777;
    margin-top: 8px;
    font-style: italic;
}
.wp-block-image {
    margin-bottom: 25px;
}
.wp-block-image img {
    display: block;
    max-width: 100%;
    height: auto;
}
.wp-block-image .aligncenter {
    margin-left: auto;
    margin-right: auto;
}
/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar-ad-item {
    margin-bottom: 35px;
    text-align: center;
}
.sidebar-ad-item img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Slider lateral */
.sidebar-slider-wrap {
    overflow: hidden; /* Corta qualquer coisa que vaze, exceto os itens dentro do flex */
    border: 1px solid #eee; /* Uma bordinha pra destacar que é um bloco contido */
}
.sidebar-slider-wrap .abw-slider-track {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}
.sidebar-slider-wrap .abw-slider-track::-webkit-scrollbar { display: none; }
.sidebar-slider-wrap .abw-ad-block {
    flex: 0 0 100%; /* Mostrar apenas 1 ad por vez na sidebar */
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    scroll-snap-align: start;
    display: block; /* Garante que a imagem e o texto fiquem em blocos (texto desce pra linha de baixo) */
    text-align: center; /* Centraliza o texto e a imagem */
}
.sidebar-slider-wrap .sidebar-ad-item {
    margin-bottom: 0; /* Remove a margem dentro do slide para evitar desalinhamento */
}
.sidebar-ad-desc {
    font-size: 11px;
    color: #888888;
    margin-top: 8px;
    display: block;
    line-height: 1.4;
}

/* ==========================================================================
   PAGINAÇÃO
   ========================================================================== */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
}
.single-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
}

/* ==========================================================================
   NOTÍCIAS RELACIONADAS (SINGLE)
   ========================================================================== */
.related-news {
    margin-top: 50px;
}
.related-heading {
    border-bottom: 2px solid #000;
    margin-bottom: 30px;
}
.related-heading h3 {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 8px 15px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}
.related-card {
    text-align: center;
}
.related-thumb {
    margin-bottom: 15px;
}
.related-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.related-info .post-cat {
    display: block;
    color: var(--primary-color, #0056b3);
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.related-info .post-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
    line-height: 1.3;
}
.related-info .post-title a {
    color: #000;
    text-decoration: none;
}
.related-info .post-meta {
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
}
.related-info .post-meta .sep {
    margin: 0 5px;
}
.related-info .post-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Responsividade das Relacionadas */
@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}
.pagination .page-numbers {
    padding: 6px 12px;
    background: #f4f4f4;
    color: #444444;
    font-weight: 700;
    font-size: 12px;
}
.pagination .current {
    background: var(--primary-color);
    color: #ffffff;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: #333333; /* Bloco cinza escuro */
    color: #cccccc;
    padding-top: 40px;
    margin-top: 50px;
    position: relative;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 40px;
}
.footer-logo img {
    max-height: 70px;
    filter: brightness(0) invert(1); /* Deixa logo branco caso seja preta, útil pra rodapé escuro */
}
.footer-nav ul {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-nav ul li a {
    color: #cccccc;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
}
.footer-nav ul li a:hover {
    color: #ffffff;
}
.footer-bottom-bar {
    background: #111111; /* Barra preta */
    padding: 15px 0;
    text-align: center;
}
.footer-copy {
    font-size: 11px;
    color: #888888;
}

#back-to-top {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: none !important;
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    cursor: pointer;
    opacity: 0 !important;
    transform: translateY(100px) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    z-index: 999999 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
}
#back-to-top.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE)
   ========================================================================== */
@media (max-width: 991px) {
    /* Header Compacto */
    .header-inner { flex-wrap: wrap; justify-content: space-between; align-items: center; }
    .site-logo { flex: 0 0 calc(100% - 50px); max-width: 240px; }
    .hamburger-icon { display: block; flex: 0 0 40px; text-align: right; }
    .header-search { display: none; }
    
    /* Configuração do Menu Mobile Aberto */
    .main-navigation-bar { display: none; }
    .main-navigation-bar.is-open { display: block; }
    .main-nav ul { flex-direction: column; align-items: stretch; padding: 0; }
    .main-nav ul li { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
    .main-nav ul li a { padding: 15px 20px; }
    
    .top-bar-left span { display: block; margin-bottom: 5px; }
    
    /* Carrossel Topo */
    .abw-ad-block { flex: 0 0 70%; }
    
    /* Mosaico Reorganizado Premium */
    .mosaic-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 5px;
    }
    .mosaic-item-main {
        grid-row: span 1;
        grid-column: span 2;
        aspect-ratio: 16/10; /* Corrige o bug da altura 0 */
    }
    .mosaic-item {
        height: auto;
        aspect-ratio: 1/1; /* Quadrados perfeitos para os thumbs */
    }
    .mosaic-item-main .post-content-overlay .post-title {
        font-size: 16px; /* Ajuste no título do mobile */
    }
    
    /* Últimas Postagens */
    .home-main-section { flex-direction: column; }
    .sidebar-wrap { width: 100%; margin-top: 40px; }
    
    .post-list-item { flex-direction: column; }
    .post-thumb { width: 100%; margin-bottom: 15px; }
    
    .footer-inner { flex-direction: column; text-align: center; gap: 20px; }
    .footer-nav ul { justify-content: center; }
}

@media (max-width: 768px) {
    .abw-ad-block { flex: 0 0 calc(80% - 10px); }
    .header-inner { flex-direction: row; gap: 10px; } /* Mantém logo e botão na mesma linha */
    .site-logo { max-width: 200px; }
    .home-main-section, .single-layout { flex-direction: column; padding: 20px 15px; }
    .sidebar-wrap { width: 100%; }
}

/* ==========================================================================
   PÁGINA INTERNA (SINGLE POST)
   ========================================================================== */
/* Força o template do Elementor (Theme Builder) a respeitar o container do tema */
.elementor-location-single {
    max-width: 1140px !important;
    margin: 20px auto 40px !important;
    background: #ffffff !important;
    padding: 30px 20px !important;
    box-sizing: border-box;
}

.single-layout {
    display: flex;
    gap: 30px;
    background: #ffffff;
    padding: 30px 20px;
    margin-top: 20px; /* Descola um pouco do header/ads */
}
.single-layout .main-content-area {
    flex: 1;
    min-width: 0;
}
.single-thumbnail {
    margin-bottom: 30px;
    width: 100%;
}
.single-thumbnail img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.single-title {
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.single-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}
.single-meta span {
    display: flex;
    align-items: center;
}
.single-meta a {
    color: #666;
    text-decoration: none;
}

.top-share-block {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.share-label {
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    margin-right: 15px;
    color: #000;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #fff !important;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}
.share-btn.heart { width: auto; padding: 0 10px; background: #0056b3; gap: 5px; }
.share-btn.fb { background: #3b5998; }
.share-btn.tw { background: #1da1f2; }
.share-btn.pin { background: #cb2027; }
.share-btn.mail { background: #007bff; }
