/* ===================== Base Reset ===================== */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;     /* black background */
  color: #fff;          /* default text */
  font-family: system-ui, Arial, sans-serif;
  line-height: 1.5;
}

/* ===================== Navbar ===================== */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: #1f1f1f; color: #fff;
  border-bottom: 1px solid #2b2b2b;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: 0.3px;
}
.brand img { height: 28px; width: 28px; display: block; }

/* Force brand white */
.navbar .brand,
.navbar .brand:link,
.navbar .brand:visited,
.navbar .brand:active,
.navbar .brand:focus {
  color: #fff !important;
  text-decoration: none !important;
}
.navbar .brand:hover { color: #8b5cf6 !important; }
.navbar .brand:focus-visible {
  outline: 2px solid #8b5cf6; outline-offset: 2px;
}

/* ===================== Navigation Tabs ===================== */
.nav {
  display: flex; align-items: center; gap: 22px;
  list-style: none; margin: 0; padding: 0;
}
.nav a,
.nav a:visited {
  color: #fff;
  text-decoration: none;
}
.nav a {
  padding: 6px 2px;
  position: relative;
  transition: color 180ms ease;
}
.nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  transform: scaleX(0); transform-origin: right;
  background: #8b5cf6;
  transition: transform 180ms ease;
}
.nav a:hover::after {
  transform: scaleX(1); transform-origin: left;
}

/* Active tab highlight */
body[data-page="home"]     .nav a[href="index.html"],
body[data-page="gallery1"] .nav a[href="gallery1.html"],
body[data-page="gallery2"] .nav a[href="gallery2.html"],
body[data-page="gallery3"] .nav a[href="gallery3.html"] {
  color: #8b5cf6;
  font-weight: 700;
}
body[data-page="home"]     .nav a[href="index.html"]::after,
body[data-page="gallery1"] .nav a[href="gallery1.html"]::after,
body[data-page="gallery2"] .nav a[href="gallery2.html"]::after,
body[data-page="gallery3"] .nav a[href="gallery3.html"]::after {
  transform: scaleX(1);
}

/* ===================== Content Wrapper ===================== */
.container { max-width: 1100px; margin: 32px auto; padding: 0 20px; }

/* ===================== Gallery 1 ===================== */
body[data-page="gallery1"] .container {
  max-width: none;
  padding: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  width: 100%;
}
.gallery-grid a {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Rows 2 & 5 span two columns */
.gallery-grid a:nth-child(5),
.gallery-grid a:nth-child(6),
.gallery-grid a:nth-child(15),
.gallery-grid a:nth-child(16) {
  grid-column: span 2;
}

/* ===================== Fullscreen Lightbox ===================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-in-out;
  z-index: 9999;
}
.lightbox:target {
  opacity: 1;
  pointer-events: auto;
}

.lightbox figure {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center; 
  justify-content: center;
}
.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

/* Close button */
.lightbox .close {
  position: fixed;
  top: 10px; right: 16px;
  background: #000;
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid #333;
  z-index: 10002;
}
.lightbox .close:hover { background: #111; }

/* Prev/Next buttons */
.lightbox .nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10001;
}
.lightbox .btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  color: #fff; text-decoration: none; font-weight: 700;
  border: 1px solid #333;
  user-select: none;
}
.lightbox .btn:hover { background: rgba(0,0,0,0.85); }
.lightbox .nav.prev { left: 12px; }
.lightbox .nav.next { right: 12px; }
.lightbox .btn:focus-visible {
  outline: 2px solid #8b5cf6; outline-offset: 2px;
}

/* Backdrop clickable close */
.lightbox:target .backdrop {
  position: fixed;
  inset: 0;
}

/* ===================== Responsive ===================== */
@media (max-width: 640px) {
  .navbar { flex-wrap: wrap; gap: 10px; }
  .nav { margin-left: auto; gap: 14px; }
}
