@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Playfair+Display:wght@400;600&family=Inter:wght@300;400&family=Dancing+Script:wght@500;700&display=swap');

:root {
  --bg: #F8F5EE;
  --text: #2E2A24;
  --purple: #6B4C8A;
  --purple-dark: #4A3560;
  --purple-light: #9B85B0;
  --green: #5A7D5A;
  --green-light: #7A9D7A;
  --line: #D4C9B8;
  --gold: #B8A88A;
  
  --font-serif: 'Cormorant Garamond', serif;
  --font-display: 'Playfair Display', serif;
  --font-ui: 'Inter', sans-serif;
  --font-hand: 'Dancing Script', cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background:
    radial-gradient(circle at 20% 30%, rgba(107, 76, 138, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(90, 125, 90, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, #F5F0E8 100%);
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.9;
  font-size: 1.15rem;
}

/* =========================================
   PORTADA - index.html
   ========================================= */
.page-landing {
  min-height: 100vh;
  padding: 2rem 1.5rem;
  position: relative;
}

.page-landing::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(107, 76, 138, 0.03) 2px, rgba(107, 76, 138, 0.03) 4px);
  pointer-events: none;
  z-index: 0;
}

.page-landing .container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,245,238,0.9) 100%);
  padding: 4rem 3.5rem;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line), 0 0 0 8px var(--bg), 0 0 0 9px var(--purple), 0 25px 80px rgba(74, 53, 96, 0.15);
}

.vine-decoration {
  position: absolute;
  width: 120px;
  height: 120px;
  opacity: 0.7;
  z-index: 2;
  pointer-events: none;
}
.vine-top-left { top: -10px; left: -10px; transform: rotate(0deg); }
.vine-top-right { top: -10px; right: -10px; transform: scaleX(-1); }
.vine-bottom-left { bottom: -10px; left: -10px; transform: scaleY(-1); }
.vine-bottom-right { bottom: -10px; right: -10px; transform: rotate(180deg); }

/* Navegación */
nav {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
nav a {
  display: inline-block;
  margin: 0 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--purple);
  text-decoration: none;
  position: relative;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
}
nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--green);
  transition: width 0.3s ease;
}
nav a:hover { color: var(--green); }
nav a:hover::after { width: 80%; }

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}
header h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--purple-dark);
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}
.subtitle {
  font-style: italic;
  color: var(--green);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}
.subtitle::before, .subtitle::after {
  content: "✦";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 0.8rem;
  opacity: 0.6;
}
.subtitle::before { left: -2rem; }
.subtitle::after { right: -2rem; }

/* Separador ornamental */
.divider-fancy {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.5rem 0;
  position: relative;
}
.divider-fancy::before, .divider-fancy::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--purple-light) 20%, var(--gold) 50%, var(--purple-light) 80%, transparent 100%);
  max-width: 200px;
}
.divider-fancy .ornament {
  padding: 0 1rem;
  font-size: 1.4rem;
  color: var(--purple);
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Texto tipo carta */
.letter-text {
  text-align: justify;
  hyphens: auto;
  margin-bottom: 2rem;
  padding: 1.5rem 2rem;
  background: rgba(255,255,255,0.5);
  border-left: 3px solid var(--purple-light);
  border-right: 3px solid var(--green-light);
  border-radius: 4px;
  position: relative;
  line-height: 2;
  font-size: 1.1rem;
}
.letter-text::before {
  content: '"';
  position: absolute;
  top: 0.5rem;
  left: 0.8rem;
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--purple);
  opacity: 0.2;
  line-height: 1;
}
.letter-text:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--purple);
  margin-right: 0.2rem;
}

/* Firma */
.signature {
  font-family: var(--font-hand);
  font-size: 1.8rem;
  color: var(--purple-dark);
  text-align: right;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
  position: relative;
  transform: rotate(-1deg);
}
.signature::before {
  content: "💜";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  opacity: 0.6;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: #999;
  font-family: var(--font-ui);
  letter-spacing: 0.1em;
}

/* Animaciones */
.fade-in { opacity: 0; animation: fadeInUp 1s ease forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   LIBRO - libro.html
   ========================================= */
.page-book {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 30%, rgba(107, 76, 138, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(90, 125, 90, 0.05) 0%, transparent 40%),
    var(--bg);
  padding: 2rem 1rem;
}

.book-container {
  max-width: 900px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,245,238,0.95) 100%);
  padding: 3.5rem 3rem;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line), 0 0 0 8px var(--bg), 0 0 0 9px var(--purple), 0 25px 80px rgba(74, 53, 96, 0.12);
  position: relative;
}

/* Índice de capítulos */
.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0 auto 2rem;
  max-width: 600px;
}
.chapter-list li {
  padding: 1.8rem 2rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.7);
  border-left: 4px solid var(--purple);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.chapter-list li:hover {
  transform: translateX(8px);
  border-left-color: var(--green);
  box-shadow: 0 4px 15px rgba(107, 76, 138, 0.1);
}
.chapter-number {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--purple);
  font-weight: 600;
  letter-spacing: 0.1em;
}
.chapter-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text);
  font-weight: 600;
}
.chapter-desc {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
}
.btn-start-reading {
  display: block;
  margin: 2rem auto;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--purple) 0%, var(--green) 100%);
  color: white;
  border: none;
  border-radius: 30px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(107, 76, 138, 0.3);
}
.btn-start-reading:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(107, 76, 138, 0.4);
}

/* Páginas del libro */
.book-pages { margin-top: 2rem; position: relative; }
.book-page { display: none; animation: pageFade 0.5s ease; }
.book-page.active { display: block; }
@keyframes pageFade {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Marco decorativo de cada página */
.page-frame {
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3.5rem;
  position: relative;
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--purple), 0 10px 40px rgba(74, 53, 96, 0.08);
  min-height: 450px;
}
.page-frame::before, .page-frame::after {
  content: "❀";
  position: absolute;
  font-size: 1.2rem;
  color: var(--green);
  opacity: 0.5;
}
.page-frame::before { top: 1rem; left: 1rem; }
.page-frame::after { bottom: 1rem; right: 1rem; transform: rotate(180deg); }

.page-content { position: relative; z-index: 1; }

.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--purple-dark);
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 400;
}
.page-divider {
  text-align: center;
  font-size: 1.5rem;
  color: var(--purple-light);
  margin: 1.5rem 0;
  opacity: 0.6;
}
.page-text {
  text-align: justify;
  hyphens: auto;
  line-height: 2;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: var(--text);
}
.page-number {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--purple);
  font-style: italic;
}

/* Zonas clickeables para pasar página */
.page-turn-zones {
  position: relative;
  height: 20px;
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}
.turn-left, .turn-right {
  flex: 1;
  height: 100%;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
}
.turn-left {
  background: linear-gradient(90deg, rgba(107, 76, 138, 0.1), transparent);
  border: 1px dashed var(--purple-light);
}
.turn-right {
  background: linear-gradient(-90deg, rgba(90, 125, 90, 0.1), transparent);
  border: 1px dashed var(--green-light);
}
.turn-left:hover {
  background: linear-gradient(90deg, rgba(107, 76, 138, 0.2), transparent);
  transform: scale(1.02);
}
.turn-right:hover {
  background: linear-gradient(-90deg, rgba(90, 125, 90, 0.2), transparent);
  transform: scale(1.02);
}
.turn-left::after {
  content: "←";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: var(--purple);
  font-size: 1.2rem;
  opacity: 0.5;
}
.turn-right::after {
  content: "→";
  position: absolute;
  right: 50%; top: 50%;
  transform: translate(50%, -50%);
  color: var(--green);
  font-size: 1.2rem;
  opacity: 0.5;
}
.page-indicator {
  text-align: center;
  margin: 1.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--purple);
  letter-spacing: 0.1em;
}

/* =========================================
   ELEMENTOS COMUNES
   ========================================= */
/* Imágenes en páginas */
.page-image-wrapper {
  margin: 2rem 0;
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  border: 1px solid var(--line);
}
.page-image-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 3px solid white;
  filter: sepia(10%) contrast(0.98);
  transition: filter 0.3s ease;
}
.page-image-wrapper img:hover { filter: none; }

/* Separador de personaje (Jun/Luna) */
.scene-header {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--purple);
  font-weight: 600;
  margin: 2.5rem 0 1.5rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  letter-spacing: 0.15em;
}
.scene-header::before, .scene-header::after {
  content: "✦";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green);
  font-size: 0.9rem;
  opacity: 0.6;
}
.scene-header::before { left: 1rem; }
.scene-header::after { right: 1rem; }

/* Diálogos */
.page-text.dialogue {
  padding-left: 1.5rem;
  border-left: 2px solid var(--purple-light);
  font-style: italic;
  color: var(--purple-dark);
}

/* Cartas y votos */
blockquote.love-letter, blockquote.vows {
  margin: 2rem 1.5rem;
  padding: 1.5rem 2rem;
  background: rgba(255,255,255,0.7);
  border-left: 4px solid var(--purple);
  border-right: 4px solid var(--green);
  border-radius: 6px;
  font-style: italic;
  color: var(--purple-dark);
  position: relative;
}
blockquote.love-letter::before, blockquote.vows::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--purple);
  opacity: 0.2;
  line-height: 1;
}

/* Reproductor de audio */
.music-section {
  text-align: center;
  margin: 2.5rem 0;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(248,245,238,0.8));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.music-icon-large {
  font-size: 2.5rem;
  color: var(--purple);
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}
.music-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--purple);
  font-style: italic;
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
}
.music-section audio {
  width: 100%;
  max-width: 400px;
  height: 45px;
  border-radius: 30px;
  outline: none;
  filter: sepia(15%) contrast(1.05);
}

/* Banner doble de imágenes */
.banner-doble {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1.5rem;
  margin: 3rem auto;
  max-width: 900px;
  padding: 0 2rem;
  flex-wrap: nowrap;
}
.banner-imagen {
  flex: 1;
  max-width: 48%;
  height: 400px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(107, 76, 138, 0.15);
  border: 3px solid white;
  transition: transform 0.3s ease;
}
.banner-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(10%) contrast(0.98);
  transition: filter 0.3s ease, transform 0.3s ease;
}
.banner-imagen:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(107, 76, 138, 0.25);
}
.banner-imagen:hover img {
  filter: none;
  transform: scale(1.05);
}

/* Banner de fotos (index) */
.photo-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  margin: 2rem 0 3rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  overflow: hidden;
}
.photo-banner img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  transition: all 0.35s ease;
  filter: sepia(12%) contrast(0.96);
}
.photo-banner img:hover {
  transform: scale(1.04) translateY(-3px);
  box-shadow: 0 8px 20px rgba(107, 76, 138, 0.12);
  filter: none;
  z-index: 2;
}

/* =========================================
   TRAMAS - tramas.html
   ========================================= */
.trama-section {
  max-width: 680px;
  margin: 0 auto 4rem;
  padding: 2.5rem;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  border-top: 3px solid var(--purple);
  border-bottom: 3px solid var(--green);
}
.trama-section h2 {
  font-family: var(--font-display);
  color: var(--purple-dark);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

/* =========================================
   GALERÍA - galeria.html
   ========================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 2rem auto;
}
.gallery-item {
  aspect-ratio: 1;
  background: var(--line);
  border-radius: 8px;
  overflow: hidden;
  border: 5px solid white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: all 0.4s ease;
  position: relative;
}
.gallery-item::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(107, 76, 138, 0.2), rgba(90, 125, 90, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 30px rgba(107, 76, 138, 0.2);
}
.gallery-item:hover::after { opacity: 1; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  filter: sepia(20%) contrast(0.95);
}
.gallery-item:hover img {
  transform: scale(1.1);
  filter: none;
}

/* =========================================
   RESPONSIVE - MÓVIL (optimizado)
   ========================================= */
@media (max-width: 768px) {
  .page-landing .container {
    padding: 2.5rem 1.5rem;
    box-shadow: 0 0 0 1px var(--line), 0 15px 40px rgba(74, 53, 96, 0.1);
  }
  header h1 { font-size: 2rem; }
  .letter-text { padding: 1rem; font-size: 1rem; }
  .vine-decoration { width: 80px; height: 80px; }
  .subtitle::before, .subtitle::after { display: none; }
  
  .book-container { padding: 2rem 1.5rem; }
  .page-frame {
    padding: 2rem 1.5rem;
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--purple), 0 8px 25px rgba(74, 53, 96, 0.08);
    min-height: auto;
    margin: 0.5rem 0;
  }
  .page-title { font-size: 1.4rem; }
  .page-text {
    font-size: 1rem;
    line-height: 1.8;
    text-align: left;
  }
  .page-image-wrapper { padding: 1rem; margin: 1.5rem 0; }
  .banner-doble { flex-direction: column; gap: 1rem; margin: 1.5rem auto; }
  .banner-imagen { max-width: 100%; height: 250px; }
  .scene-header { margin: 1.5rem 0 1rem; font-size: 1.2rem; }
  blockquote.love-letter, blockquote.vows { margin: 1.5rem 0.5rem; padding: 1rem; }
  .music-section { padding: 1.5rem 1rem; margin: 1.5rem 0; }
  .turn-left::after, .turn-right::after { font-size: 1rem; }
  .page-number { font-size: 0.8rem; margin-top: 1rem; padding-top: 0.8rem; }
}

@media (max-width: 400px) {
  .page-frame {
    padding: 1.5rem 1rem;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--purple), 0 6px 20px rgba(74, 53, 96, 0.08);
  }
  .page-text { font-size: 0.95rem; }
  .page-title { font-size: 1.2rem; }
  .banner-imagen { height: 220px; }
}

/* Móvil: photo-banner */
@media (max-width: 650px) {
  .photo-banner { flex-direction: column; gap: 0.8rem; padding: 0.8rem; }
  .photo-banner img { width: 100%; max-width: 260px; height: 170px; }
}

/* =========================================
   FIX RESPONSIVE: UN SOLO BORDE EN MÓVIL
   ========================================= */
@media (max-width: 768px) {
  /* Contenedor del libro: quitamos sombras dobles */
  .book-container {
    padding: 1rem !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }

  /* Marco de la página: SOLO una línea fina */
  .page-frame {
    padding: 2rem 1rem !important; /* Más espacio interior */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important; /* Sombra suave simple */
    border: 1px solid var(--line) !important; /* UN SOLO borde visible */
    background: rgba(255,255,255,0.95) !important;
    min-height: auto;
  }
  
  /* Ocultamos las floritas de las esquinas para ganar espacio */
  .page-frame::before,
  .page-frame::after {
    display: none !important;
  }
  
  /* Ajustes extra de texto para leer mejor */
  .page-text {
    font-size: 1rem !important;
    text-align: left !important; /* Izquierda es mejor en móvil */
    line-height: 1.7 !important;
  }
  
  .page-title {
    font-size: 1.4rem !important;
  }
  
  /* Banner doble se apila verticalmente */
  .banner-doble {
    flex-direction: column;
    margin: 1.5rem 0;
  }
  .banner-imagen {
    height: 250px;
    max-width: 100%;
  }
}

/* =========================================
   GALERÍA - ÁLBUM MANUAL (sin autoplay)
   ========================================= */
.page-gallery {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 30%, rgba(107, 76, 138, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(90, 125, 90, 0.05) 0%, transparent 40%),
    var(--bg);
  padding: 2rem 1rem;
}

.album-container {
  max-width: 900px;
  margin: 2rem auto;
}

.album-page {
  display: none;
  animation: albumFade 0.6s ease;
}

.album-page.active {
  display: block;
}

@keyframes albumFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.album-frame {
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 0 0 8px var(--bg), 0 0 0 9px var(--purple), 0 20px 60px rgba(74, 53, 96, 0.12);
}

.album-photo {
  width: 100%;
  height: 550px;
  overflow: hidden;
  background: var(--line);
}

.album-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(8%) contrast(0.98);
  transition: transform 0.5s ease, filter 0.5s ease;
}

.album-page.active .album-photo img {
  filter: sepia(0%) contrast(1);
}

.album-story {
  padding: 3rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,245,238,0.95));
}

.album-story h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--purple-dark);
  margin-bottom: 1rem;
  font-weight: 400;
}

.album-story p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.9;
  max-width: 600px;
  margin: 0 auto;
  font-style: italic;
}

/* Navegación del álbum */
.album-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255,255,255,0.8);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.album-btn {
  padding: 0.9rem 2rem;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 25px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(107, 76, 138, 0.2);
}

.album-btn:hover {
  background: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(90, 125, 90, 0.3);
}

.album-counter {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--purple);
  letter-spacing: 0.1em;
}

/* Responsive móvil */
@media (max-width: 768px) {
  .album-photo {
    height: 350px;
  }
  
  .album-story {
    padding: 2rem 1.5rem;
  }
  
  .album-story h3 {
    font-size: 1.4rem;
  }
  
  .album-story p {
    font-size: 1rem;
  }
  
  .album-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .album-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .album-photo {
    height: 280px;
  }
  
  .album-story h3 {
    font-size: 1.2rem;
  }
}
/* =========================================
   GALERÍA - ÁLBUM (SIN RECORTES)
   ========================================= */
.page-gallery {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 30%, rgba(107, 76, 138, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(90, 125, 90, 0.05) 0%, transparent 40%),
    var(--bg);
  padding: 2rem 1rem;
}

.album-container {
  max-width: 900px;
  margin: 2rem auto;
}

.album-page {
  display: none;
  animation: albumFade 0.6s ease;
}

.album-page.active {
  display: block;
}

@keyframes albumFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.album-frame {
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  overflow: visible; /* CAMBIADO: permite que las fotos se vean completas */
  box-shadow: 0 0 0 1px var(--line), 0 0 0 8px var(--bg), 0 0 0 9px var(--purple), 0 20px 60px rgba(74, 53, 96, 0.12);
  margin-bottom: 2rem;
}

/* Foto individual - SIN ALTURA FIJA, SIN RECORTES */
.album-photo {
  width: 100%;
  overflow: visible; /* CAMBIADO */
  background: var(--line);
  display: block; /* CAMBIADO */
}

.album-photo img {
  width: 100%;
  height: auto; /* MANTIENE PROPORCIÓN */
  display: block;
  filter: sepia(8%) contrast(0.98);
  transition: filter 0.5s ease;
}

.album-page.active .album-photo img {
  filter: sepia(0%) contrast(1);
}

/* Dos fotos juntas - SIN ALTURA FIJA */
.album-photo-double {
  display: flex;
  width: 100%;
  gap: 0;
  flex-wrap: wrap; /* Permite que fluyan naturalmente */
}

.album-photo-double .photo-item {
  flex: 1 1 auto; /* CAMBIADO: se adapta al contenido */
  min-width: 0; /* Permite que se encojan si es necesario */
  overflow: visible; /* CAMBIADO */
  background: var(--line);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* CAMBIADO: se alinea arriba */
}

.album-photo-double .photo-item:first-child {
  border-right: 3px solid white;
}

.album-photo-double .photo-item img {
  width: 100%;
  height: auto; /* MANTIENE PROPORCIÓN */
  display: block;
  filter: sepia(8%) contrast(0.98);
  transition: filter 0.5s ease;
}

.album-page.active .album-photo-double .photo-item img {
  filter: sepia(0%) contrast(1);
}

.album-story {
  padding: 3rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,245,238,0.95));
}

.album-story h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--purple-dark);
  margin-bottom: 1rem;
  font-weight: 400;
}

.album-story p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.9;
  max-width: 600px;
  margin: 0 auto;
  font-style: italic;
}

/* Navegación del álbum */
.album-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255,255,255,0.8);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.album-btn {
  padding: 0.9rem 2rem;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 25px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(107, 76, 138, 0.2);
}

.album-btn:hover {
  background: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(90, 125, 90, 0.3);
}

.album-counter {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--purple);
  letter-spacing: 0.1em;
}

/* Responsive móvil */
@media (max-width: 768px) {
  .album-story {
    padding: 2rem 1.5rem;
  }
  
  .album-story h3 {
    font-size: 1.4rem;
  }
  
  .album-story p {
    font-size: 1rem;
  }
  
  /* En móvil, las dos fotos se apilan */
  .album-photo-double {
    flex-direction: column;
  }
  
  .album-photo-double .photo-item:first-child {
    border-right: none;
    border-bottom: 3px solid white;
  }
  
  .album-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .album-btn {
    width: 100%;
  }
}

/* =========================================
   GALERÍA - ÁLBUM (CORREGIDO DEFINITIVO)
   ========================================= */
.page-gallery {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 30%, rgba(107, 76, 138, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(90, 125, 90, 0.05) 0%, transparent 40%),
    var(--bg);
  padding: 2rem 1rem;
}

.album-container {
  max-width: 900px;
  margin: 2rem auto;
}

.album-page {
  display: none;
  animation: albumFade 0.6s ease;
}

.album-page.active {
  display: block;
}

@keyframes albumFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.album-frame {
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 0 0 8px var(--bg), 0 0 0 9px var(--purple), 0 20px 60px rgba(74, 53, 96, 0.12);
  margin-bottom: 2rem;
}

/* FOTO INDIVIDUAL: Mantiene proporción pero cabe en el contenedor */
.album-photo {
  width: 100%;
  background: var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.album-photo img {
  max-width: 100%;
  max-height: 600px; /* Límite máximo para que no se salga */
  width: auto;
  height: auto;
  display: block;
  object-fit: contain; /* MANTIENE PROPORCIÓN SIN RECORTAR */
  filter: sepia(8%) contrast(0.98);
}

/* DOS FOTOS: Layout HORIZONTAL obligatorio */
.album-photo-double {
  display: flex;
  flex-direction: row; /* HORIZONTAL siempre */
  gap: 10px;
  padding: 20px;
  background: var(--line);
  justify-content: center;
}

.album-photo-double .photo-item {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 2px solid white;
}

.album-photo-double .photo-item:last-child {
  border-right: none;
}

.album-photo-double .photo-item img {
  max-width: 100%;
  max-height: 500px; /* Límite para que quepan las dos */
  width: auto;
  height: auto;
  object-fit: contain; /* MANTIENE PROPORCIÓN */
  display: block;
  filter: sepia(8%) contrast(0.98);
}

.album-story {
  padding: 3rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,245,238,0.95));
}

.album-story h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--purple-dark);
  margin-bottom: 1rem;
  font-weight: 400;
}

.album-story p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.9;
  max-width: 600px;
  margin: 0 auto;
  font-style: italic;
}

/* Navegación */
.album-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255,255,255,0.8);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.album-btn {
  padding: 0.9rem 2rem;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 25px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(107, 76, 138, 0.2);
}

.album-btn:hover {
  background: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(90, 125, 90, 0.3);
}

.album-counter {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--purple);
  letter-spacing: 0.1em;
}

/* Responsive móvil */
@media (max-width: 768px) {
  .album-photo { padding: 10px; }
  .album-photo img { max-height: 400px; }
  
  .album-photo-double { 
    flex-direction: row; /* MANTIENE HORIZONTAL en tablet */
    padding: 10px;
  }
  .album-photo-double .photo-item img { max-height: 350px; }
  
  .album-story { padding: 2rem 1.5rem; }
  .album-story h3 { font-size: 1.4rem; }
  
  .album-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  .album-btn { width: 100%; }
}

@media (max-width: 480px) {
  .album-photo-double {
    flex-direction: column; /* Solo en celular MUY pequeño se apila */
  }
  .album-photo-double .photo-item {
    border-right: none;
    border-bottom: 2px solid white;
  }
  .album-photo-double .photo-item img { max-height: 250px; }
}

/* === 5 FOTOS - SIN RECORTES === */
.album-photo-five {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto; /* Altura automática */
  gap: 10px;
  padding: 20px;
  background: var(--line);
}

.album-photo-five .photo-item {
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  border: 2px solid white;
}

/* Primera fila: 3 fotos */
.album-photo-five .photo-item:nth-child(1) { grid-column: 1; grid-row: 1; }
.album-photo-five .photo-item:nth-child(2) { grid-column: 2; grid-row: 1; }
.album-photo-five .photo-item:nth-child(3) { grid-column: 3; grid-row: 1; }

/* Segunda fila: 2 fotos centradas */
.album-photo-five .photo-item:nth-child(4) { grid-column: 1 / 3; grid-row: 2; }
.album-photo-five .photo-item:nth-child(5) { grid-column: 3; grid-row: 2; }

.album-photo-five .photo-item img {
  width: 100%;
  height: auto; /* SIN ALTURA FIJA */
  object-fit: contain; /* MANTIENE PROPORCIÓN SIN RECORTAR */
  display: block;
  filter: sepia(8%) contrast(0.98);
}

/* Móvil: se apilan verticalmente */
@media (max-width: 768px) {
  .album-photo-five {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .album-photo-five .photo-item {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}