/* Printco expertise stack repair.
   The former cards were children of a one-column CSS grid; each grid row limited
   its own sticky range. A normal block stack lets all cards share one sticky
   containing block, so the cards layer as the visitor scrolls through them. */
@media (min-width: 901px) {
  .home-expertise,
  .home-expertise > .container,
  .home-expertise__grid {
    overflow: visible !important;
  }

  .home-expertise {
    isolation: isolate !important;
  }

  .home-expertise__grid {
    display: block !important;
    position: relative !important;
    max-width: 1040px !important;
    margin: 0 auto !important;
    padding: 8px 0 0 !important;
    gap: 0 !important;
  }

  .home-expertise__grid > .home-service-card {
    position: sticky !important;
    top: var(--stack-top, 106px) !important;
    z-index: var(--stack-layer, 21) !important;
    display: grid !important;
    grid-template-columns: minmax(210px, .37fr) minmax(0, 1fr) !important;
    width: 100% !important;
    height: 228px !important;
    min-height: 228px !important;
    margin: 0 0 18px !important;
    transform: none !important;
    opacity: 1 !important;
    transition: box-shadow .25s ease, border-color .25s ease !important;
  }

  .home-expertise__grid > .home-service-card:nth-child(1) { --stack-top: 106px; --stack-layer: 21; }
  .home-expertise__grid > .home-service-card:nth-child(2) { --stack-top: 166px; --stack-layer: 22; }
  .home-expertise__grid > .home-service-card:nth-child(3) { --stack-top: 226px; --stack-layer: 23; }
  .home-expertise__grid > .home-service-card:nth-child(4) { --stack-top: 286px; --stack-layer: 24; }
  .home-expertise__grid > .home-service-card:nth-child(5) { --stack-top: 346px; --stack-layer: 25; }
  .home-expertise__grid > .home-service-card:nth-child(6) { --stack-top: 406px; --stack-layer: 26; }

  .home-expertise__grid > .home-service-card:last-of-type {
    margin-bottom: 0 !important;
  }

  /* Keep a little scroll runway after the last card so the final sticky card
     does not immediately unstick when it reaches the end of the section. */
  .home-expertise .home-expertise__grid::after {
    content: "" !important;
    display: block !important;
    height: 270px !important;
    background: transparent !important;
  }
}

/* Tablet/mobile use a normal list: no overlap and no cramped sticky offsets. */
@media (max-width: 900px) {
  .home-expertise,
  .home-expertise > .container,
  .home-expertise__grid {
    overflow: visible !important;
  }

  .home-expertise__grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
    padding: 8px 0 32px !important;
  }

  .home-expertise .home-expertise__grid::after {
    content: none !important;
    display: none !important;
  }

  .home-expertise__grid > .home-service-card {
    position: relative !important;
    top: auto !important;
    z-index: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 228px !important;
    margin: 0 !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

@media (max-width: 600px) {
  .home-expertise__grid > .home-service-card {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0 !important;
  }

  .home-expertise__grid > .home-service-card .home-service-card__image,
  .home-expertise__grid > .home-service-card .home-service-card__image img {
    height: 175px !important;
    min-height: 175px !important;
  }

  .home-expertise__grid > .home-service-card .home-service-card__body {
    height: auto !important;
    min-height: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-expertise__grid > .home-service-card { transition: none !important; }
}

/* Mobile stacked-card repair (phones). Keep the stack effect on touch screens
   while making the card heading and CTA remain visible in the exposed strip. */
@media (max-width: 600px) {
  .home-expertise,
  .home-expertise > .container,
  .home-expertise__grid {
    overflow: visible !important;
  }

  .home-expertise {
    isolation: isolate !important;
  }

  .home-expertise__grid {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 8px 0 54px !important;
    gap: 0 !important;
  }

  .home-expertise__grid > .home-service-card {
    position: sticky !important;
    top: var(--mobile-stack-top, 74px) !important;
    z-index: var(--mobile-stack-layer, 31) !important;
    display: grid !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    grid-template-columns: 88px minmax(0, 1fr) !important;
    grid-template-rows: 150px !important;
    width: 100% !important;
    height: 150px !important;
    min-height: 150px !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    overflow: hidden !important;
    transform: none !important;
    opacity: 1 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 20px rgba(0, 32, 56, .12) !important;
    transition: box-shadow .2s ease, border-color .2s ease !important;
    scroll-margin-top: 74px !important;
  }

  .home-expertise__grid > .home-service-card:nth-child(1) { --mobile-stack-top: 74px; --mobile-stack-layer: 31; }
  .home-expertise__grid > .home-service-card:nth-child(2) { --mobile-stack-top: 136px; --mobile-stack-layer: 32; }
  .home-expertise__grid > .home-service-card:nth-child(3) { --mobile-stack-top: 198px; --mobile-stack-layer: 33; }
  .home-expertise__grid > .home-service-card:nth-child(4) { --mobile-stack-top: 260px; --mobile-stack-layer: 34; }
  .home-expertise__grid > .home-service-card:nth-child(5) { --mobile-stack-top: 322px; --mobile-stack-layer: 35; }
  .home-expertise__grid > .home-service-card:nth-child(6) { --mobile-stack-top: 384px; --mobile-stack-layer: 36; }

  .home-expertise__grid > .home-service-card .home-service-card__image,
  .home-expertise__grid > .home-service-card .home-service-card__image img {
    display: block !important;
    width: 88px !important;
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    object-fit: cover !important;
    align-self: stretch !important;
  }

  .home-expertise__grid > .home-service-card .home-service-card__body {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    padding: 6px 9px !important;
    overflow: hidden !important;
    gap: 0 !important;
  }

  .home-expertise__grid > .home-service-card .home-service-card__body h3 {
    order: 1 !important;
    display: -webkit-box !important;
    width: 100% !important;
    max-height: 34px !important;
    margin: 0 0 8px !important;
    overflow: hidden !important;
    color: #002038 !important;
    font-size: 16px !important;
    line-height: 1.12 !important;
    font-weight: 750 !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
  }

  /* Keep a short description available on the currently exposed card, while
     the compact title and pink action remain readable on the stack's top edge. */
  .home-expertise__grid > .home-service-card .home-service-card__body p {
    order: 3 !important;
    display: -webkit-box !important;
    width: 100% !important;
    max-height: 30px !important;
    margin: 9px 0 0 !important;
    overflow: hidden !important;
    color: #4e5d69 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
  }

  .home-expertise__grid > .home-service-card .home-service-card__cta {
    order: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    align-self: flex-start !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 2px !important;
    padding: 4px 8px !important;
    border-radius: 5px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  .home-expertise__grid > .home-service-card .home-service-card__number {
    left: 6px !important;
    top: 6px !important;
    font-size: 11px !important;
  }

  .home-expertise .home-expertise__grid::after {
    content: "" !important;
    display: block !important;
    height: 360px !important;
    background: transparent !important;
    pointer-events: none !important;
  }
}


@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
  .home-expertise__grid > .home-service-card { transition: none !important; }
}
