/* Widgets: Case Study Carousel + Case Study Tiles (+ video pop-up) */

/* ── Carousel ─────────────────────────────────────────────────────────── */

.sla-cs-carousel {
  --sla-per-slide: 4;
  max-width: 810px;
  margin: 0 auto;
}

.sla-cs-carousel__heading {
  margin: 0 0 8px;
  font-family: var(--sla-font-body);
  font-size: 32px;
  font-weight: 500;
  line-height: 35.2px;
  color: #201c1c;
  text-align: center;
}

.sla-cs-carousel__frame {
  position: relative;
}

.sla-cs-carousel__viewport {
  overflow: hidden;
}

.sla-cs-carousel__track {
  display: flex;
  transition: transform 0.6s ease;
}

.sla-cs-carousel__slide {
  display: grid;
  flex: 0 0 100%;
  grid-template-columns: repeat(var(--sla-per-slide), minmax(0, 1fr));
  margin: 0;
  padding: 10px 0;
  list-style: none;
}

.sla-cs-carousel__item {
  padding: 16px 25px 0;
}

@media (max-width: 991.98px) {
  .sla-cs-carousel__slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .sla-cs-carousel__slide {
    grid-template-columns: minmax(0, 1fr);
  }

  .sla-cs-carousel__item {
    padding: 16px 0 0;
  }
}

.sla-cs-thumb {
  position: relative;
  display: block;
  color: #fff;
  text-align: center;
}

.sla-cs-thumb:hover,
.sla-cs-thumb:focus {
  color: #fff;
  text-decoration: none;
}

.sla-cs-thumb__image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
}

.sla-cs-thumb__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.sla-cs-thumb__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  transition: background 0.5s ease;
}

.sla-cs-thumb:hover .sla-cs-thumb__image img {
  transform: scale(1.15);
}

.sla-cs-thumb:hover .sla-cs-thumb__image::after {
  background: rgba(0, 0, 0, 0.2);
}

.sla-cs-thumb__title {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 80%;
  font-size: 16px;
  line-height: 1.2rem;
  transform: translate(-50%, -50%);
}

.sla-cs-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 29px;
  height: 28px;
  padding: 0;
  background: var(--sla-blue);
  border: 1px solid var(--sla-blue);
  border-radius: 50%;
}

.sla-cs-carousel__arrow::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
}

.sla-cs-carousel__arrow--prev {
  left: -40px;
}

.sla-cs-carousel__arrow--prev::before {
  transform: translateX(1px) rotate(-45deg);
}

.sla-cs-carousel__arrow--next {
  right: -40px;
}

.sla-cs-carousel__arrow--next::before {
  transform: translateX(-1px) rotate(135deg);
}

@media (max-width: 991.98px) {
  .sla-cs-carousel__frame {
    margin: 0 40px;
  }
}

@media (max-width: 575.98px) {
  .sla-cs-carousel__frame {
    margin: 0 64px;
  }
}

/* ── Tiles ────────────────────────────────────────────────────────────── */

.sla-cs-tiles {
  --sla-tile-cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--sla-tile-cols), minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.sla-cs-tile {
  position: relative;
  overflow: hidden;
}

.sla-cs-tile__link {
  display: block;
  color: #fff;
}

.sla-cs-tile__link:hover,
.sla-cs-tile__link:focus {
  color: #fff;
  text-decoration: none;
}

.sla-cs-tile__image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}

.sla-cs-tile:hover .sla-cs-tile__image {
  transform: scale(1.1);
}

.sla-cs-tile__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.sla-cs-tile:hover .sla-cs-tile__overlay {
  background: rgba(0, 44, 255, 0.27);
}

.sla-cs-tile__title {
  position: absolute;
  top: 85%;
  right: 0;
  left: 0;
  margin: 0 4%;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  transform: translateY(-50%);
}

.sla-cs-tile__more {
  display: block;
  font-size: 22px;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .sla-cs-tile__title {
    font-size: 22px;
  }

  .sla-cs-tile__more {
    font-size: 16px;
  }
}

/* ── Video pop-up ─────────────────────────────────────────────────────── */

.sla-video-popup {
  width: min(800px, calc(100% - 30px));
  padding: 16px;
  background: #fff;
  border: 0;
  border-radius: 4.8px;
}

.sla-video-popup::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.sla-video-popup video {
  display: block;
  width: 100%;
  height: auto;
}

.sla-video-popup__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 28px;
  color: #000;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
