/* ── Tokens (shared with upload page) ──────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ivory:   #FAF8F5;
  --blush:   #E8C4B8;
  --mauve:   #9B7B74;
  --gold:    #C9A96E;
  --charcoal:#2C2420;
  --glass:   rgba(250, 248, 245, 0.82);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Jost', system-ui, sans-serif;
  background: var(--ivory);
  color: var(--charcoal);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Nav ────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1.1rem 2rem;
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232, 196, 184, 0.35);
}
.nav-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--charcoal);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mauve);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--gold); }

/* ── Hero ───────────────────────────────────────────────── */
.gallery-hero {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #f0e3db 0%, transparent 70%);
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mauve);
  margin-bottom: 1rem;
  font-weight: 300;
  animation: fadeUp 0.8s var(--ease-out) 0.1s both;
}
.gallery-hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  animation: fadeUp 0.9s var(--ease-out) 0.2s both;
}
.gallery-hero h1 em {
  font-style: italic;
  color: var(--mauve);
}
.hero-sub {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--charcoal);
  opacity: .65;
  animation: fadeUp 1s var(--ease-out) 0.35s both;
}

/* ── Controls ───────────────────────────────────────────── */
.controls-bar {
  position: sticky;
  top: 57px;
  z-index: 40;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(232, 196, 184, 0.3);
  padding: 0 2rem;
}
.controls-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}
.filter-tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.tab {
  padding: 0.4rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mauve);
  cursor: pointer;
  transition: all 0.2s;
}
.tab:hover { border-color: var(--blush); color: var(--charcoal); }
.tab.active {
  background: var(--mauve);
  color: #fff;
  border-color: var(--mauve);
}
.layout-toggle { display: flex; gap: 4px; }
.layout-btn {
  width: 34px; height: 34px;
  border: 1px solid rgba(155,123,116,0.25);
  border-radius: 8px;
  background: none;
  color: var(--mauve);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.layout-btn:hover { border-color: var(--gold); color: var(--charcoal); }
.layout-btn.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }

.gallery-stats {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mauve);
  opacity: .55;
  padding: 0 0 0.6rem;
}

/* ── Gallery Wrap ───────────────────────────────────────── */
.gallery-wrap {
  padding: 2.5rem 1.5rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Masonry */
.masonry-grid {
  columns: 4 240px;
  column-gap: 12px;
}
.masonry-grid.grid-layout {
  columns: unset;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* Photo Card */
.photo-card {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--blush);
  animation: fadeUp 0.5s var(--ease-out) both;
  display: block;
}
.masonry-grid.grid-layout .photo-card {
  aspect-ratio: 1;
  margin-bottom: 0;
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-out);
}
.masonry-grid:not(.grid-layout) .photo-card img {
  height: auto;
}

.photo-card:hover img { transform: scale(1.04); }

/* Card overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,36,32,0.72) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
}
.photo-card:hover .card-overlay,
.photo-card:focus .card-overlay { opacity: 1; }

.card-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.2rem;
}
.card-tag {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Skeleton loaders */
.skeleton {
  border-radius: 14px;
  background: linear-gradient(90deg, #ece7e2 25%, #f4efeb 50%, #ece7e2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  break-inside: avoid;
  margin-bottom: 12px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
}
.empty-icon { font-size: 2.5rem; color: var(--blush); margin-bottom: 1.5rem; }
.empty-state h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.empty-state p { color: var(--mauve); margin-bottom: 2rem; font-weight: 300; }
.btn-upload-link {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: var(--mauve);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.btn-upload-link:hover { opacity: 0.85; }

/* ── Lightbox ───────────────────────────────────────────── */
.lb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 14, 0.92);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
}
.lb-backdrop.visible { opacity: 1; pointer-events: all; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}
.lightbox.visible { opacity: 1; pointer-events: all; }
.lightbox[hidden] { display: none; }

.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: calc(100vh - 160px);
}
.lb-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  transform: scale(0.96);
  transition: transform 0.35s var(--ease-out);
}
.lightbox.visible .lb-image { transform: scale(1); }

/* Nav arrows */
.lb-close, .lb-nav {
  position: fixed;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  backdrop-filter: blur(6px);
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,0.2); }

.lb-close {
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  z-index: 202;
}
.lb-nav {
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
}
.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }

/* Caption */
.lb-caption {
  width: 100%;
  max-width: 600px;
  padding-top: 1.25rem;
  text-align: center;
}
.lb-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.lb-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(255,255,255,0.9);
}
.lb-tag {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(201,169,110,0.4);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}
.lb-message {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.lb-counter {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mauve);
  opacity: 0.5;
  background: #f3ece7;
}

/* ── Keyframes ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .controls-bar { padding: 0 1rem; }
  .gallery-wrap { padding: 1.5rem 1rem 4rem; }
  .masonry-grid { columns: 2 140px; }
  .lb-prev { left: 0.75rem; }
  .lb-next { right: 0.75rem; }
  .lightbox { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Video play button overlay ──────────────────────────── */
.play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.2s;
}
.photo-card:hover .play-btn {
  transform: scale(1.1);
}

/* ── Language toggle ────────────────────────────────────── */
.lang-toggle {
  position: fixed;
  top: 1.25rem;
  left: 1.5rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mauve);
  background: rgba(250, 248, 245, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(232, 196, 184, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.lang-toggle:hover { border-color: var(--gold); }
.lang-option {
  opacity: 0.45;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.lang-option.active {
  opacity: 1;
  color: var(--charcoal);
}
.lang-sep { opacity: 0.35; }

@media (max-width: 480px) {
  .lang-toggle { top: 1rem; left: 1rem; padding: 0.5rem 0.85rem; }
}
