/*
    @see also https://codepen.io/kristen17/pen/wvPebxy
    @see other https://codepen.io/onion2k/pen/xxZYBVj
    @see other https://codepen.io/Schepp/pen/WNbQByE
*/

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
  :root {
    --carousel-item-width: 70px !important;
    --carousel-item-expand-width: 200px !important;
    --carousel-item-textsize-title: 1.2rem !important;
    --carousel-item-textsize-sub: 0.9rem !important;
  }
}

/* Medium devices (laptops/desktops, 992px and down) */
@media only screen and (min-width: 601px) and (max-width: 991px) {
  :root {
    --carousel-item-width: 130px !important;
    --carousel-item-expand-width: 250px !important;
  }
}

:root {
  --carousel-item-width: 160px;
  --carousel-item-expand-width: 350px;
  --carousel-item-textsize-title: 1.5rem;
  --carousel-item-textsize-sub: 1.2rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.carousel-parent-container {
  min-height: 600px;
  display: grid;
  place-items: center;
  font-family: HeadlandOne;
  font-weight: 400;
}

.container {
  width: 100%;
  max-width: 100vw;
  display: flex;
  justify-content: center;
  height: 500px;
  gap: 10px;

  > div {
    flex: 0 0 var(--carousel-item-width);
    border-radius: 0.5rem;
    transition: 0.5s ease-in-out;
    cursor: pointer;
    box-shadow: 1px 5px 15px rgba(var(--secondary-color), 1);
    position: relative;
    overflow: hidden;

    &:nth-of-type(1) {
      background: url('/images/np_cover_a1.jpg') no-repeat 50% / cover;
    }
    &:nth-of-type(2) {
      background: url('/images/np_cover_a2.jpg') no-repeat 50% / cover;
    }
    &:nth-of-type(3) {
      background: url('/images/np_cover_a3.jpg') no-repeat 50% / cover;
    }
    &:nth-of-type(4) {
      background: url('https://images.pexels.com/photos/247322/pexels-photo-247322.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260')
        no-repeat 50% / cover;
    }

    .content {
      font-size: var(--carousel-item-textsize-title);
      color: #fff;
      display: flex;
      align-items: center;
      padding: 15px;
      opacity: 0;
      flex-direction: column;
      height: 100%;
      justify-content: flex-end;
      background: rgba(var(--accent-color), 1);
      background: linear-gradient(0deg, rgba(var(--accent-color), 0.6755077030812324) 0%, rgba(255, 255, 255, 0) 100%);
      transform: translatey(100%);
      transition: opacity 0.5s ease-in-out, transform 0.5s 0.2s;
      visibility: hidden;

      span {
        display: block;
        margin-top: 5px;
        font-size: var(--carousel-item-textsize-sub);
      }
    }

    &:hover {
      flex: 0 0 var(--carousel-item-expand-width);
      box-shadow: 1px 3px 15px rgba(var(--primary-color), 1);
      transform: translatey(-30px);
    }

    &:hover .content {
      opacity: 1;
      transform: translatey(0%);
      visibility: visible;
    }
  }
}
