/* -------------------------------- 

File#: _3_carousel-v2
Title: Carousel v2
Descr: Display a list of items and navigate through them
Usage: codyhouse.co/license

-------------------------------- */

/* variables */
:root {
  /* colors */
  --cl6-color-primary-hsl: 250, 84%, 54%;
  --cl6-color-bg-hsl: 0, 0%, 100%;
  --cl6-color-contrast-high-hsl: 230, 7%, 23%;
  --cl6-color-contrast-higher-hsl: 230, 13%, 9%;
  --cl6-color-black-hsl: 230, 13%, 9%;
  --cl6-color-white-hsl: 0, 0%, 100%;

  /* spacing */
  --cl6-space-3xs: 0.25rem;
  --cl6-space-2xs: 0.375rem;
  --cl6-space-xs: 0.5rem;
  --cl6-space-sm: 0.75rem;
  --cl6-space-md: 1.25rem;
}

@media(min-width: 64rem){
  :root {
    /* spacing */
    --cl6-space-3xs: 0.375rem;
    --cl6-space-2xs: 0.5625rem;
    --cl6-space-xs: 0.75rem;
    --cl6-space-sm: 1.125rem;
    --cl6-space-md: 2rem;
  }
}

/* icons */
.cl6-icon {
  height: var(--cl6-size, 1em);
  width: var(--cl6-size, 1em);
  display: inline-block;
  color: inherit;
  fill: currentColor;
  line-height: 1;
  flex-shrink: 0;
  max-width: initial;
}

/* component */
.carousel-v2 {
  --carousel-grid-gap: var(--cl6-space-md);
  --carousel-item-auto-size: 280px;
  --carousel-transition-duration: 0.5s;
}
.carousel-v2 .carousel__wrapper:hover .carousel-v2__control {
  opacity: 1;
}

.carousel-v2__control {
  --cl6-size: 60px;
  height: var(--cl6-size);
  width: var(--cl6-size);
  border-radius: 50%;
  background-color: hsla(var(--cl6-color-black-hsl), 0.7);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  pointer-events: auto;
  cursor: pointer;
  margin: 0 var(--cl6-space-2xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.carousel-v2__control:hover {
  background-color: hsla(var(--cl6-color-black-hsl), 0.9);
}
.carousel-v2__control[disabled] {
  display: none;
}
.carousel-v2__control:active {
  -webkit-transform: translateY(2px);
          transform: translateY(2px);
}
.carousel-v2__control .cl6-icon {
  --cl6-size: 20px;
  display: block;
  color: hsl(var(--cl6-color-white-hsl));
}
@media (min-width: 64rem) {
  .carousel-v2__control {
    opacity: 0;
  }
}

.carousel-v2__navigation {
  display: none;
  grid-template-columns: repeat(auto-fit, 52px);
  grid-gap: var(--cl6-space-xs);
  justify-content: center;
  align-items: center;
  margin-top: var(--cl6-space-sm);
}

@media (min-width: 64rem) {
  .carousel-v2__navigation {
    display: grid;
  }
}
.carousel-v2__navigation-item {
  display: inline-block;
  margin: 0 var(--cl6-space-3xs);
}
@supports (grid-area: auto) {
  .carousel-v2__navigation-item {
    margin: 0;
  }
}
.carousel-v2__navigation-item:not(.carousel-v2__navigation-item--selected) button {
  cursor: pointer;
}
.carousel-v2__navigation-item button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 52px;
  height: 24px;
}
.carousel-v2__navigation-item button::before {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background-color: hsla(var(--cl6-color-contrast-high-hsl), 0.2);
}
.carousel-v2__navigation-item:not(.carousel-v2__navigation-item--selected) button:hover::before {
  background-color: hsla(var(--cl6-color-contrast-high-hsl), 0.4);
  transition: 0.2s;
}

.carousel-v2__navigation-item--selected button::before {
  background-color: hsla(var(--cl6-color-contrast-high-hsl), 1);
}

/* utility classes */
.cl6-justify-between {
  justify-content: space-between;
}

.cl6-items-center {
  align-items: center;
}

.cl6-flex {
  display: flex;
}

.cl6-pointer-events-none {
  pointer-events: none;
}

.cl6-right-0 {
  right: 0;
}

.cl6-bottom-0 {
  bottom: 0;
}

.cl6-left-0 {
  left: 0;
}

.cl6-top-0 {
  top: 0;
}

.cl6-position-absolute {
  position: absolute;
}

.cl6-width-100\% {
  width: 100%;
}

.cl6-block {
  display: block;
}

.cl6-overflow-hidden {
  overflow: hidden;
}

.cl6-position-relative {
  position: relative;
}

.cl6-sr-only {
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.cl6-flex-column {
  flex-direction: column;
}