/* ==========================================================================
   4. PORTFOLIO SLIDER (BIDIRECTIONAL & CENTER FOCUS)
   ========================================================================== */
.ip2026-portfolio-section {
  padding: var(--container-padding);
  background: var(--bg-gradient);
  overflow: hidden;
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ip2026-portfolio-header {
  text-align: center;
  margin-bottom: 40px;
}

.ip2026-portfolio-header h2 {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 800;
  background: linear-gradient(45deg, var(--text-color), var(--text-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ip2026-portfolio-slider {
  width: 100%;
  height: 550px;
  display: flex;
  align-items: center;
  position: relative;
  /* Masking edges for a cleaner look */
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.ip2026-slider-track {
  display: flex;
  gap: 30px; /* Matched with JS metrics */
  will-change: transform;
  /* Transition is handled by JS but fallback here */
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.ip2026-portfolio-slide {
  flex: 0 0 350px;
  height: 480px;
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  opacity: 0.3; /* Dim non-active slides */
  transform: scale(0.8);
  transition: all 0.7s cubic-bezier(0.65, 0, 0.35, 1);
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Ensure images don't distort */
.ip2026-portfolio-slide img {
  width: 100%;
  height: 80%;
  object-fit: contain; /* Changed to cover for a more premium look */
  transition: transform 0.5s ease;
}

/* The "Active" (Centered) Slide */
.ip2026-portfolio-slide.active {
  opacity: 1;
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 25px 50px var(--boxShadow-color);
}

.ip2026-portfolio-slide.active img {
    transform: scale(1.02);
}

.ip2026-slide-overlay {
  width: 100%;
  height: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  padding: 0 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
}

.ip2026-portfolio-slide.active .ip2026-slide-overlay {
  opacity: 1;
  transform: translateY(0);
}

.ip2026-overlay-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-color);
}

/* Controls & Progress */
.ip2026-portfolio-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  width: 90%;
  margin: 40px auto 0;
}

.ip2026-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(80, 52, 127, 0.1);
  margin-right: 40px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.ip2026-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--text-color);
  width: 0%;
  transition: width 0.4s ease;
}

.ip2026-p-num {
  font-weight: 600;
  color: var(--text-hover);
  cursor: pointer;
  transition: 0.3s;
  padding: 5px;
}

.ip2026-p-num.active {
  color: var(--text-color);
  transform: scale(1.3);
}

/* ==========================================================================
   PORTFOLIO RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet (Portrait & Small Landscapes) */
@media (max-width: 1024px) {
  .ip2026-portfolio-slider { height: 500px; }
  .ip2026-portfolio-slide { flex: 0 0 320px; height: 420px; }
  .ip2026-overlay-title { font-size: 20px; }
  .ip2026-portfolio-controls { max-width: 800px; }
}

/* Mobile Devices */
@media (max-width: 768px) {
  .ip2026-portfolio-section { padding: 60px 0; }
  
  /* Disable mask on mobile to provide more visible space */
  .ip2026-portfolio-slider { 
    height: 420px; 
    mask-image: none; 
    -webkit-mask-image: none; 
  }
  
  .ip2026-portfolio-slide { 
    flex: 0 0 280px; 
    height: 360px; 
    border-radius: 20px;
  }

  .ip2026-portfolio-controls {
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
  }

  .ip2026-progress-bar {
    width: 100%;
    margin-right: 0;
  }
  
  .ip2026-p-num { font-size: 14px; }
}

/* Small Mobile Phones */
@media (max-width: 480px) {
  .ip2026-portfolio-slide { flex: 0 0 240px; height: 320px; }
  .ip2026-portfolio-header h2 { font-size: 28px; }
  .ip2026-overlay-title { font-size: 18px; }
}