/*
 * Tema visual: cuento clásico «La Belle et la Bête»
 * Villeneuve (1740) / Beaumont (1756) — obra en dominio público.
 * Los motivos (rosa encantada, candelabro, reloj, taza, castillo) son del
 * acervo del cuento original, no reproducen ninguna obra protegida.
 */
:root {
  --gold-1: #f5e6a3;
  --gold-2: #e8c84a;
  --gold-3: #c9972a;
  --gold-4: #8a620a;
  --rose:   #c0395a;
  --rose-lt:#e87090;
  /* Ámbar oscuro — sombras y pliegues del vestido dorado */
  --amber:    #5c3005;
  --amber-lt: #8a5010;
  --cream:  #fdf6e3;
  --paper:  #fffdf5;
  --ink:    #3a1a08;
  --teal:   #1a6060;
  --card-shadow: 0 14px 32px rgba(92, 48, 5, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Fredoka", sans-serif;
  color: var(--ink);
  line-height: 1.5;
  background:
    radial-gradient(ellipse at 8%  0%,  rgba(255,240,160,0.55) 0 22%, transparent 22%),
    radial-gradient(ellipse at 92% 6%,  rgba(232,200,74,0.30)  0 18%, transparent 18%),
    radial-gradient(ellipse at 50% 100%,rgba(201,151,42,0.22)  0 30%, transparent 30%),
    linear-gradient(160deg, #fff8d6 0%, #fde98a 45%, #f5c832 100%);
  overflow-x: hidden;
}

.youtube-audio-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.music-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.78rem 1rem;
  border: 1px solid rgba(232, 200, 74, 0.78);
  border-radius: 999px;
  background: rgba(58, 26, 8, 0.88);
  color: var(--gold-1);
  font: inherit;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(58, 26, 8, 0.26);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.music-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(58, 26, 8, 0.32);
}

.music-toggle.is-playing {
  background: linear-gradient(135deg, rgba(192, 57, 90, 0.94), rgba(138, 98, 10, 0.94));
}

.music-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1rem;
}

.music-toggle:focus-visible {
  outline: 3px solid rgba(232, 200, 74, 0.65);
  outline-offset: 3px;
}

.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,0.95) 0 1px, transparent 1px),
    radial-gradient(circle at 33% 55%, rgba(255,255,255,0.85) 0 1px, transparent 1px),
    radial-gradient(circle at 56% 18%, rgba(255,255,255,0.95) 0 1px, transparent 1px),
    radial-gradient(circle at 76% 44%, rgba(255,255,255,0.9)  0 1px, transparent 1px),
    radial-gradient(circle at 88% 72%, rgba(255,255,255,0.9)  0 1px, transparent 1px),
    radial-gradient(circle at 20% 85%, rgba(255,255,255,0.8)  0 1px, transparent 1px);
  animation: twinkle 7s ease-in-out infinite alternate;
}

.floating-shapes,
.character-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.floating-shapes {
  z-index: 0;
}

.character-layer {
  z-index: 1;
}

.shape {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 247, 212, 0.6);
  border: 2px dashed rgba(255, 112, 168, 0.5);
  animation: drift 9s ease-in-out infinite;
}

.shape.rose {
  top: 12%;
  left: 5%;
}

.shape.teacup {
  top: 63%;
  right: 6%;
  animation-delay: 1s;
}

.shape.clock {
  top: 36%;
  right: 11%;
  animation-delay: 2s;
}

.char {
  position: absolute;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  animation: bob 7s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(112, 74, 8, 0.35));
  opacity: 0.75;
}

.c1 { top: 15%; left: 2%; }
.c2 { top: 34%; right: 2%; animation-delay: 1s; }
.c3 { top: 60%; left: 4%; animation-delay: 2s; }
.c4 { top: 78%; right: 4%; animation-delay: 3s; }
.c5 { top: 54%; right: 14%; animation-delay: 1.5s; }

.hero,
.card,
.footer,
.highlights {
  width: min(1040px, 92%);
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 2;
}

.hero,
.card,
.footer {
  border-radius: 30px;
  box-shadow: var(--card-shadow);
}

.hero {
  margin-top: 1.8rem;
  padding: 3.5rem 1.4rem 4.5rem;
  text-align: center;
  background:
    linear-gradient(150deg, rgba(92,48,5,0.78), rgba(138,98,10,0.68)),
    url("img/1.jpeg") center / cover no-repeat;
  color: var(--gold-1);
  overflow: hidden;
  border: 2px solid rgba(232,200,74,0.5);
}

/* Orla interior dorada */
.hero::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(232,200,74,0.25);
  pointer-events: none;
}

/* Ola inferior */
.hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -70px;
  height: 140px;
  background: #fff8d6;
  border-radius: 50% 50% 0 0;
}

.hero * {
  position: relative;
}

.overline {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--gold-2);
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

h1,
h2,
h3 {
  font-family: "Baloo 2", sans-serif;
  line-height: 1.1;
}

h1 {
  margin: 0.5rem auto;
  font-size: clamp(1.9rem, 5vw, 3.8rem);
  max-width: 860px;
  color: var(--gold-1);
  text-shadow: 0 2px 12px rgba(74,14,30,0.6);
}

h1 span {
  color: var(--gold-2);
}

.subtitle {
  margin: 0.4rem auto 1rem;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  max-width: 800px;
  color: rgba(245,230,163,0.92);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.8rem auto 1rem;
}

.hero-badges span {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(232,200,74,0.6);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  color: var(--gold-1);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-family: "Fredoka", sans-serif;
  text-decoration: none;
  padding: 0.78rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  color: var(--amber);
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 8px 20px rgba(92,48,5,0.35);
  border: 2px solid rgba(92,48,5,0.25);
}

.btn-secondary {
  color: var(--gold-1);
  background: linear-gradient(90deg, var(--amber), var(--amber-lt));
  box-shadow: 0 8px 20px rgba(92,48,5,0.4);
  border: 2px solid rgba(232,200,74,0.45);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px) scale(1.02);
}

.highlights {
  margin-top: 0.8rem;
  margin-bottom: 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.highlights figure {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid rgba(232,200,74,0.5);
  box-shadow: 0 10px 20px rgba(74,14,30,0.22);
  position: relative;
}

.highlights figure::after {
  content: "🌹";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
}

.highlights img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--paper);
  aspect-ratio: 1.15;
}

.card {
  background: linear-gradient(160deg, var(--cream) 0%, #fef0d0 100%);
  border: 2px solid rgba(232,200,74,0.4);
  padding: clamp(1rem, 3.5vw, 2rem);
  margin-bottom: 1rem;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--wine);
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.28rem;
  color: var(--wine-lt);
}

.party-note {
  text-align: center;
  border-top: 5px solid var(--gold-2);
  background: linear-gradient(160deg, #fffbe8 0%, #fff4c0 100%);
}

.party-note::before {
  content: "🕯️ ✨ 🌹 ✨ 🕯️";
  display: block;
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
  letter-spacing: 0.3em;
}

.party-note p {
  margin: 0.35rem 0;
  font-size: 1.08rem;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.grid.two article,
.program-grid article {
  background: rgba(255,255,255,0.7);
  border: 2px dashed rgba(201,151,42,0.45);
  border-radius: 16px;
  padding: 0.9rem;
}

.frame-strip {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.frame-strip img {
  width: 100%;
  aspect-ratio: 1.1;
  object-fit: contain;
  object-position: center;
  background: var(--paper);
  border-radius: 16px;
  border: 5px solid rgba(232,200,74,0.45);
}

.program-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-text {
  margin-top: 0;
}

.flip-wall {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.flip-card {
  perspective: 1000px;
  aspect-ratio: 0.82;
}

.flip-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s ease;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  backface-visibility: hidden;
  border: 3px solid rgba(232,200,74,0.5);
  box-shadow: 0 10px 22px rgba(74,14,30,0.28);
}

.flip-front img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--paper);
}

.flip-front::after {
  content: attr(data-char);
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.88);
}

.flip-back {
  transform: rotateY(180deg);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 0.8rem;
  color: var(--gold-1);
  background: linear-gradient(140deg, rgba(92,48,5,0.96), rgba(138,98,10,0.94));
}

.flip-back h3 {
  margin: 0 0 0.35rem;
  color: var(--gold-2);
}

.flip-back p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(245,230,163,0.9);
}

/* ── Carousel ─────────────────────────────── */
.carousel-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 6px 20px rgba(74,14,30,0.2);
  border: 2px solid rgba(232,200,74,0.35);
}

.carousel-track {
  display: flex;
  transition: transform 0.55s ease;
}

.carousel-slide {
  min-width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--paper);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--paper);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: rgba(92,48,5,0.82);
  color: var(--gold-1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
  transition: background 0.2s, transform 0.2s;
}

.carousel-btn:hover {
  background: var(--amber);
  transform: translateY(-50%) scale(1.08);
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0 0.3rem;
  background: var(--cream);
}

.carousel-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: rgba(201,151,42,0.35);
  transition: background 0.25s, transform 0.25s;
}

.carousel-dot.active {
  background: var(--gold-3);
  transform: scale(1.4);
}

/* ── Mosaic ────────────────────────────────── */
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 140px;
  gap: 0.6rem;
}

.mosaic-item {
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 2px solid rgba(232,200,74,0.38);
  box-shadow: 0 5px 14px rgba(74,14,30,0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: var(--paper);
}

.mosaic-item:nth-child(4n+1) {
  grid-column: span 2;
  grid-row: span 2;
}

.mosaic-item:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 24px rgba(92,48,5,0.28);
}

.mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.mosaic-item::after {
  content: "\1F50D";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.mosaic-item:hover::after {
  opacity: 1;
  background: rgba(92,48,5,0.18);
}

/* ── Map ───────────────────────────────────── */
.map-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid rgba(232,200,74,0.5);
}

.map-wrap iframe {
  width: 100%;
  min-height: 320px;
  border: 0;
  display: block;
}

.actions-row {
  margin-top: 0.8rem;
}

.rsvp-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
}

.rsvp-form {
  display: grid;
  gap: 0.62rem;
}

label {
  font-weight: 700;
}

label { font-weight: 700; color: var(--amber); }

input,
textarea {
  width: 100%;
  border: 2px solid rgba(201,151,42,0.4);
  border-radius: 12px;
  padding: 0.68rem 0.82rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  background: var(--paper);
  color: var(--ink);
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(232,200,74,0.55);
  border-color: var(--gold-3);
}

.rsvp-side {
  display: grid;
  gap: 0.7rem;
}

.rsvp-side img {
  width: 100%;
  min-height: 180px;
  object-fit: contain;
  object-position: center;
  background: var(--paper);
  border-radius: 16px;
  border: 3px solid rgba(232,200,74,0.4);
}

.footer {
  text-align: center;
  padding: 1.2rem 1rem;
  margin-bottom: 1.6rem;
  color: var(--ink);
  background: linear-gradient(100deg, var(--gold-2) 0%, var(--gold-3) 100%);
  border: 2px solid rgba(201,151,42,0.5);
}

/* ── Sección de créditos ───────────────────────── */
.credits-card {
  background: rgba(255,248,190,0.55);
  border: 1px solid rgba(201,151,42,0.3);
  border-radius: 16px;
  padding: 0.9rem 1.2rem;
  margin: 0 auto 1.4rem;
  width: min(1060px, 92%);
  z-index: 2;
  position: relative;
}
.credits-card summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--amber);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  list-style: none;
}
.credits-card summary::marker,
.credits-card summary::-webkit-details-marker { display: none; }
.credits-card summary::before { content: "ℹ️  "; }
.credits-card ul {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
}
.credits-card li {
  font-size: 0.82rem;
  color: var(--amber-lt);
  line-height: 1.8;
}
.credits-card a {
  color: var(--gold-4);
}

.small {
  opacity: 0.85;
  font-size: 0.88rem;
}

/* ── Rosa en hero ──────────────────────────────── */
.hero-rose {
  display: flex;
  justify-content: center;
  margin: 0.8rem 0 0.3rem;
}
.hero-rose svg {
  width: clamp(80px, 13vw, 140px);
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(192,57,90,0.55));
  animation: bob 6s ease-in-out infinite;
}

/* ── Personajes del cuento SVG ──────────────────── */
.tale-characters {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin: 1.2rem 0 0.4rem;
}
.tale-characters figure {
  margin: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.tale-characters figure svg {
  width: clamp(65px, 9vw, 105px);
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(74,14,30,0.3));
  animation: bob 7s ease-in-out infinite;
}
.tale-characters figure:nth-child(2) svg { animation-delay: 0.8s; }
.tale-characters figure:nth-child(3) svg { animation-delay: 1.6s; }
.tale-characters figure:nth-child(4) svg { animation-delay: 0.4s; }
.tale-characters figcaption {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--amber-lt);
  letter-spacing: 0.04em;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes twinkle {
  from { opacity: 0.35; transform: translateY(0);     }
  to   { opacity: 0.65; transform: translateY(-28px); }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

@media (max-width: 760px) {
  .music-toggle {
    right: 0.8rem;
    bottom: 0.8rem;
    padding: 0.72rem 0.9rem;
  }

  .music-toggle-text {
    font-size: 0.92rem;
  }

  .mosaic-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
  }

  .hero::after {
    inset: auto -10% -44px;
    height: 88px;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }

  .highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two,
  .program-grid,
  .frame-strip,
  .rsvp-layout {
    grid-template-columns: 1fr;
  }

  .flip-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 2.2rem 1rem 4.4rem;
  }

  .hero-actions {
    margin-top: 0.35rem;
  }

  .hero-actions .btn-primary {
    width: min(100%, 320px);
    text-align: center;
  }

  .char {
    font-size: 1.4rem;
    opacity: 0.55;
  }

  .shape {
    width: 56px;
    height: 56px;
    opacity: 0.65;
  }

  .map-wrap iframe {
    min-height: 260px;
  }
}
