/* ==============================================================
   Project Detail Pages — Shared styles
   Used by every project page and by templates/project-template.html
   ============================================================== */

/* ===== Hero ===== */
.project-hero {
  position: relative;
  height: 70vh;
  min-height: 480px;
  background: var(--ink) center / cover no-repeat;
  overflow: hidden;
}
.project-hero-img {
  position: absolute;
  inset: 0;
  /* background-image set via inline <style> in the page */
}
.project-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.75) 100%);
}
.project-hero-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 56px;
}

.project-breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
}
.project-breadcrumb a {
  color: rgba(255,255,255,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.3);
}
.project-breadcrumb a:hover { color: #fff; }

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
  width: fit-content;
}
.project-tag-built  { background: rgba(15, 110, 86, 0.95); }
.project-tag-render { background: rgba(216, 90, 48, 0.95); }

.project-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 500;
  color: #fff;
  line-height: 1.1;
  max-width: 780px;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.project-hero-sub {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
}

/* ===== Stats row ===== */
.project-stats {
  background: var(--card);
  border-bottom: 0.5px solid var(--line);
}
.project-stats-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.project-stat {
  text-align: center;
  padding: 0 8px;
  border-right: 0.5px solid var(--line);
}
.project-stat:last-child { border-right: none; }
.project-stat-value {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
}
.project-stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}
@media (max-width: 840px) {
  .project-stats-inner { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .project-stat { border-right: none; text-align: left; }
}

/* ===== Body (narrative + sidebar) ===== */
.project-body { padding: 80px 0; }
.project-body-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: flex-start;
}
.project-narrative h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 20px;
}
.project-narrative p {
  font-size: 17px;
  color: var(--ink-2);
  margin-bottom: 18px;
  line-height: 1.75;
}
.project-side {
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: 88px;
}
.project-side h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.project-side ul { list-style: none; padding: 0; margin: 0 0 24px; }
.project-side li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.project-side li svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--accent);
  margin-top: 2px;
}
.project-side .btn { width: 100%; margin-top: 4px; }
@media (max-width: 900px) {
  .project-body-grid { grid-template-columns: 1fr; gap: 40px; }
  .project-side { position: static; }
}

/* ===== Gallery masonry ===== */
.project-gallery { padding: 0 0 80px; }
.project-gallery-head {
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 0 24px;
}
.project-gallery-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 8px;
}
.project-gallery-head p { color: var(--ink-3); }
.gallery-masonry {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-masonry .tall { grid-row: span 2; }
.gallery-item {
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--ink);
  aspect-ratio: 4 / 3;
  position: relative;
  cursor: pointer;
}
.gallery-item.tall { aspect-ratio: 4 / 5; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 24px 14px 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
}
.gallery-item:hover .gallery-item-caption {
  opacity: 1;
  transform: translateY(0);
}
@media (max-width: 840px) {
  .gallery-masonry { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gallery-masonry .tall { grid-row: auto; }
  .gallery-item.tall { aspect-ratio: 4 / 3; }
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,8,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Final CTA ===== */
.project-cta {
  background: var(--ink);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
}
.project-cta h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  margin-bottom: 16px;
}
.project-cta p {
  color: rgba(255,255,255,0.75);
  max-width: 520px;
  margin: 0 auto 28px;
  font-size: 17px;
}
.project-cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Back link ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 24px;
}
.back-link:hover { color: var(--ink); }
