/* Artworks gallery — dark, edge-to-edge masonry.
   Self-contained: scoped to body.gallery-page so the main
   site styles aren't affected. */

:root {
  --bg: #0a0a0a;
  --ink: #f2f2ef;
  --ink-soft: #8a8a87;
}

html {
  scroll-behavior: smooth;
}

body.gallery-page {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter",
               "Helvetica Neue", system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Top nav (floating, glassy) ------------------------------- */

.gallery-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg,
              rgba(10,10,10,0.78) 0%,
              rgba(10,10,10,0.40) 70%,
              rgba(10,10,10,0)    100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
}

.gallery-nav .brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.gallery-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.4rem;
}

.gallery-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 150ms ease;
}

.gallery-nav a:hover,
.gallery-nav a[aria-current="page"] {
  color: var(--ink);
}

/* --- Masonry ------------------------------------------------- */

.masonry {
  columns: 3;
  column-gap: 0;
  margin: 0;
  padding: 0;
}

.masonry img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  break-inside: avoid;
  vertical-align: bottom;     /* kills the tiny inline-image gap */
  cursor: zoom-in;
  transition: opacity 220ms ease, filter 220ms ease;
}

.masonry img:hover {
  opacity: 0.82;
}

/* --- Lightbox ------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 8, 8, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.lightbox[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  background: none;
  border: 0;
  color: var(--ink-soft);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  transition: color 150ms ease;
}

.lightbox-close:hover { color: var(--ink); }

body.lightbox-open { overflow: hidden; }

/* --- Responsive --------------------------------------------- */

@media (max-width: 1000px) {
  .masonry { columns: 2; }
}

@media (max-width: 540px) {
  .masonry { columns: 1; }
  .gallery-nav { padding: 0.85rem 1rem; }
  .gallery-nav ul { gap: 0.9rem; }
  .lightbox { padding: 1.25rem; }
}
