/* Cabecera superior */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 1.25rem clamp(1rem, 3.5vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.header-brands {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.brand-link {
  transition: opacity 0.2s ease;
}

.brand-link:hover {
  opacity: 0.7;
}

.brand-link .logo-etc-helvetica {
  font-size: clamp(1.35rem, 2vw, 1.95rem);
}

.brand-link .logo-zine-lockup {
  font-size: clamp(1.3rem, 1.9vw, 1.85rem);
}

.brand-link .logo-word-lockup {
  font-size: clamp(1.35rem, 2vw, 1.95rem);
}

.brand-slash {
  font-family: var(--font-helvetica);
  font-weight: 300;
  font-size: 1.2rem;
  color: var(--text-dim);
}

/* Filtros */
.filter-bar {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--text-white);
}

.filter-btn.active {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Collage en escritorio (24 columnas) */
.collage-stage {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3.5vw, 3.5rem) 7.5rem;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  column-gap: 1.1rem;
  row-gap: 3rem;
  align-items: start;
  min-height: 75vh;
}

.work-item {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.work-item.is-hidden {
  display: none;
}

.work-item.is-dimmed {
  opacity: 0.12;
  pointer-events: none;
}

.work-item.rearranging {
  animation: collageSlide 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes collageSlide {
  from {
    transform: translateY(12px) scale(0.98);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

/* Slots dinámicos en escritorio */
.slot-01 { grid-column: 1 / span 6; margin-top: 0; }
.slot-02 { grid-column: 8 / span 5; margin-top: 2.4rem; }
.slot-03 { grid-column: 14 / span 5; margin-top: 0.4rem; }
.slot-04 { grid-column: 20 / span 5; margin-top: 3.4rem; }

.slot-05 { grid-column: 3 / span 6; margin-top: 0.8rem; }
.slot-06 { grid-column: 11 / span 5; margin-top: -0.8rem; }
.slot-07 { grid-column: 18 / span 5; margin-top: 1.6rem; }

.slot-08 { grid-column: 2 / span 6; margin-top: 1.2rem; }
.slot-09 { grid-column: 10 / span 5; margin-top: 2.5rem; }
.slot-10 { grid-column: 16 / span 6; margin-top: 0; }
.slot-11 { grid-column: 4 / span 5; margin-top: 1.2rem; }

/* Control de proporción real */
.work-media {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.work-media img,
.work-media video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 210px;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.work-item:hover .work-media img,
.work-item:hover .work-media video {
  transform: scale(1.02);
}

.work-media.is-empty {
  width: 220px;
  max-width: 100%;
  background-color: #0c0c0c;
  aspect-ratio: 4 / 3;
}

.work-caption {
  margin-top: 0.4rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.68rem;
  line-height: 1.2;
  min-width: 0;
}

.work-title {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.work-item:hover .work-title {
  color: var(--text-white);
}

.work-tag {
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Visor de video en grande */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(12px); /* Safari necesita el prefijo -webkit- antes que la propiedad normal */
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.08s ease-out;
  cursor: pointer;
}

.video-lightbox.is-open {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #333;
  color: var(--text-white);
  padding: 0.4rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 310;
  transition: border-color 0.2s ease;
}

.lightbox-close:hover {
  border-color: var(--text-white);
}

#lightbox-player {
  display: block;
  width: 90vw;
  height: auto;
  max-width: 960px;
  max-height: 82vh;
  object-fit: contain;
   pointer-events: auto;
  cursor: default;
}

/* Barra flotante inferior (PC y teléfono) */
.floating-dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(10, 10, 10, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid #262626;
  padding: 0.6rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  padding: 0.15rem 0.35rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dock-item:hover {
  opacity: 0.75;
  transform: translateY(-1px);
}

.dock-item span {
  font-size: 0.88rem;
  color: var(--text-white);
  white-space: nowrap;
}

.dock-item small {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
}

.dock-divider {
  width: 1px;
  height: 24px;
  background: #242424;
}

/* Pie de página */
.site-footer {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3.5vw, 3.5rem) 6.5rem;
  border-top: 1px solid #141414;
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-socials {
  display: flex;
  gap: 1.25rem;
}

/* Adaptación móvil */
@media (max-width: 820px) {
  .site-header {
    padding: 0.9rem 0.9rem 0.65rem;
    gap: 0.55rem;
  }

  .filter-bar {
    gap: 1rem;
  }

  .filter-btn {
    font-size: 0.72rem;
  }

  .collage-stage {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 0.5rem;
    row-gap: 1.4rem;
    padding: 0.8rem 0.75rem 6rem;
    min-height: auto;
  }

  .work-media img,
  .work-media video {
    max-height: 125px;
  }

  .slot-01 { grid-column: 1 / span 5; margin-top: 0; }
  .slot-02 { grid-column: 6 / span 4; margin-top: 1rem; }
  .slot-03 { grid-column: 10 / span 3; margin-top: 0.2rem; }

  .slot-04 { grid-column: 2 / span 4; margin-top: 0.3rem; }
  .slot-05 { grid-column: 6 / span 6; margin-top: -0.3rem; }

  .slot-06 { grid-column: 1 / span 4; margin-top: 0.4rem; }
  .slot-07 { grid-column: 6 / span 3; margin-top: 1rem; }
  .slot-08 { grid-column: 9 / span 4; margin-top: 0; }

  .slot-09 { grid-column: 2 / span 4; margin-top: 0.2rem; }
  .slot-10 { grid-column: 7 / span 5; margin-top: -0.3rem; }
  .slot-11 { grid-column: 2 / span 5; margin-top: 0.4rem; }

  .work-caption {
    font-size: 0.56rem;
    margin-top: 0.25rem;
  }

  .work-tag {
    display: none;
  }

  .dock-hide-mobile {
    display: none;
  }

  .floating-dock {
    width: calc(100% - 1.5rem);
    max-width: 360px;
    padding: 0.5rem 0.75rem;
    justify-content: space-around;
    gap: 0.4rem;
    bottom: 10px;
  }

  #lightbox-player {
    max-width: 92vw;
    max-height: 82vh;
  }
}