:root {
  --color-bg: #0e0e10;
  --color-bg-alt: #17171a;
  --color-text: #f2f2f2;
  --color-muted: #a0a0a5;
  --color-accent: #f54c2e;
  --max-width: 1100px;
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }

section[id] { scroll-margin-top: 64px; }

body {
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  text-transform: uppercase;
}

/* Fondo fijo real con position:fixed en vez de background-attachment:fixed,
   que en iOS (Safari y Chrome, ambos con motor WebKit) se ve mal o no queda fijo. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('../img/fondo.webp') center / cover no-repeat;
}

/* Las descripciones se mantienen en formato normal, no en mayúsculas */
.bio-text p,
.contacto-content p,
.yt-title {
  text-transform: none;
}

h1, h2, h3 { font-weight: 800; letter-spacing: 0.5px; }

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

::selection { background: var(--color-accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Aparición suave de secciones al entrar en pantalla (activada por JS) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Efecto vidrio esmerilado usado en secciones y tarjetas */
.glass {
  background: rgba(42, 42, 42, 0.33);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5.9px);
  -webkit-backdrop-filter: blur(5.9px);
  border: 1px solid rgba(0, 0, 0, 0.3);
}

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

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14,14,16,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #232326;
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--color-muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--color-accent); }

/* Link de la sección que se está viendo (lo marca js/main.js) */
.nav-links a.activo {
  color: var(--color-text);
  border-bottom: 2px solid var(--color-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
}

/* HERO */
.hero {
  position: relative;
  height: 90vh;
  min-height: 320px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.6s ease;
}

.hero-slider {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.hero-slider::-webkit-scrollbar { display: none; }

.hero-slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  scroll-snap-align: center;
  background-color: var(--color-bg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.65) 100%);
}

.hero-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}

.hero-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
}

.hero-dots .dot.active { background: var(--color-accent); }

/* MARQUEE */
.marquee {
  background: var(--color-accent);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
}

.marquee-track {
  display: inline-flex;
  width: max-content;
}

/* Se activa por JS recién con el contenido ya insertado (ver marquee.js) */
.marquee-track.listo {
  animation: marquee-scroll 20s linear infinite;
}

/* Se pausa al pasar el mouse, para poder leerlo tranquilo */
.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-track span {
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding-right: 40px;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track.listo { animation: none; }
}

/* SECTIONS */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 70px 20px;
}

.section-alt { max-width: none; }
.section-alt > * { max-width: var(--max-width); margin-left: auto; margin-right: auto; }
.section-alt .bio-content,
.section-alt .cuentos-grid {
  padding: 30px;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 36px;
  text-align: center;
}

.loading { color: var(--color-muted); text-align: center; }

/* FECHAS */
.fechas-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.fechas-mes {
  padding: 30px;
}

.fechas-mes-titulo {
  width: fit-content;
  max-width: 100%;
  font-size: clamp(1.4rem, 7vw, 2.4rem);
  white-space: nowrap;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  border-bottom: 1px solid #232326;
  padding-bottom: 14px;
}

.fecha-info .bandera {
  width: 20px;
  height: 14px;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
}

.fechas-mes-lista {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fecha-item {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 18px 22px;
  flex-wrap: wrap;
}

.fecha-divider {
  width: 2px;
  align-self: stretch;
  background: var(--color-accent);
  min-height: 40px;
}

.fecha-fecha {
  min-width: 110px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-accent);
}

.fecha-info { flex: 1; min-width: 200px; }

.fecha-ciudad {
  font-size: 1.3rem;
  font-weight: 800;
}

.fecha-lugar { color: var(--color-muted); font-size: 0.9rem; }

.fecha-show {
  font-weight: 700;
  color: var(--color-text);
  min-width: 120px;
}

.btn-outline {
  display: inline-block;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  transition: 0.2s;
}

.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 76, 46, 0.35);
}

.btn-outline.text-gradiente:hover {
  background-image: none;
  -webkit-text-fill-color: #fff;
}

/* BIOGRAFIA */
.bio-content {
  display: flex;
  gap: 40px;
  align-items: stretch;
}

.bio-content img {
  width: 42%;
  max-width: 420px;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  align-self: flex-start;
}

.bio-text { flex: 1; min-width: 0; }
.bio-text p { margin-bottom: 14px; color: var(--color-muted); }

@media (max-width: 700px) {
  .bio-content {
    flex-direction: column;
  }
  .bio-content img {
    width: 100%;
    max-width: none;
  }
}

/* GALERIA */
.galeria-section {
  overflow: hidden;
  padding: 30px 0;
}

.galeria-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

/* Se activa por JS recién con las fotos ya insertadas (ver galeria.js),
   así el "reloj" de la animación no arranca contra un ancho vacío. */
.galeria-track.listo {
  animation: galeria-scroll 40s linear infinite;
}

/* Se pausa al pasar el mouse, así es más fácil elegir y clickear una foto */
.galeria-track:hover { animation-play-state: paused; }

.galeria-item {
  width: 260px;
  height: 260px;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
}

.galeria-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

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

@keyframes galeria-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .galeria-track.listo { animation: none; }
}

@media (max-width: 600px) {
  .galeria-item { width: 160px; height: 160px; }
}

/* LIGHTBOX */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox-track {
  display: flex;
  width: 100%;
  height: 85vh;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.lightbox-track::-webkit-scrollbar { display: none; }

.lightbox-slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-slide img {
  max-width: 85vw;
  max-height: 85vh;
  border-radius: 6px;
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 10;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox-arrow:hover { background: var(--color-accent); }

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 700px) {
  .lightbox-arrow { display: none; }
}

/* YOUTUBE */
.youtube-wrap {
  padding: 30px;
  margin-bottom: 30px;
}

.youtube-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.youtube-item {
  overflow: hidden;
}

.youtube-item iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.youtube-item .yt-title { padding: 10px 12px; font-size: 0.9rem; }

.yt-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.yt-thumb:hover .yt-play {
  background: var(--color-accent);
  transform: translate(-50%, -50%) scale(1.08);
}

#youtubeChannelLink { display: block; width: fit-content; margin: 0 auto; }

/* CUENTOS */
.cuentos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.cuento-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 260px;
  background: #222;
  transition: box-shadow 0.3s;
}

.cuento-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  transition: transform 0.4s ease;
}

.cuento-card:hover img {
  filter: url(#efecto-agua);
  transform: scale(1.08);
}

.cuento-card:hover {
  box-shadow: 0 0 40px 6px rgba(150, 60, 220, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .cuento-card:hover img { filter: none; transform: scale(1.06); }
}

.cuento-card .cuento-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent);
  font-weight: 700;
}

/* CONTACTO */
.contacto-content {
  text-align: center;
}

.contacto-content p { color: var(--color-muted); margin-bottom: 20px; }

.contacto-telefono {
  margin-top: 16px;
  font-size: 1.1rem;
}

.contacto-telefono a:hover { color: var(--color-accent); }

.redes {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.redes a {
  color: var(--color-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
}
.redes a:hover { color: var(--color-text); border-color: var(--color-accent); }

/* FOOTER */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--color-muted);
  font-size: 0.85rem;
  border-radius: 0;
  border: none;
}

.footer-legal { margin-top: 6px; opacity: 0.7; }

/* CUENTOS (página) */
.cuento-page {
  max-width: 800px;
}

.cuento-volver {
  display: inline-block;
  margin-bottom: 30px;
}

.cuentos-pagina-titulo {
  font-size: 2.2rem;
  margin-bottom: 30px;
}

.cuentos-lista {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.cuento-item-volver {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.cuentos-fin {
  text-align: center;
  padding: 20px 0 10px;
}

.cuentos-fin-texto {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.cuento-item {
  padding: 30px;
}

.cuento-titulo {
  font-size: 2.2rem;
  margin-bottom: 24px;
}

.cuento-portada {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 30px;
}

.cuento-texto {
  color: #fff;
  font-size: 1.1rem;
  text-transform: none;
}

.cuento-texto p { margin-bottom: 18px; }

/* Textura de gradiente usada como "máscara" del texto (estética del show).
   Poner el archivo en img/gradiente.webp. Se define al final de la hoja
   para que gane siempre sobre los colores sólidos de cada elemento. */
.text-gradiente {
  background-image: url('../img/gradiente.webp');
  background-size: 100% auto;
  background-position: left center;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Si no existe img/gradiente.webp, js/gradiente-fallback.js agrega esta
   clase y el texto cae en blanco sólido en vez de quedar invisible. */
html.sin-gradiente .text-gradiente {
  background-image: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #fff;
}

/* EVENTO (landing de un show puntual, para pauta de Facebook/Meta) */
/* El bloque hero + barra-info + barra-compra entra completo en la pantalla
   al abrir la página (altura real fijada por JS, ver evento.js), sin
   necesidad de scrollear para ver el botón de compra. */
.evento-pantalla {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.evento-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px 60px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  align-items: start;
}

.evento-col-izquierda {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.evento-col-principal {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.evento-poster {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.evento-poster-caption {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
}

.evento-titulo { font-size: clamp(1.5rem, 4vw, 2.2rem); }

.evento-datos-fecha { width: fit-content; font-size: 1.05rem; font-weight: 800; }

.evento-datos-lugar { text-transform: none; color: var(--color-muted); font-size: 0.95rem; }

.evento-descripcion p { text-transform: none; color: var(--color-muted); }

.evento-mapa-wrap { padding: 20px; }

.evento-mapa {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.evento-mapa iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Panel de compra: en desktop queda pegado (sticky) en la columna derecha
   mientras se scrollea el resto; en mobile se vuelve una barra fija abajo
   del todo (ver RESPONSIVE), como en la referencia. */
.evento-panel-compra {
  position: sticky;
  top: 84px;
  padding: 24px;
  text-align: center;
}

.evento-panel-info { margin-bottom: 16px; }
.evento-panel-info .evento-datos-fecha { margin: 0 auto 6px; }

.evento-comprar-btn {
  display: inline-block;
  width: 100%;
  background: var(--color-accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 16px 24px;
  border-radius: 30px;
  font-size: 1.05rem;
  transition: 0.2s;
}

.evento-comprar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 76, 46, 0.4);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 20px;
    display: none;
    border-bottom: 1px solid #232326;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .fecha-divider { display: none; }

  .evento-layout {
    grid-template-columns: 1fr;
    padding-bottom: 100px;
  }

  .evento-panel-compra {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 50;
    border-radius: 0;
    padding: 12px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }

  .evento-panel-info { display: none; }
}
