/**
 * responsive.css
 * Breakpoints do portal.
 * Objetivo: nenhuma seção extrapolar a viewport, inclusive menus aninhados.
 */

@media (max-width: 1180px) {
    .main-nav {
        gap: 18px;
    }

    .brand {
        width: 104px;
        min-width: 104px;
    }

    .brand picture,
    .brand img {
        width: 96px;
        height: 96px;
    }

    .primary-nav {
        gap: 12px;
    }

    .primary-nav__list > li > a,
    .nav-parent {
        padding-inline: 9px;
        font-size: .72rem;
    }

    .services-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .topbar__links > a:nth-child(-n+2) {
        display: none;
    }

    .main-nav {
        min-height: 92px;
    }

    .brand {
        width: 90px;
        min-width: 90px;
    }

    .brand picture,
    .brand img {
        width: 82px;
        height: 82px;
    }

    .mobile-menu-toggle {
        display: block;
        margin-left: auto;
    }

    .primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: block;
        max-height: 0;
        overflow: hidden;
        padding: 0 20px;
        border-top: 1px solid var(--line);
        background: #fff;
        box-shadow: 0 16px 30px rgba(7,35,74,.12);
        opacity: 0;
        transition: max-height 350ms ease, opacity 200ms ease, padding 350ms ease;
    }

    .primary-nav.is-open {
        max-height: calc(100vh - 92px);
        overflow-y: auto;
        padding-top: 16px;
        padding-bottom: 22px;
        opacity: 1;
    }

    .primary-nav__list {
        display: block;
    }

    .primary-nav__list > li {
        display: block;
        border-bottom: 1px solid #edf0f4;
    }

    .primary-nav__list > li > a,
    .nav-parent {
        width: 100%;
        min-height: 52px;
        justify-content: space-between;
        padding: 0 4px;
        font-size: .83rem;
        text-align: left;
    }

    .primary-nav__list > li > a::after,
    .nav-parent::after {
        display: none;
    }

    .primary-nav__cta {
        width: 100%;
        margin-top: 18px;
    }

    .submenu,
    .mega-menu,
    .nested-submenu__panel {
        position: static;
        width: 100%;
        min-width: 0;
        display: none;
        margin: 0 0 10px;
        padding: 6px 0 8px 12px;
        border: 0;
        border-left: 2px solid #d8e5f8;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none !important;
    }

    .has-submenu:hover > .submenu,
    .has-submenu:focus-within > .submenu,
    .nested-submenu:hover > .nested-submenu__panel,
    .nested-submenu:focus-within > .nested-submenu__panel {
        display: none;
    }

    .has-submenu.is-open > .submenu,
    .nested-submenu.is-open > .nested-submenu__panel {
        display: block;
    }

    .mega-menu {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .mega-menu__title {
        padding-left: 10px;
        margin-top: 4px;
    }

    .nested-submenu__trigger {
        min-height: 44px;
    }

    .nested-submenu__trigger i {
        transform: rotate(90deg);
    }

    .news-layout {
        grid-template-columns: 1fr;
    }

    .section-intro {
        max-width: 580px;
    }

    .posts-track {
        grid-template-columns: repeat(3, minmax(260px, 1fr));
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 10px;
    }

    .post-card {
        scroll-snap-align: start;
    }

    .services-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 800px) {
    .section {
        padding: 66px 0;
    }

    .topbar__contacts {
        width: 100%;
        justify-content: center;
    }

    .topbar__contacts .topbar__hours,
    .topbar__contacts > a:nth-of-type(2),
    .topbar__separator,
    .topbar__links {
        display: none;
    }

    .main-nav {
        min-height: 84px;
    }

    .brand {
        width: 78px;
        min-width: 78px;
    }

    .brand picture,
    .brand img {
        width: 72px;
        height: 72px;
    }

    /*.hero {
        min-height: 560px;
        align-items: flex-end;
    } */
    .hero {
        min-height: 520px;

        background:
            linear-gradient(
                90deg,
                rgba(4, 39, 86, 0.96) 0%,
                rgba(4, 39, 86, 0.90) 55%,
                rgba(4, 39, 86, 0.72) 100%
            ),
            url("https://www.graficos.org.br/portal/assets/img/fachada.png");

        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .hero__media::before {
        width: 78%;
        height: 60%;
        right: -18%;
    }

    .hero__overlay {
        background: linear-gradient(180deg, rgba(4,33,73,.55) 0%, rgba(4,35,78,.84) 42%, rgba(3,29,66,.98) 100%);
    }

    .hero__content {
        padding-bottom: 72px;
    }

    .hero__copy {
        max-width: 100%;
    }

    .hero h1 {
        font-size: clamp(2.8rem, 11vw, 4.6rem);
    }

    .hero__controls {
        bottom: 16px;
        right: 20px;
    }

    .about-grid,
    .split-feature,
    .history-grid {
        grid-template-columns: 1fr;
    }

    .split-feature,
    .history-grid {
        gap: 34px;
    }

    .history-year {
        font-size: 6.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .membership-cta {
        grid-template-columns: auto 1fr;
    }

    .membership-cta .btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(calc(100% - 28px), var(--container));
    }

    .topbar__inner {
        min-height: 32px;
    }

    .main-nav {
        min-height: 78px;
    }

    .brand {
        width: 72px;
        min-width: 72px;
    }

    .brand picture,
    .brand img {
        width: 66px;
        height: 66px;
    }

    .mobile-menu-toggle {
        width: 42px;
        height: 42px;
    }

    .hero {
        min-height: 590px;
    }

    .hero__eyebrow {
        font-size: .68rem;
    }

    .hero p {
        font-size: .95rem;
    }

    .hero__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero__actions .btn {
        width: 100%;
    }

    .section-intro h2,
    .about-card h2,
    .split-feature h2,
    .history-content h2 {
        font-size: 2rem;
    }

    .posts-track {
        grid-template-columns: repeat(3, 82vw);
        gap: 16px;
    }

    .post-card__media {
        height: 180px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        min-height: 0;
        display: grid;
        grid-template-columns: 58px 1fr;
        column-gap: 14px;
        text-align: left;
    }

    .service-card__icon {
        grid-row: span 2;
        width: 54px;
        height: 54px;
        margin: 0;
    }

    .service-card h3 {
        align-self: end;
    }

    .about-card {
        padding: 26px;
    }

    .split-feature__visual {
        min-height: 240px;
    }

    .membership-cta {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 26px 20px;
    }

    .membership-cta__icon {
        margin-inline: auto;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand,
    .footer-column {
        grid-column: auto;
    }

    .whatsapp-float {
        width: 52px;
        height: 52px;
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 380px) {
    .brand {
        width: 68px;
        min-width: 68px;
    }

    .brand picture,
    .brand img {
        width: 62px;
        height: 62px;
    }
}
