/* ── Galería ── */
.gallery-page {
  min-height: 100vh;
  padding-bottom: 60px; /* espacio para el reproductor fijo */
}

/* Hero */
.gallery-hero {
  padding: 160px 0 80px;
  background: linear-gradient(180deg, var(--verde-dark) 0%, var(--verde) 100%);
  color: var(--crema);
  position: relative;
  overflow: hidden;
}

.gallery-hero::before {
  content: 'CINE ITALO ARGENTINO • 1929 • CAPITÁN SARMIENTO • SOCIEDAD ITALIANA • ';
  position: absolute;
  top: 80px;
  left: 0; right: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(245, 237, 224, 0.18);
  white-space: nowrap;
  pointer-events: none;
}

.gallery-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: rgba(245, 237, 224, 0.7);
}

.gallery-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 100px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--crema);
  margin-bottom: 20px;
}

.gallery-title em {
  font-style: italic;
  color: #e8d4a6;
  font-weight: 400;
}

.gallery-subtitle {
  font-size: 17px;
  color: rgba(245, 237, 224, 0.75);
  max-width: 480px;
  line-height: 1.6;
}

/* Filtros */
.gallery-filters {
  background: var(--crema);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 80px;
  z-index: 50;
}

.gallery-filter-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gallery-filter-tabs::-webkit-scrollbar {
  display: none;
}

.gallery-tab {
  padding: 14px 20px;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.gallery-tab:hover {
  color: var(--tinta);
}

.gallery-tab.active {
  color: var(--borgo);
  border-bottom-color: var(--borgo);
}

/* Grid de fotos */
.gallery-content {
  padding: 48px 0 64px;
  background: var(--crema);
}

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

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  margin: 0;
  background: var(--crema-dark);
}

.gallery-item[hidden] {
  display: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

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

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(26, 20, 16, 0.82));
  color: var(--crema);
  padding: 32px 12px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

/* Lightbox */
.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 8, 0.93);
  backdrop-filter: blur(6px);
}

.gallery-lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 1100px);
}

.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 78vh;
}

.lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.lb-caption {
  color: rgba(245, 237, 224, 0.65);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-align: center;
  max-width: 70ch;
  margin: 0;
  text-transform: uppercase;
}

.lb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(245, 237, 224, 0.25);
  background: rgba(245, 237, 224, 0.08);
  color: var(--crema);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}

.lb-close:hover {
  background: rgba(245, 237, 224, 0.18);
}

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(245, 237, 224, 0.25);
  background: rgba(245, 237, 224, 0.08);
  color: var(--crema);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}

.lb-nav:hover {
  background: rgba(245, 237, 224, 0.18);
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* Reproductor de música */
.music-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--tinta);
  border-top: 1px solid rgba(245, 237, 224, 0.08);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
}

.music-player-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: 58px;
}

.mp-note {
  font-size: 18px;
  color: #e8d4a6;
  flex-shrink: 0;
  opacity: 0.7;
}

.mp-track-info {
  flex: 1;
  min-width: 0;
}

.mp-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--crema);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.mp-artist {
  display: block;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: rgba(245, 237, 224, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.mp-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.mp-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: rgba(245, 237, 224, 0.7);
  cursor: pointer;
  border-radius: 50%;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.mp-btn:hover {
  background: rgba(245, 237, 224, 0.1);
  color: var(--crema);
}

.mp-btn-play {
  width: 40px;
  height: 40px;
  background: var(--borgo);
  color: var(--crema);
  font-size: 15px;
}

.mp-btn-play:hover {
  background: var(--borgo-dark);
  color: var(--crema);
}

.mp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 320px;
}

.mp-progress {
  flex: 1;
  height: 3px;
  background: rgba(245, 237, 224, 0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.mp-progress:hover {
  height: 5px;
}

.mp-progress-bar {
  height: 100%;
  background: #e8d4a6;
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
}

.mp-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(245, 237, 224, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 34px;
}

.mp-list-btn {
  font-size: 16px;
  flex-shrink: 0;
}

/* Playlist desplegable */
.mp-playlist[hidden] {
  display: none;
}

.mp-playlist {
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid rgba(245, 237, 224, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(245,237,224,0.2) transparent;
}

.mp-playlist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  color: rgba(245, 237, 224, 0.6);
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(245, 237, 224, 0.04);
}

.mp-playlist-item:hover {
  background: rgba(245, 237, 224, 0.06);
  color: var(--crema);
}

.mp-playlist-item.is-active {
  background: rgba(139, 35, 50, 0.15);
  color: #e8d4a6;
}

.mp-playlist-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(245, 237, 224, 0.25);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}

.mp-playlist-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.mp-playlist-artist {
  font-size: 11px;
  font-family: var(--font-mono);
  color: rgba(245, 237, 224, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Responsivo */
@media (max-width: 900px) {
  .gallery-hero {
    padding: 120px 0 60px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
  }

  .mp-progress-wrap {
    display: none;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .gallery-item {
    aspect-ratio: 1 / 1;
  }

  .music-player-bar {
    padding: 0 14px;
    gap: 10px;
  }

  .mp-note {
    display: none;
  }
}
