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

/* ── Design tokens ─────────────────────────────────── */
:root {
  --font-sans: system-ui, -apple-system, sans-serif;

  /* Light theme (homepage) */
  --bg: #f8f7f4;
  --fg: #1a1a1a;
  --muted: #666;
  --border: #e0ddd8;
  --accent: #2c5f8a;
  --card-bg: #fff;
}

[data-theme="dark"] {
  --bg: #0d0d0d;
  --fg: #e8e6e0;
  --muted: #888;
  --border: #222;
  --accent: #a8c5de;
  --card-bg: #161616;
}

/* ── Base ───────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

/* ── Layout ─────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Nav ────────────────────────────────────────────── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav .site-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}
nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
nav a { color: var(--muted); font-size: 0.95rem; }
nav a:hover { color: var(--fg); text-decoration: none; }

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

/* ── Gallery grid (photography index) ───────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.gallery-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  color: var(--fg);
}
.gallery-card:hover { transform: scale(1.02); text-decoration: none; }
.gallery-card img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
}
.gallery-card .card-info {
  padding: 0.75rem 1rem;
}
.gallery-card .card-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
}
.gallery-card .card-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ── Photo grid (gallery view) ──────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  padding: 1.5rem 0;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.photo-grid img:hover { opacity: 0.85; }

/* ── Lightbox ───────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 1rem;
  user-select: none;
}
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ── Page header ────────────────────────────────────── */
.page-header {
  padding: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
}
.page-header .back-link {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: block;
}

/* ── Homepage hero ──────────────────────────────────── */
.hero {
  padding: 4rem 0 3rem;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.hero .tagline {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
.hero .bio {
  max-width: 600px;
  color: var(--muted);
  line-height: 1.8;
}

/* ── Sub-site cards (homepage) ──────────────────────── */
.sites-section {
  padding-bottom: 3rem;
}
.sites-section h2 {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.site-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  transition: border-color 0.2s ease;
  display: block;
  color: var(--fg);
}
.site-card:hover { border-color: var(--accent); text-decoration: none; }
.site-card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--fg); }
.site-card p { font-size: 0.9rem; color: var(--muted); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
}
