 body {
  transition: background-color 1s ease;
  margin: 0;
  background: url('https://www.transparenttextures.com/patterns/parchment.png');
  font-family: 'Georgia', serif;
  color: #3b2f2f;
     opacity: 0;
    transition: opacity 1s ease;
}

body.fade-in {
    opacity: 1;
  }


header {
  background: linear-gradient(to right, #3e1f0f, #5a3925);
  color: #f3e5ab;
  text-align: center;
  padding: 40px 20px;
  font-family: 'Cinzel Decorative', cursive;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.flotante {
  position: absolute;
  top: 450px; /* Ajusta según la altura del contenido */
  width: 250px; /* O el tamaño que se vea bien */
  height: 350px;
  z-index: 1;
  pointer-events: none; /* No interfiere con clics */
  transition: transform 0.3s ease;
}

.flotante-izquierda {
  left: 40px;
}

.flotante-derecha {
  right: 40px;
}


@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.flotante {
  animation: flotar 4s ease-in-out infinite;
}


/* Navegación principal en header */
.main-nav {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.hero {
  display: flex;
  justify-content: center;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.hero li a {
  color: #f3e5ab;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 15px;
  border-radius: 8px;
  transition: background 0.3s;
}

header h1 {
  text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.hero li a:hover {
  background: #3e1f0f;
}

.libro {
  max-width: 800px;
  margin: 40px auto;
  padding: 40px;
  background: rgba(255, 248, 220, 0.95);
  border: 8px double #4a2f13;
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  position: relative;
}

h2 {
  text-align: center;
  font-family: 'Cinzel', serif;
  margin-bottom: 20px;
}

.libro section {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.libro section img {
  max-width: 45%;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

p {
  line-height: 1.8;
  font-size: 18px;
  text-align: justify;
}

p em {
  font-style: italic;
  color: #5a3925;
}

p strong {
  color: #3e1f0f;
}


.libro-nav {
  display: flex;
  justify-content: flex-end;
  margin-top: 40px;
}

.libro-nav a {
  background: #5a3925;
  color: #f3e5ab;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 10px;
  font-weight: bold;
  transition: background 0.3s;
}

.libro-nav a:hover {
  background: #3e1f0f;
}

/* FOOTER */
.footer-buttons {
  margin-top: 10px;
}

.footer-buttons button {
  margin: 5px;
  padding: 8px 14px;
  background-color: #1e1e1d00;
  color: #5a3925;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

footer {
  background-color: #12121f;
  text-align: center;
  padding: 15px 0;
  color: #aaa;
  font-size: 0.9rem;
  border-top: 2px solid #FFD700;
}

/* Modal ya está definido en tu CSS, pero agrego por claridad */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-contenido {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  color: black;
  border-radius: 10px;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
}

.contenido-scrollable {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px;
}

.cerrar {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
}



.capitulo-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
}

.capitulo-nav a {
  background: #5a3925;
  color: #f3e5ab;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 10px;
  font-weight: bold;
  transition: background 0.3s;
}

.capitulo-nav a:hover {
  background: #3e1f0f;
}

.continuar-kindle {
  text-align: center;
  margin-top: 50px;
  padding: 30px;
  background: #f3e5ab;
  border: 4px dashed #5a3925;
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.continuar-kindle p {
  font-size: 20px;
  font-weight: bold;
  color: #3e1f0f;
  margin-bottom: 15px;
  font-family: 'Cinzel', serif;
}

.continuar-kindle a {
  display: inline-block;
  background: #5a3925;
  color: #f3e5ab;
  padding: 12px 25px;
  text-decoration: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 18px;
  transition: background 0.3s, transform 0.2s;
}

.continuar-kindle a:hover {
  background: #3e1f0f;
  transform: scale(1.05);
}


.fade-out {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.redes-sociales {
  margin-top: 15px;
}

.redes-sociales a {
  color: #3e1f0f;
  text-decoration: none;
  margin: 0 8px;
  font-size: 1rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

.redes-sociales a:hover {
  color: #9d5b3a;
  transform: scale(1.2);
}


/* Ocultar imágenes flotantes en móviles y tablets */
@media (max-width: 1200px), (orientation: portrait) {
  .flotante {
    display: none !important;
  }
}

/* === DROPDOWN CAPÍTULOS === */

.dropdown {
  position: relative;
}

.dropbtn {
  background: none;
  border: none;
  color: #f3e5ab;
  font-family: inherit;
  font-weight: bold;
  font-size: 1rem;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
}

.dropbtn:hover {
  background: #3e1f0f;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #000000;
  min-width: 180px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  z-index: 999;
  padding: 10px 0;
}

.dropdown-content a {
  display: block;
  padding: 10px 20px;
  color: #3e1f0f;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
}

.dropdown-content a:hover {
  background: #f3e5ab;
}

/* Mostrar menú */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Ajuste del nav principal */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 0 40px;
}

/* Grupos de navegación */
.hero {
  display: flex;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Opcional: refuerzo visual */
.hero-right {
  justify-content: flex-end;
}