/* =====================================================
   GALLERY PAGE
   ===================================================== */
.gallery-page {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 96px;
  min-height: 100vh;
}

.gallery-header {
  margin-bottom: 48px;
}

/* Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.gallery-item:hover {
  box-shadow: var(--shadow-lg);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
  color: #fff;
  padding: 28px 14px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s, transform 0.22s;
}
.gallery-item:hover .gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

.gallery-play-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  pointer-events: none;
  transition: background 0.2s;
}
.gallery-item:hover .gallery-play-icon {
  background: rgba(255,255,255,0.28);
}

/* =====================================================
   MODAL
   ===================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }

.modal-content {
  max-width: 90vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.modal-content img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
}
.modal-content video {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 6px;
}

.modal-caption {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  margin-top: 18px;
  max-width: 620px;
  text-align: center;
  line-height: 1.55;
  padding: 0 24px;
}

.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 10;
}
.modal-close:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10;
}
.modal-nav:hover { background: rgba(255,255,255,0.22); color: #fff; }
.modal-prev { left: 16px; }
.modal-next { right: 16px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .modal-prev { left: 8px; }
  .modal-next { right: 8px; }
}
