/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root { 
  --radius-xl: 16px; 
  --mussan-primary: #1a435a;
}

/* ==========================================================================
   2. HERO SECTION (Bovenaan de pagina)
   ========================================================================== */
.hero-portfolio {
  position: relative;
  min-height: clamp(48svh, 54svh, 60svh);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  overflow: hidden;
}

.hero-portfolio__bg {
  position: absolute;
  inset: 0;
  /* Belangrijk: var(--portfolio-hero-image) krijgt zijn URL via PHP */
  background:
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.35)),
    var(--portfolio-hero-image) center/cover no-repeat;
  z-index: 0;
}

.hero-portfolio__inner {
  position: relative;
  z-index: 1;
  color: #fff;
  width: 100%;
  max-width: clamp(1120px, 92vw, 1400px);
  padding: 100px 24px 80px;
}

.hero-portfolio__title {
  font-size: clamp(2.2rem, 4.8vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 10px;
  color: #fff;
}

/* ==========================================================================
   3. DETAIL CARDS & BADGES (Projectinformatie)
   ========================================================================== */
.detail-card {
  background: #fff;
  border: 1px solid rgba(26,67,90,.10);
  /* The left accent border */
  border-left: 6px solid var(--mussan-primary); 
  border-radius: var(--radius-xl);
  
  /* Remove internal padding because the columns handle it */
  padding: 0; 
  /* Important: Ensures the rounded corners clip the background colors */
  overflow: hidden; 
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
  margin-bottom: 24px;
}

/* --- Left Column (Info & Actions) --- */
.detail-card .col-lg-5 {
  background-color: #f8f9fa; /* Soft gray background */
  border-right: 1px solid rgba(0,0,0,0.05); /* Divider line */
  padding: 40px !important;
}

/* --- Right Column (The Story) --- */
.detail-card .col-lg-7 {
  background-color: #fff;
  padding: 40px 50px !important;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .detail-card .col-lg-5,
  .detail-card .col-lg-7 {
    padding: 24px !important;
  }
}

/* --- Typography & Elements --- */

.project-title { 
  margin: 0; 
  font-weight: 800; 
  font-size: 2rem; 
  line-height: 1.2;
  color: var(--mussan-primary);
  word-wrap: break-word;
}

.detail-card .lead {
  color: #334155; 
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 0;
}

/* --- BADGES (The Fix) --- */
.badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 16px;
}

/* RESTORED: Original "Pill" Style */
.icon-badge2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px; /* Bigger padding */
  border-radius: 999px; /* Round Pill Shape */
  font-weight: 800;
  
  /* Original Colors */
  background: #f7fafc; 
  border: 1px solid #c5cfd6;
  color: #2b3a44;
  
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}

/* Buttons */
.cta-row { 
  margin-top: auto; 
}
/* ==========================================================================
   4. BEFORE/AFTER SLIDER (Interactieve sectie)
   ========================================================================== */
.ba-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(26,67,90,.10);
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  margin-bottom: 24px;
}

.ba-slider {
  position: relative;
  aspect-ratio: 16/9;
  background: #e5e7eb;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  overflow: hidden;
  --pos: 50%; /* Beheerd door JS */
}

/* De onderste foto (Voor) */
.ba-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* De bovenste laag container (Na) */
.ba-after-wrap {
  position: absolute;
  inset: 0;
  width: 100% !important; /* Foto mag NIET verschuiven */
  height: 100%;
  z-index: 2;
  /* Hierdoor wordt het linker deel transparant gemaakt om 'Voor' te tonen */
  clip-path: inset(0 0 0 var(--pos));
}

.ba-after {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* De witte scheidingslijn */
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  transform: translateX(-50%);
  width: 4px;
  background: #fff;
  z-index: 10;
  pointer-events: none;
}

/* De blauwe knop op de lijn */
.ba-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--mussan-primary);
  box-shadow: 0 10px 24px rgba(26,67,90,.28);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}

/* Labels 'Voor' en 'Na' */
.ba-label {
  position: absolute;
  z-index: 5;
  top: 12px;
  font-weight: 800;
  background: rgba(17,17,17,.75);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  pointer-events: none; /* Zodat ze het slepen niet blokkeren */
}
.ba-label.left { left: 12px; }
.ba-label.right { right: 12px; }

/* Specifieke hoogte voor de grote fallback-afbeelding (als BA uit staat) */
.ba-card .gallery-item img {
  height: 550px; /* Dit maakt de afbeelding een stuk hoger */
  object-fit: cover;
  width: 100%;
}

/* Responsieve aanpassing: iets minder hoog op mobiel zodat het schermvullend blijft */
@media (max-width: 768px) {
  .ba-card .gallery-item img {
    height: 300px;
  }
}

/* ==========================================================================
   5. GALLERY GRID (Onderste foto's)
   ========================================================================== */
.gallery-item {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(26,67,90,.10);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* SHOW MODAL GALLERY */
/* Custom Gallery Modal Styling */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  user-select: none;
}

.modal-container {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modalImg {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  animation: fadeIn 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  z-index: 10001;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  padding: 20px;
  cursor: pointer;
  font-size: 2rem;
  transition: 0.2s;
  z-index: 10000;
}

.modal-nav:hover { background: rgba(255,255,255,0.2); }
.modal-prev { left: 10px; }
.modal-next { right: 10px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   6. RESPONSIVE STYLES
   ========================================================================== */
@media (max-width: 768px) {
  .hero-portfolio {
    margin-top: 70px;
  }
  .hero-portfolio__inner {
    padding: 80px 20px 60px;
  }
  .hero-portfolio__sub {
    display: none;
  }
  .gallery-item img {
    height: 180px;
  }
}