/* ==========================================================================
   Intellinez Studio — theme-responsive.css
   Media queries only. theme.css is desktop-first; breakpoints mirror
   Tailwind defaults: md = 768px, lg = 1024px.
   ========================================================================== */

/* ==========================================================================
   Tablet — max-width: 1023px  (below Tailwind's `lg`)
   ========================================================================== */
@media (max-width: 1023px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-visual { height: 380px; order: -1; }

  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-card.is-featured { transform: none; grid-column: span 2; }

  .content-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-post-card { grid-template-columns: 1fr; }
  .featured-post-title { font-size: 1.625rem; }
  .featured-post-body { padding: 2rem; }

  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .team-leader-avatar-ring { width: 8rem; height: 8rem; }

  /* .article-layout/.article-sidebar/.sidebar-card are already full-width
     and stacked at every breakpoint by default — nothing to override here. */

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: span 2; }
}

/* ==========================================================================
   Mobile — max-width: 767px  (below Tailwind's `md`)
   ========================================================================== */
@media (max-width: 767px) {
  .container { padding-inline: 1.25rem; }
  .section { padding-block: 2.5rem; /* 40px */ }

  /* Forms: paired fields (e.g. First/Last Name) stack to full width below
     tablet, where a 50%/33% column is too narrow to type in. */
  .wpforms-field--half,
  .wpforms-field--third {
    flex-basis: 100%;
  }

  /* Brands logo carousel: shorter travel distance and tighter spacing so the
     loop doesn't feel sluggish on narrow viewports. */
  .logo-strip-track { gap: 3rem; padding-right: 3rem; animation-duration: 30s; }
  .logo-strip img { max-height: 2.75rem; max-width: 10rem; }

  /* Header / nav */
  .nav-desktop, .nav-cta { display: none; }
  .nav-mobile-toggle { display: block; }
  .nav-mobile-menu.is-open { display: block; }
  .nav-mobile-menu-inner { display: flex; flex-direction: column; gap: 0.25rem; padding-block: 1rem; }

  /* Typography scale */
  .hero-title { font-size: 3rem; }
  .hero-subtitle { font-size: 1.0625rem; }
  .section-heading { font-size: 2.25rem; }
  .page-hero-title { font-size: 2.5rem; }
  .content-hero-title { font-size: 2.5rem; }
  .article-title { font-size: 1.75rem; }
  .featured-card-title { font-size: 1.375rem; }
  .content-card-title { font-size: 1.25rem; }

  /* Hero */
  .hero { padding-top: 6rem; padding-bottom: 3rem; }
  .hero-visual { height: 280px; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; }
  .hero-trust { flex-direction: column; gap: 0.75rem; }

  /* Grids -> single column */
  .grid-2, .grid-3, .grid-4,
  .pricing-grid,
  .content-grid,
  .stats-grid,
  .mini-case-metrics,
  .article-metrics-band,
  .compare-row {
    grid-template-columns: 1fr;
  }
  .pricing-card.is-featured { grid-column: auto; }

  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .team-leaders-grid { grid-template-columns: 1fr; max-width: 24rem; gap: 1.5rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-grid > :first-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }

  /* Service group / case / featured cards -> stacked */
  .service-group-card:not(:last-child) { margin-bottom: 0; }

  .case-card, .case-card--reverse { grid-template-columns: 1fr; gap: 1.5rem; }
  .case-card--reverse .case-card-media { order: 0; }

  .featured-card { grid-template-columns: 1fr; }
  .featured-card-body { padding: 1.75rem; }

  .sidebar-card { padding: 1.25rem; }

  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-form-card { padding: 1.5rem; }

  .back-to-top { width: 2.5rem; height: 2.5rem; bottom: 1rem; left: 1rem; }

  /* Timeline switches to single-column, left-aligned rail.
     Specificity note: the desktop rule for normal (non-reverse) rows is
     `.timeline-row:not(.timeline-row--reverse) .timeline-card` — the
     :not() argument counts toward specificity, making that selector
     (0,3,0) versus this override's original (0,2,0), so the desktop
     grid-column/margin/text-align silently kept winning here even at
     mobile widths. Prefixing with `.timeline` brings this to (0,3,0) too,
     so the tie resolves by source order (this file loads after
     theme.css) instead of the desktop rule always winning outright. */
  .timeline-connector { left: 1.5rem; }
  .timeline .timeline-row,
  .timeline .timeline-row--reverse {
    grid-template-columns: auto 1fr;
    gap: 1rem;
    text-align: left;
  }
  .timeline .timeline-row .timeline-dot,
  .timeline .timeline-row--reverse .timeline-dot { grid-column: 1; }
  .timeline .timeline-row .timeline-card,
  .timeline .timeline-row--reverse .timeline-card { grid-column: 2; margin-left: 0; margin-right: 0; max-width: none; text-align: left; }
  .timeline .timeline-row .timeline-card-head,
  .timeline .timeline-row--reverse .timeline-card-head { flex-direction: row; justify-content: flex-start; }

  /* Testimonials */
  .testimonial-card { flex-basis: 82vw; }

  /* Compare table collapses to stacked feature blocks */
  .compare-row--header { display: none; }
  .compare-row { gap: 0.5rem; margin-bottom: 1.25rem; }
  .compare-feature-label { font-weight: 600; }

  /* Pain points / solutions / mini case */
  .mini-case-card { padding: 1.5rem; }
  .mini-case-metrics { gap: 1rem; }

  .page-hero { padding-top: 5.5rem; padding-bottom: 2rem; }
  .content-hero { padding-top: 5.5rem; padding-bottom: 1.5rem; }
  .article-header { padding-top: 5.5rem; padding-bottom: 1.25rem; }
  .breadcrumb-row { margin-bottom: 0.75rem; }
}

/* ==========================================================================
   Small mobile — max-width: 479px
   ========================================================================== */
@media (max-width: 479px) {
  .hero-title { font-size: 2.25rem; }
  .section-heading { font-size: 1.75rem; }
  .page-hero-title { font-size: 2rem; }
  .content-hero-title { font-size: 2rem; }
  .pricing-card { padding: 1.5rem; }
  .testimonial-card { flex-basis: 88vw; }
}
