:root { --bg:#000; --card:#111; --fg:#f0f0f0; }

body {
  margin: 0;
  font-family: system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  background: var(--bg);
  color: var(--fg);
  padding: 2rem;
}

.gallery-page {
  max-width: 1200px;
  margin: auto;
}

.gallery-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.projects-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1rem;
}

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .25s ease, filter .25s ease;
}

.project-card:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 0 16px rgba(255,255,255,.25));
  z-index: 1;
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #222;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-description {
  margin-top: 1rem;
  color: #fff;
  text-align: center;
  font-size: 1rem;
  max-width: 90%;
}

.project-card h2 {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  margin: 0;
  padding: .75rem 1rem;
  background: rgba(0,0,0,.7);
  font-size: 1rem;
  text-align: center;
  opacity: 0;
  transform: translateY(100%);
  transition: all .3s ease;
  color: #fff;
}

.project-card:hover h2 {
  opacity: 1;
  transform: translateY(0);
}

/* slider overlay */
/* Ensure slider is always centered and responsive */
.slider {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.slider.active {
  display: flex;
}

.slider-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  padding: 1rem;
  gap: 1rem;
}

.slider-overlay.active {
  display: flex;
}

/* Layout of image + nav buttons */
.slider-content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 80vh;
  flex-wrap: nowrap;
  gap: 1rem;
  position: relative;
}

/* The image itself */
.slider-content img {
  max-width: 90vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.slide-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Navigation and close buttons */
.slider-btn {
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  position: absolute;
  top: 1rem;
  z-index: 10;
}

#close-slider {
  right: 1rem;
}

#fullscreen-toggle {
  right: 4rem;
}

#prev-slide {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

#next-slide {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

#fullscreen-toggle {
  display: none;
}

.slider.active #fullscreen-toggle {
  display: block;
}


/* Description below the image */
.slide-description {
  margin-top: 1rem;
  color: #fff;
  text-align: center;
  font-size: 1rem;
  max-width: 90%;
  overflow-wrap: break-word;
}

.slide-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 1rem;
}

#current-slide-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
}

.nav-btn,
.slider-close,
.fullscreen-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  padding: .25rem .5rem;
  user-select: none;
}

.slider-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 2.5rem;
}

.fullscreen-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 1rem;
  background: rgba(255,255,255,.1);
  border-radius: 4px;
  padding: 6px 10px;
}

/* Responsive */

/* Small screen tweaks */
@media (max-width: 600px) {
  .slider-content img {
    max-width: 100vw;
    max-height: 60vh;
  }

  .slider-btn {
    font-size: 1.5rem;
    padding: 0.3rem 0.8rem;
  }

  .slide-description {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .project-card {
    transform: none;
    filter: none;
  }
  .project-card:hover {
    transform: none;
    filter: none;
  }
  .project-card h2 {
    opacity: 1;
    transform: translateY(0);
    position: static;
    background: none;
    padding: .5rem 0;
    text-align: center;
  }
}
