/* ==========================================================================
   Frasso Studio — Project Case Study Stylesheet (Split Rail & Gallery)
   ========================================================================== */

.project-detail-layout {
  display: grid;
  grid-template-columns: clamp(300px, 28vw, 384px) 1fr;
  background-color: var(--wool);
  position: relative;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   1. Left Sticky Architectural Rail
   -------------------------------------------------------------------------- */
.project-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(30px, 4vh, 52px) clamp(28px, 2.4vw, 40px) clamp(30px, 4vh, 52px) clamp(34px, 3vw, 52px);
  color: var(--slate);
  z-index: 20;
}

.rail-top {
  display: flex;
  flex-direction: column;
  gap: clamp(26px, 5vh, 60px);
}

.rail-utility {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.rail-menu-btn {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.rail-menu-btn:hover {
  opacity: 0.6;
}

.rail-breadcrumb {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oak);
}
.rail-bc-slash {
  opacity: 0.4;
  padding: 0 4px;
}

.rail-title-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: clamp(80px, 22vh, 260px);
}
.rail-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.7vw, 1.625rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.rail-title::before {
  content: "// ";
  opacity: 0.45;
  font-weight: 400;
}
.rail-sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--walnut);
  opacity: 0.7;
}

.rail-meta {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.2vh, 24px);
  margin-top: clamp(48px, 12vh, 160px);
}
.rail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rail-meta-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oak);
}
.rail-meta-value {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}

/* Mobile Meta Grid */
.rail-meta-mobile {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
  padding: clamp(28px, 5vh, 44px) clamp(28px, 5vw, 48px) 0;
}

/* --------------------------------------------------------------------------
   2. Scrollable Right Content Column
   -------------------------------------------------------------------------- */
.project-content {
  min-width: 0;
}

/* Hero Fullscreen Media */
.project-hero-section {
  width: 100%;
  height: 100vh;
  height: 100svh;
  position: relative;
  overflow: hidden;
  background-color: var(--linen);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-hero-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

/* Overview Narrative Section */
.project-overview {
  display: grid;
  grid-template-columns: 1fr clamp(280px, 34vw, 540px);
  min-height: 100vh;
  min-height: 100svh;
  align-items: stretch;
}
.overview-text-wrap {
  display: flex;
  flex-direction: column;
  padding: clamp(72px, 12vh, 150px) clamp(36px, 4.5vw, 88px) clamp(56px, 9vh, 110px);
}
.overview-body {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  max-width: 560px;
}
.overview-body p {
  font-family: var(--font-display);
  font-size: clamp(0.9375rem, 1vw, 1.0625rem);
  font-weight: 300;
  line-height: var(--leading-body);
  color: var(--slate);
}

.overview-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.4vw, 18px);
  max-width: 560px;
  margin-top: clamp(40px, 6vh, 72px);
}
.overview-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-xs);
}

.overview-portrait-media {
  position: relative;
  min-height: 100vh;
  background-color: var(--linen);
  display: flex;
  align-items: center;
  justify-content: center;
}
.overview-portrait-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

/* --------------------------------------------------------------------------
   3. Interactive Photo Gallery & Lightbox Slider
   -------------------------------------------------------------------------- */
.project-gallery-section {
  position: relative;
  width: 100%;
  background-color: var(--wool);
  border-top: 1px solid var(--color-border);
  padding: clamp(48px, 8vh, 96px) 0;
}

.gallery-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 85vh;
  background-color: #181310;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-frame.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}
.gallery-frame img, .gallery-frame video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(246, 242, 235, 0.65);
  backdrop-filter: blur(12px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  cursor: pointer;
  z-index: 10;
  transition: background-color var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
}
.gallery-nav-btn:hover {
  background-color: rgba(246, 242, 235, 0.95);
}
.gallery-nav-btn.prev { left: 24px; }
.gallery-nav-btn.next { right: 24px; }

.gallery-thumbs-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 24px clamp(24px, 5vw, 60px) 0;
  scrollbar-width: none;
}
.gallery-thumbs-container::-webkit-scrollbar {
  display: none;
}
.gallery-thumb-btn {
  flex-shrink: 0;
  width: 80px;
  height: 54px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out);
  border: 1px solid transparent;
}
.gallery-thumb-btn.active {
  opacity: 1;
  border-color: var(--slate);
}
.gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   4. Next Project Footer Teaser
   -------------------------------------------------------------------------- */
.project-next-nav {
  background: var(--wool);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(32px, 6vw, 72px) clamp(24px, 6vw, 96px);
}
.next-nav-all {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--walnut);
  transition: color var(--duration-fast) var(--ease-out);
}
.next-nav-all:hover {
  color: var(--slate);
}
.next-nav-next {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-decoration: none;
}
.next-nav-label {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--walnut);
}
.next-nav-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 600;
  color: var(--slate);
  transition: color var(--duration-fast) var(--ease-out);
}
.next-nav-next:hover .next-nav-title {
  color: var(--walnut);
}

/* --------------------------------------------------------------------------
   Responsive Layout
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .project-detail-layout {
    grid-template-columns: 1fr;
  }
  .project-rail {
    height: auto;
    position: static;
    padding: 32px 28px 20px;
  }
  .rail-title-block {
    margin-top: 24px;
  }
  .rail-meta {
    display: none;
  }
  .rail-meta-mobile {
    display: grid;
  }
  .project-overview {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .overview-portrait-media {
    min-height: 60vh;
  }
}
