/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #111;
  --surface:   #1a1a1a;
  --border:    #2e2e2e;
  --text:      #e8e8e8;
  --muted:     #888;
  --accent:    #c89b6e;
  --radius:    10px;
  --font:      system-ui, -apple-system, "Segoe UI", sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--accent);
}
.site-title:hover { opacity: .85; }

/* ── Main ─────────────────────────────────────────────────── */
.site-main {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
}

/* ── Page title ───────────────────────────────────────────── */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}

/* ── Home / Gallery list ──────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.gallery-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--border);
}
.gallery-card__image--empty {
  background: var(--border);
}

.gallery-card__info {
  padding: 1rem 1.2rem;
}
.gallery-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .25rem;
}
.gallery-card__count {
  font-size: .85rem;
  color: var(--muted);
}

/* ── Individual gallery page ──────────────────────────────── */
.gallery-page__header {
  margin-bottom: 1.75rem;
}
.back-link {
  display: inline-block;
  font-size: .9rem;
  color: var(--accent);
  margin-bottom: .75rem;
  transition: opacity .15s;
}
.back-link:hover { opacity: .75; }

.photo-count {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ── PhotoSwipe gallery grid ──────────────────────────────── */
.pswp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

.pswp-gallery a {
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: var(--border);
  line-height: 0;
  transition: opacity .15s;
}
.pswp-gallery a:hover { opacity: .85; }

.pswp-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-main { padding: 1.5rem 1rem; }
  .page-title { font-size: 1.5rem; }
  .pswp-gallery {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 4px;
  }
  .pswp-gallery img { height: 120px; }
}
