/**
 * STREET DOGS | Craft Hot Dogs & Urban Diner
 * Gallery Styles - Editorial Asymmetric Grid & Accessible Lightbox
 */

/* ==========================================================================
   GRILLA EDITORIAL ASIMÉTRICA
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 240px;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  cursor: pointer;
  background-color: var(--color-surface);
}

.gallery-item:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Variación de proporciones editoriales */
.gallery-item.col-span-8 { grid-column: span 8; }
.gallery-item.col-span-6 { grid-column: span 6; }
.gallery-item.col-span-4 { grid-column: span 4; }
.gallery-item.row-span-2 { grid-row: span 2; }

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .gallery-img {
  transform: scale(1.025);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.gallery-caption {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
}

.gallery-tag {
  color: var(--color-secondary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

/* Responsive Grid */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 200px;
  }
  .gallery-item.col-span-8 { grid-column: span 6; }
  .gallery-item.col-span-4 { grid-column: span 3; }
  .gallery-item.col-span-6 { grid-column: span 6; }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }
  .gallery-item.col-span-8,
  .gallery-item.col-span-6,
  .gallery-item.col-span-4 {
    grid-column: span 1;
  }
  .gallery-item.row-span-2 {
    grid-row: span 1;
  }
}

/* ==========================================================================
   LIGHTBOX MODAL ACCESIBLE
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
}

.lightbox-caption {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
  text-align: center;
}

.lightbox-btn {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.lightbox-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
  top: -50px;
  right: 0;
}

.lightbox-prev {
  left: -60px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 768px) {
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: 10px; right: 10px; }
}
