:root {
  color-scheme: light;
  --module-bg: #ffffff;
  --ink: #1b1b1b;
  --quiet: rgba(27, 27, 27, 0.62);
  --line: rgba(27, 27, 27, 0.16);
  --progress-bg: rgba(255, 255, 255, 0.38);
  --progress-fill: rgba(255, 255, 255, 0.96);
  --dot: rgba(27, 27, 27, 0.22);
  --dot-active: #1b1b1b;
  --focus: #c20d19;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 0;
  margin: 0;
  background: var(--module-bg);
}

body {
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.carousel-shell {
  display: grid;
  width: 100vw;
  min-height: 100vh;
  place-items: center;
  background: var(--module-bg);
}

.carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100vw, calc((100vh - 38px) * 1080 / 1350), 1080px);
  overflow: hidden;
  background: var(--module-bg);
  color: var(--ink);
  touch-action: pan-y;
  user-select: none;
}

.slides {
  display: flex;
  width: 100%;
  aspect-ratio: 1080 / 1350;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  transform: translate3d(calc(var(--active-slide, 0) * -100%), 0, 0);
  transition: transform 260ms ease;
}

.slide {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  background: var(--module-bg);
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.tap-zone {
  position: absolute;
  top: 36px;
  bottom: 38px;
  z-index: 3;
  width: 38%;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tap-zone-left {
  left: 0;
}

.tap-zone-right {
  right: 0;
}

.tap-zone:focus-visible {
  outline: none;
}

.carousel:focus-within {
  box-shadow: inset 0 0 0 2px rgba(194, 13, 25, 0.55);
}

.progress {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(var(--slide-count, 1), minmax(0, 1fr));
  gap: 5px;
  height: 3px;
  pointer-events: none;
}

.progress-segment {
  overflow: hidden;
  border-radius: 999px;
  background: var(--progress-bg);
}

.progress-segment::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--progress-fill);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
}

.progress-segment.is-seen::before {
  opacity: 1;
  transform: scaleX(1);
}

.progress-segment.is-active::before {
  opacity: 1;
  transform: scaleX(1);
}

.counter {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dot-indicator {
  display: flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px 2px;
  background: var(--module-bg);
  pointer-events: none;
}

.dot {
  display: block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--dot);
  transform: scale(1);
  transition: background-color 180ms ease, transform 180ms ease;
}

.dot.is-active {
  background: var(--dot-active);
  transform: scale(1.2);
}

.loading,
.error {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 20px;
  color: var(--quiet);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .slides {
    transition: none;
  }
}
