/* ==========================================================================
   Scalefront Digital — Responsive Stylesheet
   Breakpoints:
   - 1400px and down  (desktop squeeze)
   - 1199px and down  (small desktop / large tablet)
   -  991px and down  (tablet, mobile nav kicks in)
   -  767px and down  (mobile)
   -  480px and down  (small mobile)
   ========================================================================== */


/* --------------------------------------------------------------------------
   Desktop squeeze (max-width: 1400px)
   -------------------------------------------------------------------------- */
@media (max-width: 1400px) {
    :root {
        --fs-7xl: 3.75rem;
        --fs-6xl: 3rem;
    }
}


/* --------------------------------------------------------------------------
   Small desktop / large tablet (max-width: 1199px)
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    :root {
        --fs-7xl: 3.25rem;
        --fs-6xl: 2.75rem;
        --fs-5xl: 2.5rem;
        --fs-4xl: 2rem;
        --header-padding: 1.5rem;
    }

    .nav-list {
        gap: var(--space-6);
    }

    .header-inner {
        gap: var(--space-6);
    }

    /* Mega menu: tighten spacing at narrower viewports */
    .mega-menu {
        padding: var(--space-6);
    }

    .mega-menu-inner {
        gap: var(--space-6);
    }

    .mega-menu-item {
        padding: var(--space-2);
    }

    .mega-menu-icon {
        width: 36px;
        height: 36px;
    }

    .mega-menu-icon svg {
        width: 18px;
        height: 18px;
    }

    .mega-menu-desc {
        font-size: var(--fs-xs);
    }
}


/* --------------------------------------------------------------------------
   Tablet (max-width: 991px)  —  mobile nav activates
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    :root {
        --fs-7xl: 2.75rem;
        --fs-6xl: 2.5rem;
        --fs-5xl: 2.25rem;
        --fs-4xl: 1.875rem;
        --header-padding: 1.25rem;
        --header-height: 80px;
    }

    .section {
        padding: var(--space-16) 0;
    }

    /* ---- Header: switch to logo/toggle/actions mobile layout ---- */
    .header-inner {
        grid-template-columns: auto 1fr auto;
        gap: var(--space-4);
    }

    /* Strip backdrop-filter on mobile: it creates a containing block
       for `position: fixed` descendants, which would trap .main-nav
       inside the header's 80px bounds. Homepage stays solid white;
       inner pages keep their blue (already set in style.css, but we
       re-assert here to ensure the mobile override does not revert it). */
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background-color: var(--color-white);
    }

    .page-inner .site-header {
        background-color: var(--color-blue);
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        height: auto;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background-color: var(--color-white);
        border-top: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        padding: var(--space-6) var(--header-padding) var(--space-8);
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: transform var(--transition-base), opacity var(--transition-base), visibility 0s linear var(--transition-base);
        margin: 0;
        justify-self: stretch;
        grid-column: 1 / -1;
        z-index: 999;
    }

    .main-nav.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        transition: transform var(--transition-base), opacity var(--transition-base), visibility 0s;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
        height: auto;
        width: 100%;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-link {
        display: block;
        padding: var(--space-4) 0;
        font-size: var(--fs-lg);
        width: 100%;
    }

    .nav-link::after {
        display: none;
    }

    /* ---- Nav items: reset full-height desktop behavior ---- */
    .nav-list > li {
        display: block;
        height: auto;
    }

    /* ---- Mega menu: collapse into mobile accordion ---- */
    .nav-list .has-dropdown {
        position: static;
    }

    /* Disable the desktop hover bridge (not needed in accordion mode) */
    .has-dropdown::after {
        display: none;
    }

    .nav-link-dropdown {
        justify-content: space-between;
    }

    .dropdown-chevron {
        width: 18px;
        height: 18px;
    }

    .mega-menu {
        position: static;
        transform: none !important;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background-color: transparent;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: max-height var(--transition-base);
    }

    .mega-menu::before,
    .mega-menu::after {
        display: none;
    }

    .has-dropdown.is-open > .mega-menu {
        max-height: 2000px;
        padding: var(--space-2) 0 var(--space-4);
    }

    /* Prevent hover-based open on touch devices */
    .has-dropdown:hover > .mega-menu,
    .has-dropdown:focus-within > .mega-menu {
        opacity: 1;
        visibility: visible;
        max-height: 0;
    }

    .has-dropdown.is-open:hover > .mega-menu,
    .has-dropdown.is-open > .mega-menu {
        max-height: 2000px;
    }

    .mega-menu-inner {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .mega-menu-head {
        display: none;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: var(--space-1);
        margin-bottom: var(--space-3);
    }

    .mega-menu-item {
        padding: var(--space-3);
    }

    .mega-menu-item:hover {
        background-color: var(--color-bg-alt);
    }

    .mega-menu-feature {
        padding: var(--space-5);
    }

    .feature-title {
        font-size: var(--fs-xl);
    }

    .header-phone {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    /* ---- Hero ---- */
    .hero {
        padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-12);
        min-height: calc(100vh - 40px);
    }

    .hero-divider-line {
        width: 80px;
    }

    /* ---- Logo strip ---- */
    .logo-strip-list {
        gap: var(--space-8);
        justify-content: center;
    }

    /* ---- Services slider: 2 cards visible on tablet ---- */
    .services {
        padding: var(--space-16) 0;
    }

    .services-header {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .services-nav {
        justify-self: start;
    }

    .services-slider-track .service-card {
        flex-basis: calc((100% - var(--space-6)) / 2);
    }

    /* ---- Why Us ---- */
    .why-us {
        padding: var(--space-16) 0;
    }

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

    .benefit-card {
        padding: var(--space-6);
    }

    /* ---- Process: 2 columns, line becomes vertical between rows ---- */
    .process {
        padding: var(--space-16) 0;
    }

    .process-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-10) var(--space-6);
    }

    .process-line {
        display: none;
    }

    /* ---- Case Studies ---- */
    .cases {
        padding: var(--space-16) 0;
    }

    .cases-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: var(--space-10);
    }

    /* ---- Testimonials ---- */
    .testimonials {
        padding: var(--space-16) 0;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: var(--space-10);
    }

    .testimonials-ratings {
        gap: var(--space-5);
    }

    /* ---- FAQs: stack to single column ---- */
    .faqs {
        padding: var(--space-16) 0;
    }

    .faqs-grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .faqs-aside {
        position: static;
        max-width: 720px;
        margin: 0 auto;
        text-align: center;
    }

    .faqs-aside .section-eyebrow,
    .faqs-sub {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .faqs-cta-card {
        margin: 0 auto;
        text-align: left;
    }

    /* ---- Blog ---- */
    .blog {
        padding: var(--space-16) 0;
    }

    .blog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-6);
        margin-bottom: var(--space-10);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

    /* ---- Contact ---- */
    .contact {
        padding: var(--space-16) 0;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }

    .contact-info,
    .contact-form-wrap {
        max-width: 720px;
        margin: 0 auto;
        width: 100%;
    }

    .contact-call-cta,
    .contact-details {
        max-width: 100%;
    }

    /* ---- Footer ---- */
    .site-footer {
        padding-top: var(--space-16);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-10);
        padding-bottom: var(--space-12);
    }

    .footer-brand {
        grid-column: 1 / -1;
        max-width: 100%;
    }
}


/* --------------------------------------------------------------------------
   Mobile (max-width: 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    :root {
        --container-padding: 1.25rem;
        --header-padding:    1.25rem;
        --fs-7xl: 2.5rem;
        --fs-6xl: 2.25rem;
        --fs-5xl: 2rem;
        --fs-4xl: 1.75rem;
        --fs-xl:  1.125rem;
    }
.highlight-bg:before {
    border-radius: 1.2rem;
}
    /* ---- Header ---- */
    .logo-image {
        height: 38px;
    }

    .header-actions .btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--fs-sm);
    }

    /* ---- Hero on mobile ---- */
    .hero {
        padding: calc(var(--header-height) + var(--space-10)) 0 var(--space-10);
    }

    .hero-title {
        font-size: clamp(2rem, 9vw, 3rem);
    }

    .hero-description {
        font-size: var(--fs-base);
    }

    .hero-actions {
        flex-direction: column;
        gap: var(--space-3);
        width: 100%;
        align-items: stretch;
        margin-bottom: var(--space-12);
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-services {
        font-size: var(--fs-sm);
        gap: var(--space-3);
    }

    /* ---- Logo strip on mobile ---- */
    .logo-strip {
        padding: var(--space-10) 0;
    }

    .logo-strip-caption {
        font-size: 0.6875rem;
        margin-bottom: var(--space-6);
    }

    .logo-strip-list {
        gap: var(--space-6) var(--space-8);
    }

    .logo-strip-item {
        height: 28px;
    }

    /* ---- Services slider on mobile: 1 card with a peek ---- */
    .services-slider-track {
        gap: var(--space-4);
    }

    .services-slider-track .service-card {
        flex-basis: 88%;
    }

    .service-card {
        padding: var(--space-6);
    }

    .service-icon {
        width: 48px;
        height: 48px;
        margin-bottom: var(--space-4);
    }

    .service-icon svg {
        width: 24px;
        height: 24px;
    }

    .slider-btn {
        width: 44px;
        height: 44px;
    }

    .slider-btn svg {
        width: 16px;
        height: 16px;
    }

    /* ---- Why Us on mobile ---- */
    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .benefit-card {
        padding: var(--space-5);
    }

    .benefit-icon {
        width: 48px;
        height: 48px;
        margin-bottom: var(--space-4);
    }

    .benefit-icon svg {
        width: 22px;
        height: 22px;
    }

    /* ---- Process on mobile: single column stack ---- */
    .process-timeline {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .process-number {
        width: 64px;
        height: 64px;
    }

    .process-number span {
        font-size: var(--fs-lg);
    }

    /* ---- Case Studies on mobile ---- */
    .case-visual {
        padding: var(--space-5);
        aspect-ratio: 16 / 9;
    }

    .case-content {
        padding: var(--space-5);
    }

    .case-metric {
        font-size: 2.5rem;
    }

    /* ---- Testimonials on mobile ---- */
    .testimonial-card {
        padding: var(--space-6);
    }

    .testimonial-quote {
        font-size: var(--fs-sm);
    }

    .testimonial-quote-mark {
        font-size: 4rem;
    }

    .testimonials-ratings {
        flex-direction: column;
        gap: var(--space-3);
    }

    .rating-divider {
        display: none;
    }

    /* ---- FAQs on mobile ---- */
    .faq-q-text {
        font-size: var(--fs-base);
    }

    .faq-question {
        padding: var(--space-5) 0;
        gap: var(--space-3);
    }

    .faq-icon {
        width: 32px;
        height: 32px;
    }

    .faq-icon svg {
        width: 14px;
        height: 14px;
    }

    .faq-answer {
        padding: 0 0 var(--space-5) 0;
    }

    .faq-answer p {
        font-size: var(--fs-sm);
    }

    /* ---- Blog on mobile ---- */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
        max-width: 480px;
        margin: 0 auto;
    }

    .blog-card-body {
        padding: var(--space-5);
    }

    .blog-card-title {
        font-size: var(--fs-lg);
    }

    /* ---- Contact on mobile ---- */
    .contact-form {
        padding: var(--space-6);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .contact-call-cta {
        padding: var(--space-4) var(--space-5);
        gap: var(--space-3);
    }

    .contact-call-cta-action {
        font-size: var(--fs-base);
    }

    .contact-call-cta-icon {
        width: 40px;
        height: 40px;
    }

    /* ---- Footer on mobile ---- */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .footer-legal {
        gap: var(--space-4);
        flex-wrap: wrap;
        justify-content: center;
    }
}


/* --------------------------------------------------------------------------
   Small mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    :root {
        --fs-7xl: 2.125rem;
        --fs-6xl: 2rem;
        --fs-5xl: 1.75rem;
    }

    .hero-services .sep {
        display: none;
    }

    .hero-card-blue {
        width: 68%;
    }
}
