/* ═══════════════════════════════════════════════════════════
   RESPONSIVIDADE — Mobile First
   COMSAF
═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════
   TABLETS GRANDES / DESKTOP MÉDIO
   max-width: 1200px
══════════════════════════════════ */
@media (max-width: 1200px) {
    :root {
        --header-main-h: 72px;
    }

    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    .footer-newsletter-col {
        grid-column: 1 / -1;
        max-width: 480px;
    }

    .numbers-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .about-grid {
        gap: var(--space-10);
    }

    .about-img-stack {
        height: 440px;
    }
}

/* ══════════════════════════════════
   TABLET
   max-width: 1024px
══════════════════════════════════ */
@media (max-width: 1024px) {
    /* Header */
    .topbar-left .topbar-location {
        display: none;
    }

    /* Nav — colapsa */
    .header-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 85vw);
        background: var(--white);
        box-shadow: -4px 0 40px rgba(0,0,0,0.15);
        z-index: var(--z-modal);
        padding: var(--space-16) var(--space-6) var(--space-8);
        transform: translateX(100%);
        transition: transform var(--duration-slow) var(--ease-out);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .header-nav.open {
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-1);
    }

    .nav-link {
        padding: var(--space-3) var(--space-4);
        font-family: var(--font-primary);
        font-size: var(--fs-base);
        font-weight: var(--fw-semibold);
        color: var(--text-primary);
        border-radius: var(--radius-lg);
        justify-content: space-between;
    }

    .nav-link::after {
        display: none;
    }

    .nav-list .dropdown-menu,
    .nav-list > li > .sub-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        box-shadow: none;
        border: none;
        padding: 0 0 0 var(--space-4);
        background: var(--green-25);
        border-radius: var(--radius-lg);
        margin-top: var(--space-1);
        display: none;
    }

    .nav-list .dropdown-menu::before,
    .nav-list > li > .sub-menu::before {
        display: none;
    }

    .nav-list .dropdown-menu a,
    .nav-list .sub-menu a {
        font-family: var(--font-primary);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        color: var(--text-primary);
    }

    .nav-list > li.has-dropdown.dropdown-open > .dropdown-menu,
    .nav-list > li.has-dropdown.dropdown-open > .sub-menu,
    .nav-list > li.menu-item-has-children.dropdown-open > .sub-menu,
    .nav-list > li.menu-item-has-children.dropdown-open > .dropdown-menu {
        display: block;
        transform: none !important;
        left: auto;
        top: auto;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: all !important;
    }

    .hamburger {
        display: flex;
    }

    .header-actions .btn-outline-header span {
        display: none;
    }

    .header-actions .btn-outline-header {
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 0;
        justify-content: center;
    }

    /* Overlay */
    .nav-overlay {
        display: block;
    }

    /* Serviços */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Sobre */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .about-visual {
        max-width: 560px;
        margin-inline: auto;
    }

    .about-img-stack {
        height: 400px;
    }

    /* Contato */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-details {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
}

/* ══════════════════════════════════
   TABLET PEQUENO / MOBILE GRANDE
   max-width: 768px
══════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --header-topbar-h: 36px;
        --header-main-h: 64px;
    }

    /* Topbar */
    .topbar-left .topbar-link:nth-child(2) {
        display: none;
    }

    .btn-accessibility span {
        display: none;
    }

    /* Hero */
    .hero-section {
        height: 100svh;
        min-height: 520px;
        max-height: none;
    }

    .slide-desc {
        display: none;
    }

    .slide-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .slide-actions {
        gap: var(--space-3);
    }

    .btn-primary-hero,
    .btn-secondary-hero {
        padding: 12px 24px;
        font-size: var(--fs-xs);
    }

    .slider-arrow {
        width: 42px;
        height: 42px;
        font-size: var(--fs-sm);
    }

    .slider-prev { left: var(--space-4); }
    .slider-next { right: var(--space-4); }

    .scroll-down-hint {
        display: none;
    }

    /* Editais (página) */
    .edital-item {
        grid-template-columns: 1fr;
        grid-template-areas:
            "head"
            "title"
            "meta"
            "actions";
    }

    .edital-item__meta {
        grid-template-columns: 1fr;
    }

    .edital-item__actions {
        justify-self: start;
    }

    /* Números */
    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Divisores: remove o vertical, adiciona horizontal entre linhas */
    .number-item + .number-item::before {
        display: none;
    }

    .number-item:nth-child(n+3) {
        border-top: 1px solid var(--gray-200);
    }

    .number-item:nth-child(even)::after {
        display: none;
    }

    .number-item {
        padding: var(--space-8) var(--space-4);
    }

    /* Divisor vertical apenas no item par (direita) */
    .number-item:nth-child(2)::before,
    .number-item:nth-child(4)::before {
        display: block;
    }

    /* Serviços */
    .services-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin-inline: auto;
    }

    /* Sobre */
    .about-img-stack {
        height: 340px;
    }

    .about-img-main {
        width: 85%;
        height: 320px;
    }

    .about-img-secondary {
        width: 50%;
        height: 200px;
    }

    .about-badge {
        right: -10px;
        width: 90px;
        height: 90px;
    }

    .about-badge .badge-num {
        font-size: var(--fs-xl);
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    /* Notícias */
    .news-card {
        flex: 0 0 calc(100% - 2rem);
    }

    .news-carousel-container {
        gap: var(--space-2);
    }

    .news-carousel-container .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: var(--fs-xs);
    }

    /* Depoimentos */
    .testimonial-card {
        padding: var(--space-8) var(--space-6);
    }

    /* Contato */
    .contact-details {
        grid-template-columns: 1fr;
    }

    .contact-form-box {
        padding: var(--space-6);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* CTA */
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn-cta-primary,
    .btn-cta-secondary {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-brand {
        padding-right: 0;
    }

    .footer-newsletter-col {
        grid-column: auto;
        max-width: none;
    }

    .footer-bottom .container {
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }

    /* Back to top */
    .back-to-top {
        right: var(--space-4);
        bottom: var(--space-6);
        width: 44px;
        height: 44px;
    }

    /* Acessibilidade */
    .a11y-panel {
        width: 100%;
        border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
        top: auto;
        bottom: 0;
        right: 0;
        transform: translateY(100%);
    }

    .a11y-panel.open {
        transform: translateY(0);
    }

    .a11y-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* ══════════════════════════════════
   MOBILE PEQUENO
   max-width: 480px
══════════════════════════════════ */
@media (max-width: 480px) {
    :root {
        --section-pad-y: var(--space-12);
    }

    .container {
        padding-inline: var(--space-4);
    }

    /* Topbar */
    .header-topbar .topbar-left {
        gap: var(--space-3);
    }

    .topbar-link i {
        display: none;
    }

    /* Header — Transparência como ícone (ver max-width: 1024px) */

    /* Hero */
    .slide-tag {
        font-size: 10px;
        padding: 4px 12px;
    }

    .slide-title {
        font-size: clamp(1.5rem, 8vw, 2rem);
    }

    .btn-secondary-hero {
        display: none;
    }

    /* Números */
    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .number-item {
        padding: var(--space-6) var(--space-3);
    }

    .number-icon {
        width: 46px;
        height: 46px;
        font-size: 1.1rem;
    }

    .number-value {
        font-size: 1.9rem;
    }

    /* Sobre */
    .about-img-stack {
        height: 280px;
    }

    .about-img-main {
        width: 88%;
        height: 260px;
        border-radius: var(--radius-xl);
    }

    .about-img-secondary {
        width: 55%;
        height: 160px;
        border-radius: var(--radius-xl);
    }

    .about-badge {
        width: 76px;
        height: 76px;
        right: -4px;
    }

    .about-badge .badge-num {
        font-size: var(--fs-lg);
    }

    .about-lead {
        font-size: var(--fs-base);
    }

    .about-actions {
        flex-direction: column;
    }

    .about-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Cards de notícia */
    .news-card {
        flex: 0 0 calc(100vw - 3rem);
    }

    /* Depoimento */
    .testimonial-text {
        font-size: var(--fs-base);
    }

    .testimonial-footer {
        flex-wrap: wrap;
    }

    /* Footer legal */
    .footer-legal {
        gap: var(--space-4);
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Section header */
    .section-title {
        font-size: var(--fs-2xl);
    }

    .section-desc {
        font-size: var(--fs-base);
    }
}

/* ══════════════════════════════════
   REDUÇÕES DE MOVIMENTO
══════════════════════════════════ */
@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;
    }

    .slide-bg {
        transform: none !important;
        transition: none !important;
    }

    .partners-marquee {
        animation: none;
    }

    .about-badge {
        animation: none;
    }

    .scroll-wheel {
        animation: none;
    }
}

/* ══════════════════════════════════
   IMPRESSÃO
══════════════════════════════════ */
@media print {
    .site-header,
    .hero-section,
    .back-to-top,
    .a11y-panel,
    .scroll-progress,
    .hamburger,
    .slider-arrow,
    .carousel-arrow {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .container {
        max-width: 100%;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }
}
