/* Mobile-first: reforços até ~839px; grids em coluna única vêm do style.css base */

@media (max-width: 839px) {
    body {
        background-attachment: scroll, scroll;
        background-position: center top;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 10px 14px;
        font-family: inherit;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
        z-index: 102;
    }

    .menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px;
        margin: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
        position: absolute;
        right: 0;
        top: calc(100% + 6px);
        width: min(320px, calc(100vw - 2rem));
        box-shadow: var(--shadow);
        z-index: 101;
    }

    .menu li {
        width: 100%;
    }

    .menu a {
        display: block;
        padding: 12px 14px;
        border-radius: 10px;
        font-weight: 600;
    }

    .menu a:hover,
    .menu a:focus-visible {
        background: rgba(15, 76, 129, 0.06);
        text-decoration: none;
    }

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

    .menu.open {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }

    .footer-grid .list-unstyled {
        text-align: center;
    }

    .hero-grid,
    .cta-grid,
    .contact-grid {
        gap: 20px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .cta-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .map-wrap iframe {
        min-height: 220px;
    }

    .split {
        gap: 20px;
    }

    .portfolio-gallery {
        grid-auto-columns: 92%;
    }

    .portfolio-grid {
        grid-auto-columns: minmax(260px, 86%);
    }

    .lightbox-dialog {
        width: 92vw;
        max-width: 92vw;
        height: 78vh;
        max-height: 78vh;
    }

    .lightbox-content {
        height: 78vh;
    }

    .lightbox-toolbar {
        min-height: 54px;
        padding: 8px;
    }

    .lightbox-title {
        font-size: 0.9rem;
    }

    .lightbox-controls {
        gap: 6px;
    }

    .lightbox-control {
        min-width: 40px;
        min-height: 40px;
    }

    .lightbox-reset {
        min-width: 56px;
    }

    .lightbox-stage {
        height: calc(100% - 54px);
    }
}

/* Tablet: duas colunas onde faz sentido */
@media (min-width: 520px) and (max-width: 839px) {
    .cards-grid,
    .testimonials-grid,
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-auto-columns: minmax(280px, 56%);
    }
}

/* Desktop e telas largas */
@media (min-width: 840px) {
    .hero-grid,
    .cta-grid,
    .contact-grid {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
    }

    .split {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

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

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

/* Telas muito estreitas */
@media (max-width: 380px) {
    .eyebrow {
        font-size: 0.72rem;
    }

    .card {
        padding: 16px;
    }
}

/* Prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    .btn,
    .menu-toggle {
        transition: none;
    }
}
