/* =============================================
   Admixa Agency — Responsive Styles
   ============================================= */

/* ── Max Width 1199px ── */
@media (max-width: 1199.98px) {
    .capabilities-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .process-step__content {
        max-width: calc(50% - 48px);
    }
}

/* ── Max Width 991px (Tablet) ── */
@media (max-width: 991.98px) {
    .capabilities-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-md);
    }

    .hero__title {
        font-size: clamp(2.2rem, 5vw, 3.5rem);
    }

    /* Timeline → vertical */
    .process-timeline::before {
        left: 32px;
    }

    .process-step,
    .process-step:nth-child(even) {
        flex-direction: row;
        gap: var(--space-xl);
    }

    .process-step__number {
        width: 48px;
        height: 48px;
        font-size: var(--font-size-lg);
    }

    .process-step__content {
        max-width: none;
        flex: 1;
    }

    .about-values {
        grid-template-columns: 1fr;
    }

    .case-study-meta {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Max Width 767px (Mobile Landscape) ── */
@media (max-width: 767.98px) {
    .hero {
        min-height: 100svh;
        padding-top: 100px;
        padding-bottom: var(--space-3xl);
    }

    .hero__title {
        font-size: clamp(1.8rem, 7vw, 2.8rem);
    }

    .hero__subtitle {
        font-size: var(--font-size-base);
    }

    .hero__actions {
        flex-direction: column;
    }

    .hero__actions .btn-primary-custom,
    .hero__actions .btn-secondary-custom {
        width: 100%;
        justify-content: center;
    }

    .section {
        padding: clamp(3rem, 6vw, 5rem) 0;
    }

    .capabilities-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }

    .capability-item {
        padding: var(--space-md) var(--space-sm);
    }

    .capability-item__icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .capability-item__label {
        font-size: var(--font-size-xs);
    }

    .portfolio-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--space-sm);
        -webkit-overflow-scrolling: touch;
    }

    .portfolio-filter-btn {
        flex-shrink: 0;
    }

    .card-custom {
        padding: var(--space-xl);
    }

    .page-header {
        padding: clamp(7rem, 10vw, 10rem) 0 clamp(2rem, 4vw, 4rem);
    }

    .page-header__title {
        font-size: clamp(1.8rem, 6vw, 2.8rem);
    }

    .footer__top {
        padding: var(--space-3xl) 0 var(--space-xl);
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }

    .case-study-meta {
        grid-template-columns: 1fr;
    }

    .case-study-gallery {
        grid-template-columns: 1fr;
    }

    .cta-section h2 {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
    }

    .process-timeline::before {
        left: 24px;
    }

    .process-step__number {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
    }

    .process-step {
        gap: var(--space-md);
    }
}

/* ── Max Width 575px (Small Mobile) ── */
@media (max-width: 575.98px) {
    .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonial-card {
        padding: var(--space-xl);
    }

    .btn-primary-custom,
    .btn-secondary-custom {
        padding: 0.75rem 1.5rem;
        font-size: var(--font-size-sm);
    }

    .navbar-admixa .navbar-brand img {
        height: var(--navbar-logo-h-mobile, 30px);
    }
}

/* ── Max Width 374px (Very Small) ── */
@media (max-width: 374.98px) {
    .hero__title {
        font-size: 1.6rem;
    }

    .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem;
    }

    body {
        font-size: 0.9375rem;
    }
}

/* ── Horizontal Overflow Guard ── */
/* The scroll-reveal entrance classes are applied to full-width and
   edge-aligned blocks. Their 30px horizontal offset pushes those blocks past
   the viewport, which makes mobile browsers widen the layout viewport (the page
   then renders wider than the screen) and leaves ~6px of scroll at the 768px
   container gutter. Below 1020px the Bootstrap container gutter is never wider
   than 30px, so the reveal slides vertically instead — same duration, same
   easing, no horizontal overflow. Desktop (>=1020px) is untouched. */
@media (max-width: 1019.98px) {
    .reveal-left,
    .reveal-right {
        transform: translateY(28px);
    }
}

/* ── Home Card Sliders (Services + Recent Projects) ── */
/* Desktop keeps the ordinary Bootstrap grid — this only engages on phones, where
   each .row.g-4 becomes a horizontal, swipeable, snap-aligned track. Reusing the
   existing row as the track means no grid maths has to be rebuilt, so the
   desktop layout is unchanged by construction. */
@media (max-width: 767.98px) {
    .slider__viewport {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 0.25rem;
    }

    .slider__viewport::-webkit-scrollbar {
        display: none;
    }

    /* The Bootstrap row already supplies the flex layout and the 12px gutter
       padding. Only its negative margins have to go so the first card starts
       flush with the container edge. */
    .slider__viewport > .row {
        flex-wrap: nowrap;
        margin-inline: 0;
        scroll-padding-inline: 0;
    }

    .slider__viewport > .row > * {
        flex: 0 0 82%;
        max-width: 82%;
        scroll-snap-align: start;
    }

    /* Cards parked to the right would otherwise stay at opacity:0 until the
       user swipes them into view. */
    .slider__viewport .reveal,
    .slider__viewport .reveal-left,
    .slider__viewport .reveal-right,
    .slider__viewport .reveal-scale {
        opacity: 1;
        transform: none;
    }

    .slider__controls {
        display: flex;
    }

    .slider.is-static .slider__controls {
        display: none;
    }
}

/* ── Cramped Desktop: Bootstrap's own lg/xl container steps (992–1399px) ──
   Logo and CTAs are flex-shrink:0 (style.css) so they are protected
   UNCONDITIONALLY at every width — these rules only decide how the nav
   LINKS compress (padding/gap trim) so the single row fits without
   wrapping. The links row also carries flex-wrap:wrap as a universal
   safety net: no width can ever overflow, with or without these trims. */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .navbar-admixa .nav-link {
        padding: 0.5rem 0.625rem !important;
    }

    /* Underline follows the tightened padding so it still spans the link text */
    .navbar-admixa .nav-link::after {
        left: 0.625rem;
        right: 0.625rem;
    }

    .navbar-admixa .d-lg-flex.gap-1 {
        gap: 0 !important;
    }

    /* CTA pair — Bootstrap's .gap-3 is !important, so this override must be too */
    .navbar-admixa .d-flex.align-items-center.gap-3 {
        gap: 0.5rem !important;
    }

    .navbar-admixa .btn-nav-cta,
    .navbar-admixa .btn-nav-review {
        padding: 0.5rem 0.875rem;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar-admixa .nav-link {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.8125rem;
    }

    .navbar-admixa .nav-link::after {
        left: 0.25rem;
        right: 0.25rem;
    }

    .navbar-admixa .d-flex.align-items-center.gap-3 {
        gap: 0.375rem !important;
    }

    .navbar-admixa .btn-nav-cta,
    .navbar-admixa .btn-nav-review {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }

    .navbar-admixa .btn-nav-review {
        gap: 0.25rem;
    }
}

/* ── Mobile Footer Accordion ──
   Services / Company / Get in Touch collapse behind their headings below
   768px. main.js adds .is-accordion only while this breakpoint is active, so
   desktop visitors (and no-JS visitors at any width) keep the normal
   always-open footer. Collapse uses the grid 0fr→1fr trick (animates to the
   list's real height); visibility takes collapsed links out of the focus /
   screen-reader order while they are hidden. */
@media (max-width: 767.98px) {
    .footer-col.is-accordion .footer__heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0;
        padding: 0.85rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    .footer-col.is-accordion .footer__heading:focus-visible {
        outline: 2px solid var(--cyan-light);
        outline-offset: 2px;
        border-radius: 2px;
    }

    .footer-col.is-accordion .footer__chevron {
        display: inline-block;
        color: rgba(255, 255, 255, 0.5);
        transition: transform var(--transition-base), color var(--transition-fast);
    }

    .footer-col.is-accordion.open .footer__chevron {
        transform: rotate(180deg);
        color: var(--cyan-light);
    }

    .footer-col.is-accordion .footer__links-wrap {
        display: grid;
        grid-template-rows: 0fr;
        overflow: hidden;
        visibility: hidden;
        transition: grid-template-rows var(--transition-base), visibility var(--transition-base),
                    margin-top var(--transition-base);
    }

    /* The spacing margin lives on the OPEN wrapper (outside the grid): a
       margin on the ul would contribute to the 0fr track's base size and
       leave a visible 16px gap while collapsed. */
    .footer-col.is-accordion.open .footer__links-wrap {
        grid-template-rows: 1fr;
        visibility: visible;
        margin-top: var(--space-md);
    }

    .footer-col.is-accordion .footer__links {
        min-height: 0;
        overflow: hidden;
    }
}

/* ── Touch Targets & Mobile Menu Sizing ── */
@media (max-width: 991.98px) {
    /* Hamburger: Glass capsule touch area (42x42px) */
    .navbar-toggler-admixa {
        width: 42px;
        height: 42px;
    }

    /* Brand link: 44px tall touch strip, logo position unchanged. */
    .navbar-admixa .navbar-brand {
        position: relative;
    }

    .navbar-admixa .navbar-brand::after {
        content: "";
        position: absolute;
        inset: -7px -6px;
    }

    /* Slider dots: 24x24 touch targets (WCAG 2.2 target-size minimum). The
       visible dot is drawn by ::before and keeps its 8px / 22px active look. */
    .team-slider__dots {
        gap: 0.125rem;
    }

    .team-slider__dot,
    .team-slider__dot.is-active {
        width: 24px;
        height: 24px;
        padding: 0;
        border: 0;
        background: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .team-slider__dot::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: var(--radius-full);
        background: var(--border);
        transition: all var(--transition-fast);
    }

    .team-slider__dot.is-active::before {
        width: 22px;
        border-radius: 999px;
        background: var(--gradient-brand);
    }

    /* Social icons inside the compact team cards are 26px — too small to tap. */
    .team-member-card__socials .team-social-icon {
        width: 32px;
        height: 32px;
    }

}

/* ── Small Mobile Text / Link Targets ── */
@media (max-width: 575.98px) {
    /* 11.25px on phones once body drops to 0.9375rem */
    .badge {
        font-size: 0.75rem;
    }

    /* Give the card link a ~40px tall row without changing its appearance. */
    .card-custom__link {
        padding: 0.5rem 0;
    }
}
