body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  background: #fff;
  color: #111;
}

header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
}

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

main {
  padding: 2rem;
}

#project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  position: relative;
  overflow: hidden;
}

.project-card img {
  width: 100%;
  display: block;
}

.project-card h3 {
  position: absolute;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  width: 100%;
  padding: 0.5rem;
  margin: 0;
}

/* Project detail layout */
#project-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding: 0 1rem;
}

.gallery figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease-in-out;
  user-select: none;
  -webkit-user-drag: none;
}

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

.gallery figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
  text-align: left;
}

/* Lightbox styles */
#lightbox.hidden {
  display: none;
}

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  touch-action: none; /* important for pinch gesture */
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.2s ease;
  display: block;
  margin: 0 auto;
  touch-action: none;
}

.lightbox-content img.zoomed {
  cursor: zoom-out;
  transform: scale(2);
}

#lightbox-caption {
  color: #eee;
  font-size: 0.95rem;
  max-width: 100%;
  text-align: center;
  padding: 0 1rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0 1rem;
  z-index: 1;
}

.lightbox-nav.prev { left: -3rem; }
.lightbox-nav.next { right: -3rem; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
}

/* Mobile nav */
.menu-icon {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

#nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 768px) {
  .menu-icon {
    display: block;
  }

  #nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 1rem;
    top: 4rem;
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1001;
  }

  #nav-links.show {
    display: flex;
  }
}