/* ═══════════════════════════════════════════
   CASE STUDY PAGE STYLES
   Extends style.css — dark-themed gallery pages
═══════════════════════════════════════════ */

/* ── Page base ── */
body.page-dark {
  background-color: var(--dark);
  color: var(--white);
}

/* ── Nav overrides for dark pages ── */
.nav-logo--light {
  color: rgba(255,255,255,0.75) !important;
}

.nav-links--light a {
  color: rgba(255,255,255,0.45);
}

.nav-links--light a:hover {
  color: var(--white);
}

.nav-links--light a::after {
  background: var(--white);
}

.nav.scrolled {
  background: rgba(17, 17, 16, 0.88) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

/* ── Case Study Hero ── */
.cs-hero {
  padding: 10rem 3rem 5rem;
  max-width: 820px;
  margin: 0 auto;
}

.cs-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color var(--transition), gap var(--transition);
}

.cs-back-link:hover {
  color: rgba(255,255,255,0.8);
  gap: 0.75rem;
}

.cs-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.cs-meta span {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.cs-sep {
  color: rgba(255,255,255,0.15) !important;
}

.cs-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 500;
  color: var(--white);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
  animation: fadeUp 0.9s ease both;
}

.cs-subtitle {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2rem;
  line-height: 1.6;
  animation: fadeUp 0.9s 0.1s ease both;
}

.cs-description {
  font-size: 0.9rem;
  line-height: 2;
  color: rgba(255,255,255,0.5);
  max-width: 680px;
  animation: fadeUp 0.9s 0.2s ease both;
}

.cs-description em {
  color: rgba(255,255,255,0.75);
  font-style: italic;
}

/* ── Divider ── */
.cs-gallery {
  padding: 2rem 3rem 6rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Masonry-style grid ── */
.cs-gallery-grid {
  columns: 3;
  column-gap: 1rem;
}

.cs-img-wrap {
  break-inside: avoid;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 3px;
  position: relative;
  display: block;
}

.cs-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease, filter 0.4s ease;
  filter: brightness(0.9);
}

.cs-img-wrap:hover img {
  transform: scale(1.03);
  filter: brightness(1);
}

/* ── Lightbox overlay on click ── */
.cs-img-wrap.active-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  border-radius: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
}

.cs-img-wrap.active-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 2px;
  transform: none;
  filter: brightness(1);
}

/* ── Placeholder slots ── */
.placeholder-wrap {
  aspect-ratio: 4/3;
  cursor: default;
}

.placeholder-wrap:nth-child(3n+1) { aspect-ratio: 3/4; }
.placeholder-wrap:nth-child(3n+2) { aspect-ratio: 16/10; }
.placeholder-wrap:nth-child(3n)   { aspect-ratio: 1/1; }

.cs-placeholder {
  width: 100%;
  height: 100%;
  min-height: 200px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.2);
  transition: background var(--transition), border-color var(--transition);
}

.cs-placeholder:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
}

.cs-placeholder svg {
  opacity: 0.5;
}

.cs-placeholder p {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .cs-gallery-grid { columns: 2; }
}

@media (max-width: 768px) {
  .cs-hero { padding: 7rem 1.5rem 3rem; }
  .cs-gallery { padding: 1.5rem 1.5rem 4rem; }
  .cs-gallery-grid { columns: 2; column-gap: 0.5rem; }
  .cs-img-wrap { margin-bottom: 0.5rem; }
}

@media (max-width: 480px) {
  .cs-gallery-grid { columns: 1; }
}
