:root {
  --bg: #0b0b0a;
  --panel: #121110;
  --border: #262319;
  --text: #f3efe6;
  --muted: #928c7c;
  --gold: #c6a15b;
  --gold-soft: rgba(198, 161, 91, 0.15);
  --overlay: rgba(8, 7, 5, 0.86);
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.brand-mark {
  color: var(--gold);
  font-size: 14px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  all: unset;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }

.nav-item.active {
  background: var(--gold-soft);
  color: var(--gold);
}

.nav-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.admin-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.admin-link:hover { color: var(--gold); }

/* Content */
.content {
  padding: 48px 56px 80px;
}

.content-header {
  margin-bottom: 36px;
}

.content-header h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 34px;
  margin: 0 0 6px;
}

.content-sub {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state a { color: var(--gold); text-decoration: none; }

/* Mosaic grid */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 90px;
  gap: 6px;
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: var(--panel);
  cursor: pointer;
  grid-column: span 2;
  grid-row: span 2;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.tile:hover img { transform: scale(1.05); }

.tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--overlay) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tile:hover .tile-overlay { opacity: 1; }

.tile-name {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text);
}

.tile-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: rgba(8,7,5,0.7);
  border: 1px solid rgba(198,161,91,0.4);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.tile:hover::after { transform: scaleX(1); }

/* Grid size variants for mosaic rhythm */
.tile.wide { grid-column: span 3; }
.tile.tall { grid-row: span 3; }
.tile.big { grid-column: span 3; grid-row: span 3; }
.tile.small { grid-column: span 2; grid-row: span 1; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6,5,4,0.97);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lb-stage {
  max-width: 90vw;
  max-height: 82vh;
}

.lb-stage img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.lb-close, .lb-nav {
  all: unset;
  position: absolute;
  color: var(--text);
  font-size: 30px;
  cursor: pointer;
  padding: 10px;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.lb-close:hover, .lb-nav:hover { opacity: 1; color: var(--gold); }

.lb-close { top: 20px; right: 28px; font-size: 34px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); font-size: 44px; }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); font-size: 44px; }

.lb-meta {
  position: absolute;
  bottom: 24px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.lb-meta #lbGalleryName { color: var(--gold); text-transform: uppercase; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .content { padding: 32px 20px 60px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .tile, .tile.wide, .tile.big { grid-column: span 2; grid-row: span 2; }
}
