/* ==============================================
   Oniric Lab — styles.css
   ============================================== */

/* -----------------------------------------------
   VARIABLES & RESET
----------------------------------------------- */
:root {
  --orange:  #F1F155;   /* amarillo de marca — todos los titulares y acentos */
  --bg:      #111111;   /* fondo principal */
  --white:   #ffffff;
  --divider: #F1F155;   /* color de la línea divisoria */
  --white-60: rgba(255,255,255,0.6);
  --white-80: rgba(255,255,255,0.8);

  --font-display: 'Anton', Impact, Arial Narrow, sans-serif;
  --font-body:    'Poppins', system-ui, sans-serif;

  --anim-duration: 0.75s;
  --anim-ease:     cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

/* -----------------------------------------------
   HEADER
----------------------------------------------- */
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 1.6rem 4vw;
  transition: background-color 0.45s ease, padding 0.3s ease;
}

#header.scrolled {
  background-color: rgba(17, 17, 17, 0.96);
  backdrop-filter: blur(10px);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Es un enlace a la propia portada: al pulsarlo se recarga la página */
.logo {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  letter-spacing: 0.05em;
  color: var(--white);
  text-decoration: none;
}
.logo:hover { color: var(--orange); }

.header-social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header-social a {
  color: var(--white);
  opacity: 0.85;
  transition: opacity 0.2s;
  line-height: 0;
}

.header-social a:hover {
  opacity: 1;
}


/* -----------------------------------------------
   BOTONES
----------------------------------------------- */

.btn-outline {
  display: inline-block;
  border: 1.5px solid var(--white);
  border-radius: 50px;
  padding: 0.85rem 2.8rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--white);
  text-transform: uppercase;
  transition: background-color 0.25s, color 0.25s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-outline:hover {
  background-color: var(--white);
  color: var(--bg);
}

.btn-outline--sm {
  padding: 0.65rem 2rem;
  font-size: 0.68rem;
  align-self: flex-start;
  width: fit-content;
}


/* -----------------------------------------------
   HERO
----------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh; /* iOS Safari: excluye la barra del navegador */
  overflow: hidden;
  background-color: var(--bg);
}

.hero-photo {
  position: absolute;
  overflow: hidden;
  z-index: 1;
}

.hero-photo--left {
  top: 0;
  left: 0;
  width: 28%;
  height: 85%;
}

.hero-photo--right {
  bottom: 0;
  right: 0;
  width: 22%;
  height: 60%;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  gap: 2.5rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9.5vw, 11rem);
  line-height: 0.9;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* Mientras Anton no ha llegado, el navegador dibujaría el titular con
   una fuente de repuesto un 46% más ancha y se saldría de la pantalla en
   móvil. Se mantiene oculto ese instante; el script del <head> lo
   destapa al cargar las fuentes (o a los 2 s, si fallan). */
.hero-headline { visibility: hidden; }
html.fuentes-listas .hero-headline { visibility: visible; }
/* Sin Anton, la fuente de repuesto ocupa un 46% más: se compensa el
   tamaño para que siga cabiendo. */
html.sin-anton .hero-headline { font-size: min(8.9vw, 3.4rem); }

.hero-headline em {
  font-style: italic;
}

.hero-headline__line {
  display: block;
}


/* -----------------------------------------------
   SECCIÓN 2 — Obtén ingresos por crear
----------------------------------------------- */
.section-incomes {
  padding-top: 8rem;
}

.section-incomes__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: flex-end;
  gap: 3rem;
  padding: 0 4vw 4rem;
}

/* En portátiles las dos columnas no caben a su ancho fijo: que puedan
   encogerse en vez de empujar la página hacia los lados */
.section-incomes__header > * {
  min-width: 0;
  max-width: 100%;
}

.section-incomes__heading {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6.5vw, 8rem);
  line-height: 0.92;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.section-incomes__heading em {
  font-style: italic;
}

.section-incomes__desc {
  font-size: clamp(0.7rem, 0.9vw, 0.82rem);
  line-height: 1.75;
  color: var(--white-80);
  text-align: justify;
  padding-bottom: 0.4rem;
  /* En portátiles la columna es más estrecha que el ancho fijo del texto:
     sin este tope la página se podía mover de lado */
  max-width: 100%;
}

.section-incomes__image-wrap {
  width: 100%;
  height: 65vh;
  overflow: hidden;
}

.section-incomes__image-wrap .parallax-img {
  width: 100%;
  height: 130%;
  object-fit: cover;
  object-position: center 25%;
  will-change: transform;
}

/* Vídeo que se superpone a la foto al pasar el ratón.
   Hereda de .parallax-img el tamaño y el encuadre, así que la imagen y
   el vídeo quedan exactamente alineados y el fundido no da ningún salto. */
.incomes-media {
  position: relative;
}

.incomes-media__video {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.incomes-media.is-playing .incomes-media__video {
  opacity: 1;
}

/* Si el visitante pide menos animación, el vídeo no aparece */
@media (prefers-reduced-motion: reduce) {
  .incomes-media__video {
    display: none;
  }
}

/* Franja de los ojos (sección Avatares): solo la banda de cejas a
   pómulos. La foto es ese mismo recorte del primer fotograma del vídeo
   (filas 188–538 de 1080); el vídeo, en 16:9 y con bandas negras, se
   encuadra con object-position para que coincida al píxel con la foto. */
.eyes-band {
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 350;
  overflow: hidden;
}

.eyes-band img,
.eyes-band video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25.76%;
}

/* Overlay naranja al hover — solo cuando el hueco de imagen es un enlace (botón) */
a.section-incomes__image-wrap {
  position: relative;
  cursor: pointer;
}
a.section-incomes__image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--orange);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
a.section-incomes__image-wrap:hover::after {
  opacity: 0.25;
}

/* Mientras el vídeo está en marcha se retira el velo naranja: teñiría
   la imagen y el propio movimiento ya indica que el bloque responde.
   Va después de la regla :hover porque tienen la misma especificidad. */
a.section-incomes__image-wrap.is-playing::after {
  opacity: 0;
}


/* -----------------------------------------------
   LÍNEA DIVISORIA
----------------------------------------------- */
.divider-line {
  width: 100%;
  height: 6px;
  background-color: var(--divider);
}


/* -----------------------------------------------
   SECCIÓN 3 — Conviértete en Creador de Contenido
----------------------------------------------- */
.section-creator {
  padding: 8rem 0;
}

.section-creator__heading-wrap {
  padding: 0 4vw 5rem;
  overflow: hidden;
}

.section-creator__heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 11.5rem);
  line-height: 0.88;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.section-creator__course {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
  padding: 0 4vw;
}

.course-num {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  color: var(--orange);
  padding-top: 0.25rem;
}

.course-body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.course-title {
  font-family: var(--font-body);
  font-size: clamp(0.65rem, 1vw, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
}

.course-meta {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.course-meta li {
  font-size: clamp(0.6rem, 0.8vw, 0.72rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white-60);
}

.course-desc {
  font-size: clamp(0.68rem, 0.9vw, 0.8rem);
  line-height: 1.8;
  color: var(--white-80);
  text-align: justify;
}

.course-photo {
  width: clamp(180px, 22vw, 360px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.course-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}


/* -----------------------------------------------
   SECCIÓN 4 — Contacto
----------------------------------------------- */
.section-contact {
  padding-bottom: 0;
}

.section-contact__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3rem;
  padding: 6rem 4vw;
}

.contact-heading {
  font-family: var(--font-display);
  /* Titular grande: en 2000 px de ancho ocupa unos 600 px */
  font-size: clamp(1.8rem, 6vw, 7.5rem);
  line-height: 0.95;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.contact-heading em {
  font-style: italic;
}

.contact-intro {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.1vw, 1.2rem);
  line-height: 1.6;
  color: var(--white-80);
  max-width: 33rem;
  margin: 0 auto 1.5rem;
}

/* El correo es ahora el único punto de contacto: se trata como titular,
   no como botón, para que pese lo mismo que el encabezado de la sección. */
.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.2vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--white);
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--orange);
  transition: color 0.25s, border-color 0.25s;
  word-break: break-word;
}

.contact-email:hover,
.contact-email:focus-visible {
  color: var(--orange);
}

.contact-email:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 6px;
}

.contact-photo {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #000;
}

.contact-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Botón "Inicio": mismo estilo que el "‹ INICIO" de Avatares, con la
   flecha hacia arriba */
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  margin-top: 1.5rem;
  padding: 0 0.5rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.to-top svg { transition: transform 0.2s; }

.to-top:hover,
.to-top:focus-visible { color: #fff; }

.to-top:hover svg { transform: translateY(-3px); }

.to-top:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}

/* -----------------------------------------------
   Footer
----------------------------------------------- */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5rem 4vw 0;
  font-family: var(--font-body);
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 4rem;
  align-items: start;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.site-footer__logo {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  letter-spacing: 0.05em;
  color: var(--white);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer__desc {
  max-width: 26rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--white-60);
}

.site-footer__social {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.site-footer__social a {
  display: inline-flex;
  color: var(--white-60);
  transition: color 0.2s;
}

.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.site-footer__col h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1.1rem;
}

.site-footer__col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-footer__col a {
  font-size: 0.875rem;
  color: var(--white-60);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}
.site-footer__legal a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer__legal a:hover { color: var(--orange); }

.site-footer__logo:hover,
.site-footer__social a:hover,
.site-footer__col a:hover { color: var(--orange); }

.site-footer a:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
  .site-footer { padding-top: 3.5rem; }
  .site-footer__top { grid-template-columns: 1fr; gap: 3rem; }
  .site-footer__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__bottom { flex-direction: column; margin-top: 3rem; }
}


/* -----------------------------------------------
   RESPONSIVE — móvil (< 768px)
----------------------------------------------- */
@media (max-width: 768px) {

  /* Header */
  #header {
    padding: 1rem 5vw;
  }

  /* Ocultar ambas fotos del hero — el texto queda limpio y centrado */
  .hero-photo--right,
  .hero-photo--left {
    display: none;
  }

  /* Hero headline. Sin suelo en rem: un mínimo fijo se sale de la
     pantalla en móviles estrechos o con el zoom de Safari activado.
     Al depender solo del ancho, ocupa siempre la misma proporción. */
  .hero-headline {
    font-size: min(13vw, 5rem);
  }

  /* Hero content */
  .hero-content {
    padding: 5rem 6vw 3rem;
    gap: 1.5rem;
  }

  /* Reducir paddings de secciones en móvil */
  .section-incomes {
    padding-top: 4rem;
  }

  .section-creator {
    padding: 4rem 0;
  }

  .section-creator__heading-wrap {
    padding-bottom: 3rem;
  }

  .section-works {
    padding: 4rem 0;
  }

  .section-contact {
    padding-bottom: 4rem;
  }

  /* Sección ingresos */
  .section-incomes__header {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-bottom: 2.5rem;
  }

  /* justify en columnas estrechas deja huecos enormes — usar left */
  .section-incomes__desc {
    max-width: 100%;
    font-size: 0.88rem;
    line-height: 1.7;
    text-align: left;
  }

  .section-incomes__image-wrap {
    height: 45vh;
  }

  /* Sección creator */
  .section-creator__heading {
    font-size: clamp(2.5rem, 12vw, 6rem);
  }

  /* Una sola columna: evita layouts rotos con grids auto/1fr */
  .section-creator__course {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .course-photo {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
  }

  /* Mejorar legibilidad de texto en móvil */
  .course-title {
    font-size: 0.82rem;
  }

  .course-meta li {
    font-size: 0.74rem;
  }

  .course-desc {
    font-size: 0.88rem;
    line-height: 1.75;
    text-align: left;
  }

  /* Sección contacto */
  .section-contact__inner {
    gap: 2.5rem;
    padding: 3rem 5vw;
  }

  .contact-photo {
    max-width: 200px;
  }

  .contact-heading {
    font-size: clamp(1.6rem, 8vw, 3rem);
    margin-bottom: 2rem;
  }

  .contact-intro {
    max-width: none;
    margin-bottom: 2rem;
  }

  /* Área táctil mínima de 44px para el enlace de correo */
  .contact-email {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Botón GO a trabajos */
  .works-go-btn {
    padding: 3rem 1.5rem;
    font-size: clamp(2.5rem, 11vw, 5rem);
  }

  /* Botones táctiles — área mínima 44px, sin delay de tap */
  .btn-outline {
    min-height: 44px;
    touch-action: manipulation;
  }

  .btn-outline {
    padding: 0.9rem 2rem;
  }
}

/* -----------------------------------------------
   RESPONSIVE — tablet (768px – 1024px)
----------------------------------------------- */
@media (max-width: 1024px) and (min-width: 769px) {

  .hero-headline {
    font-size: clamp(4rem, 10vw, 8rem);
  }

  /* Mantener 2 columnas pero con foto más pequeña */
  .section-creator__course {
    grid-template-columns: 1fr 200px;
  }

  .course-photo {
    width: 100%;
  }

  .section-contact__inner {
    gap: 3rem;
  }
}


/* -----------------------------------------------
   SECCIÓN TRABAJOS
----------------------------------------------- */
.section-works {
  padding: 8rem 0;
}

.section-works__header {
  padding: 0 4vw 3rem;
}

.section-works__heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 11.5rem);
  line-height: 0.88;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* ── Botón GO → trabajos.html ── */
.works-go-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 11.5rem);
  letter-spacing: -0.02em;
  color: var(--orange);
  text-decoration: none;
  border-top: 2px solid rgba(255,255,255,0.07);
  border-bottom: 2px solid rgba(255,255,255,0.07);
  transition: color 0.3s, background 0.3s, border-color 0.3s;
  line-height: 1;
}

.works-go-btn:hover {
  color: #fff;
  background: rgba(241, 241, 85,0.04);
  border-color: rgba(241, 241, 85,0.3);
}

/* ── Carrusel de muestra: pasa solo, en bucle continuo ──
   La tira lleva las mismas fotos dos veces; al llegar a la mitad vuelve
   al principio y el salto no se ve. Los bordes se desvanecen. */
.works-strip {
  /* Holgura suficiente para no tocar el texto de debajo de TRABAJOS,
     que va colocado a mano y baja según el ancho de la pantalla */
  margin: 7rem 0 1.5rem;
  overflow: hidden;
  mask: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.works-strip__track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: works-strip-scroll 60s linear infinite;
}

/* Medida fija (4:5) para que la tira no cambie de ancho según van
   cargando las fotos y el movimiento sea siempre parejo */
.works-strip img {
  flex: 0 0 auto;
  height: clamp(150px, 16vw, 280px);
  width: clamp(120px, 12.8vw, 224px);
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: rgba(255, 255, 255, 0.05);
}

/* Se para al pasar el ratón por encima, para poder mirar una foto */
.works-strip:hover .works-strip__track { animation-play-state: paused; }

@keyframes works-strip-scroll {
  from { transform: translate3d(0, 0, 0); }
  /* La mitad de la tira = una vuelta completa a la lista */
  to   { transform: translate3d(calc(-50% - 0.625rem), 0, 0); }
}

/* Quien tenga desactivadas las animaciones ve la tira quieta */
@media (prefers-reduced-motion: reduce) {
  .works-strip__track { animation: none; }
}

@media (max-width: 768px) {
  .works-strip { margin: 2rem 0 0.5rem; }
  .works-strip__track { gap: 0.75rem; animation-duration: 45s; }
  @keyframes works-strip-scroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(calc(-50% - 0.375rem), 0, 0); }
  }
}


/* -----------------------------------------------
   GALERÍA FOTO — overlay pantalla completa
----------------------------------------------- */
.foto-gallery {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.foto-gallery.open {
  opacity: 1;
  pointer-events: auto;
}

.fg-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(10px);
}

.fg-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--orange);
  text-transform: uppercase;
}

.fg-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  color: var(--white);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.fg-close:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ── Grid masonry — 5 columnas ajustadas ── */
.fg-grid {
  height: 100vh;
  overflow-y: auto;
  padding-top: 60px;
  columns: 5;
  column-gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 241, 85, 0.2) transparent;
}

.fg-grid::-webkit-scrollbar { width: 2px; }
.fg-grid::-webkit-scrollbar-thumb { background: rgba(241, 241, 85, 0.25); }

.fg-item {
  break-inside: avoid;
  margin-bottom: 3px;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  display: block;
}

.fg-item img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: bottom;
  transition: opacity 0.3s ease, transform 0.35s ease;
}

.fg-item:hover img {
  opacity: 0.82;
  transform: scale(1.02);
}

@media (max-width: 1200px) { .fg-grid { columns: 4; } }
@media (max-width: 900px)  { .fg-grid { columns: 3; } }
@media (max-width: 560px)  { .fg-grid { columns: 2; } }


/* -----------------------------------------------
   LIGHTBOX
----------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(10, 10, 10, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

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

.lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 88vw;
  max-height: 88vh;
}

#lb-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
  transition: opacity 0.2s ease;
}

/* Botón cerrar */
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  color: var(--white);
  font-size: 0.95rem;
  cursor: pointer;
  z-index: 10;
  transition: border-color 0.2s, color 0.2s;
}

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

/* Flechas de navegación */
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  color: var(--white);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  user-select: none;
}

.lightbox-arrow:hover {
  border-color: var(--orange);
  background: rgba(241, 241, 85, 0.12);
  color: var(--orange);
}

.lightbox-arrow--prev { left: 1.5rem; }
.lightbox-arrow--next { right: 1.5rem; }

/* Contador */
.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .lightbox-arrow {
    width: 38px;
    height: 38px;
    font-size: 1.6rem;
  }

  .lightbox-arrow--prev { left: 0.75rem; }
  .lightbox-arrow--next { right: 0.75rem; }
}


/* -----------------------------------------------
   GALERÍA VIDEO — overlay pantalla completa
----------------------------------------------- */
.video-gallery {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.video-gallery.open {
  opacity: 1;
  pointer-events: auto;
}

.vg-grid {
  height: 100vh;
  overflow-y: auto;
  padding: 76px 8px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 241, 85, 0.2) transparent;
}

.vg-grid::-webkit-scrollbar { width: 2px; }
.vg-grid::-webkit-scrollbar-thumb { background: rgba(241, 241, 85, 0.25); }

.vg-item {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a0a0a;
  border-radius: 2px;
}

.vg-item iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.vg-empty {
  grid-column: 1 / -1;
  padding: 6rem 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.2);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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