/* ============================================================
   BERIZAL PORTAL — RESPONSIVE STYLES
   Breakpoints: 1200px, 1024px, 768px, 640px, 480px
   ============================================================ */

/* ==================== 1200px ==================== */
@media (max-width: 1200px) {
    :root {
        --container-pad: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
        gap: var(--sp-8);
    }

    .news-layout {
        grid-template-columns: 1fr 300px;
    }

    .quick-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* ==================== 1024px ==================== */
@media (max-width: 1024px) {
    /* Turismo */
    .turismo-spotlight {
        grid-template-columns: 1fr;
    }

    .turismo-spotlight__visual {
        min-height: 240px;
        max-height: 320px;
    }

    .turismo-spotlight__img {
        min-height: 240px;
        max-height: 320px;
    }

    /* Reels */
    .reels-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Navigation font size */
    .nav-link {
        padding: var(--sp-2) var(--sp-2);
        font-size: var(--fs-xs);
    }

    .nav-link span {
        display: none;
    }

    .nav-link i:first-child {
        font-size: 1rem;
    }

    .nav-link .nav-arrow {
        display: none;
    }

    .nav-list {
        gap: 0;
    }

    /* Footer grid */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-8);
    }

    .footer-col--brand {
        grid-column: span 2;
    }

    /* Docs grid */
    .docs-grid {
        grid-template-columns: 1fr;
    }

    /* Stats */
    .stat-item {
        padding: var(--sp-2) var(--sp-5);
    }

    .stat-num {
        font-size: var(--fs-lg);
    }

    /* Secretarias */
    .sec-card {
        flex: 0 0 calc(33.333% - var(--sp-3));
    }

    /* Services */
    .servicos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-item--large {
        grid-column: span 2;
        grid-row: span 1;
    }

    .gallery-item--large .gallery-img {
        height: 300px;
    }
}

/* ==================== 900px ==================== */
@media (max-width: 900px) {
    /* Show hamburger */
    .btn-hamburger {
        display: flex;
    }

    /* Full screen mobile nav */
    .nav {
        position: fixed;
        top: calc(var(--topbar-height) + var(--header-height));
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--clr-white);
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--sp-6);
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform var(--dur-slow) var(--ease);
        z-index: var(--z-overlay);
        box-shadow: var(--shadow-xl);
    }

    .nav.nav--open {
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: var(--sp-1);
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: var(--sp-4) var(--sp-4);
        font-size: var(--fs-base);
        border-radius: var(--r-md);
        width: 100%;
        justify-content: flex-start;
    }

    .nav-link span {
        display: block;
        flex: 1;
    }

    .nav-link .nav-arrow {
        display: block;
    }

    .nav-link i:first-child {
        font-size: var(--fs-base);
        width: 24px;
    }

    /* Mobile dropdown */
    .dropdown {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border-radius: var(--r-md);
        background: var(--clr-light);
        border: 1px solid var(--clr-border);
        padding: var(--sp-2);
        margin-top: var(--sp-1);
        display: none;
        pointer-events: auto;
        min-width: unset;
    }

    .dropdown::before {
        display: none;
    }

    .nav-item.has-dropdown.open .dropdown {
        display: block;
    }

    .nav-item.has-dropdown.open .nav-arrow {
        transform: rotate(180deg);
    }

    /* Topbar simplified */
    .topbar-left .topbar-info,
    .topbar-left .topbar-link:last-child {
        display: none;
    }

    /* Logo */
    .logo-state {
        display: none;
    }

    .logo-city {
        font-size: var(--fs-base);
    }

    /* News layout */
    .news-layout {
        grid-template-columns: 1fr;
    }

    .news-layout--carousel {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
    }

    .news-layout--carousel .news-featured-viewport {
        min-height: 300px;
    }

    .news-aside:not(.news-aside--mosaic) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-4);
    }

    .news-layout--carousel .news-card--tile-wide {
        grid-template-columns: minmax(140px, 38%) minmax(0, 1fr);
    }

    /* Quick grid */
    .quick-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* CTA Grid */
    .cta-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-inline: auto;
    }

    /* Video */
    .video-section {
        padding-block: var(--sp-16);
    }
}

/* ==================== 768px ==================== */
@media (max-width: 768px) {
    /* Turismo */
    .turismo-highlights {
        grid-template-columns: 1fr;
        gap: var(--sp-3);
        margin-bottom: var(--sp-8);
    }

    .turismo-highlight {
        padding: var(--sp-4) var(--sp-5);
    }

    .turismo-grid-heading {
        text-align: left;
        margin-inline: 0;
    }

    /* Reels */
    .reels-grid {
        grid-template-columns: 1fr;
        max-width: 380px;
        margin-inline: auto;
    }

    /* Services */
    .servicos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hero search */
    .hero-search-form {
        flex-direction: column;
        border-radius: var(--r-xl);
        padding: var(--sp-3);
    }

    .hero-search-btn {
        width: 100%;
        justify-content: center;
    }


    /* Section spacing */
    .section {
        padding-block: var(--sp-16);
    }

    .section-title {
        font-size: var(--fs-2xl);
    }

    /* Hero */
    .hero-slider {
        max-height: 700px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-cta--center {
        align-items: center;
    }

    .hero-slider--video + .hero-scroll-hint {
        bottom: 128px;
    }

    .hero-scroll-hint {
        display: none;
    }

    /* Stats Bar */
    .stats-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--sp-1);
        padding-block: var(--sp-3);
    }

    .stat-item {
        padding: var(--sp-2) var(--sp-4);
    }

    .stat-divider {
        display: none;
    }

    /* Secretarias carousel */
    .sec-card {
        flex: 0 0 calc(50% - var(--sp-2));
    }

    /* Services */
    .servicos-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Docs */
    .docs-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-8);
    }

    .footer-col--brand {
        grid-column: span 1;
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }

    /* Topbar */
    .accessibility-label {
        display: none;
    }
}

/* ==================== 640px ==================== */
@media (max-width: 640px) {
    /* Quick access */
    .quick-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--sp-3);
    }

    .quick-icon-wrap {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .quick-card {
        padding: var(--sp-4) var(--sp-2);
    }

    /* News layout */
    .news-aside:not(.news-aside--mosaic) {
        grid-template-columns: 1fr;
    }

    .news-layout--carousel .news-aside--mosaic {
        grid-template-columns: 1fr;
    }

    .news-layout--carousel .news-card--tile-wide {
        grid-template-columns: 1fr;
    }

    .news-layout--carousel .news-card--tile-wide .news-img {
        min-height: 200px;
        aspect-ratio: 16 / 9;
    }

    /* Hero */
    .hero-title {
        font-size: 2rem;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item--large {
        grid-column: span 1;
    }

    /* Filter bar */
    .gallery-filter-bar {
        gap: var(--sp-2);
    }

    .filter-btn {
        padding: var(--sp-2) var(--sp-3);
        font-size: var(--fs-xs);
    }

    /* Back to top */
    .back-to-top {
        bottom: var(--sp-5);
        right: var(--sp-5);
        width: 42px;
        height: 42px;
    }

    /* Video */
    .video-section {
        padding-block: var(--sp-12);
    }

    .btn-play-video {
        flex-direction: column;
        gap: var(--sp-3);
        border-radius: var(--r-xl);
    }

    .btn-play-icon {
        width: 64px;
        height: 64px;
        font-size: var(--fs-xl);
    }
}

/* ==================== 480px ==================== */
@media (max-width: 480px) {
    /* Services 1 column */
    .servicos-grid {
        grid-template-columns: 1fr;
    }

    /* Tabs scroll */
    .doc-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }


    :root {
        --header-height: 64px;
        --topbar-height: 36px;
    }

    /* Topbar */
    .topbar-left {
        gap: var(--sp-3);
    }

    .topbar-link span,
    .topbar-info span {
        display: none;
    }

    .topbar-social {
        gap: var(--sp-1);
    }

    /* Logo simplified */
    .logo-name {
        display: none;
    }

    .logo-city {
        font-size: var(--fs-base);
    }

    /* Quick grid */
    .quick-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--sp-2);
    }

    /* Hero stats */
    .stats-row {
        gap: 0;
    }

    .stat-item {
        padding: var(--sp-2) var(--sp-3);
    }

    .stat-num {
        font-size: var(--fs-md);
    }

    /* Secretarias */
    .sec-card {
        flex: 0 0 calc(100% - var(--sp-2));
    }

    /* Section headers */
    .section-header {
        margin-bottom: var(--sp-8);
    }
}

/* ==================== Print ==================== */
@media print {
    .topbar,
    .header,
    .hero-nav,
    .hero-video-bg,
    .hero-stats-bar,
    .back-to-top,
    .btn-hamburger,
    .btn-search-toggle {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    .section {
        padding-block: 2rem;
        break-inside: avoid;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
