/* ============================================================
   Tokens de diseño
   Paleta: cielo de noche de evento + luces cálidas
   ============================================================ */
:root {
  --bg-deep:     #0b1e23;
  --bg-mid:      #0f2a30;
  --glass:       rgba(255, 255, 255, 0.07);
  --glass-brd:   rgba(255, 255, 255, 0.14);
  --amber:       #e8a33d;
  --coral:       #e85d4e;
  --text:        #f5f1e8;
  --text-muted:  #9fb4b8;

  --radius: 18px;
  --blur: 16px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

/* Fondo: cielo nocturno con un resplandor cálido, fijo detrás de todo */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(232, 163, 61, 0.12), transparent 60%),
    radial-gradient(900px 600px at 100% 10%, rgba(232, 93, 78, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
}
.sky-glow {
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(232, 163, 61, 0.08), transparent 70%);
  filter: blur(40px);
}

/* ============================================================
   Layout general
   ============================================================ */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  padding: 22px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px 3px rgba(232, 163, 61, 0.55);
}

.sitefooter {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 32px 24px 48px;
}

/* ============================================================
   Hero (home)
   ============================================================ */
.hero {
  max-width: 780px;
  margin: 6vh auto 5vh;
  padding: 0 24px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.25;
  margin: 0 0 14px;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

/* ============================================================
   Componente base: superficie de vidrio
   ============================================================ */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  padding: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  color: #1a1006;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232, 93, 78, 0.35); }

.btn-ghost {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-brd);
}
.btn-ghost:hover { box-shadow: none; background: rgba(255,255,255,0.11); }

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

/* ============================================================
   Grid de eventos (home)
   ============================================================ */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.event-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.event-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 163, 61, 0.5);
  box-shadow: 0 10px 34px rgba(232, 163, 61, 0.14), 0 4px 14px rgba(0,0,0,0.35);
}

.event-card-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(232,163,61,0.15), rgba(232,93,78,0.15));
}
.event-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.event-card:hover .event-card-cover img { transform: scale(1.05); }

.event-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(11,30,35,0.85) 100%);
}

.lock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(11,30,35,0.65);
  border: 1px solid var(--glass-brd);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  backdrop-filter: blur(8px);
}

.event-card-body { padding: 18px 20px 20px; }
.event-card-body h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 4px;
}
.event-date {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--amber);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.event-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ============================================================
   Página de galería
   ============================================================ */
.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin: 28px 0 20px;
}
.back-link:hover { color: var(--text); }

.gallery-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  margin: 0 0 6px;
}
.gallery-desc { color: var(--text-muted); max-width: 640px; }

.unlock-card {
  max-width: 420px;
  margin: 24px auto;
  text-align: center;
}
.unlock-icon { font-size: 2rem; margin: 0 0 6px; }
.unlock-card h2 { font-family: var(--font-display); margin: 0 0 8px; font-size: 1.4rem; }
.unlock-card p { color: var(--text-muted); }

.unlock-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.unlock-form input[type="password"] {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-brd);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
.unlock-form input[type="password"]:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.2);
}
.form-error { color: var(--coral); font-weight: 600; font-size: 0.9rem; }

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0;
}

.day-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.day-tab {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.day-tab:hover { color: var(--text); }
.day-tab.is-active {
  color: #1a1006;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  border-color: transparent;
}
.day-count {
  font-size: 0.75rem;
  opacity: 0.75;
}

.day-panel { display: none; }
.day-panel.is-active { display: block; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.photo-item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-brd);
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.3s ease;
}
.photo-item img.is-loaded { opacity: 1; }
.photo-item:hover img { transform: scale(1.04); }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 14, 17, 0.92);
  backdrop-filter: blur(6px);
  z-index: 100;
}
.lightbox.is-open { display: flex; }

.lightbox-img {
  max-width: 90vw;
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  color: var(--text);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { border-color: var(--amber); }

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

/* Accesibilidad: respeta reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Mobile */
@media (max-width: 560px) {
  .gallery-toolbar { flex-direction: column; align-items: stretch; }
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.2rem; }
}

/* ============================================================
   Toggle claro/oscuro
   ============================================================ */
.topbar { justify-content: space-between; }

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}
.switch #theme-toggle { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--amber);
  transition: 0.8s;
  z-index: 0;
  overflow: hidden;
}
.slider.round { border-radius: 34px; }
.slider.round .sun-moon { border-radius: 50%; }

.sun-moon {
  position: absolute;
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: #fff8e7;
  transition: 0.8s;
}
#theme-toggle:checked + .slider { background-color: var(--bg-deep); }
#theme-toggle:focus + .slider { box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.35); }
#theme-toggle:checked + .slider .sun-moon {
  transform: translateX(22px);
  background-color: #f5f1e8;
  animation: rotate-center 1s ease-in-out both;
}
@keyframes rotate-center {
  0% { transform: translateX(22px) rotate(0deg); }
  100% { transform: translateX(22px) rotate(360deg); }
}

.moon-dot { opacity: 0; transition: 0.4s; fill: #9fb4b8; }
#theme-toggle:checked + .slider .sun-moon .moon-dot { opacity: 1; }

#moon-dot-1 { left: 9px; top: 2px; position: absolute; width: 5px; height: 5px; z-index: 4; }
#moon-dot-2 { left: 2px; top: 9px; position: absolute; width: 8px; height: 8px; z-index: 4; }
#moon-dot-3 { left: 14px; top: 15px; position: absolute; width: 3px; height: 3px; z-index: 4; }

#light-ray-1 { left: -7px; top: -7px; position: absolute; width: 36px; height: 36px; z-index: -1; fill: #fff; opacity: 0.35; }
#light-ray-2 { left: -14px; top: -14px; position: absolute; width: 46px; height: 46px; z-index: -1; fill: #fff; opacity: 0.25; }
#light-ray-3 { left: -16px; top: -16px; position: absolute; width: 50px; height: 50px; z-index: -1; fill: #fff; opacity: 0.15; }

.cloud-light { position: absolute; fill: #eee; animation-name: cloud-move; animation-duration: 6s; animation-iteration-count: infinite; }
.cloud-dark { position: absolute; fill: #ccc; animation-name: cloud-move; animation-duration: 6s; animation-iteration-count: infinite; animation-delay: 1s; }

#cloud-1 { left: 26px; top: 13px; width: 34px; }
#cloud-2 { left: 38px; top: 9px; width: 17px; }
#cloud-3 { left: 15px; top: 20px; width: 25px; }
#cloud-4 { left: 30px; top: 15px; width: 34px; }
#cloud-5 { left: 41px; top: 12px; width: 17px; }
#cloud-6 { left: 19px; top: 22px; width: 25px; }

@keyframes cloud-move {
  0% { transform: translateX(0px); }
  40% { transform: translateX(3px); }
  80% { transform: translateX(-3px); }
  100% { transform: translateX(0px); }
}

.stars { transform: translateY(-27px); opacity: 0; transition: 0.4s; }
.star {
  fill: #f5f1e8;
  position: absolute;
  transition: 0.4s;
  animation-name: star-twinkle;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}
#theme-toggle:checked + .slider .stars { transform: translateY(0); opacity: 1; }

#star-1 { width: 17px; top: 1px; left: 2px; animation-delay: 0.3s; }
#star-2 { width: 5px; top: 13px; left: 2px; }
#star-3 { width: 10px; top: 17px; left: 8px; animation-delay: 0.6s; }
#star-4 { width: 15px; top: 0px; left: 15px; animation-delay: 1.3s; }

@keyframes star-twinkle {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  80% { transform: scale(0.8); }
  100% { transform: scale(1); }
}

/* ============================================================
   Modo claro (activado con data-theme="light" en <html>)
   Fondo blanco puro, la paleta ámbar/coral se mantiene como acento
   ============================================================ */
html[data-theme="light"] {
  --bg-deep: #ffffff;
  --bg-mid: #ffffff;
  --glass: rgba(11, 30, 35, 0.04);
  --glass-brd: rgba(11, 30, 35, 0.12);
  --text: #14201f;
  --text-muted: #5b6b6d;
}

html[data-theme="light"] .sky { background: #ffffff; }
html[data-theme="light"] .sky-glow { display: none; }

html[data-theme="light"] .btn { color: #2a1608; }

html[data-theme="light"] .glass-card,
html[data-theme="light"] .event-card,
html[data-theme="light"] .day-tab,
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .unlock-form input[type="password"],
html[data-theme="light"] .photo-item {
  box-shadow: 0 2px 10px rgba(11, 30, 35, 0.06);
}

html[data-theme="light"] .event-card-shade {
  background: linear-gradient(180deg, transparent 40%, rgba(255,255,255,0.9) 100%);
}

html[data-theme="light"] .lock-badge {
  background: rgba(255,255,255,0.75);
  color: var(--text);
}

html[data-theme="light"] .lightbox { background: rgba(255, 255, 255, 0.96); }
html[data-theme="light"] .lightbox-close,
html[data-theme="light"] .lightbox-prev,
html[data-theme="light"] .lightbox-next { color: var(--text); }
html[data-theme="light"] .lightbox-img { box-shadow: 0 10px 40px rgba(11,30,35,0.15); }
