/* =========================================================
   JD CAPITAL GROUP — PROJECTS PAGE
   Light, white-based case studies with a premium image
   carousel. Images are presented, never edited — the original
   files are shown as provided, at proper (non-stretched) sizes.
   The full-screen lightbox stays dark intentionally: a dark
   viewing stage is what makes photography read best when
   enlarged, regardless of the page's own light theme.
   ========================================================= */

body.projects-page {
  background: var(--white);
  color: var(--charcoal);
  position: relative;
}

/* ---------- Page hero ---------- */
.project-hero {
  position: relative;
  padding: 180px 0 80px;
  background: linear-gradient(160deg, #fbfaf7 0%, var(--soft-gray) 55%, #f1eee7 100%);
  overflow: hidden;
}
.project-hero .hero-bg { position: absolute; inset: 0; z-index: 0; }
.project-hero .hero-lines { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.3; }
.project-hero .hero-lines line { stroke: var(--gold); stroke-width: 1; }
.project-hero .hero-glow {
  position: absolute;
  top: -20%; right: -5%;
  width: 55%; height: 140%;
  background: radial-gradient(circle, rgba(182,144,63,0.14), transparent 70%);
  filter: blur(40px);
}
.project-hero .container { position: relative; z-index: 1; }
.project-hero-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 22px;
  max-width: 780px;
}

/* ---------- Case study block ---------- */
.case-study {
  position: relative;
  padding: 100px 0;
}
.case-study:nth-of-type(even) { background: var(--soft-gray); }

.case-head {
  max-width: 720px;
  margin: 0 0 48px;
}

.case-index {
  display: block;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}
.feature-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.case-head h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 40px);
  color: var(--navy);
  margin: 0 0 8px;
}
.case-role {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-mid);
  margin: 0 0 22px;
}
.project-copy {
  color: var(--gray-mid);
  font-size: 15.5px;
  max-width: 680px;
  margin: 0 0 26px;
}
.project-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.project-scope span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy);
  background: rgba(182, 144, 63, 0.08);
  border: 1px solid rgba(182, 144, 63, 0.3);
  padding: 7px 14px;
  border-radius: 20px;
}

.case-divider {
  height: 1px;
  max-width: var(--max-width);
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, rgba(182, 144, 63, 0.4), transparent);
}

/* ---------- Image carousel ---------- */
.carousel { max-width: 720px; }

.carousel-stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.carousel-frame {
  position: relative;
  flex: 1;
  padding: 12px;
  background: var(--white);
  border: 3px solid var(--gold);
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(24, 22, 20,0.1);
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: 2px;
  background: var(--soft-gray);
  /* hide the native scrollbar while keeping native touch-swipe scrolling */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 460px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 12px 32px rgba(24, 22, 20,0.12);
}

.carousel-caption {
  position: absolute;
  left: 24px;
  bottom: 18px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(182, 144, 63, 0.35);
  box-shadow: 0 8px 20px rgba(24, 22, 20,0.08);
  padding: 8px 16px;
  border-radius: 20px;
  pointer-events: none;
}

.carousel-arrow {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--gray-line);
  color: var(--navy);
  box-shadow: 0 8px 20px rgba(24, 22, 20,0.06);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.carousel-arrow:hover {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid rgba(182, 144, 63, 0.4);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.carousel-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.3);
}

.carousel-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.carousel-thumbs::-webkit-scrollbar { display: none; }
.carousel-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--gray-line);
  background: var(--soft-gray);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.65;
  transition: all var(--transition);
}
.carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carousel-thumb:hover { opacity: 0.9; }
.carousel-thumb.active {
  opacity: 1;
  border-color: var(--gold);
}

/* =========================================================
   Lightbox — intentionally dark regardless of page theme.
   A dark stage is the standard, tested way to present enlarged
   photography without the surrounding UI competing for attention.
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 11, 10, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  overflow: hidden;
}
.lightbox.active { opacity: 1; visibility: visible; }

.lightbox-backdrop {
  position: absolute;
  inset: -10%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.3) brightness(0.5);
  transform: scale(1.15);
  opacity: 0.75;
  transition: opacity 0.4s ease;
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  text-align: center;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.lightbox.active .lightbox-stage { transform: scale(1); opacity: 1; }

.lightbox-frame {
  display: inline-block;
  padding: 10px;
  border: 1px solid rgba(216, 184, 118, 0.4);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 30px 90px rgba(0,0,0,0.6);
}
.lightbox-frame img {
  display: block;
  max-width: min(600px, 82vw);
  max-height: 64vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  margin: 0 auto;
}

.lightbox-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 0 4px;
}
.lightbox-caption {
  margin: 0;
  color: var(--gold-light);
  font-size: 14px;
  letter-spacing: 0.03em;
  font-weight: 600;
  text-align: left;
}
.lightbox-count {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #9aa5b5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lightbox-close, .lightbox-nav {
  position: absolute;
  z-index: 2;
  background: transparent;
  border: 1px solid rgba(216, 184, 118, 0.4);
  color: var(--gold-light);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.lightbox-close:hover, .lightbox-nav:hover {
  background: var(--gold-light);
  color: var(--navy-deep);
  border-color: var(--gold-light);
}
.lightbox-close {
  top: 28px; right: 28px;
  width: 44px; height: 44px;
  font-size: 22px;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  font-size: 26px;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .project-hero { padding: 140px 0 56px; }
  .case-study { padding: 64px 0; }
  .case-head { margin-bottom: 32px; }

  .carousel-slide { height: 320px; }
  .carousel-frame { padding: 8px; border-width: 2px; }
  .carousel-arrow { width: 38px; height: 38px; font-size: 18px; }
  .carousel-caption { left: 14px; bottom: 12px; font-size: 11.5px; padding: 6px 12px; }
  .carousel-thumb { width: 56px; height: 56px; }

  .lightbox-nav { width: 40px; height: 40px; font-size: 20px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: 16px; right: 16px; width: 38px; height: 38px; }
  .lightbox-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
}
