:root {
  color-scheme: dark;
  --bg: rgba(10, 15, 25, 0.8);
  --overlay: rgba(3, 7, 14, 0.72);
  --button: rgba(255, 255, 255, 0.12);
  --button-hover: rgba(255, 255, 255, 0.22);
  --accent: #f0e6d1;
  --text: #f8f7f3;
  --muted: #c2c1bb;
  --border: rgba(255, 255, 255, 0.18);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--fuente-cuerpo);
}

body {
  color: var(--text);
  background: url('foto1.png') top/cover no-repeat fixed;
  position: relative;
}

body::before {
  pointer-events: none;
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(3,7,14,0.5), rgba(3,7,14,0.9));
  z-index: 0;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  height: auto;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}


.hero {
  max-width: 960px;
  width: 100%;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  margin: 0;
  letter-spacing: -0.05em;
}

.hero p {
  margin: 1rem auto 2rem;
  max-width: 680px;
  line-height: 1.7;
  color: var(--muted);
  font-size: 1.05rem;
}

.nav-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  width: min(100%, 960px);
  margin: 0 auto 3rem;
}

.nav-buttons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 1.2rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--button);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  backdrop-filter: blur(16px);
}

.nav-buttons a:hover,
.nav-buttons a:focus-visible {
  background: var(--button-hover);
  transform: translateY(-2px);
  border-color: rgba(240, 230, 209, 0.36);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.card {
  width: 100%;
  max-width: 960px;
  background: rgba(139, 143, 147, 0.102);
  border: 1px solid rgba(197, 184, 184, 0.08);
  border-radius: 30px;
  padding: 2rem;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.22);
}

.card h2 {
  margin-top: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.card p {
  color: var(--muted);
  line-height: 1.8;
}

.main-container {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100vh;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.book-wrapper {
  width: 100%;
  max-width: 1200px;
  height: auto;
  min-height: 700px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
}

.flipbook-container {
  width: 100%;
  height: auto;
  min-height: 700px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.book {
  box-shadow:
    0 25px 80px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: visible;
  max-width: 100%;
}

/* ============================================
   RESPONSIVE PARA FLIPBOOK DENTRO DE CARD
   ============================================ */
@media (max-width: 768px) {
  .main-container {
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  
  .book-wrapper {
    min-height: 500px;
  }
  
  .flipbook-container {
    min-height: 500px;
  }
  
  .nav-controls {
    bottom: 10px;
    padding: 0.5rem 1rem;
  }
  
  .nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .page-indicator {
    font-size: 0.9rem;
    padding: 0 0.8rem;
  }
}

@media (max-width: 480px) {
  .book-wrapper {
    min-height: 400px;
  }
  
  .flipbook-container {
    min-height: 400px;
  }
}

.footer {
  margin-top: auto;
  padding: 2rem 1rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 980px;
  width: 100%;
}

.footer strong {
  display: block;
  color: var(--text);
  font-size: 0.98rem;
  margin-bottom: 0.7rem;
}

@media (max-width: 620px) {
  .page-shell {
    padding: 1.5rem;
  }
  .hero h1 {
    font-size: 2.8rem;
  }
}

.memory-card {
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--accent);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.memory-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.memory-card h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.memory-card .date {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}

.memory-card p {
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ============================================
   BOTÓN DESTACADO - TU VOZ
   ============================================ */
.nav-highlight {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(233, 30, 141, 0.25)) !important;
  border: 2px solid var(--accent) !important;
  color: var(--accent) !important;
  font-weight: 700 !important;
  position: relative;
  box-shadow: 0 0 15px rgba(240, 230, 209, 0.2);
}

.nav-highlight::after {
  content: "Nuevo";
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent);
  color: #0a0f19;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-highlight:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(233, 30, 141, 0.4)) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 20px rgba(240, 230, 209, 0.3);
}

#modalImage {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.photo-modal-content {
  animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   GRID DE FOTOS - CORREGIDO
   ============================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin: 0;
}

.photo-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
  width: 100%;          /* ← AGREGAR: asegura que ocupe todo el espacio */
  max-width: 100%;      /* ← AGREGAR: evita que se desborde */
  box-sizing: border-box; /* ← AGREGAR: incluye padding/border en el ancho */
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;       /* ← AGREGAR: elimina espacio extra debajo */
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  padding: 2rem 1rem 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* ← AGREGAR: permite clic en la foto */
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ============================================
   MODAL DE VIDEO - AGREGAR ESTO
   ============================================ */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.video-modal.active {
  display: flex;
}

.video-modal-content {
  max-width: 1000px;
  width: 100%;
  background: rgba(10, 15, 25, 0.95);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-modal-title {
  font-family: var(--fuente-titulos);
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 700;
}

.video-modal-close {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(220, 53, 69, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.video-modal-close:hover {
  background: rgba(220, 53, 69, 0.4);
  transform: rotate(90deg);
}

.video-modal-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: black;
}

.video-modal-player iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-modal-description {
  padding: 1.5rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .video-modal {
    padding: 1rem;
  }
  
  .video-modal-title {
    font-size: 1rem;
  }
}