/* Two-tone background: the tint starts part-way down the images. */
.tg-service-band {
  background: linear-gradient(to bottom, #fff 0 8rem, var(--color-paper) 8rem);
}

.tg-service-media {
  aspect-ratio: 8 / 7;
}

.tg-service-dash {
  background: var(--color-ink);
  flex: none;
  height: 1px;
  margin-top: 0.8rem;
  opacity: 0.4;
  width: 2rem;
}

/* Left edge lines up with the max-w-6xl container; right side runs to the screen edge. */
.tg-service-track {
  --tg-gutter: 1.5rem;
  --tg-inset: calc(max(0px, (100% - 80rem) / 2) + var(--tg-gutter));
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 0.75rem;
  padding-inline: var(--tg-inset) var(--tg-gutter);
  scroll-padding-inline-start: var(--tg-inset);
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
}

.tg-carousel-nav {
  display: none;
  flex-shrink: 0;
  gap: 0.5rem;
}

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

.tg-service-slide {
  flex: 0 0 min(80vw, 24rem);
  scroll-snap-align: start;
}

.tg-carousel-control {
  align-items: center;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-btn);
  display: inline-flex;
  font-size: 1.25rem;
  height: 3rem;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  width: 3rem;
}

.tg-carousel-control:hover:not(:disabled) {
  background: var(--color-ink);
  color: #fff;
}

.tg-carousel-control:disabled {
  cursor: default;
  opacity: 0.25;
}

@media (min-width: 640px) {
  .tg-carousel-nav {
    display: flex;
  }

  .tg-service-slide {
    flex-basis: calc((100% - 1.5rem) / 2.2);
  }
}

@media (min-width: 768px) {
  .tg-service-track {
    --tg-gutter: 2.5rem;
  }
}

/* Two full slides and part of the next, sized from the container width. */
@media (min-width: 1024px) {
  .tg-service-track {
    gap: 2rem;
  }

  .tg-service-slide {
    flex-basis: calc((min(100vw, 80rem) - 5rem) * 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tg-service-track {
    scroll-behavior: auto;
  }
}
