/* ===== Gallery Grid ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  grid-auto-rows: 280px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item-wide {
  grid-column: span 2;
}

.gallery-item-tall {
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 36, 64, 0.85) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h4 {
  color: white;
  font-family: var(--font-body);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.gallery-overlay p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
  margin: 0;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 16px;
  font-size: 0.95rem;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ===== Instagram Feed ===== */
.instagram-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  justify-items: center;
  margin-bottom: 40px;
}

.instagram-feed .instagram-embed-placeholder {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.instagram-feed .instagram-embed-placeholder i {
  font-size: 3rem;
  color: var(--border);
  margin-bottom: 16px;
  display: block;
}

.instagram-feed .instagram-embed-placeholder p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.instagram-feed iframe {
  border: none !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm);
}

.instagram-cta {
  text-align: center;
  margin-top: 20px;
}

/* Instagram embed container */
.instagram-embed-wrapper {
  width: 100%;
  max-width: 400px;
}

.instagram-embed-wrapper blockquote {
  margin: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 200px;
  }
  .gallery-item-wide {
    grid-column: span 2;
  }
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
  .instagram-feed {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .gallery-item-wide {
    grid-column: span 1;
  }
}
