@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    padding: 0;
    margin: 0;
  }

  html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }

  body {
    min-block-size: 100vh;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-wrap: balance;
  }

  ul[role="list"],
  ol[role="list"] {
    list-style: none;
  }

  img,
  iframe,
  audio,
  video,
  canvas {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
  }

  svg {
    max-inline-size: 100%;
  }

  table {
    border-collapse: collapse;
  }

  math,
  time,
  table {
    font-variant-numeric: tabular-nums lining-nums slashed-zero;
  }

  code {
    font-variant-numeric: slashed-zero;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
  }

  input,
  button,
  textarea,
  select {
    font-family: inherit;
    font-size: inherit;
  }

  :focus-visible {
    outline-offset: 0.2rem;
  }

  :target {
    scroll-margin-block: 5ex;
  }
}

:root {
  --border: gainsboro;
  --color-bg-slider: whitesmoke;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: white;
  color: #171717;
}

.container {
margin: 1rem;
}

.entry {
  margin: 2rem 0;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: clamp(20rem, 35svh, 38rem);
  min-height: 20rem;
  max-height: 38rem;
  padding: clamp(1rem, 4vw, 3rem);
  border-radius: 0.75rem;
  position: relative;
}

h2 {
  color: #333;
  border-bottom: 3px solid #667eea;
  padding-bottom: 0.5rem;
}

h3 {
  color: #667eea;
  margin-top: 2rem;
}

.components-demo {
  margin-top: 2rem;
}

.slider {
  width: 100%;
  margin-inline: auto;
  background: var(--slider-bg, var(--color-bg-slider));
  transition: background-color 300ms ease;
  border-radius: 0.75rem;
}

.slider__viewport {
  width: min(100%, 60rem);
  margin-inline: auto;
  overflow: hidden;
}

.slider__track {
  display: grid;
}

.slider__slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: clamp(20rem, 35svh, 38rem);
  min-height: 20rem;
  max-height: 38rem;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}

.slider__slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 300ms ease, visibility 0s linear 0s;
}

.slider__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.75rem;
}

.slider__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100%, 60rem);
  margin: 1rem auto 0;
  padding: 0 1rem 1rem;
}

.slider__buttons {
  display: flex;
  gap: 0.5rem;
}

.slider__button,
.slider__dot {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.slider__button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: #171717;
  color: white;
  font: inherit;
}

.slider__button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.slider__dots {
  display: flex;
  justify-content: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
}

.slider__dot {
  position: relative;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  background: transparent;
}

.slider__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid #555;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.slider__dot[aria-current="true"]::before {
  background: #171717;
  border-color: #171717;
}

.slider__button:focus-visible,
.slider__dot:focus-visible,
.slider__slide :focus-visible {
  outline: 3px solid #075fcc;
  outline-offset: 3px;
}

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

@media (prefers-reduced-motion: reduce) {
  .slider__slide,
  .slider__slide.is-active {
    transition: none;
  }
}
