/* ==========================================================================
   TERRA Project Detail & Lightbox Gallery Styles
   ========================================================================== */

.project-detail-main {
  padding-top: calc(var(--header-height, 92px) + clamp(2rem, 4.5vw, 3.5rem)) !important;
  padding-bottom: clamp(5rem, 8vw, 8rem);
}

/* Breadcrumb & Navigation Topbar */
.project-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #71736a;
}

.breadcrumb-nav a {
  color: var(--ink);
  transition: color 0.2s ease;
}

.breadcrumb-nav a:hover {
  color: var(--yellow);
}

.breadcrumb-sep {
  opacity: 0.4;
}

.back-to-work {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 750;
  color: var(--ink);
  transition: transform 0.2s ease, color 0.2s ease;
}

.back-to-work:hover {
  color: var(--yellow);
  transform: translateX(-3px);
}

/* Project Hero Header */
.project-hero-header {
  margin-bottom: 3rem;
}

.project-hero-header h1 {
  max-width: 100%;
  font-family: var(--body-font), sans-serif;
  font-size: clamp(2.1rem, 3.2vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0.5rem 0 1rem;
  overflow-wrap: break-word;
}

.project-hero-header h1 em {
  display: inline-block;
  font-family: var(--body-font, sans-serif);
  font-style: normal;
  font-weight: 500;
  color: var(--yellow);
  font-size: 1.05em;
  margin-left: 0.25em;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.project-lead-quote {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 500;
  line-height: 1.35;
  color: #45473e;
  max-width: 850px;
  margin-bottom: 2rem;
}

/* Project Specifications Grid */
.project-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 3.5rem;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spec-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8c8e82;
}

.spec-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

/* Hero Showcase Banner - Centered */
.project-hero-banner {
  position: relative;
  width: min(85%, 1060px);
  margin-left: auto;
  margin-right: auto;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 560px;
  margin-bottom: 4rem;
  box-shadow: var(--shadow);
  background: var(--mist);
  text-align: center;
}

.project-hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin: 0 auto;
}

.banner-badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(20, 21, 19, 0.85);
  backdrop-filter: blur(8px);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Comparison Section - Centered & Reduced by 20% on desktop */
.comparison-section-wrap {
  margin-bottom: 5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.5rem);
  padding: clamp(1.25rem, 4vw, 3rem);
  box-shadow: 0 16px 48px rgba(20, 21, 19, 0.05);
  text-align: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.comparison-header-row {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.comparison-header-row > div {
  text-align: center;
}

.comparison-header-row h2 {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(1.8rem, 2.5vw, 2.45rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0;
}

.comparison-hint {
  font-size: 0.88rem;
  color: #71736a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comparison-hint span {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--yellow-soft);
  color: var(--ink);
  font-weight: 750;
  border-radius: 6px;
  font-size: 0.78rem;
}

/* Perspective Selector Tabs - Centered */
.perspective-tabs {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.perspective-tab {
  background: var(--mist);
  border: 1px solid transparent;
  color: #55574e;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.perspective-tab:hover {
  background: var(--mist);
  color: var(--ink);
}

.perspective-tab.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.perspective-tab.active .tab-idx {
  background: var(--yellow);
  color: var(--ink);
}

.tab-idx {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
  font-size: 0.7rem;
}

/* Comparison Canvas - Reduced in size by 20% on desktop (80% width) and Centered */
.project-detail-comparison {
  width: 80%;
  max-width: 980px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  box-shadow: 0 10px 30px rgba(20,21,19,0.12);
}

@media (max-width: 768px) {
  .project-hero-banner {
    width: 100%;
    max-height: 400px;
  }
  .project-detail-comparison {
    width: 100%;
    max-width: 100%;
  }
  .perspective-tabs {
    justify-content: flex-start;
  }
}

/* Narrative & Features Layout */
.project-story-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 6vw, 5rem);
  margin-bottom: 5rem;
  align-items: start;
}

.story-copy h2 {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(1.8rem, 2.5vw, 2.45rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 1.2rem;
}

.story-copy p {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(0.96rem, 1.08vw, 1.04rem);
  line-height: 1.6;
  color: #55574e;
  margin-bottom: 1.5rem;
}

.features-box {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
}

.features-box h3 {
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.features-box h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.features-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #484a40;
}

.features-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--yellow);
  font-weight: 900;
  font-size: 0.85rem;
}

/* Standardized Lightbox Gallery Grid */
.gallery-section-wrap {
  margin-bottom: 5rem;
}

.gallery-section-header {
  margin-bottom: 2rem;
}

.gallery-section-header h2 {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(1.8rem, 2.5vw, 2.45rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
}

.gallery-section-header p {
  font-family: var(--body-font), sans-serif;
  font-size: clamp(0.96rem, 1.08vw, 1.04rem);
  line-height: 1.6;
  color: #55574e;
  margin: 0;
}

.lightbox-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.lightbox-gallery-card {
  position: relative;
  background: var(--white);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(20, 21, 19, 0.06);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.lightbox-gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(20, 21, 19, 0.14);
  border-color: var(--yellow);
}

.gallery-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--mist);
}

.gallery-card-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-gallery-card:hover .gallery-card-thumb-wrap img {
  transform: scale(1.05);
}

.gallery-zoom-badge {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(20, 21, 19, 0.85);
  color: var(--white);
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.25s ease;
}

.lightbox-gallery-card:hover .gallery-zoom-badge {
  opacity: 1;
  transform: scale(1);
}

.gallery-card-caption {
  padding: 1.2rem 1.4rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #3b3d34;
  flex-grow: 1;
}

/* Lightbox Modal Overlay */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 17, 21, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.lightbox-close-btn:hover {
  background: var(--yellow);
  color: var(--ink);
  transform: scale(1.08);
}

.lightbox-stage {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-stage img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  font-size: 1.8rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: var(--yellow);
  color: var(--ink);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev-btn { left: 1.5rem; }
.lightbox-next-btn { right: 1.5rem; }

.lightbox-info-bar {
  margin-top: 1.25rem;
  color: var(--white);
  text-align: center;
  max-width: 800px;
}

.lightbox-caption-text {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.lightbox-counter-text {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--yellow);
}

/* Next Project Teaser Banner */
.next-project-teaser {
  background: var(--yellow);
  color: var(--ink);
  border-radius: 0;
  padding: clamp(2.5rem, 5vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
  margin-top: 4rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.next-project-teaser:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.teaser-copy span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.teaser-copy h3 {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  margin: 0.25rem 0 0;
  letter-spacing: -0.03em;
}

.teaser-arrow {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.next-project-teaser:hover .teaser-arrow {
  transform: translateX(6px);
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .project-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-story-section {
    grid-template-columns: 1fr;
  }
  .lightbox-prev-btn { left: 0.5rem; }
  .lightbox-next-btn { right: 0.5rem; }
}

@media (max-width: 640px) {
  .project-specs-grid {
    grid-template-columns: 1fr;
  }
  .lightbox-gallery-grid {
    grid-template-columns: 1fr;
  }
  .comparison-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Wide Screen & 23-inch 1920x1200 Enhancements for Project Detail
   ========================================================================== */
@media (min-width: 1400px) {
  .project-detail-comparison {
    width: 90%;
    max-width: 1380px;
  }
  .project-hero-banner {
    max-width: 1380px;
  }
  .project-specs-panel {
    max-width: 1200px;
  }
  .project-story-section {
    gap: clamp(3rem, 6vw, 7rem);
    margin-bottom: 6.5rem;
  }
  .lightbox-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2.25rem;
  }
}

@media (min-width: 1800px) {
  .project-detail-comparison {
    width: 94%;
    max-width: 1680px;
  }
  .project-hero-banner {
    max-width: 1680px;
  }
  .project-specs-panel {
    max-width: 1440px;
  }
  .project-specs-grid {
    gap: 2rem;
  }
  .project-story-section {
    gap: clamp(4rem, 7vw, 9rem);
    margin-bottom: 8rem;
  }
  .project-title {
    font-size: clamp(2.8rem, 4.4vw, 5.2rem);
  }
  .lightbox-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2.75rem;
  }
}
