/* ====== Landing de eventos · Loviluz ====== */

:root {
  --orange: #ff8200;
  --orange-soft: #ffa234;
  --orange-deep: #d96d00;
  --bg: #0d0d0f;
  --bg-2: #16161a;
  --surface: #1d1d22;
  --text: #f5f5f7;
  --text-dim: #a6a6ad;
  --radius: 18px;
  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

.screen { min-height: 100dvh; }
.screen[hidden] { display: none !important; }

.screen--centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 120% at 50% 0%, #1a1a1f 0%, var(--bg) 60%);
}

/* ====== Tarjeta (estados de error) ====== */
.card {
  max-width: 420px;
  text-align: center;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 40px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.card__logo { margin-bottom: 18px; height: auto; }
.card__title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  margin: 0 0 10px;
}
.card__text { color: var(--text-dim); line-height: 1.55; margin: 0; }

/* ====== Loader ====== */
.loader {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(255, 130, 0, 0.2);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== Gate de vídeo (modal claro sobre la galería) ====== */
.screen--video {
  /* Overlay fijo sobre la galería: por encima del header (5), bajo el lightbox (50) */
  position: fixed;
  inset: 0;
  z-index: 40;
  /* Backdrop claro translúcido: la galería se ve difuminada detrás */
  background: rgba(245, 245, 247, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.video-stage {
  position: relative;
  /* Modal a ~1/4 de pantalla en escritorio; algo mayor en móvil por legibilidad */
  width: min(90vw, 420px);
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  background: #fff;
}
.video-stage__player {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  background: #fff; /* fondo claro: nada de negro asomando bajo el overlay */
  display: block;
}

.video-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  cursor: pointer;
  color: var(--bg);
  /* Base blanca opaca + resplandor naranja: oculta el primer fotograma del vídeo */
  background: radial-gradient(120% 120% at 50% 38%, rgba(255,162,52,0.22), rgba(255,255,255,0) 62%), #ffffff;
  font-family: var(--font-body);
}
.video-start__play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 1.5rem;
  padding-left: 5px;
  box-shadow: 0 14px 40px rgba(255, 130, 0, 0.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.video-start__label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
}
.video-start__hint { color: #6b6b72; font-size: 0.92rem; }

.video-progress[hidden] { display: none; }
.video-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(255,255,255,0.96), transparent);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.video-progress__bar {
  height: 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.video-progress__bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--orange);
  transition: width 0.2s linear;
}
.video-progress__text {
  font-size: 0.8rem;
  color: #6b6b72;
  text-align: right;
}

/* ====== Galería ====== */
.screen--gallery {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 280px);
  padding-bottom: 40px;
}
.gallery-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(13, 13, 15, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gallery-header__logo { flex: 0 0 auto; height: auto; }
.gallery-header__titles { flex: 1 1 auto; min-width: 0; }
.gallery-header__title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-header__count { margin: 2px 0 0; color: var(--text-dim); font-size: 0.85rem; }
.gallery-header__count--warn { color: var(--orange-soft); font-weight: 600; }

.gallery-grid {
  columns: 2;
  column-gap: 10px;
  padding: 14px;
}
@media (min-width: 640px) { .gallery-grid { columns: 3; } }
@media (min-width: 960px) { .gallery-grid { columns: 4; column-gap: 14px; padding: 20px; } }

.photo {
  position: relative;
  break-inside: avoid;
  margin-bottom: 10px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  display: block;
}
.photo img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}
.photo img.is-loaded { opacity: 1; }
.photo:hover img { transform: scale(1.04); }
.photo__dl {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(13, 13, 15, 0.72);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s, background 0.25s;
}
.photo:hover .photo__dl { opacity: 1; transform: translateY(0); }
.photo__dl:hover { background: var(--orange); }
@media (hover: none) { .photo__dl { opacity: 1; transform: none; } }

/* Botón de selección para descarga múltiple */
.photo__select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(13, 13, 15, 0.45);
  color: transparent; /* el check se oculta hasta seleccionar */
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.photo__select:hover { background: rgba(13, 13, 15, 0.72); transform: scale(1.05); }
.photo.is-selected { box-shadow: 0 0 0 3px var(--orange); }
.photo.is-selected .photo__select {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.gallery-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 24px;
  font-size: 1.05rem;
}

.gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 20px;
}
.gallery-footer a { color: var(--orange-soft); text-decoration: none; }
.gallery-footer a:hover { text-decoration: underline; }

/* ====== Botones ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 130, 0, 0.35);
}
.btn--primary:hover { filter: brightness(1.05); }
.btn--primary:disabled { opacity: 0.6; cursor: progress; }
.btn__icon { font-size: 1.05rem; }

/* ====== Lightbox ====== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: 92vw;
  max-height: 80dvh;
  border-radius: 10px;
  object-fit: contain;
}
.lightbox__btn {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__btn:hover { background: var(--orange); }
.lightbox__close { top: 18px; right: 18px; }
.lightbox__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__download {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
}
@media (max-width: 640px) {
  .lightbox__prev { left: 6px; }
  .lightbox__next { right: 6px; }
}
