/* Carousel container */
.carousel {
  position: relative;
  width: 70%;
  overflow: hidden;
  margin: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  border: 2px solid #404040;
  border-radius: 8px;
}

/* Inner wrapper for slides */
.carousel-inner {
  display: flex;
  transition: transform 0.5s ease-in-out;
  width: 100%;
}

/* Individual slide */
.carousel-item {
  flex: 0 0 100%;
  width: 100%;
  display: none;
}

.carousel-item.active {
  display: block;
}

/* Images */
.carousel-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Navigation controls */
.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background-color: rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0.5;
  transition: opacity 0.25s ease;
  border-radius: 8px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 0.9;
}

.carousel-control-prev {
  left: 10px;
}

.carousel-control-next {
  right: 10px;
}

/* Icons for navigation */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: transparent no-repeat center center;
  background-size: 100% 100%;
}

.carousel-control-prev-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

.carousel-control-next-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Visually hidden for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .carousel-control-prev,
  .carousel-control-next {
    width: 40px;
    height: 40px;
  }
}

/* ==================== NON MOBILE NARROW STYLES ==================== */
@media (pointer: fine) and (max-width: 1024px) {
  .carousel {
    width: 100%;
  }
}

/* ==================== GENERAL MOBILE STYLES ==================== */
/* Browsers tested for: Brave */
@media (max-width: 768px) and (max-aspect-ratio: 4/3) and (pointer: course),
  (max-width: 480px) and (pinter: course),
  (pointer: coarse) and (max-width: 1024px) {
  .carousel {
    width: 100%;
    border-radius: 16px;
  }

  /* Icons for navigation */
  .carousel-control-prev,
  .carousel-control-next {
    width: 80px;
    height: 80px;
    border-radius: 16px;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 40px;
    height: 40px;
  }
}

/* ==================== MOBILE PORTRAIT STYLES ==================== */
/* Browsers tested for: Firefox */
@media (max-width: 480px) and (orientation: portrait) {
  .carousel {
    width: 100%;
    border-radius: 8px;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 35px;
    height: 35px;
    border-radius: 8px;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 15px;
    height: 15px;
  }
}

/* ==================== MOBILE LANDSCAPE STYLES ==================== */
@media (max-height: 460px) and (orientation: landscape) and (pointer: coarse) {
  .carousel {
    height: calc(65vh);
    width: calc(100vw - 50%);
    border-radius: 4px;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 35px;
    height: 35px;
    border-radius: 4px;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 20px;
    height: 20px;
  }
}
