/* ==========================================================================
   Responsive — Mobile-first breakpoint overrides
   ========================================================================== */

/* --- Mobile Overrides: Timeline, Quote, Narrative --- */
@media (max-width: 767px) {
    /* Timeline */
    .reveal-timeline__content {
        padding-left: 0;
    }

    .reveal-timeline__number {
        font-size: var(--text-xl);
        min-width: 45px;
    }

    .reveal-timeline__title {
        font-size: var(--text-base);
    }

    .reveal-timeline__stat-number {
        font-size: 2.25rem;
    }

    /* Quote strip */
    .section-quote__text {
        font-size: var(--text-2xl);
    }

    /* Narrative blocks — stack single column */
    .narrative-block {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        padding: var(--space-xl) 0;
    }

    /* On mobile, always text first regardless of source order */
    .narrative-block__text {
        order: 1;
    }

    .narrative-block__visual {
        order: 2;
    }

    .narrative-block__title {
        font-size: var(--text-xl);
    }

    /* Switch directional reveals to vertical on mobile */
    .js .reveal.reveal--from-left,
    .js .reveal.reveal--from-right {
        transform: translateY(30px);
    }

    .js .reveal.reveal--from-left.reveal--visible,
    .js .reveal.reveal--from-right.reveal--visible {
        transform: translateY(0);
    }

    /* HIW phase sections: reduced padding on mobile */
    .hiw-phase,
    .hiw-faq {
        padding: var(--space-2xl) 0;
    }

    /* Pricing table: sticky feature column on mobile */
    .pricing-table__feature-head,
    .pricing-table__feature {
        position: sticky;
        left: 0;
        z-index: 1;
        background-color: var(--color-white);
        min-width: 160px;
        max-width: 200px;
    }

    .pricing-table tbody tr:nth-child(even) .pricing-table__feature {
        background-color: #F9F9F7;
    }
}


/* --- Small Mobile: Subscribe form stack --- */
@media (max-width: 479px) {
    .subscribe-block__form {
        flex-direction: column;
    }

    .subscribe-block__btn {
        width: 100%;
    }
}


/* --- Mobile Hero Overrides --- */
@media (max-width: 639px) {
    .hero__search-bar {
        max-width: 100%;
        width: 100%;
    }

    .hero-response__body {
        min-height: 160px;
        max-height: 360px;
        padding: 1rem;
    }

    .hero-response__ai-avatar {
        width: 24px;
        height: 24px;
    }

    .hero-response__ai-avatar svg {
        width: 16px;
        height: 16px;
    }

    .hero-response__content {
        font-size: 0.8125rem;
    }
}


/* --- Small Tablet (640px) --- */
@media (min-width: 640px) {
    .audit-form__grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

}


/* --- Tablet (768px) --- */
@media (min-width: 768px) {
    :root {
        --container-padding: 2rem;
    }

    h1 {
        font-size: var(--text-5xl);
    }

    h2 {
        font-size: var(--text-4xl);
    }

    .hero__title {
        font-size: var(--text-5xl);
    }

    .section {
        padding-top: var(--space-3xl);
        padding-bottom: var(--space-3xl);
    }

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

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

    /* Tighten quote→solution gap (override .section defaults) */
    .section-quote {
        padding-bottom: 3.75rem;
    }

    .section-solution {
        padding-top: 5rem;
    }

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

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

    .page-header__title {
        font-size: var(--text-5xl);
    }

    .blog-card--featured .blog-card__title {
        font-size: var(--text-3xl);
    }
}


/* --- Desktop (1024px) --- */
@media (min-width: 1024px) {
    .site-nav {
        display: flex;
    }

    .nav-toggle {
        display: none;
    }

    h1 {
        font-size: var(--text-6xl);
    }

    .hero {
        padding-top: calc(72px + var(--space-4xl));
        padding-bottom: var(--space-4xl);
    }

    .hero__title {
        font-size: var(--text-6xl);
    }

    .hero__grid {
        grid-template-columns: 1.2fr 1fr;
        gap: var(--space-3xl);
    }

    .hero__search-bar {
        max-width: 480px;
    }

    .hero-response__body {
        min-height: 200px;
    }

    .hero__stats {
        max-width: 600px;
    }

    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pricing-compare__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-2xl);
        position: relative;
        max-width: none;
    }

    /* Switch connecting line from vertical to horizontal through circle centres */
    .steps-grid::before {
        left: 16px;
        right: calc((100% - 2 * var(--space-2xl)) / 3 - 16px);
        top: 16px;
        bottom: auto;
        width: auto;
        height: 2px;
    }

    /* Step cards become vertical columns on desktop */
    .step-card {
        flex-direction: column;
        align-items: flex-start;
    }

    /* CTA top padding override */
    .section-cta {
        padding-top: 5rem;
    }

    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .blog-layout {
        grid-template-columns: 1fr 300px;
    }

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

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

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


/* --- Large Desktop (1280px) --- */
@media (min-width: 1280px) {
    .hero__content {
        max-width: 900px;
    }

    .hero__stats {
        max-width: 700px;
    }

    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
