/* ==============================
   Projects Section
============================== */
.projects-section {
  background: #000;
  text-align: left;
  border-bottom: 3px solid silver;
  margin: 130px 0;
  padding: 130px 20px;
  overflow: visible;
}

.projects-section .container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.projects-section .section-title {
  max-width: 400px;
  text-align: left;
  color: #fff;
}

.projects-section .section-title h4 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.projects-section .section-title p {
  color: #ccc;
  font-size: 1.2rem;
  line-height: 1.5;
}

/* 3D Carousel Wrapper (Desktop) */
.image-carousel-wrapper {
  width: 45vw;
  max-width: 420px;
  height: 45vw;
  max-height: 420px;
  perspective: 1000px; /* "camera" distance */
  flex-shrink: 0;
  position: relative;
}

/* 3D ring container for Desktop */
.image-container {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
  position: relative;
}

/* Each face for 5 items => 360/5 = 72° increments.
   placed them in a ring around the Y-axis for DESKTOP. */
.project-item:nth-child(1) {
  transform: rotateY(0deg) translateZ(250px);
}
.project-item:nth-child(2) {
  transform: rotateY(72deg) translateZ(250px);
}
.project-item:nth-child(3) {
  transform: rotateY(144deg) translateZ(250px);
}
.project-item:nth-child(4) {
  transform: rotateY(216deg) translateZ(250px);
}
.project-item:nth-child(5) {
  transform: rotateY(288deg) translateZ(250px);
}

/* Shared Project Styles */
.project-item {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  box-sizing: border-box;
  text-align: center;
}

.project-image {
  width: 160px;
  height: auto;
  margin-bottom: 10px;
  border-radius: 15px;
}

.project-info {
  max-width: 300px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 15px;
  border-radius: 5px;
}

.project-info p {
  margin-bottom: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Outline button for “View” / “Visit Site” */
.btn.btn-outline {
  padding: 8px 16px;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  border-radius: 5px;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn.btn-outline:hover {
  background: #26729e;
  color: #fff;
}

/* Carousel arrows */
.arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  border: none;
  background-color: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  z-index: 3;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.arrow-btn:hover {
  background-color: #26729e;
}

.arrow-btn.left {
  left: 10px;
}

.arrow-btn.right {
  right: 10px;
}

/* Mobile Slideshow Override */
@media (max-width: 768px) {
  .image-carousel-wrapper {
    width: 100%;
    max-width: 420px;
    height: auto;
  }

  .image-container {
    width: 100%;
    height: auto;
    transform: none;
    transform-style: flat;
    position: relative;
  }

  /* For mobile slideshow, each project is stacked,
     but will only show one at a time via .active in JS. */
  .project-item {
    position: relative;
    display: none; /* Hide all by default */
    transform: none !important; /* Cancel ring transform */
    margin: 0 auto;
    width: 100%;
  }
  .project-item.active {
    display: block;
  }

  /* Keep next/prev arrows visible for slideshow mode */
  .arrow-btn {
    display: block;
  }
}
