/* MADVIZ — Flex Carousel (Liquid Glass WebGL) */
.flex-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: contain;
  outline: none;
}

.flex-carousel[data-hover='open'] {
  cursor: zoom-in;
}

.flex-carousel[data-hover='close'] {
  cursor: zoom-out;
}

.flex-carousel[data-dragging] {
  cursor: grabbing;
}

.flex-carousel:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(128, 128, 140, 0.55);
}

.flex-carousel__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
}

.flex-carousel__caption {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + var(--flex-carousel-half, 30%) * var(--flex-carousel-lift, 1) + 22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  pointer-events: none;
  text-align: center;
  animation: flex-carousel-reveal 900ms ease both;
  z-index: 10;
}

.flex-carousel__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  animation: flex-carousel-title 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.flex-carousel__subtitle {
  font-weight: 400;
  opacity: 0.65;
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.flex-carousel__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-primary, monospace);
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
  color: #ffffff;
  letter-spacing: 0.08em;
  transition: opacity 400ms ease;
  margin-top: 4px;
}

.flex-carousel__count[data-hidden] {
  opacity: 0;
}

.flex-carousel__digits {
  display: inline-flex;
}

.flex-carousel__digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
}

.flex-carousel__reel {
  display: flex;
  flex-direction: column;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.flex-carousel__reel span {
  height: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-carousel__slash {
  opacity: 0.5;
}

.flex-carousel__live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes flex-carousel-title {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flex-carousel-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flex-carousel__caption,
  .flex-carousel__title {
    animation: none;
  }

  .flex-carousel__reel {
    transition: none;
  }
}

/* ============================================================
   CONTENEDOR PRINCIPAL EN ARCHIVE.HTML
   ============================================================ */
.flex-gallery-root {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 1;
}

.ripple-distortion {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #080612;
  z-index: 1;
}

.ripple-distortion::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 8, 22, 0.28) 0%, rgba(8, 6, 18, 0.58) 100%);
  pointer-events: none;
}

.ripple-distortion canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.flex-gallery-stage {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* ============================================================
   LIGHTBOX FULLSCREEN PARA AMPLIAR RENDER
   ============================================================ */
.flex-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 12, 0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 40px 24px;
}

.flex-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.flex-lightbox__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 90vh;
  transform: scale(0.96);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.flex-lightbox.is-open .flex-lightbox__inner {
  transform: scale(1);
}

.flex-lightbox__img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
  user-select: none;
}

.flex-lightbox__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 16px;
  padding: 0 4px;
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.flex-lightbox__title {
  font-weight: 500;
  opacity: 0.95;
}

.flex-lightbox__brand {
  opacity: 0.45;
  font-size: 11px;
}

.flex-lightbox__close {
  position: fixed;
  top: 28px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 1010;
}

.flex-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.06);
}

.flex-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 1010;
}

.flex-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.flex-lightbox__nav--prev {
  left: 24px;
}

.flex-lightbox__nav--next {
  right: 24px;
}

@media (max-width: 768px) {
  .flex-lightbox__nav {
    width: 36px;
    height: 36px;
  }
  .flex-lightbox__nav--prev {
    left: 10px;
  }
  .flex-lightbox__nav--next {
    right: 10px;
  }
  .flex-lightbox__close {
    top: 18px;
    right: 18px;
  }
  .flex-carousel__caption {
    top: calc(50% + var(--flex-carousel-half, 30%) * var(--flex-carousel-lift, 1) + 14px);
  }
}
