:root {
  --bg: #0c0c0d;
  --panel: #111112;
  --fg: #e8e6e3;
  --dim: #8a8782;
  --line: #232324;
  --gap: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

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

.app { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */

#sidebar {
  width: 200px;
  flex-shrink: 0;
  padding: 40px 26px;
  border-right: 1px solid var(--line);
}

#sidebar .brand {
  display: block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  margin-bottom: 30px;
}

#nav-toggle { display: none; }

#nav-list { list-style: none; }

#nav-list li { margin-bottom: 4px; }

#nav-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  color: var(--dim);
  transition: color .15s;
}

#nav-list a:hover, #nav-list a.active { color: var(--fg); }

#nav-list .n {
  font-size: 11px;
  opacity: .55;
  margin-left: 10px;
}

#nav-list .aux { margin-top: 20px; }
#nav-list .aux + .aux { margin-top: 0; }
#nav-list .aux a { font-size: 13px; }

/* ---------- content ---------- */

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#gallery {
  flex: 1;
  width: 100%;
  padding: var(--gap);
}

#gallery-status {
  text-align: center;
  color: var(--dim);
  padding: 40px 20px;
}
#gallery-status:empty { display: none; }

.row {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.row a {
  display: block;
  position: relative;
  overflow: hidden;
  background: #161617;  /* overridden inline by each photo's avg color */
}

.row img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease, transform .35s ease;
}

.row img.loaded { opacity: 1; }

.row a:hover img { transform: scale(1.02); }

.prose {
  flex: 1;
  max-width: 640px;
  padding: 48px 32px;
}

.prose h1 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .25em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.prose p { margin-bottom: 14px; color: var(--fg); }

footer {
  padding: 28px 24px 34px;
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
}

footer a { color: var(--dim); }

/* ---------- lightbox ---------- */

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 9, .96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#lightbox[hidden] { display: none; }

#lb-img {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  object-fit: contain;
  box-shadow: 0 8px 60px rgba(0, 0, 0, .6);
}

#lb-cap {
  position: absolute;
  bottom: 34px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--fg);
  font-size: 14px;
  padding: 0 18px;
}

#lb-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 18px 12px;
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
  letter-spacing: .02em;
}

#lb-meta .sep { margin: 0 .55em; opacity: .45; }

#lb-close, .lb-nav {
  position: absolute;
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  padding: 16px;
  z-index: 11;
  transition: color .15s;
}

#lb-close:hover, .lb-nav:hover { color: var(--fg); }

#lb-close { top: 8px; right: 12px; }

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 44px;
  padding: 24px 18px;
}

#lb-prev { left: 4px; }
#lb-next { right: 4px; }

/* ---------- mobile ---------- */

@media (max-width: 760px) {
  :root { --gap: 4px; }

  .app { flex-direction: column; }

  #sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 18px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  #sidebar .brand { margin-bottom: 0; }

  #nav-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--dim);
    font-size: 20px;
    cursor: pointer;
  }

  #nav-list { display: none; width: 100%; margin-top: 14px; }
  #nav-list.open { display: block; }
  #nav-list .aux { margin-top: 8px; }

  .lb-nav { display: none; }  /* swipe / tap sides instead */
}
