@layer reset, base, theme, layouts, components, utilities, child-base, child;

@layer child {
    .wrapper {
        margin: 0 5%;
    }

    /* Fix for iOS infinite image growth */
    /* img,
    picture,
    video,
    canvas,
    svg {
        height: auto !important;
    } */

    .main {
        margin: var(--big-gap) auto;
    }

    @media (min-width: 768px) {
        .menu-top {
            margin: 0 20px;
        }
    }

    @media (max-width: 768px) {
        body .main {
            margin-top: 10px;
        }

    }

    /* Header */

    header#header .menu-top .wrapper {
        width: 100%;
    }

    @media (max-width: 768px) {
        body header#header .menu-top .wrapper {
            grid-template-columns: 50px 1fr 0;
            max-width: fit-content !important;
        }

        body header#header .right-menu .search-form {
            display: none !important;
        }
    }

    @media (max-width: 768px) {
        header#header>div>div>div {
            height: 80px !important;
        }
    }

    /* Logo. */

    header#header .brand {
        height: 130% !important;
    }

    .brand img {
        object-fit: contain;
    }

    /* *** Custom Underline *** */
    .underline--full::after {
        background-color: #CCC !important;
    }

    /* *** Customizações de plugins *** */
    .web-stories-list.is-carousel.has-archive-link {
        margin: 0 !important;
    }

    a.serverdoin-widgets--button.serverdoin-widgets--whatsapp {
        display: none !important;
    }

    .serverdoin-whatsapp-button {
        margin-top: 10px;
    }


    .wps-story-ring {
        border-color: var(--primary-color) !important;
    }



    .publicacao-legal-wrapper {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: var(--big-gap);
    }

    .publicacao-legal-wrapper .grid-posts-01 {
        grid-template-columns: 1fr;
        margin-bottom: var(--big-gap);
    }

    .filter-group {
        min-width: 31%;
    }

    .pl-filters {
        max-width: 100% !important;
    }

    #publicacoes-legais li.publicacao {
        max-width: 100% !important;
    }

    #publicacoes-legais li.publicacao>a>div>.category {
        color: var(--primary-color);
        filter: brightness(100%);
    }

    #publicacoes-legais li.publicacao>a:hover {
        filter: brightness(100%) !important;
    }

    .pl-filters .btn-filter {
        background-color: var(--primary-color) !important;
    }

    .serverdoin-widgets--share-buttons {
        justify-content: left !important;
        margin-top: var(--medium-gap);
    }

    @media (max-width: 768px) {
        .publicacao-legal-wrapper {
            grid-template-columns: 1fr;
        }

        .filter-group {
            width: 100%;
        }

    }

    /* *** blocos da home *** */

    @media (min-width: 768px) {
        .grid-3-cols.item-17 {
            grid-template-columns: 1fr .5fr !important;
        }
    }

    @media (max-width: 768px) {
        .grid-posts-01 {
            gap: 0;
        }

        .grid-posts-01 .post-item:not(:last-child):after {
            display: inline-block;
            content: "";
            height: 1px;
            background-color: #ccc;
            width: 100%;
            margin-bottom: 10px;
        }

        .layout-section:not(:last-child) .grid-posts-01:after {
            display: inline-block;
            content: "";
            height: 1px;
            background-color: #ccc;
            width: 100%;
            margin-top: 20px;
        }

        .grid-posts-02 .post-item:not(:last-child) {
            position: relative;
        }

        .grid-posts-02 .post-item:not(:last-child):after {
            display: inline-block;
            content: "";
            height: 1px;
            background-color: #ccc;
            width: 100%;
            position: absolute;
            bottom: -20px;
        }

        .layout-section:not(:last-child) .grid-posts-02:after {
            display: inline-block;
            content: "";
            height: 1px;
            background-color: #ccc;
            width: 100%;
        }

        .rank-math-breadcrumb {
            font-size: 16px;
        }

        @media (max-width: 768px) {
            body .rank-math-breadcrumb {
                font-size: 14px;
            }

        }
    }

    /* Bloco internas - Post */

    .wrapper .page-header.font-destaque-1 {
        background-color: #fa3737;
    }

    .wrapper .page-header.font-destaque-1 h1 {
        color: white;
        display: block;
        text-align: center;
    }

    /* Se a div possui um link que contém "informativo" no URL, muda o fundo */
    .category-primary-post:has(a[href*="informativo"]) {
        background-color: black !important;
        text-align: center;
        display: block;
    }

    .category-primary-post:has(a[href*="Obituario"]) {
        background-color: black !important;
        text-align: center;
        display: block;
    }

    .category-primary-post:has(a[href*="Seguranca"]) {
        background-color: #fa3737 !important;
        text-align: center;
        display: block;
    }

    .category-primary-post:has(a[href*="Esporte"]) {
        background-color: #4abd08c9 !important;
        text-align: center;
        display: block;
    }


    .category-primary-post.section-title.font-destaque-3 {
        background-color: black;
        text-align: center;
        display: block;
    }


    .wrapper .section-title a {
        color: white;
    }

    .item-2 section.custom-html-section {
        margin-top: 10px;
        margin-bottom: 20px;
    }

    .post-item-meta span.author-name {
        display: none;
    }

    /* bloco destaque - home*/
    .post-hero__overlay .post-item-category {
        font-size: 12px;
    }

    /* bloco colunistas - Home*/

    .columnists-posts-01 .grid-columnists-posts-01 {
        gap: var(--big-gap);
    }

    .columnist-item .latest-post-title a {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    /* Posts */

    body.single .post-item-meta {
        font-size: 13px;
    }


    .single .main-region.item-4:after {
        display: block;
        content: "";
        width: 100%;
        height: 1px;
        background-color: #ccc;
        margin-top: var(--big-gap);
    }

    @media (max-width: 768px) {

        .single a[class="post-item-title"] {
            text-align: center;
            font-size: 24px !important;
        }

        .single a[class="post-item-subtitle"] {
            text-align: center;
            font-size: 16px !important;
        }

        .single .post-item-meta span.update-info {
            display: block;
            color: #555;
        }
    }

    /* Bloco de Autor */

    .author-block {
        border: none !important;
        padding: 0 !important;
        margin-top: 20px;
    }

    .author-block__avatar img {
        height: 50px !important;
        width: auto;
    }

    .author-block__name {
        font-size: 14px !important;
    }

    .author-block__description {
        font-size: 12px !important;
    }

    /* No Desktop mantém o padrão do widget */
    .custom-weather-container {
        width: 100%;
        overflow: hidden;
    }

    /* No Mobile (telas menores que 768px) */
    @media (max-width: 768px) {
        .custom-weather-container {
            /* Define uma altura fixa que combine com a escala para não sobrar espaço branco */
            height: 160px;
            overflow: hidden;
            display: flex;
            align-items: flex-start;
            justify-content: center;
        }

        .custom-weather-container iframe {
            /* Diminui o tamanho do widget em 30% */
            transform: scale(0.75);
            /* Garante que o ponto de ancoragem seja o topo, para não criar vácuo acima */
            transform-origin: top center;
            /* Força o iframe a entender que o container "encolheu" */
            width: 133% !important;
            /* Compensação matemática para o scale(0.75) */
        }
    }

    /* post */

    @media (max-width: 768px) {
        body section.layout-section.layout-full-width:nth-child(2) {
            margin: -25px 0;
        }
    }
}



/* Corrigindo espaçamento da listagem de categorias ao criar um post */

.wp-admin.post-type-post .css-1n451hs {
    height: auto !important;
}

/* Post */

body.single .serverdoin-widgets--button, body.single .serverdoin-whatsapp-button img {
    width: 38px;
    height: 38px;
    padding: 8px !important;
}


/* Define altura de 1000px apenas para Desktop (telas maiores que 1024px) */
@media (min-width: 1024px) {
    .tradingview-widget-container {
        height: 1000px !important;
    }
}

/* Garante que no mobile ele respeite o fluxo ou 100% do pai */
@media (max-width: 1023px) {
    .tradingview-widget-container {
        height: 100%;
        /* Ou min-height: 500px se o container pai não tiver altura fixa */
    }
}

body :where(figure) {
    margin: 0;
}

:is(.archive, .search) .grid-posts-01 .post-item-category-02 {
    color: #FFF !important;
}

@media (max-width: 768px) {
    body.wp-singular .wrapper {
        max-width: 90%;
    }
}
