/* ── Slideshow ── */
.gallery-slideshow {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
  margin-top: 1.25rem;
  background: #c8b8b8;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 30%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem 2rem;
}

.slide-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}

.slide-caption {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: #fff;
  font-weight: 400;
}

.slide-dots {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background var(--transition);
  cursor: pointer;
}

.dot.active {
  background: #fff;
}

/* ── Gallery main ── */
.gallery-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 2rem;
}

/* ── Projects grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.5rem;
}

/* ── Project card ── */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}

/* ── Stacked photos (Option B: cascading offset) ── */
.stack-wrap {
  position: relative;
  height: 110px;
  margin: 8px 10px;
}

.stack-img {
  position: absolute;
  width: 82%;
  height: 100px;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  background-color: #c8b8b8;
  background-size: cover;
  background-position: center;
}

.s1 {
  background-color: #a89898;
  transform: rotate(-6deg) translate(-8px, 8px);
  z-index: 1;
}

.s2 {
  background-color: #b8a8a8;
  transform: rotate(3deg) translate(4px, 4px);
  z-index: 2;
}

.s3 {
  transform: rotate(0deg);
  z-index: 3;
}

.project-card:hover .s1 {
  transform: rotate(-10deg) translate(-12px, 10px);
  transition: transform 0.25s ease;
}

.project-card:hover .s2 {
  transform: rotate(5deg) translate(8px, 5px);
  transition: transform 0.25s ease;
}

.project-card:hover .s3 {
  transform: rotate(1deg);
  transition: transform 0.25s ease;
}

/* ── Card info ── */
.card-info {
  padding: 0 4px;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}


/* ── Gallery overlay ── */
.gallery-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.gallery-overlay.open {
  opacity: 1;
  visibility: visible;
}

.gallery-modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.gallery-close {
  position: sticky;
  top: 0;
  align-self: flex-end;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
  flex-shrink: 0;
  z-index: 10;
}

.gallery-close:hover { color: var(--red); }

.overlay-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text);
}

.overlay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.overlay-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  display: block;
  object-fit: cover;
  cursor: zoom-in;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  cursor: zoom-out;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 80%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
  cursor: default;
}


/* ── Responsive ── */
@media (max-width: 680px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-slideshow {
    height: 220px;
  }

  .gallery-main {
    padding: 1.5rem 1rem 2rem;
  }
}

@media (max-width: 420px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}