/* ══════════════════════════════════
    PAGE HEADER
══════════════════════════════════ */
.page-header { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 120px 52px 0; }

.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 500; color: var(--text-2); text-decoration: none;
  letter-spacing: .03em; transition: color 0.2s, gap 0.2s; margin-bottom: 32px;
}
.back-link:hover { color: var(--text); gap: 12px; }
.back-link::before { content: '←'; }

.page-title { font-size: clamp(2.8rem, 6vw, 5.5rem); font-weight: 200; letter-spacing: -0.04em; line-height: 0.95; color: var(--text); }
.page-meta { margin-top: 16px; font-size: .84rem; color: var(--text-3); font-weight: 400; }
#work-count { color: var(--text-2); font-weight: 500; }

/* ══════════════════════════════════
    GALLERY GRID
══════════════════════════════════ */
.gallery-outer { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 32px 52px 120px; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.work-card {
  position: relative; display: block; border-radius: 18px; overflow: hidden;
  cursor: pointer; background: #eef0f3; aspect-ratio: 4 / 3;
  color: inherit; text-decoration: none; isolation: isolate;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), box-shadow 0.45s cubic-bezier(0.22,1,0.36,1), opacity 0.35s ease;
}
.work-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); }
.work-card:hover,
.work-card:focus-visible { transform: translateY(-6px); box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 22px 50px rgba(0,0,0,0.12), 0 6px 14px rgba(0,0,0,0.06); }
.work-card:hover img,
.work-card:focus-visible img { transform: scale(1.03); }
.work-card:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.work-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.58) 0%, transparent 55%);
  opacity: 0; transition: opacity 0.3s ease;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 22px;
}
.work-card:hover .work-card-overlay,
.work-card:focus-visible .work-card-overlay { opacity: 1; }
.work-card.img-missing { background: #111; }
.work-card.img-missing img { visibility: hidden; }
.work-card.img-missing .work-card-overlay { opacity: 1; }
.work-card-title { color: #fff; font-size: .88rem; font-weight: 600; line-height: 1.3; }
.work-card-cat   { color: rgba(255,255,255,0.6); font-size: .72rem; font-weight: 400; margin-top: 4px; }

/* EMPTY STATE */
.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 80px 0;
  color: var(--text-3); font-size: .9rem; display: none;
}
.empty-state.visible { display: block; }
.empty-state strong { display: block; font-size: 1.4rem; font-weight: 300; color: var(--text-2); margin-bottom: 8px; }


/* ══════════════════════════════════
    RESPONSIVE
══════════════════════════════════ */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .page-header { padding: 100px 20px 0; }
  .gallery-outer { padding: 24px 20px 80px; }
}

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