/* Service galleries: the original list remains the content source. */
:is(.home-page .service-grid, .locale-page .locale-services .service-grid) {
  --gallery-gap: 24px;
  --gallery-content-width: 100%;
  --gallery-card-width: calc((var(--gallery-content-width) - 48px) / 2.5);
  --gallery-ink: #1d1d1f;
  --gallery-secondary: #6e6e73;
  --gallery-accent: #b7ff22;
  display: flex;
  align-items: stretch;
  gap: var(--gallery-gap);
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 4px 0 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  text-align: left;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}

:is(.home-page .service-grid, .locale-page .locale-services .service-grid) > li {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 var(--gallery-card-width);
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  grid-column: auto;
  gap: 0;
  width: var(--gallery-card-width);
  min-width: 0;
  max-width: none;
  min-height: 530px;
  height: auto;
  margin: 0;
  padding: 32px 32px 24px;
  overflow: visible;
  border: 0;
  border-radius: 28px;
  background: #fff;
  box-shadow: none;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  text-align: left;
}

:is(.home-page .service-grid, .locale-page .locale-services .service-grid) > li:nth-child(n) {
  grid-column: auto;
  max-width: none;
  margin: 0;
}

:is(.home-page .service-grid, .locale-page .locale-services .service-grid) h3 {
  align-self: stretch;
  width: auto;
  max-width: none;
  margin: 0 0 16px;
  color: var(--gallery-ink);
  font-family: inherit;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.143;
  letter-spacing: -.026em;
  overflow-wrap: normal;
  text-wrap: balance;
}

:is(.home-page .service-grid, .locale-page .locale-services .service-grid) p {
  display: block;
  grid-column: auto;
  width: auto;
  max-width: none;
  margin: 0;
  color: var(--gallery-secondary);
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -.014em;
  overflow: visible;
  text-wrap: pretty;
}

:is(.home-page .service-grid, .locale-page .locale-services .service-grid) p strong {
  color: var(--gallery-ink);
  font-weight: 600;
}

:is(.home-page .service-grid, .locale-page .locale-services .service-grid) .service-icon {
  align-self: flex-start;
  width: 44px;
  height: 44px;
  margin: 0 0 24px;
  border: 0;
  border-radius: 12px;
  background: #f5f5f7;
  color: var(--gallery-ink);
  box-shadow: none;
}

/* Fallback retains its visible scrollbar and original service icons. */
:is(.home-page .service-grid, .locale-page .locale-services .service-grid):not(.v12-service-track) {
  margin-top: 36px;
}

.v12-service-gallery {
  min-width: 0;
  margin-top: 36px;
  isolation: isolate;
}

:is(.home-page .service-grid, .locale-page .locale-services .service-grid).v12-service-track {
  box-sizing: border-box;
  width: var(--gallery-viewport-width, 100%);
  margin-left: calc(-1 * var(--gallery-inset, 0px));
  padding-left: var(--gallery-inset, 0px);
  padding-right: max(0px, calc(var(--gallery-viewport-width, 100%) - var(--gallery-inset, 0px) - var(--gallery-card-width)));
  scroll-padding-left: var(--gallery-inset, 0px);
  scroll-padding-right: 0;
  scrollbar-width: none;
}

.v12-service-track::-webkit-scrollbar { display: none; }

:is(.home-page .service-grid, .locale-page .locale-services .service-grid).v12-service-track .service-icon {
  display: none;
}

.v12-service-art {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 100%;
  height: 190px;
  margin-top: auto;
  padding-top: 30px;
  box-sizing: content-box;
  color: #1d1d1f;
  pointer-events: none;
  user-select: none;
}

.v12-service-art svg {
  display: block;
  width: 100%;
  max-width: 340px;
  height: 100%;
  overflow: visible;
}

.v12-gallery-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 16px 0 0 auto;
  padding: 0;
}

.v12-gallery-arrow {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 89%);
  color: #1d1d1f;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 3%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.v12-gallery-arrow svg { width: 20px; height: 20px; }
.v12-gallery-arrow[aria-disabled="true"] { color: #6e6e73; opacity: .38; cursor: default; }
.v12-gallery-arrow:not([aria-disabled="true"]):active { transform: scale(.94); }

.v12-gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  gap: 0;
}

.v12-gallery-dot {
  display: grid;
  place-items: center;
  flex: 0 1 36px;
  width: 36px;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #6e6e73;
  cursor: pointer;
  touch-action: manipulation;
}

.v12-gallery-dot::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .42;
  transition: opacity 160ms ease, transform 160ms ease;
}

.v12-gallery-dot[aria-current="true"] { color: #1d1d1f; }
.v12-gallery-dot[aria-current="true"]::before { opacity: 1; transform: scale(1.18); }
.v12-gallery-arrow:focus-visible,
.v12-gallery-dot:focus-visible,
.v12-service-track:focus-visible { outline: 2px solid #1d1d1f; outline-offset: 4px; }

.v12-gallery-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (hover: hover) {
  .v12-gallery-arrow:not([aria-disabled="true"]):hover { background: #fff; }
  .v12-gallery-dot:hover::before { opacity: .85; }
}

@media (max-width: 1023px) {
  :is(.home-page .service-grid, .locale-page .locale-services .service-grid) {
    --gallery-card-width: calc((var(--gallery-content-width) - 24px) / 1.75);
  }
}

@media (max-width: 639px) {
  :is(.home-page .service-grid, .locale-page .locale-services .service-grid) {
    --gallery-gap: 16px;
    --gallery-card-width: calc((var(--gallery-content-width) - 16px) / 1.12);
    padding-bottom: 8px;
  }

  :is(.home-page .service-grid, .locale-page .locale-services .service-grid) > li {
    min-height: 530px;
    padding: 28px 26px 22px;
  }

  .v12-service-gallery { margin-top: 28px; }
  .v12-service-art { height: 166px; padding-top: 28px; }
  .v12-gallery-controls { max-width: 296px; margin-top: 16px; }
  .v12-gallery-dot { flex-basis: 32px; width: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .v12-service-track { scroll-behavior: auto; }
  .v12-gallery-arrow,
  .v12-gallery-dot::before { transition: none; }
}

@media (forced-colors: active) {
  :is(.home-page .service-grid, .locale-page .locale-services .service-grid) > li { border: 1px solid CanvasText; }
  .v12-gallery-arrow { border: 1px solid ButtonText; }
  .v12-gallery-dot::before { background: ButtonText; }
  .v12-gallery-dot[aria-current="true"] { outline: 1px solid Highlight; }
}
