/* ============================================================
   PORTFOLIO.CSS — page-specific styles for the case studies page
   Loads AFTER styles.css and inherits all tokens/classes from it.
   Only classes unique to this page live here.
   ============================================================ */

/* ---------- Case study sections ---------- */
.case {
  border-bottom: 1px solid var(--hairline);
}

.case-title {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  max-width: 20ch;
  margin-bottom: 3rem;
}

/* Case-level stat bars sit tighter than the hero's */
.case .stat-bar {
  margin-bottom: 4rem;
}

/* ---------- Two-column body: snapshot rail + narrative ---------- */
.case-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(3rem, 6vw, 5rem);
  align-items: start;
}

.snapshot {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
  border-top: 3px solid var(--accent);
  padding-top: 1.25rem;
}

.snapshot-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.snapshot dl {
  display: grid;
  gap: 1.1rem;
}

.snapshot dt {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.snapshot dd {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink);
}

/* ---------- Narrative ---------- */
.narrative h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.75rem 0 0.875rem;
}

.narrative h3:first-of-type {
  margin-top: 0;
}

.narrative p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 62ch;
}

.narrative p + p {
  margin-top: 0.875rem;
}

.narrative strong {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Image slots ---------- */
.img-slot {
  margin: 1.75rem 0 0.5rem;
  border: 1px solid var(--hairline) !important;
  border-radius: 2px;
  background: var(--card-hover-bg);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}

.img-slot:not(:has(img))::after {
  content: attr(data-slot);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-slot:has(img) {
  border: none;
  background: none;
}

.img-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.875rem;
  margin-top: 1.75rem;
}

.img-gallery .img-slot {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden; /* contain the zoom */
}

/* Zoom on hover — gallery images only */
.img-gallery .img-slot img {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.img-gallery .img-slot:hover img {
  transform: scale(1.06);
}

.img-gallery .img-slot:has(img),
.img-gallery .img-slot:has(img) img {
  cursor: pointer;
}

/* ---------- Lightbox ---------- */
html.lb-lock {
  overflow: hidden;
}
html.lb-lock body,
html.lb-lock .nav {
  padding-right: var(--lb-sbw, );
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, 0.86);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.open {
  opacity: 1;
}

.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  transform: scale(0.97);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.open .lightbox-figure {
  transform: scale(1);
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.7);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 241, 234, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: #f5f1ea;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lightbox-close:hover {
  border-color: #f5f1ea;
  background: rgba(0, 0, 0, 0.7);
}

.lightbox-close svg {
  width: 20px;
  height: 20px;
}

/* ---------- Snapshot client logos ---------- */
.snapshot-logo {
  height: 28px;
  width: auto;
  max-width: 160px;
  filter: brightness(0) invert(1); /* dark theme: render logo in ink */
}

[data-theme="light"] .snapshot-logo {
  filter: brightness(0);
}

/* ---------- Case testimonial (mirrors the hero-quote pattern) ---------- */
.case-quote {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--hairline);
}

.case-quote-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 34ch;
  margin-bottom: 1.75rem;
}

/* ---------- Portfolio hero intro ---------- */
.portfolio-hero .hero-subhead {
  max-width: 62ch;
}

/* ---------- Additional Work: quick-hit card grid ---------- */
.quickhits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}

.qh-card {
  padding: 2.5rem 2.25rem;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background 0.3s ease;
}

.qh-card:hover {
  background: var(--card-hover-bg);
}

.qh-client {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.qh-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.qh-desc {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-muted);
  flex: 1;
}

.qh-tags {
  display: grid;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.qh-tags dt {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.qh-tags dd {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink);
}

.qh-media {
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}
 
.qh-media .img-gallery {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
  margin-top: 0;
}
 
.qh-media .img-gallery .img-slot {
  aspect-ratio: 4 / 3;
}

@media (max-width: 700px) {
  .quickhits-grid {
    grid-template-columns: 1fr;
  }

  .qh-card {
    padding: 2rem 1.5rem;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-cta { display: revert; }
  .case-body {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .snapshot {
    position: static;
  }
}
