/* MOBILE: phone and tablet behaviour for the v3 pages. Linked last in <head>, so it wins over the page styles.
   Aim: feel like a native app. Compact hero with a thumb-sized button, swipeable card rows, no scroll-jacking
   (page-snap.js is off below 900px and on touch), comparison as row cards, light booking calendar. */

/* touch: no grey flash on tap, no double-tap zoom delay on controls */
a, button, summary, .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

@media (max-width: 899px) {
  /* swipeable rows: cards slide sideways and settle on a card, with the next one peeking in */
  #channels .ch__grid, #proof .q-row {
    display: flex !important; gap: 12px; width: auto; margin-left: 0; margin-right: 0;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    padding: 4px 24px 20px; scroll-padding: 0 24px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  #channels .ch__grid::-webkit-scrollbar, #proof .q-row::-webkit-scrollbar { display: none; }
  #channels .ch-card { flex: 0 0 min(78%, 320px); scroll-snap-align: start; }

  #proof .q-row { border-top: 0; margin-top: 36px; }
  #proof .q-row .q, #proof .q-row .q + .q {
    flex: 0 0 min(84%, 340px); scroll-snap-align: start; margin: 0; padding: 22px 20px 20px !important;
    border: 0 !important; border-radius: 18px; background: #f6f7fb;
  }
  #proof .q-row blockquote { font-size: 17px; line-height: 1.45; }
  #proof .q-row figcaption { margin-top: 14px; font-size: 14px; }
}

/* upright tablets and phones: the hero is compact, content first, the button right under the line
   (the desktop's full-screen hero leaves a void in a tall, narrow screen) */
@media (max-width: 1023px) and (orientation: portrait), (max-width: 639px) {
  main > section.hero--c { height: auto !important; min-height: 0 !important; padding-bottom: 24px !important; }
  .hero-mid { flex: none !important; min-height: 0 !important; margin-top: 36px; }
  .hero-logos { margin-top: 64px; }
  main > section.hero--c:not(:has(.hero-logos)) { padding-bottom: 56px !important; }
}

@media (max-width: 639px) {
  /* phones: the button is full width, like an app's main action */
  .hero--c .hero-sub { font-size: 17px; margin-top: 16px; }
  .hero-mid { margin-top: 28px; padding: 0 20px; }
  .hero--c .hero-cta { width: 100%; }
  .hero--c .hero-cta .btn { width: 100%; height: 54px; justify-content: center; border-radius: 14px; font-size: 16px; }
  .hero-logos { margin-top: 48px; padding-bottom: 12px; }
  .hero-logos .marquee__set { gap: 40px; padding-right: 40px; }
  .hero-logos .marquee__set img { width: 92px; height: 24px; padding: 0; }
  .hero-logos .marquee__set img.lg-unilever { height: 32px; }
  .hero-logos .marquee__set img.lg-godrej { height: 28px; }

  /* comparison: each row becomes a small card, the agency answer muted beside InquiSight's */
  table.cmp, table.cmp tbody { display: block; width: calc(100% - 40px); margin-left: auto; margin-right: auto; }
  table.cmp thead { display: none; }
  table.cmp tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 0; border-bottom: 1px solid rgba(9, 9, 11, .07); }
  table.cmp tbody tr:last-child { border-bottom: 0; }
  table.cmp tbody th { grid-column: 1 / -1; width: auto !important; padding: 0 0 2px !important; border: 0 !important; font-size: 13px; }
  table.cmp tbody td { padding: 10px 12px !important; border: 0 !important; border-radius: 12px !important; font-size: 14.5px; line-height: 1.35; background: #f4f4f5; }
  table.cmp tbody td.cmp__us { background: #f0f2fd; color: #09090b; }
  table.cmp tbody td::before { content: "Agency"; display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 500; color: #a1a1aa; }
  table.cmp tbody td.cmp__us::before { content: "InquiSight"; color: #3f51d1; }
  table.cmp tbody .cmp__us svg { display: none !important; }

  /* one even rhythm between sections on a phone, instead of the desktop's tall gaps */
  main > section.hw-sec, main > section.ch, main > section.cmp-sec, main > .quotes-sec, main > section.sp-sec { padding-top: 72px !important; padding-bottom: 56px !important; }
  main > section.uc { padding-top: 72px !important; padding-bottom: 40px !important; }
  #proof .q-row { margin-top: 28px; padding-bottom: 4px; }

  /* booking: the calendar uses the full width of the screen */
  .close-cal { margin-left: -8px; margin-right: -8px; border-radius: 18px; }
}

/* the open phone menu: comfortable rows, safe area at the bottom */
@media (max-width: 1023px) {
  .nav.is-open .nav__link { min-height: 48px; display: flex; align-items: center; }
  .nav.is-open .nav__menu .menu-col a { min-height: 44px; display: flex; align-items: center; }
  footer, .nav.is-open { padding-bottom: env(safe-area-inset-bottom); }
}
