/* ==========================================================
   JORNAL DO PRÉDIO — RESPONSIVIDADE GLOBAL

   Este arquivo deve ser carregado por último, depois dos
   estilos específicos de cada página.
========================================================== */

html {
    overflow-x: hidden;
}

body,
.site-frame {
    min-width: 0;
    overflow-x: hidden;
}

img,
picture,
video,
iframe,
svg {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}


/* ==========================================================
   TABLETS E CELULARES
========================================================== */

@media (max-width: 767px) {

    /* ------------------------------------------------------
       ESTRUTURA GERAL
    ------------------------------------------------------ */

    .editorial-container,
    .institucional-container {
        box-sizing: border-box;
        width: calc(100% - 28px);
        max-width: none;
        margin-right: auto;
        margin-left: auto;
    }

    main,
    section,
    article,
    aside,
    header,
    footer,
    form,
    div {
        min-width: 0;
    }

    h1,
    h2,
    h3,
    p,
    a,
    span,
    strong {
        overflow-wrap: break-word;
    }

    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }


    /* ------------------------------------------------------
       BARRA SUPERIOR
    ------------------------------------------------------ */

    .topbar,
    .topbar-inner {
        height: auto;
        min-height: 38px;
    }

    .topbar-inner {
        gap: 10px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .topbar-left,
    .topbar-right {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .topbar-right {
        justify-content: flex-end;
        margin-left: auto;
    }

    .topbar span,
    .topbar a {
        gap: 5px;
        font-size: 9px;
        white-space: nowrap;
    }


    /* ------------------------------------------------------
       LOGO E MENU
    ------------------------------------------------------ */

    .editorial-header {
        min-height: 150px;
    }

    .masthead {
        height: 150px;
        min-height: 150px;
    }

    .masthead-logo {
        width: min(220px, 68vw);
        height: 92px;
    }

    .masthead-tagline {
        box-sizing: border-box;
        gap: 9px;
        max-width: 100%;
        padding: 0 8px;
    }

    .masthead-tagline span {
        width: 30px;
    }

    .masthead-tagline p {
        font-size: 10px;
        line-height: 1.3;
        text-align: center;
    }

    .mobile-menu-button {
        box-sizing: border-box;
        min-height: 46px;
        width: 100%;
        padding: 0;
    }

    .main-menu-links a,
    .main-menu-links a:first-child {
        box-sizing: border-box;
        min-height: 44px;
        height: auto;
        padding: 11px 0;
        white-space: normal;
    }

    .main-menu-actions {
        box-sizing: border-box;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .header-newsletter-button {
        flex: 1;
        min-width: 150px;
    }


    /* ------------------------------------------------------
       LINHA EM DESTAQUE
    ------------------------------------------------------ */

    .highlight-bar-inner {
        gap: 9px;
        overflow: hidden;
    }

    .highlight-bar-inner p,
    .highlight-text {
        min-width: 0;
        overflow: hidden;
    }

    .highlight-link {
        min-width: 0;
        width: 100%;
    }

    .highlight-title {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }


    /* ------------------------------------------------------
       HOME — CAPA PRINCIPAL
    ------------------------------------------------------ */

    .editorial-cover {
        padding-top: 16px;
    }

    .main-headline-image {
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .main-headline-image img {
        height: 100%;
        object-fit: cover;
    }

    .main-headline-content {
        padding-top: 11px;
    }

    .main-headline-content h1 {
        max-width: 100%;
        font-size: clamp(27px, 8.2vw, 34px);
        line-height: 1.06;
        letter-spacing: -0.025em;
    }

    .main-headline-content > p {
        font-size: 12px;
        line-height: 1.5;
    }

    .main-headline-metadata,
    .article-metadata {
        row-gap: 4px;
    }

    .secondary-news-column,
    .most-read-column {
        width: 100%;
    }

    .most-read-column {
        order: 3;
        padding: 22px 0 0;
        border-top: 1px solid var(--border);
    }

    .most-read-column li {
        min-height: 68px;
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .most-read-position {
        font-size: 30px;
    }

    .editorial-section-heading h2 {
        font-size: clamp(22px, 7vw, 28px);
    }

    .latest-main-title,
    .special-main-title,
    .custom-newspaper-copy h2 {
        font-size: clamp(22px, 7vw, 28px);
        line-height: 1.1;
    }


    /* ------------------------------------------------------
       BLOG
    ------------------------------------------------------ */

    .blog-page {
        padding-bottom: 30px;
    }

    .blog-header-title h1,
    .search-header h1,
    .article-header h1 {
        font-size: clamp(28px, 8vw, 38px);
        line-height: 1.08;
    }

    .blog-featured-content h2 {
        font-size: clamp(24px, 7vw, 31px);
        line-height: 1.1;
    }

    .blog-categories,
    .search-categories {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .blog-category-link,
    .search-category-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .article-body,
    .article-content {
        overflow-wrap: anywhere;
    }

    .article-body img,
    .article-content img,
    .article-body iframe,
    .article-content iframe {
        height: auto;
        max-width: 100%;
    }


    /* ------------------------------------------------------
       PRESTADORES
    ------------------------------------------------------ */

    .providers-header-copy h1,
    .provider-detail-title h1,
    .provider-budget-header h1 {
        font-size: clamp(27px, 8vw, 36px);
        line-height: 1.08;
    }

    .providers-search-form,
    .provider-budget-form-grid {
        grid-template-columns: 1fr;
    }

    .provider-result-card,
    .provider-detail-content,
    .provider-budget-layout {
        max-width: 100%;
    }

    .provider-result-commercial {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }

    .provider-result-button {
        box-sizing: border-box;
        width: 100%;
    }


    /* ------------------------------------------------------
       GUIA IMOBILIÁRIO
    ------------------------------------------------------ */

    .realty-header-copy h1,
    .realty-detail-copy h1 {
        font-size: clamp(27px, 8vw, 36px);
        line-height: 1.08;
    }

    .realty-detail-cover {
        height: auto;
        min-height: 190px;
        aspect-ratio: 16 / 7;
    }

    .realty-detail-cover img {
        height: 100%;
        object-fit: cover;
    }

    .realty-detail-description {
        line-height: 1.55;
        text-align: left;
    }

    .realty-detail-sidebar-publicidade,
    .provider-detail-sidebar .provider-detail-ad-dynamic,
    .providers-sidebar .providers-sidebar-ad {
        max-width: 100%;
    }


    /* ------------------------------------------------------
       PÁGINAS INSTITUCIONAIS
    ------------------------------------------------------ */

    .institucional-title,
    .jornal-personalizado-hero__title,
    .portfolio-hero__title,
    .portfolio-detail-hero__title,
    .legal-hero h1 {
        font-size: clamp(30px, 9vw, 42px);
        line-height: 1.08;
        letter-spacing: -0.025em;
    }

    .institucional-section {
        padding-top: 42px;
        padding-bottom: 42px;
    }

    .institucional-section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }


    /* ------------------------------------------------------
       FORMULÁRIOS E BOTÕES
    ------------------------------------------------------ */

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    button:not(.flash-close-button):not(.flash-message-close) {
        box-sizing: border-box;
        min-height: 44px;
    }

    textarea {
        min-height: 120px;
    }

    .error-section {
        width: calc(100% - 28px);
    }


    /* ------------------------------------------------------
       PUBLICIDADE
    ------------------------------------------------------ */

    .publicidade-bloco,
    .publicidade-bloco__conteudo,
    .publicidade-direta,
    .publicidade-direta picture,
    .publicidade-direta img {
        max-width: 100%;
    }

    .publicidade-bloco--fixo
    .publicidade-bloco__conteudo {
        width: 100%;
        overflow: hidden;
    }

    .publicidade-direta img {
        object-fit: contain;
    }

    .special-sidebar > .publicidade-bloco--lateral {
        align-self: start;
        justify-self: center;
        margin-right: auto;
        margin-left: auto;
        max-width: 300px;
        width: min(100%, 300px);
    }

    .special-sidebar > .publicidade-bloco--lateral
    .publicidade-bloco__conteudo,
    .special-sidebar > .publicidade-bloco--lateral
    .publicidade-bloco__placeholder {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .special-sidebar > .publicidade-bloco--lateral
    .publicidade-bloco__conteudo {
        justify-content: center;
        overflow: hidden;
    }

    .special-sidebar >
    .publicidade-bloco--lateral.publicidade-bloco--sem-preenchimento
    .adsbygoogle {
        display: none !important;
    }

    .special-sidebar >
    .publicidade-bloco--lateral.publicidade-bloco--sem-preenchimento
    .publicidade-bloco__placeholder {
        display: flex !important;
    }

    .newsletter-privacy-check {
        align-items: flex-start;
        display: flex;
        gap: 7px;
        width: 100%;
    }

    .newsletter-privacy-check input[type="checkbox"] {
        flex: 0 0 14px;
        height: 14px;
        margin: 1px 0 0;
        min-height: 0;
        padding: 0;
        width: 14px;
    }


    /* ------------------------------------------------------
       RODAPÉ
    ------------------------------------------------------ */

    .footer-bottom,
    .footer-bottom__links {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}


/* ==========================================================
   CELULARES PEQUENOS
========================================================== */

@media (max-width: 480px) {

    .editorial-container,
    .institucional-container,
    .error-section {
        width: calc(100% - 20px);
    }

    .topbar-left,
    .topbar-right {
        gap: 7px 9px;
    }

    .topbar span,
    .topbar a {
        font-size: 8px;
    }

    .editorial-header,
    .masthead {
        height: 138px;
        min-height: 138px;
    }

    .masthead-logo {
        width: min(195px, 66vw);
        height: 82px;
    }

    .masthead-tagline span {
        width: 26px;
    }

    .masthead-tagline p {
        font-size: 9px;
    }

    .highlight-label {
        padding-right: 7px;
        padding-left: 7px;
        font-size: 7px;
    }

    .highlight-title {
        font-size: 9px;
    }

    .editorial-cover {
        padding-top: 14px;
    }

    .main-headline-image {
        aspect-ratio: 4 / 3;
    }

    .main-headline-content h1 {
        font-size: clamp(26px, 8.4vw, 32px);
        line-height: 1.05;
    }

    .main-headline-content > p {
        font-size: 11px;
    }

    .blog-article-card,
    .search-result-card {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .blog-card-image-link,
    .search-result-image {
        height: 94px;
    }

    .providers-header-copy h1,
    .provider-detail-title h1,
    .realty-header-copy h1,
    .realty-detail-copy h1 {
        font-size: 28px;
    }

    .realty-detail-cover {
        min-height: 175px;
        aspect-ratio: 16 / 9;
    }

    .realty-detail-hero {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .realty-detail-logo {
        height: 62px;
    }

    .institucional-btn,
    .error-primary-button,
    .error-secondary-button {
        box-sizing: border-box;
        width: 100%;
    }

    .publicidade-direta__texto {
        padding: 16px;
    }

    .publicidade-direta__texto strong {
        font-size: 20px;
    }
}


/* ==========================================================
   ACESSIBILIDADE
========================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* ==========================================================
   IMOBILIÁRIO — CAPA COMPLETA NO CELULAR
========================================================== */

@media (max-width: 480px) {

    .realty-detail-cover {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: auto;
        background-color: #eef1f2;
        overflow: hidden;
    }

    .realty-detail-cover picture {
        display: block;
        width: 100%;
    }

    .realty-detail-cover img {
        display: block;
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
        object-position: center;
    }
}
