/* ============================================================
   CONTAINER
   ============================================================ */

.container-gallery {
  width: 100vw;
  overflow-x: hidden;
  overflow-y: hidden;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 3rem 0rem 4rem 0rem;

  > .phantom-page-gallery {
    width: calc(100% - 30px);
    padding-left: 15px;
    padding-bottom: 40px;
  }
}

@media (min-width: 992px) {
  .container-gallery {
    padding: 0;
  }
}
@media (min-width: 1400px) {
  .container-gallery {
    margin-top: 3rem;
    margin-bottom: 2rem;
  }
}

/*
============================================================
PAGE GALLERY — thumbnail carousel (.phantom-page-gallery)
============================================================ */

.phantom-page-gallery {
  .splide__track {
    overflow: visible;
  }

  > div:first-child {
    height: 100%;
  }

  .splide__slide {
    display: flex;
    flex-direction: column;
    transition: all ease 300ms;
    width: 100%;
    height: 100%;
    aspect-ratio: 1.33;

    /* <figure> wraps the image (+ optional caption) for a valid
       figure/figcaption relationship; kept transparent to the flex layout. */
    figure {
      margin: 0;
      height: 100%;
      display: flex;
      flex-direction: column;
    }

    figcaption {
      text-align: center;
      margin-top: 8px;
    }

    /* Slides */
    picture {
      height: 100%;
      position: relative;
      @media (max-width: 992px) {
        display: flex;
        justify-content: center;
      }
    }

    img {
      width: auto;
      height: 100%;

      @media (max-width: 992px) {
        width: 100%;
        height: 100%;
      }

      max-height: none;
      border-radius: 10px;
      object-fit: contain;
    }
  }

  .arrows-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;

    .splide__arrows {
      bottom: 0;
      display: flex;
      gap: 20px;
      position: relative;
      bottom: 0;
      left: 0;
      z-index: 10;
      width: auto;
      transform: none;
      height: 40px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
    }
  }

  @media (min-width: 992px) {
    .arrows-container {
      justify-content: flex-end;
      margin-bottom: 2rem;
      margin-top: 1rem;
    }
  }

  .splide__arrow {
    background-color: transparent;
    position: relative;
    right: auto;
    top: 0;
    transform: none;
    left: auto;
    svg {
      width: 60px;
      height: 60px;
    }
  }

  .splide__pagination {
    display: none;
    bottom: unset;

    button {
      opacity: 0.5;

      &.is-active {
        opacity: 1;
      }
    }
  }
}

@media (min-width: 768px) {
  .phantom-page-gallery .splide__slide img {
    border-radius: 40px;
  }
}

@media (min-width: 1024px) {
  .container-gallery {
    overflow: visible;
    overflow-x: hidden;

    > .phantom-page-gallery {
      overflow: visible;
      padding-bottom: 8rem;

      .splide__slide {
        width: auto;
      }

      .splide__arrows {
        display: flex;
        z-index: 10;
        width: 80px;
        height: 60px;
        justify-content: space-between;
        align-items: flex-end;
      }
    }
  }
}

@media (min-width: 1200px) {
  .container-gallery {
    overflow: visible;
    overflow-x: hidden;

    > .phantom-page-gallery {
      max-height: 80vh;
    }
  }
}

/* ============================================================
   SISSA visual overrides
   ============================================================ */

.phantom-page-gallery .splide__slide img {
  border-radius: 0;
}

.phantom-page-gallery .splide__arrow {
  border: 1px solid #000;
  opacity: 1;
  border-radius: 0;
  width: 62px;
  height: 62px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.2s ease;
  transform: none;
  top: 0;
  aspect-ratio: 1;

  svg {
    width: 16px;
    height: auto;
    fill: #000;
  }
}

.phantom-page-gallery .splide__arrow:hover {
  background-color: #f8f8f5;
}

@media (min-width: 1024px) {
  .container-gallery {
    > .phantom-page-gallery {
      .splide__arrows {
        width: 150px;
        height: 100px;
      }
    }
  }
}
