/* ===== Responsive Breakpoints ===== */

/* Tablet (max-width: 1160px) */
@media (max-width: 1160px) {
    :root { --padding-x: 28px; }
}

/* Mobile Landscape (max-width: 860px) */
@media (max-width: 860px) {
    :root { --padding-x: 24px; }
}

/* Mobile Portrait (max-width: 760px) — PRIMARY BREAKPOINT */
@media (max-width: 760px) {
    :root {
        --padding-x: 20px;
        --grid-columns: 1;
        --grid-gap: 16px;
    }

    .nav-hamburger { display: flex; }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 24px !important;
        padding: 60px 40px;
        font-size: 16px !important;
        transition: right var(--transition-base);
        z-index: var(--z-modal);
        border-left: 1px solid var(--border);
    }
    .nav-menu.nav-menu-open { right: 0; }
    .nav-divider { display: none !important; }
    .nav-social { display: inline-flex !important; margin-top: 16px; }
    .nav-menu .menu-item a { font-size: 16px; padding: 8px 0; }

    .nav-hamburger-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-hamburger-open span:nth-child(2) { opacity: 0; }
    .nav-hamburger-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .section-hero { padding-top: 90px !important; padding-bottom: 28px !important; }
    .section-large { padding-top: 52px !important; padding-bottom: 52px !important; }
    .section-medium { padding-top: 44px !important; padding-bottom: 44px !important; }

    .grid-12 { grid-template-columns: 1fr !important; }
    .grid-2 { grid-template-columns: 1fr !important; }

    .form-row { grid-template-columns: 1fr; }
    .service-content-grid { grid-template-columns: 1fr; }
    .service-content-main { grid-column: auto; }
    .service-content-sidebar { grid-column: auto; }

    .journal-featured { grid-template-columns: 1fr; }
    .journal-featured-image { grid-column: auto; }
    .journal-featured-content { grid-column: auto; }

    .case-study-content { grid-template-columns: 1fr !important; }
    .case-study-main { grid-column: auto !important; }
    .case-study-sidebar { grid-column: auto !important; position: static; }

    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item-wide { grid-column: auto; }

    .work-row { grid-template-columns: 1fr; gap: 6px; padding: 20px 16px; }
    .work-row-title { font-size: 20px; }
    .work-row-cat { text-align: left; font-size: 11px; }
    .work-row-arrow { display: none; }

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

    .work-card:hover { transform: none !important; }
    .work-card:hover .work-card-image img { transform: none !important; }

    /* How we work: 2x2 grid on mobile */
    .how-we-work-grid {
        grid-template-columns: 1fr 1fr;
    }
    .how-we-work-grid .discipline-item {
        padding: 16px 16px 16px 0;
    }

    /* Products + Clients: match layout on mobile */
    .products-grid,
    .clients-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    /* Truncate items after 4th on mobile */
    .truncatable > *:nth-child(n+5) {
        display: none;
    }
    .truncatable.is-expanded > *:nth-child(n+5) {
        display: flex;
    }

    /* View more button — mobile only */
    .view-more-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-top: 16px;
        padding: 14px;
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-pill);
        background: transparent;
        color: var(--cream);
        font-family: var(--font-primary);
        font-size: 13px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        cursor: pointer;
        transition: all var(--transition-fast);
    }
    .view-more-btn:hover {
        background: var(--accent);
        color: var(--bg);
        border-color: var(--accent);
    }
    .view-more-btn .arrow {
        transition: transform 0.3s ease;
    }
    .view-more-btn.is-expanded .arrow {
        transform: rotate(180deg);
    }

    /* Expandable disciplines on mobile */
    .discipline-expandable { padding: 0; border-bottom: 1px solid var(--border); }
    .discipline-expandable:last-child { border-bottom: none; }
    .discipline-expandable .discipline-header {
        cursor: pointer;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 20px 0;
    }
    .discipline-expandable .discipline-number {
        margin-bottom: 0;
        font-size: 28px;
        width: auto;
    }
    .discipline-expandable .discipline-title {
        margin: 0;
        flex: 1;
    }
    .discipline-toggle {
        display: block;
        width: 28px;
        height: 28px;
        position: relative;
        flex-shrink: 0;
        transition: transform 0.3s ease;
    }
    .discipline-toggle::before,
    .discipline-toggle::after {
        content: '';
        position: absolute;
        background: var(--cream);
        transition: transform 0.3s ease;
    }
    .discipline-toggle::before {
        width: 16px;
        height: 2px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    .discipline-toggle::after {
        width: 2px;
        height: 16px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    .discipline-expandable.is-open .discipline-toggle::after {
        transform: translate(-50%, -50%) rotate(90deg);
    }
    .discipline-expandable .discipline-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
    }
    .discipline-expandable.is-open .discipline-content {
        max-height: 200px;
    }
    .discipline-expandable .discipline-desc {
        padding-bottom: 20px;
    }

    /* Company page responsive */
    .company-story { grid-template-columns: 1fr; }
    .company-story-label { grid-column: auto; margin-bottom: 8px; }
    .company-story-content { grid-column: auto; }
    .company-hero-image-inner { aspect-ratio: 16/9; }

    /* Team: horizontal swipeable slider on mobile */
    .team-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
        padding-bottom: 16px;
        scrollbar-width: none;
    }
    .team-grid::-webkit-scrollbar { display: none; }
    .team-member {
        flex: 0 0 200px;
        scroll-snap-align: start;
    }
    .team-member-photo {
        aspect-ratio: 3/4;
    }
    .team-member-name { font-size: 16px; }
    .team-member-role { font-size: 12px; }

    /* Contact page responsive */
    .contact-content { grid-template-columns: 1fr; }
    .contact-form-area { grid-column: auto; }
    .contact-details-area { grid-column: auto; }
    .contact-map { padding-bottom: 60px; }
    .map-container { aspect-ratio: 16/9; }

    /* Case study sidebar product logo full width */
    .portfolio-by-logo { max-height: 100px !important; }

    [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Small Mobile (max-width: 390px) */
@media (max-width: 390px) {
    :root { --padding-x: 16px; }
    body { font-size: 14px; }
}

/* Extra Small (max-width: 360px) */
@media (max-width: 360px) {
    :root { --padding-x: 12px; }
}
