/* ================================================================
   Hello-Archi(R) — Architecture Studio
   project_detail.css
   Project detail page only: sticky nav, hero, sticky overview +
   details, animated gallery, photo grid and the in-page lightbox.
   Reuses the shared .hero / .cta / footer / modal from base.css.
   NOTE: .proj-back is shared with the article page, so it lives in
   base.css, not here.
   Split from the original styles.css. Loaded on the project detail
   page (after base.css).
   ================================================================ */

/* ---- Project-detail top bar (sticky) --------------------------- */
.pp-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(245, 245, 245, 0.12);
}
.pp-nav__back { font-size: 0.9rem; color: var(--beige); display: inline-flex; align-items: center; gap: 8px; }
.pp-nav__back:hover { color: var(--white); opacity: 1; }
.pp-hero { padding: clamp(60px, 10vw, 130px) var(--gutter) clamp(30px, 4vw, 50px); }
.pp-hero__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;          /* ~12px metadata: location — category */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-light);
  margin-bottom: 1.4rem;
}
.pp-hero__title {
  font-size: clamp(2.4rem, 6vw, 4.5rem);   /* project hero — bold, restrained */
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 16ch;
}
.pp-figure {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
}
.pp-cover { padding: 0 var(--gutter); }
.pp-cover .pp-figure { aspect-ratio: 16 / 8; }
.pp-intro {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(40px, 6vw, 100px);
  padding: clamp(60px, 9vw, 130px) var(--gutter);
}
.pp-specs { display: flex; flex-direction: column; gap: 1.4rem; }
.pp-spec { border-top: 1px solid rgba(245, 245, 245, 0.16); padding-top: 1rem; }
.pp-spec dt {
  font-family: var(--font-mono);
  font-size: 0.74rem;          /* ~12px metadata label */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-light);
  margin-bottom: 0.4rem;
}
.pp-spec dd { font-size: 1rem; color: var(--white); }
.pp-prose p {
  font-size: clamp(1.3rem, 2vw, 1.75rem);   /* large editorial copy (28-36px) */
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin-bottom: 1.4rem;
  max-width: 42ch;
  color: var(--grey-light);                 /* soft grey body */
}
.pp-prose p:first-child { color: var(--white); }   /* lead paragraph in full white */
.pp-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 1.6vw, 24px);
  padding: 0 var(--gutter) clamp(60px, 9vw, 130px);
}
.pp-gallery .pp-figure:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 8; }
.pp-next {
  display: block;
  padding: clamp(60px, 9vw, 120px) var(--gutter);
  background: var(--black);
  color: var(--white);
  text-align: center;
}
.pp-next__label {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: 0.75rem;          /* ~12px eyebrow */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-light);
  margin-bottom: 1rem;
}
.pp-next__label::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pp-next__title {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);   /* restrained section title */
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: opacity 0.3s ease;
}
.pp-next:hover .pp-next__title { opacity: 0.6; }

@media (max-width: 760px) {
  .pp-intro { grid-template-columns: 1fr; }
  .pp-gallery { grid-template-columns: 1fr; }
  .pp-gallery .pp-figure:first-child { grid-column: auto; }
}

/* ================================================================
   PROJECT PAGE  (project.html — "Canal Edge Residence")
   Full-screen hero, sticky overview + details, animated gallery.
   Reuses the shared .hero, .cta, footer and modal components.
   ================================================================ */

/* The scroll-progress pill follows the shared behaviour on every page:
   the JS toggles .is-visible so it fades out near the top (at 0%) and
   in once you start scrolling — matching index, work and studio. */

/* ---- Hero ------------------------------------------------------- */
/* Reuses .hero (full viewport, column, space-between) + .hero__bg /
   .hero__overlay. We add a centred year+title block, footer meta row
   and a bottom-centre CTA on top of that shared shell. */
.proj-hero { text-align: left; }

/* Top-right "Menu" link behaves like the hero nav links */
.proj-hero__nav { gap: 0; }

/* Title block — small dot + year, then the project title.
   margin-top:auto pushes it (and the foot row below it) down so the
   text sits in the lower-centre of the hero rather than the middle. */
.proj-hero__center {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-inline: var(--gutter);
  padding-bottom: clamp(28px, 6vh, 70px);
}
.proj-hero__year {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--beige);
  margin-bottom: clamp(18px, 3vw, 30px);
  /* Fade/slide in on load */
  opacity: 0;
  transform: translateY(16px);
  animation: projHeroIn 0.9s var(--ease) 0.25s forwards;
}
.proj-hero__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--white);
}
.proj-hero__title {
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 18ch;
  /* Fade/slide in on load, just after the year */
  opacity: 0;
  transform: translateY(26px);
  animation: projHeroIn 1s var(--ease) 0.4s forwards;
}

/* Bottom meta row — copyright left, "Made in Framer" right */
.proj-hero__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--gutter);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--beige);
  opacity: 0.85;
}

@keyframes projHeroIn {
  to { opacity: 1; transform: none; }
}

/* ---- Overview: sticky details (left) + image gallery (right) ---- */
.proj-overview {
  background: var(--black);
  color: var(--white);
  padding-block: clamp(60px, 9vw, 130px);
}
.proj-overview__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}

/* The left column sticks while the gallery scrolls past it */
.proj-overview__aside {
  position: sticky;
  top: clamp(60px, 12vh, 120px);
}
.proj-overview__desc {
  font-size: clamp(0.925rem, 1.4vw, 1.125rem);   /* editorial lead copy */
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: clamp(28px, 3.5vw, 40px);
}

/* Details table — label/value rows separated by hairline rules */
.proj-specs { display: flex; flex-direction: column; }
.proj-spec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(10px, 1.1vw, 13px) 0;
  border-top: 1px solid rgba(245, 245, 245, 0.16);
}
.proj-spec:last-child { border-bottom: 1px solid rgba(245, 245, 245, 0.16); }
.proj-spec dt {
  font-family: var(--font-mono);
  font-size: 0.595rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-light);
}
.proj-spec dd {
  font-size: clamp(0.825rem, 1.15vw, 0.925rem);
  color: var(--white);
  text-align: right;
}

/* Vertical image gallery — full-width shots stacked with spacing */
.proj-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.2vw, 36px);
}
.gallery-shot { margin: 0; overflow: hidden; border-radius: 6px; }
.gallery-shot__img {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-size: cover;
  background-position: center;
  /* Entrance state: faded + slid down + slightly zoomed.
     .is-in (added by IntersectionObserver) animates it into place. */
  opacity: 0;
  transform: translateY(48px) scale(1.04);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.gallery-shot.is-in .gallery-shot__img { opacity: 1; transform: none; }

/* "View Other Projects +" row — aligned to the right under the gallery */
.proj-overview__footrow {
  display: flex;
  justify-content: flex-end;
  margin-top: clamp(40px, 6vw, 80px);
}

/* ---- Photo gallery grid — clickable thumbnails ------------------- */
.proj-photos {
  margin-top: clamp(56px, 8vw, 110px);
}
.proj-photos__title {
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: clamp(24px, 3vw, 40px);
}
.proj-photos__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(10px, 1.2vw, 18px);
}
.proj-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  /* gentle zoom on hover; the dim layer is the ::after below */
  transition: transform 0.5s var(--ease);
}
.proj-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 7, 0);
  transition: background 0.4s var(--ease);
}
/* "+" cue, centred, fades + scales in on hover */
.proj-photo::before {
  content: '+';
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 300;
  line-height: 1;
  opacity: 0;
  transform: scale(0.7) rotate(-90deg);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  pointer-events: none;
}
.proj-photo:hover { transform: scale(1.015); }
.proj-photo:hover::after { background: rgba(8, 8, 7, 0.22); }
.proj-photo:hover::before,
.proj-photo:focus-visible::before { opacity: 1; transform: scale(1) rotate(0deg); }
.proj-photo:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

/* ---- Lightbox slider (in-page image viewer) --------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.lightbox.is-open { visibility: visible; opacity: 1; }
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 5, 0.9);
  backdrop-filter: blur(8px);
}
.lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: calc(100vh - 32px);
  display: grid;
  place-items: center;
}
.lightbox__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: calc(100vh - 120px);
}
.lightbox__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.lightbox__slide.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.lightbox__close {
  position: absolute;
  /* keep the ✕ centred on the same x axis as the next (›) arrow */
  top: -6px; right: clamp(-72px, -5vw, -28px);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(245, 245, 245, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s ease;
}
.lightbox__close:hover { background: rgba(245, 245, 245, 0.25); }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  display: grid; place-items: center;
  background: rgba(245, 245, 245, 0.08);
  border: 1px solid rgba(245, 245, 245, 0.14);
  border-radius: 50%;
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s ease, transform 0.3s ease;
}
.lightbox__nav:hover { background: rgba(245, 245, 245, 0.22); }
.lightbox__nav--prev { left: clamp(-72px, -5vw, -28px); }
.lightbox__nav--next { right: clamp(-72px, -5vw, -28px); }
.lightbox__nav--prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox__nav--next:hover { transform: translateY(-50%) translateX(2px); }
.lightbox__counter {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--grey-light);
}

/* ---- Responsive: stack columns; drop the sticky behaviour -------- */
@media (max-width: 900px) {
  .proj-overview__grid { grid-template-columns: 1fr; gap: clamp(36px, 7vw, 56px); }
  /* On a single column there's nothing to scroll the aside against,
     so release the sticky and let it flow normally above the gallery. */
  .proj-overview__aside { position: static; top: auto; }
}

@media (max-width: 900px) {
  /* lift the nav arrows inward so they sit over the image on small screens */
  .lightbox__nav--prev { left: 6px; }
  .lightbox__nav--next { right: 6px; }
}

@media (max-width: 760px) {
  .gallery-shot__img { aspect-ratio: 3 / 4; }
  .proj-photos__grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox__nav { width: 44px; height: 44px; font-size: 1.5rem; }
  .lightbox__stage { aspect-ratio: 3 / 4; }
}

@media (max-width: 460px) {
  .proj-photos__grid { grid-template-columns: 1fr; }
}

/* Reduced motion: reveal the hero text and gallery immediately */
@media (prefers-reduced-motion: reduce) {
  .proj-hero__year,
  .proj-hero__title { opacity: 1; transform: none; animation: none; }
  .gallery-shot__img { opacity: 1; transform: none; }
  .lightbox__slide { transition: opacity 0.2s linear; transform: none; }
  .lightbox__slide.is-active { transform: none; }
}
