:root {
  --bg: #0f0f10;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --card-bg: #18181a;
  --border: #232323;
  --accent: #e8e8e8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.hidden { display: none !important; }

.site-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}
.logo {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 18px;
}
main { padding: 32px; max-width: 1400px; margin: 0 auto; }

/* --- список розділів --- */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 24px;
  text-decoration: none;
  color: var(--fg);
  transition: transform 0.15s ease, background 0.15s ease;
  border: 1px solid var(--border);
}
.category-card:hover { transform: translateY(-2px); background: #202022; }
.category-card__title {
  font-size: 18px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.category-card__count { color: var(--muted); margin-top: 8px; font-size: 14px; }
.empty { color: var(--muted); }

/* --- грід галереї (masonry через колонки) --- */
.gallery-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; }
.gallery-count { color: var(--muted); font-weight: 400; font-size: 16px; }

.grid {
  column-count: 4;
  column-gap: 12px;
}
@media (max-width: 1200px) { .grid { column-count: 3; } }
@media (max-width: 800px)  { .grid { column-count: 2; } }
@media (max-width: 500px)  { .grid { column-count: 1; } }

.grid__item {
  margin: 0 0 12px;
  break-inside: avoid;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card-bg);
}
.grid__item img {
  width: 100%;
  display: block;
  transition: transform 0.2s ease;
}
.grid__item:hover img { transform: scale(1.02); }

/* --- лайтбокс --- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 4px;
}
.lightbox__close {
  position: absolute; top: 20px; right: 28px;
  background: none; border: none; color: #fff; font-size: 32px; cursor: pointer;
  line-height: 1;
}
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #fff; font-size: 28px; cursor: pointer;
  padding: 16px;
}
.lightbox__nav--prev { left: 8px; }
.lightbox__nav--next { right: 8px; }

/* --- логін --- */
.login-box { max-width: 360px; margin: 80px auto; text-align: center; }
.login-box input {
  width: 100%; padding: 12px; margin-top: 20px; border-radius: 6px;
  border: 1px solid #333; background: #1a1a1a; color: #fff; font-size: 15px;
}
.login-box button {
  width: 100%; padding: 12px; margin-top: 12px; border-radius: 6px;
  border: none; background: var(--accent); color: #111; font-weight: 600; cursor: pointer;
}
.error { color: #ff6b6b; margin-top: 12px; }
