/* WordPress theme-html (.wpdev-theme-page)
   1) why-bg .feature-grid — mobile horizontal carousel
   2) #services .service-grid — scroll stack (cards stack on scroll; NOT carousel)
   3) .sec-ink .problem-grid — mobile horizontal carousel (1 row)
   4) #process .process-list — scroll stack (cards stack on scroll; NOT carousel)
   Desktop: untouched. */

/* Sticky needs a non-hidden ancestor scrollport */
body.page-theme-html.page-service section#services.has-page-svc-stack,
body.page-theme-html.page-service section#process.has-page-svc-stack,
.wpdev-theme-page section#services.has-page-svc-stack,
.wpdev-theme-page section#process.has-page-svc-stack {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

.wpdev-theme-page #services .service-grid.page-svc-stack,
.wpdev-theme-page #process .process-list.page-svc-stack {
  overflow: visible !important;
  transform: none !important;
  filter: none !important;
  contain: none !important;
}

/* Mobile/tablet: 1-col sticky stack — cards pile as you scroll */
@media (max-width: 900px) {
  .wpdev-theme-page #services .service-grid.page-svc-stack,
  .wpdev-theme-page #process .process-list.page-svc-stack {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }

  .wpdev-theme-page #services .service-grid.page-svc-stack .svc-stack-item,
  .wpdev-theme-page #process .process-list.page-svc-stack .svc-stack-item {
    position: sticky;
    width: 100% !important;
    max-width: 100% !important;
  }

  .wpdev-theme-page #services .service-grid.page-svc-stack .svc-card,
  .wpdev-theme-page #process .process-list.page-svc-stack .proc {
    opacity: 1 !important;
    background: var(--paper, #fff) !important;
    box-shadow:
      0 1px 2px rgba(13, 32, 41, 0.04),
      0 10px 28px -16px rgba(13, 32, 41, 0.16) !important;
  }

  .wpdev-theme-page #services .service-grid.page-svc-stack .svc-card:hover,
  .wpdev-theme-page #process .process-list.page-svc-stack .proc:hover {
    transform: none !important;
  }
}

/* Desktop: keep original multi-col grid, no sticky */
@media (min-width: 901px) {
  .wpdev-theme-page #services .service-grid.page-svc-stack {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 20px !important;
  }

  .wpdev-theme-page #process .process-list.page-svc-stack {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 18px !important;
  }

  .wpdev-theme-page #services .service-grid.page-svc-stack .svc-stack-item,
  .wpdev-theme-page #process .process-list.page-svc-stack .svc-stack-item {
    position: relative !important;
    top: auto !important;
    margin: 0 !important;
    transform: none !important;
  }

  .wpdev-theme-page #services .service-grid.page-svc-stack .svc-stack-item > *,
  .wpdev-theme-page #process .process-list.page-svc-stack .svc-stack-item > * {
    transform: none !important;
  }
}

@media (max-width: 767px) {
  body.page-theme-html .wpdev-theme-page .why-bg .wrap,
  .wpdev-theme-page.theme-html-root .why-bg .wrap,
  .wpdev-theme-page .why-bg .wrap {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body.page-theme-html .wpdev-theme-page .why-bg .why-mobile-carousel,
  .wpdev-theme-page.theme-html-root .why-bg .why-mobile-carousel,
  .wpdev-theme-page .sec-ink.why-bg .why-mobile-carousel,
  .wpdev-theme-page .why-bg .why-mobile-carousel {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }

  body.page-theme-html .wpdev-theme-page .why-bg .why-mobile-carousel::-webkit-scrollbar,
  .wpdev-theme-page .why-bg .why-mobile-carousel::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
  }

  body.page-theme-html .wpdev-theme-page .why-bg .why-mobile-carousel .feature-grid,
  .wpdev-theme-page.theme-html-root .why-bg .why-mobile-carousel .feature-grid,
  .wpdev-theme-page .why-bg .why-mobile-carousel .feature-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: max-content !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
  }

  body.page-theme-html .wpdev-theme-page .why-bg .why-mobile-carousel .feat-card,
  .wpdev-theme-page.theme-html-root .why-bg .why-mobile-carousel .feat-card,
  .wpdev-theme-page .why-bg .why-mobile-carousel .feat-card,
  .wpdev-theme-page .why-bg .why-mobile-carousel .feature-grid > * {
    flex: 0 0 85vw !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    width: 85vw !important;
    min-width: 85vw !important;
    max-width: 85vw !important;
    height: auto !important;
    box-sizing: border-box !important;
    scroll-snap-align: start !important;
  }

  .wpdev-theme-page .why-bg .why-mobile-carousel .feat-card:hover {
    transform: none !important;
  }

  body.page-theme-html .wpdev-theme-page #why-us .wrap,
  .wpdev-theme-page #why-us .wrap {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body.page-theme-html .wpdev-theme-page #why-us .why-mobile-carousel,
  .wpdev-theme-page #why-us .why-mobile-carousel,
  .wpdev-theme-page .why-mobile-carousel:has(> .why-grid) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }

  .wpdev-theme-page #why-us .why-mobile-carousel::-webkit-scrollbar,
  .wpdev-theme-page .why-mobile-carousel:has(> .why-grid)::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
  }

  html body.page-theme-html .wpdev-theme-page #why-us .why-grid,
  .wpdev-theme-page #why-us .why-grid,
  .wpdev-theme-page .why-grid,
  .wpdev-theme-page #why-us .why-mobile-carousel .why-grid,
  .wpdev-theme-page .why-mobile-carousel > .why-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }

  .wpdev-theme-page #why-us .why-mobile-carousel .why-grid,
  .wpdev-theme-page .why-mobile-carousel > .why-grid {
    width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
  }

  html body.page-theme-html .wpdev-theme-page #why-us .why-grid > .why-card,
  .wpdev-theme-page #why-us .why-grid > .why-card,
  .wpdev-theme-page .why-grid > .why-card,
  .wpdev-theme-page #why-us .why-grid > *,
  .wpdev-theme-page .why-mobile-carousel .why-grid > * {
    flex: 0 0 85vw !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    width: 85vw !important;
    min-width: 85vw !important;
    max-width: 85vw !important;
    height: auto !important;
    box-sizing: border-box !important;
    scroll-snap-align: start !important;
  }

  .wpdev-theme-page #why-us .why-card:hover,
  .wpdev-theme-page .why-grid > .why-card:hover {
    transform: none !important;
  }

  /* .problem-grid — beat theme @media(max-width:560px){1fr} vertical stack */
  body.page-theme-html .wpdev-theme-page .problem-grid,
  .wpdev-theme-page.theme-html-root .problem-grid,
  .wpdev-theme-page .sec-ink .problem-grid,
  .wpdev-theme-page .problem-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin-top: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    overscroll-behavior-x: contain !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }

  body.page-theme-html .wpdev-theme-page .problem-grid::-webkit-scrollbar,
  .wpdev-theme-page .problem-grid::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
  }

  body.page-theme-html .wpdev-theme-page .problem-grid .problem-card,
  .wpdev-theme-page.theme-html-root .problem-grid .problem-card,
  .wpdev-theme-page .problem-grid > .problem-card {
    flex: 0 0 85vw !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    width: 85vw !important;
    min-width: 85vw !important;
    max-width: 85vw !important;
    height: auto !important;
    box-sizing: border-box !important;
    scroll-snap-align: start !important;
  }

  .wpdev-theme-page .problem-grid .problem-card:hover {
    transform: none !important;
  }
}

/* By The Numbers — 2-up on phones (beats .page-service .stats { 1fr }) */
@media (max-width: 680px) {
  html body.page-service .wpdev-theme-page .stats,
  html body.page-theme-html .wpdev-theme-page .stats,
  .wpdev-theme-page .stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px 16px !important;
  }
  html body.page-service .wpdev-theme-page .stat,
  .wpdev-theme-page .stat {
    min-width: 0 !important;
    padding: 10px 0 10px 14px !important;
    border-left: 1px solid rgba(255, 255, 255, 0.16) !important;
  }
  html body.page-service .wpdev-theme-page .stat:nth-child(odd),
  .wpdev-theme-page .stat:nth-child(odd) {
    border-left: none !important;
    padding-left: 0 !important;
  }
  html body.page-service .wpdev-theme-page .stat:nth-child(n + 3),
  .wpdev-theme-page .stat:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 16px !important;
  }
  html body.page-service .wpdev-theme-page .stat .num,
  .wpdev-theme-page .stat .num {
    font-size: clamp(1.45rem, 7vw, 2rem) !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  html body.page-service .wpdev-theme-page .stat .lbl,
  .wpdev-theme-page .stat .lbl {
    font-size: 0.62rem !important;
    letter-spacing: 0.06em !important;
    line-height: 1.35 !important;
    white-space: normal !important;
  }
}
