/* =========================================================
   Trichy Dev Cabs — responsive.css
   Desktop-first adjustments, then tablet & mobile compositions
   ========================================================= */

/* ---------- Wide desktop ---------- */
@media (max-width: 1440px) {
    :root { --gutter: 34px; --container: 1240px; }
    .hero-visual { margin-right: calc(var(--gutter) * -1); }
}

@media (max-width: 1320px) {
    :root { --gutter: 28px; }
    .hero-word { font-size: clamp(3.6rem, 11vw, 10rem); }
    .showcase { grid-template-columns: minmax(210px, .38fr) minmax(0, 1fr); }
    .map-node { padding: 10px 13px; }
    .mn-name { font-size: .82rem; }
}

/* ---------- Laptop: collapse navigation ---------- */
@media (max-width: 1140px) {
    .main-nav { display: none; }
    .nav-toggle { display: block; }
    .header-actions { margin-left: auto; }

    /* Slider controls: the side arrows clear the copy only on desktop,
       so below this width the console arrows carry the prev/next role */
    .hero-nav { display: none; }
    .hc-arrow { display: grid; }

    .hero-layout { grid-template-columns: minmax(0, 1fr); }
    .hero-copy { max-width: 680px; }
    .hero-visual {
        position: absolute;
        right: 0;
        bottom: 4%;
        width: 58%;
        height: clamp(240px, 38vh, 400px);
        opacity: .5;
        z-index: 0;
        margin-right: 0;
        pointer-events: none;
    }
    .hero-copy { z-index: 4; }

    .story-grid { gap: 40px; }
    .bento-asym {
        grid-template-areas:
            "visual visual since"
            "visual visual call"
            "wa     comfort comfort"
            "plain  plain   plain2";
    }
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
    .footer-contact { grid-column: span 3; }

    /* Topbar: drop the address line first */
    .topbar-place { display: none; }

    /* Routes: single column, copy above the map, actions last */
    .map-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .map-side { display: contents; }
    .map-head { order: 1; max-width: 640px; margin-bottom: 0; }
    .map { order: 2; margin: clamp(24px, 4vw, 40px) auto 0; }
    .map-foot { order: 3; margin-top: clamp(52px, 7vw, 74px); }
}

/* ---------- Tablet landscape ---------- */
@media (max-width: 1024px) {
    :root { --gutter: 26px; }

    /* Topbar: keep phone + WhatsApp only */
    .topbar-mail { display: none; }

    /* Sticky storytelling shortens */
    .story-sticky { position: static; min-height: 0; }
    .story-step { min-height: 0; padding: 28px 0; opacity: 1; }
    .story-step .story-node { border-color: var(--gold); background: var(--gold); }

    /* Showcase stacks */
    .showcase { grid-template-columns: minmax(0, 1fr); }
    .showcase-list {
        flex-direction: row;
        overflow-x: auto;
        border-top: 0;
        border-bottom: 1px solid var(--line);
        scrollbar-width: none;
        position: sticky;
        top: var(--header-h);
        align-self: start;
        background: var(--white);
        z-index: 20;
    }
    .showcase-list::-webkit-scrollbar { display: none; }
    .sc-item {
        flex: 0 0 auto;
        border-bottom: 0;
        padding: 16px 20px;
        gap: 10px;
    }
    .sc-name { font-size: 1.1rem; }
    .sc-arrow { display: none; }
    .sc-item:hover, .sc-item.is-active { padding-left: 20px; }
    .showcase-stage { min-height: clamp(540px, 66vh, 660px); }
    .showcase-hint { display: block; }

    /* Reel → native horizontal swipe (static flow, so it takes the same
       --sec-pad as every other section instead of its own spacing) */
    .reel { height: auto !important; padding: var(--sec-pad) 0 var(--sec-pad-b); overflow: visible; }
    .reel-inner { position: static; min-height: 0; padding: 0; }
    .reel-viewport {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .reel-viewport::-webkit-scrollbar { display: none; }
    .reel-track { transform: none !important; }
    .reel-frame { scroll-snap-align: center; }
    /* One shared height for every gallery frame — widths stay varied */
    .reel-tall  { width: clamp(260px, 62vw, 420px); height: clamp(300px, 48vh, 480px); }
    .reel-small { width: clamp(220px, 48vw, 320px); height: clamp(300px, 48vh, 480px); }
    .reel-wide  { width: clamp(300px, 76vw, 560px); height: clamp(300px, 48vh, 480px); transform: none; }
    .reel-progress { display: none; }

    /* FAQ + contact stack */
    .faq-grid { grid-template-columns: minmax(0, 1fr); }
    .faq-head { position: static; }
    .faq-head .section-display { font-size: clamp(1.8rem, 5.5vw, 3rem); }
    .contact-grid { grid-template-columns: minmax(0, 1fr); }

    /* Reviews: empty state stacks */
    .review-empty { grid-template-columns: minmax(0, 1fr); }

    /* Booking flow: two columns, drop the road line */
    .route-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 56px; padding-top: 40px; }
    .rf-line { display: none; }
    .rf-dot { display: none; }

    /* Trust card: narrow/portrait here, so split it — photo band on top,
       caption on a solid navy panel underneath (no crop, no overlay text) */
    .wb-visual { display: block; min-height: 0; max-height: none; aspect-ratio: auto; background: var(--ink); }
    .wb-visual .wb-media {
        position: relative;
        inset: auto;
        transform: none;
        height: clamp(210px, 54vw, 380px);
    }
    .wb-visual:hover .wb-media { transform: none; }
    .wb-visual::before { display: none; }
    /* Y=35% keeps the whole line-up (roofs to tyres) inside the band at
       every stacked width, from 2.2:1 down to the phone sizes */
    .wb-media img { object-position: center 35%; }
    .wb-visual .wb-body { padding: clamp(20px, 3vw, 30px) clamp(22px, 3.4vw, 34px) clamp(24px, 3vw, 32px); }
    .wb-lead { flex-direction: column; align-items: flex-start; gap: 14px; }
    .wb-visual h3 { max-width: 30ch; }

    /* Map sizing */
    .map { max-width: min(620px, 100%); }

    /* Planner → stacked card, heading above the fields */
    .planner-card { grid-template-columns: minmax(0, 1fr); }
    .planner-head {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding-right: 0;
        padding-bottom: 16px;
    }
    .planner-alt { margin-top: 4px; }
}

/* ---------- Tablet portrait ---------- */
@media (max-width: 900px) {
    .bento-asym {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "visual visual"
            "since  call"
            "wa     comfort"
            "plain  plain2";
    }
    .wb-comfort { flex-direction: column; align-items: flex-start; }

    /* Map → simplified node list */
    .map { aspect-ratio: auto; display: grid; gap: 12px; padding-bottom: 0; }
    .map-texture { opacity: .5; }
    .map-lines { display: none; }
    .map-center {
        position: static;
        transform: none;
        width: 100%;
        max-width: none;
        aspect-ratio: auto;
        border-radius: 0;
        padding: 20px;
        place-content: start;
        text-align: left;
        animation: none;
    }
    .map-nodes {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .map-nodes::-webkit-scrollbar { display: none; }
    .map-node {
        position: static;
        transform: none;
        flex: 0 0 auto;
        scroll-snap-align: start;
        justify-content: flex-start;
        opacity: 1;
        animation: none;
        backdrop-filter: none;
        background: rgba(255, 255, 255, .05);
    }
    .map-node:hover, .map-node.is-active, .map-node:focus-visible { transform: none; }
    .map-panel {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 6px;
    }

    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-contact { grid-column: span 2; }

    /* Planner: two field columns */
    .planner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Large mobile ---------- */
@media (max-width: 768px) {
    :root { --gutter: 20px; --header-h: 76px; --topbar-h: 0px; --header-h-stuck: 66px; }

    /* Topbar is desktop-only */
    .topbar { display: none; }

    /* Larger logo — scaled down for the compact mobile bar */
    .brand-mark { width: 56px; height: 58px; }
    .brand-text strong { font-size: 1.16rem; }
    .brand-text small { font-size: .56rem; letter-spacing: .1em; }
    .site-header.is-stuck { height: var(--header-h-stuck); }
    .site-header.is-stuck .brand-mark { width: 46px; height: 48px; }
    .site-header.is-stuck .brand-text strong { font-size: 1.08rem; }

    body {
        font-size: 16px;
    }

    /* The floating Call / Book Ride / WhatsApp capsule is intentionally
       disabled — sections.css keeps the base
       .mobile-capsule { display: none } rule on every breakpoint */

    .wa-float { display: none; }
    .header-actions .btn { display: none; }
    .header-actions { gap: 0; }
    .nav-toggle { margin-left: auto; }

    /* Hero */
    .hero { min-height: 100svh; padding-top: calc(var(--header-h) + 12px); }
    /* Slides ignore the hero's padding (they are absolute), so the copy must
       clear the stuck header itself — and grow DOWNWARD, never under it */
    .hero-slide { align-items: flex-start; }
    .hero-layout {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        padding-top: calc(var(--header-h) + 18px);
        padding-bottom: clamp(120px, 20vh, 170px);
        gap: 10px;
    }
    .hero-display { font-size: clamp(2rem, 10vw, 3.05rem); }
    .hero-copy { max-width: 100%; }
    .hero-visual {
        position: relative;
        right: auto; bottom: auto;
        width: 100%;
        height: clamp(210px, 32vh, 300px);
        opacity: 1;
        margin-top: 8px;
        pointer-events: auto;
    }
    .hero-word { font-size: clamp(2.6rem, 16vw, 5rem); right: -8%; }
    .hero-route { opacity: .8; }
    .hero-cta .btn { width: 100%; }
    .hero-tags li { padding: 6px 12px; font-size: .66rem; letter-spacing: .1em; }
    .hero-grid-lines { background-size: 50% 100%; }
    /* Portrait crop — keep the sky (and the headline) readable over the car */
    .hero-photo img { object-position: 50% 55%; }
    /* Lighter than before: the photo reads through, text keeps a vertical scrim */
    .hero-scrim {
        background:
            linear-gradient(180deg, rgba(4, 14, 28, .84) 0%, rgba(4, 14, 28, .66) 32%, rgba(4, 14, 28, .46) 60%, rgba(4, 14, 28, .78) 100%);
    }

    /* Console docks at the bottom edge while the hero is on screen — its
       natural spot at the hero's end falls below the fold on phones */
    .hero-console {
        position: fixed;
        left: 0; right: 0;
        bottom: calc(14px + env(safe-area-inset-bottom));
        z-index: 90;
        padding-bottom: 0;
        opacity: 0;
        transform: translateY(14px);
        pointer-events: none;
        transition: opacity .3s var(--ease), transform .3s var(--ease);
    }
    .hero.console-docked .hero-console {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
    .hero-console-inner {
        gap: 12px;
        flex-wrap: nowrap;
        background: rgba(4, 16, 31, .88);
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 14px;
        padding: 10px 12px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .hc-dest { font-size: .66rem; letter-spacing: .18em; }
    .hc-progress { order: 0; flex-basis: auto; min-width: 34px; }
    .hc-right { gap: 8px; }
    .hc-arrow { width: 36px; height: 36px; }
    .hc-dots { display: none; }

    /* Planner */
    .booking-planner { margin-top: -44px; }
    .planner-card { padding: 24px 20px; }
    .planner-grid { gap: 16px; }
    .planner-grid .field { grid-column: span 1 !important; }
    .planner-note { display: none; }
    .planner-foot .btn { width: 100%; }

    /* Story */
    .story-steps { padding-left: 34px; }
    .story-steps::before { left: 7px; }
    .story-node { left: -34px; width: 18px; height: 18px; margin-top: -9px; }
    .story-step { padding: 24px 0; }
    .story-meta { flex-wrap: wrap; gap: 12px; }
    .story-date { font-size: 1.6rem; }

    /* Showcase */
    .showcase-stage { min-height: clamp(560px, 78vh, 660px); }
    .sc-panel { padding: 24px 20px; align-items: flex-end; }
    .sc-word { font-size: clamp(2.4rem, 14vw, 4.5rem); }
    .sc-title { font-size: clamp(1.5rem, 7vw, 2.2rem); }
    .sc-points { flex-direction: column; gap: 8px; }
    .sc-item { padding: 14px 16px; }
    .sc-item:hover, .sc-item.is-active { padding-left: 16px; }

    /* Bento */
    .bento-asym {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "visual"
            "since"
            "call"
            "wa"
            "comfort"
            "plain"
            "plain2";
    }
    .wb-comfort { flex-direction: column; align-items: flex-start; }

    /* Booking flow → vertical road */
    .route-flow { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-left: 40px; padding-top: 0; position: relative; }
    .route-flow::before {
        content: "";
        position: absolute;
        left: 11px;
        top: 10px;
        bottom: 10px;
        width: 2px;
        background: repeating-linear-gradient(180deg, rgba(7, 27, 51, .22) 0 14px, transparent 14px 28px);
    }
    .rf-step { padding-top: 0; }
    .process-cta .btn { width: 100%; }

    /* Reel: swipe + labels always visible */
    .reel-head { flex-direction: column; align-items: flex-start; }
    .reel-caption { transform: none; padding: 14px 16px; }
    .reel-zoom { display: none; }

    /* Reviews */
    .reviews-head, .trust-head, .rides-head { flex-direction: column; align-items: flex-start; }

    /* Photo bands: taller crop so the image still reads on narrow screens */
    .section-shot { aspect-ratio: 16 / 10; }

    /* FAQ */
    .faq-trigger { gap: 14px; padding: 18px 2px; }
    .faq-a-inner { padding-left: calc(16px + 26px); }
    .faq-head-cta .btn { width: 100%; }

    /* CTA */
    .cta-title { font-size: clamp(1.8rem, 7.5vw, 2.6rem); }
    .cta-actions { flex-direction: column; align-items: stretch; }

    /* Contact / footer */
    .contact-form { padding: 24px 20px; }
    .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; padding: 44px 0 34px; }
    .footer-contact { grid-column: span 1; }
    .footer-bottom-inner { padding-bottom: 16px; }
    /* Contact rows: long emails must wrap, never force the page wide */
    .contact-card p,
    .contact-card address { overflow-wrap: anywhere; }

    .map-foot { flex-direction: column; align-items: stretch; }
    .map-foot-actions .btn { width: 100%; }

    .lightbox { padding: 14px; gap: 6px; }
    .lb-nav { width: 44px; height: 44px; }
    .lb-close { width: 42px; height: 42px; top: 14px; right: 14px; }
}

/* ---------- Small mobile ---------- */
@media (max-width: 520px) {
    .planner-grid { grid-template-columns: minmax(0, 1fr); }
    /* Below this width the two-column story collapses onto itself —
       stack it so the steps and creed keep room to breathe */
    .story-grid { grid-template-columns: minmax(0, 1fr); }
    .story-steps { order: 2; }
    .story-creed { margin-top: 34px; padding-left: 2px; }
    .creed { padding-left: 18px; }
    .brand-mark { width: 50px; height: 52px; }
    .brand-text strong { font-size: 1.05rem; }
    .brand-text small { font-size: .5rem; letter-spacing: .08em; }
    .site-header.is-stuck .brand-mark { width: 42px; height: 44px; }
    .header-actions .btn { padding: 10px 14px; font-size: .72rem; min-height: 40px; }

    .hero-display { font-size: clamp(1.95rem, 9.6vw, 2.75rem); }
    .hero-kicker { letter-spacing: .26em; font-size: .66rem; }

    .reel-tall  { width: 82vw; height: 50vh; }
    .reel-small { width: 70vw; height: 50vh; }
    .reel-wide  { width: 86vw; height: 50vh; }

    /* Reviews: card sized to the viewport on phones */
    .rv-card { width: min(80vw, 300px); }

    .story-display { font-size: clamp(1.7rem, 8vw, 2.4rem); }
    .section-display { font-size: clamp(1.7rem, 8vw, 2.5rem); }

    .sc-panel { padding: 20px 16px; }

    .cap-btn { padding: 0 13px; font-size: .7rem; }
    .cap-main { padding: 0 16px; }

    .re-block h3 { font-size: 1.4rem; }

    /* Trust card: keep the tag on one line and the four fleet chips in a
       single row on phones */
    .wb-visual .wb-tag { font-size: .62rem; letter-spacing: .18em; }
    .wb-fleet { gap: 5px; }
    .wb-fleet li { font-size: .58rem; letter-spacing: .1em; padding: 4px 9px; }
}

/* ---------- Very small (360px) ---------- */
@media (max-width: 380px) {
    :root { --gutter: 16px; }
    .brand-mark { width: 44px; height: 46px; }
    .brand-text strong { font-size: 1rem; }
    .brand-text small { font-size: .47rem; letter-spacing: .06em; }
    .hero-display { font-size: clamp(1.72rem, 9vw, 2.3rem); }
    .btn-lg { padding: 15px 20px; font-size: .88rem; min-height: 52px; }

    /* Trust card: a wider band on the narrowest phones so the four
       vehicles are not cropped left and right */
    .wb-visual .wb-media { height: clamp(180px, 58vw, 200px); }
    .cap-btn { padding: 0 11px; letter-spacing: .06em; }
    .fq-text { font-size: .96rem; }
    .mobile-nav-list a { font-size: 1.1rem; }
}

/* ---------- Reduced motion: stop scroll-linked layout jumps ---------- */
@media (prefers-reduced-motion: reduce) {
    .reel { height: auto !important; }
    .reel-inner { position: static; min-height: 0; }
    .reel-viewport { overflow-x: auto; }
    .reel-track { transform: none !important; }
    .story-sticky { position: static; min-height: 0; }
    .story-step { opacity: 1; }
    .faq-head { position: static; }
}

/* ---------- Print ---------- */
@media print {
    .site-header, .mobile-capsule, .wa-float, .hero-console,
    .lightbox, .mobile-menu, .scroll-progress, .booking-planner { display: none !important; }
    body { background: #fff; }
    .hero, .map-section, .cta-final { min-height: 0; }
}
