html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.map-facade {
    cursor: pointer;
    transition: filter 0.2s ease;
}
.map-facade:hover,
.map-facade:focus-visible {
    filter: brightness(1.05);
}
.map-facade svg {
    user-select: none;
    pointer-events: none;
}

/* content-visibility: auto pula render+paint de seções fora da viewport.
 * Ganho real de Total Blocking Time e Speed Index em listas longas.
 * contain-intrinsic-size evita "pulo" do scroll ao entrar na viewport.
 */
#sobre,
#especialidades,
#equipe,
#depoimentos,
#faq {
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}
#contato {
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
}
footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

*:focus-visible {
    outline: 2px solid #2B6B73;
    outline-offset: 3px;
    border-radius: 4px;
}

a, button, summary {
    -webkit-tap-highlight-color: rgba(43, 107, 115, 0.15);
}

summary {
    list-style: none;
}
summary::-webkit-details-marker {
    display: none;
}
summary::after {
    content: ' +';
    color: #2B6B73;
    font-weight: 700;
    float: right;
    transition: transform 0.2s;
}
details[open] summary::after {
    content: ' −';
}

@media (max-width: 320px) {
    h1 {
        font-size: 1.25rem !important;
        line-height: 1.1 !important;
    }

    h2 {
        font-size: 1.125rem !important;
        line-height: 1.2 !important;
    }

    .px-8,
    .p-8,
    .p-12,
    .px-4,
    .py-24,
    .py-12 {
        padding: 0.75rem !important;
    }

    nav .flex.justify-between {
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center;
    }

    nav a.flex.items-center svg {
        width: 110px !important;
        height: auto !important;
    }

    ul>li.flex.justify-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px;
    }

    .flex-grow.border-b-\[1\.5px\] {
        display: none;
    }

    .text-xl {
        font-size: 1rem !important;
    }

    .text-lg {
        font-size: 0.9rem !important;
    }

    .w-40 {
        width: 80px !important;
        height: 80px !important;
    }

    .text-4xl,
    .text-5xl,
    .text-6xl,
    .text-7xl {
        font-size: 1.25rem !important;
    }

    .gap-8,
    .gap-12,
    .gap-16,
    .gap-6,
    .gap-4 {
        gap: 1rem !important;
    }

    iframe {
        min-height: 250px !important;
    }
}

@media (max-width: 250px) {
    h1, h2, h3 {
        font-size: 1rem !important;
        line-height: 1.15 !important;
        word-break: break-word;
    }
    .max-w-7xl, .max-w-3xl, .max-w-2xl, .max-w-sm {
        max-width: 100% !important;
    }
    .grid {
        grid-template-columns: 1fr !important;
    }
    .px-4, .px-6, .px-8, .p-6, .p-8, .p-12, .py-12, .py-20, .py-24 {
        padding: 0.5rem !important;
    }
    .gap-4, .gap-6, .gap-8, .gap-12, .gap-16 {
        gap: 0.5rem !important;
    }
    .text-base, .text-lg, .text-xl, .text-2xl, .text-3xl, .text-4xl, .text-5xl, .text-6xl, .text-7xl {
        font-size: 0.85rem !important;
    }
    .w-32, .w-40, .h-32, .h-40 {
        width: 56px !important;
        height: 56px !important;
    }
    nav .flex.justify-between {
        flex-direction: column !important;
        gap: 4px !important;
    }
    iframe {
        min-height: 200px !important;
    }
}

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

@media (prefers-color-scheme: dark) {
    /* mantém o tema light explicitamente para evitar inversão indesejada */
    html { color-scheme: light; }
}

body,
html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

img {
    pointer-events: none;
    max-width: 100%;
    height: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-to-content {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: #2B6B73;
    color: #fff;
    opacity: 0;
}
.skip-to-content:focus {
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
}

@media print {
    nav, footer, #lgpd-banner, .whatsapp-float, iframe { display: none !important; }
    body { color: #000; background: #fff; }
    a[href]:after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
