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

:root {
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 6px;
  --transition: 0.2s ease;

  /* Light theme (default) */
  --bg:        #f9f9f9;
  --surface:   #ffffff;
  --border:    #e5e5e5;
  --text:      #1a1a1a;
  --text-muted:#666;
  --accent:    #1a1a1a;
  --header-bg: #ffffff;
  --footer-bg: #f0f0f0;
}

[data-theme="dark"] {
  --bg:        #0f0f0f;
  --surface:   #1a1a1a;
  --border:    #2d2d2d;
  --text:      #f0f0f0;
  --text-muted:#888;
  --accent:    #f0f0f0;
  --header-bg: #111111;
  --footer-bg: #111111;
}

[data-theme="warm"] {
  --bg:        #faf7f2;
  --surface:   #ffffff;
  --border:    #e8e0d5;
  --text:      #2d2418;
  --text-muted:#7a6a58;
  --accent:    #8b5e3c;
  --header-bg: #fdf9f4;
  --footer-bg: #f0ebe2;
}

[data-theme="slate"] {
  --bg:        #1e2330;
  --surface:   #252c3d;
  --border:    #333c52;
  --text:      #dde3f0;
  --text-muted:#8b95b0;
  --accent:    #7c9fd4;
  --header-bg: #1a2030;
  --footer-bg: #1a2030;
}

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

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

/* ─── Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}
.header-inner { max-width: 900px; margin: 0 auto; }
.site-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--text);
}
.site-bio {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.site-contact {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* ─── Gallery grid ──────────────────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery.gap-tight  { gap: 4px; }
.gallery.gap-normal { gap: 12px; }
.gallery.gap-wide   { gap: 24px; }

@media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    padding: 0.75rem;
  }
  .gallery.gap-normal { gap: 8px; }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  aspect-ratio: 1;
  transition: transform var(--transition), box-shadow var(--transition);
}
.gallery-item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.gallery-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition);
}
.gallery-item img[loading="lazy"] { opacity: 0; }
.gallery-item img.loaded { opacity: 1; }

.item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 0.75rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.gallery-item:hover .item-overlay,
.gallery-item:focus-visible .item-overlay { opacity: 1; }
.item-title { font-weight: 500; }

.video-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.7rem;
  pointer-events: none;
}

/* ─── Lightbox ──────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lb-content {
  max-width: min(90vw, 1200px);
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-content img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 3px;
}

.lb-content video {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 3px;
}

.lb-caption {
  margin-top: 0.75rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  text-align: center;
  max-width: 600px;
  padding: 0 1rem;
}
.lb-caption-title { font-weight: 500; }
.lb-caption-desc { color: rgba(255,255,255,0.6); margin-top: 0.25rem; font-size: 0.8rem; }

.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: rgba(255,255,255,0.12);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  transition: background var(--transition);
  z-index: 1001;
  -webkit-tap-highlight-color: transparent;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.25); }
.lb-close { top: 1rem; right: 1rem; font-size: 1.2rem; }
.lb-prev  { left: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 2rem; padding: 0.5rem 0.8rem; }
.lb-next  { right: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 2rem; padding: 0.5rem 0.8rem; }

@media (max-width: 500px) {
  .lb-prev { left: 0.25rem; }
  .lb-next { right: 0.25rem; }
}

/* ─── Empty state ───────────────────────────────────────────────────────── */
.empty-gallery {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 2rem;
  font-size: 1rem;
}

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

/* ─── Auth page ─────────────────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  margin: 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 300;
  text-align: center;
  margin-bottom: 0.25rem;
}
.auth-subtitle {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }

/* ─── Form elements ─────────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.optional { font-weight: 400; opacity: 0.7; }
.field-input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.field-textarea { resize: vertical; min-height: 80px; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover { opacity: 0.85; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); }
.btn-danger {
  background: transparent;
  color: #c0392b;
  border-color: #e0b0b0;
}
.btn-danger:hover { background: #fff0f0; }
.btn-full { width: 100%; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error   { background: #fff0f0; color: #c0392b; border: 1px solid #f5c6c6; }
.alert-success { background: #f0faf0; color: #27ae60; border: 1px solid #b8e4b8; }
