/* RAMS TARGET GYM - Clean White Gallery Stylesheet (GPU Accelerated) */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: #f8fafc;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
  contain: content;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--transition-smooth);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.gallery-item:hover {
  transform: translate3d(0, -4px, 0);
  border-color: var(--accent-red);
  box-shadow: var(--shadow-hover);
}

.gallery-item:hover img {
  transform: scale3d(1.06, 1.06, 1);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--transition-fast);
  padding: 1.5rem;
  text-align: center;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  box-shadow: 0 4px 12px var(--accent-red-glow);
}

.gallery-title {
  font-size: 1.05rem;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.gallery-cat {
  font-size: 0.75rem;
  color: #fbbf24;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  padding: 1.5rem;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 900px;
  max-height: 85vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale3d(0.95, 0.95, 1);
  transition: transform var(--transition-fast);
}

.lightbox-modal.active .lightbox-content {
  transform: scale3d(1, 1, 1);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  display: block;
  object-fit: contain;
}

.lightbox-caption {
  background: #ffffff;
  padding: 1rem 1.5rem;
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  color: var(--text-main);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background var(--transition-fast);
}

.lightbox-close:hover {
  background: var(--accent-red);
}
