/* Layout based on the Squeeze Carousel by Yura Dubinin on 21st.dev. */
.service-carousel {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: clamp(38px, 5.8vw, 83px);
}

.squeeze-stage {
  --gap: clamp(8px, 1.75%, 22px);
  --available: calc(100% - 5 * var(--gap));
  --wide: .64;
  --next: .18;
  --third: .087;
  --fourth: .045;
  --fifth: .028;
  position: relative;
  height: clamp(250px, 36vw, 468px);
  overflow: clip;
  isolation: isolate;
  touch-action: pan-y;
}

.squeeze-panel {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: calc(var(--available) * var(--wide));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: clamp(6px, .6vw, 9px);
  background: #23323b;
  color: white;
  cursor: pointer;
  text-align: left;
  transition: left 1s cubic-bezier(.22, 1, .36, 1), width 1s cubic-bezier(.22, 1, .36, 1);
}

.squeeze-panel:is([data-slot="1"], :nth-child(2):not([data-slot])) {
  left: calc(var(--available) * var(--wide) + var(--gap));
  width: calc(var(--available) * var(--next));
}

.squeeze-panel:is([data-slot="2"], :nth-child(3):not([data-slot])) {
  left: calc(var(--available) * (var(--wide) + var(--next)) + 2 * var(--gap));
  width: calc(var(--available) * var(--third));
}

.squeeze-panel:is([data-slot="3"], :nth-child(4):not([data-slot])) {
  left: calc(var(--available) * (var(--wide) + var(--next) + var(--third)) + 3 * var(--gap));
  width: calc(var(--available) * var(--fourth));
}

.squeeze-panel:is([data-slot="4"], :nth-child(5):not([data-slot])) {
  left: calc(var(--available) * (var(--wide) + var(--next) + var(--third) + var(--fourth)) + 4 * var(--gap));
  width: calc(var(--available) * var(--fifth));
}

.squeeze-panel:is([data-slot="5"], :nth-child(6):not([data-slot])) {
  left: calc(var(--available) * (var(--wide) + var(--next) + var(--third) + var(--fourth) + var(--fifth)) + 5 * var(--gap));
  width: calc(var(--available) * (1 - var(--wide) - var(--next) - var(--third) - var(--fourth) - var(--fifth)));
}

.squeeze-panel img,
.squeeze-panel::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.squeeze-panel img { object-fit: cover; }
.squeeze-panel::after {
  content: "";
  background: linear-gradient(transparent 48%, rgb(0 0 0 / 66%));
  opacity: 0;
  transition: opacity .45s ease;
}

.squeeze-panel span {
  position: absolute;
  z-index: 1;
  left: clamp(14px, 2.6vw, 34px);
  bottom: clamp(17px, 2.6vw, 34px);
  max-width: calc(100% - 28px);
  font-size: clamp(16px, 1.55vw, 22px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.squeeze-panel[aria-pressed="true"] { z-index: 1; }
.squeeze-panel[aria-pressed="true"]::after,
.squeeze-panel[aria-pressed="true"] span { opacity: 1; }
.squeeze-panel[aria-pressed="true"] span { transition-delay: .18s; }
.squeeze-panel:focus-visible { outline-offset: -4px; z-index: 2; }

.squeeze-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.service-description {
  margin: 0;
  color: #505b64;
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.5;
}

.squeeze-controls { display: flex; flex: none; gap: 8px; }
.squeeze-controls button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #b7c0c8;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 19px;
  cursor: pointer;
}
.squeeze-controls button:hover { background: var(--ink); border-color: var(--ink); color: white; }

@media (min-width: 571px) and (hover: hover) and (pointer: fine) {
  .squeeze-stage:has([data-slot="1"]:hover) { --wide: .61; --next: .21; }
  .squeeze-stage:has([data-slot="2"]:hover) { --wide: .61; --third: .117; }
  .squeeze-stage:has([data-slot="3"]:hover) { --wide: .61; --fourth: .075; }
  .squeeze-stage:has([data-slot="4"]:hover) { --wide: .61; --fifth: .058; }
  .squeeze-stage:has([data-slot="5"]:hover) { --wide: .61; }
}

@media (max-width: 570px) {
  .squeeze-stage { --wide: .56; --next: .17; --third: .105; --fourth: .075; --fifth: .052; height: 255px; }
  .squeeze-footer { align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  .squeeze-panel, .squeeze-panel::after, .squeeze-panel span {
    transition: none;
  }
}
