/* ─── Individual Project Page ───────────────────────────────────── */

.project-page #project-main {
  margin-left: 220px;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}

.project-page #project-main::-webkit-scrollbar {
  display: none;
}

/* ─── Gallery ───────────────────────────────────────────────────── */

#gallery {
  position: relative;
  width: 100%;
  padding-top: 80px;
  padding-right: 80px;
  padding-left: 80px;
}

#gallery-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f5f4f2;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
  background-size: cover;
  background-position: center;
}

.gallery-slide.active {
  opacity: 1;
}

/* Image-based slides (used when <img> is inside .gallery-slide) */
.gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Portrait slides — contain image, show background either side */
.gallery-slide.portrait {
  background: #f5f4f2;
}

.gallery-slide.portrait img {
  object-fit: contain;
}

/* ─── Navigation zones ──────────────────────────────────────────── */

.gallery-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
}

#zone-prev {
  left: 0;
  justify-content: flex-start;
  padding-left: 28px;
}

#zone-next {
  right: 0;
  justify-content: flex-end;
  padding-right: 28px;
}

.zone-arrow {
  opacity: 0.3;
  transition: opacity 0.2s ease;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.zone-arrow line {
  transition: stroke-width 0.2s ease;
}

.gallery-zone:hover .zone-arrow {
  opacity: 1;
}

.gallery-zone:hover .zone-arrow line {
  stroke-width: 2.5;
}

/* ─── Dot indicators ────────────────────────────────────────────── */

#gallery-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 11;
  pointer-events: none;
}

.gallery-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.gallery-dot.active {
  background: rgba(255, 255, 255, 0.85);
}

/* ─── Project Info ──────────────────────────────────────────────── */

#project-info {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 72px 80px 100px;
}

#project-info-columns {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
}


/* ─── Facts column ──────────────────────────────────────────────── */

.facts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  padding: 11px 0;
}

.award-line {
  display: block;
}

.award-line + .award-line {
  margin-top: 7px;
}

.facts-list dt,
.facts-list dd {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
}

.facts-list dt {
  color: rgba(0, 0, 0, 0.38);
}

.facts-list dd {
  color: rgba(0, 0, 0, 0.38);
  margin: 0;
}

.facts-list dd a {
  display: inline;
  color: inherit;
  text-decoration: none;
  text-transform: none;
  letter-spacing: inherit;
}

/* ─── Description column ────────────────────────────────────────── */

.project-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0a0a0a;
  margin-bottom: 0;
  line-height: 1.3;
}

.description-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.description-body p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.85;
  color: rgba(0, 0, 0, 0.7);
  letter-spacing: 0.01em;
  text-align: justify;
}

.description-body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.description-body a:hover {
  color: #0a0a0a;
}

/* ─── Back / Prev / Next nav ────────────────────────────────────── */

#back-link {
  padding: 0 80px 80px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

/* Single-link fallback (before JS runs) and all three link classes */
#back-link a,
.back-prev,
.back-all,
.back-next {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: color 0.25s ease;
  white-space: nowrap;
}

#back-link a:hover,
.back-prev:hover,
.back-all:hover,
.back-next:hover {
  color: #0a0a0a;
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .project-page #project-main {
    margin-left: 180px;
  }

  #gallery {
    padding-right: 40px;
    padding-left: 40px;
  }

  #project-info {
    padding: 48px 40px 80px;
    gap: 28px;
  }

  #project-info-columns {
    grid-template-columns: 200px 1fr;
    gap: 48px;
  }

  #back-link {
    padding: 0 40px 60px;
  }
}

@media (max-width: 640px) {
  /* Fix 3: project main flows naturally — body handles scrolling */
  .project-page #project-main {
    margin-left: 0;
    height: auto;
    overflow-y: visible;
  }

  #project-info {
    gap: 24px;
    padding: 40px 24px 60px;
  }

  #project-info-columns {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  #gallery {
    padding-right: 0;
    padding-left: 0;
  }

  #gallery-track {
    aspect-ratio: 4 / 3;
  }

  /* ── Mobile restructured layout ── */

  #mobile-hero .mobile-slide,
  #mobile-rest-images .mobile-slide {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    position: relative;
  }

  #mobile-hero .mobile-slide img,
  #mobile-rest-images .mobile-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  #mobile-rest-images {
    display: flex;
    flex-direction: column;
    gap: 38px;
    margin-top: 38px;
  }

  #mobile-title-bar {
    padding: 24px 24px 4px;
  }

  #mobile-title-bar .project-title {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .mobile-year {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.58rem;
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.38);
  }

  #mobile-description-body {
    padding: 28px 24px 0;
  }

  #mobile-facts-section {
    padding: 48px 24px 0;
  }

  #mobile-facts-section .facts-heading {
    margin-bottom: 20px;
  }
}
