/* Reseteo básico */
html,
body {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden; /* 🔥 elimina el hueco blanco lateral */
  display: flex;
  flex-direction: column;
}

/* Agrega espacio al body para que no se oculte por el navbar fijo */

header {
  position: relative;
  background-color: #0b2341;
  height: 75vh;
  min-height: 25rem;
  width: 100%;
  overflow: hidden;
}

header .overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: #0b2341;
  opacity: 0.5;
  z-index: 1;
}

header video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transform: translate(-50%, -50%);
}

header .container {
  position: relative;
  z-index: 2;
}



@media (pointer: coarse) and (hover: none) {
  header {
    background: url("assets/video/video1.mp4") #0b2341 no-repeat center center
      scroll;
  }

  header video {
    display: none;
  }
}

p {
  font-size: 1.2em;
}

.maquina {
  font-family: monospace;
  font-size: 1.5em;
  color: #195389;
  white-space: nowrap;
  display: flex;
  justify-content: center;
  padding-right: 0.2em; /* espacio para la última letra */
}

.maquina h1 {
  font-size: 1.5em;
  color: #195389;
  font-family: monospace;
  white-space: nowrap;
  display: inline-block;
}

.cursor {
  display: inline-block;
  width: 1px;
  background: black;
  margin-left: 2px;
  animation: blink 0.7s infinite;
}

@keyframes escribir {
  from {
    width: 0;
  }
  to {
    width: 100%; /* anima hasta llenar el contenedor */
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Elimina márgenes en el contenedor */
main {
  margin-top: 0; /* Evita márgenes innecesarios en la parte superior */
  padding-top: 0; /* Evita relleno innecesario */
  flex: 1; /* El contenido principal ocupa todo el espacio disponible */
}

/* --------------------------- */
/* ------- N A V B A R ------- */
/* --------------------------- */

nav.navbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  font-size: 1.2em;
}
.navbar-nav .nav-link.active {
  color: #e0bb3f !important; /* azul */
  font-weight: bold;
} 

/* Navbar responsive */
@media (max-width: 992px) {
  .navbar-collapse {
    justify-content: center;
    background-color: #0b2341; /* fondo al abrir */
  }
  /* Menú abierto ocupa todo el header */
  .navbar-collapse.show {
    height: 100%;             /* misma altura que tu header */
    background-color: rgb(11, 35, 65); /* semi-transparente */
    display: flex;
    flex-direction: column;
    justify-content: center;  /* centra verticalmente los links */
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease; /* animación suave */
  }


  .navbar-nav {
    text-align: center;
    
  } 
  
  /* Link activo en móviles */
  .navbar-nav .nav-link.active {
    color: #e0bb3f !important; /* azul */
    font-weight: bold;
  } /* Para que el hover también funcione sobre fondo negro */
  .navbar-nav .nav-link {
    color: #fff; /* color por defecto de links */
  }
  .navbar-nav .nav-link:hover {
    color: #e0bb3f;
  }
}

/* --------------------------- */
/* --------- TITULOS --------- */
/* --------------------------- */

.titulo-contenedor {
  text-align: center;
  width: 100%;
  color: #1d497e;
  text-shadow: 2px 2px 5px white; /* Sombra blanca */
}

.tituloContenedorO {
  text-align: center;
  font-size: 40px;
  color: #1d497e;
  text-shadow: 2px 2px 5px white; /* Sombra blanca */
}

.tituloContenedorLibro {
  text-align: center;
  font-size: 2rem; /* tamaño base */
  font-weight: bold;
  margin: 1rem 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 90%; /* ✅ no ocupa todo el ancho */
  color: #cabb70;
  text-shadow: 1px 1px 2px rgb(255, 255, 255), 0 2px 3px rgb(253, 253, 253),
    0 0 5px rgb(255, 255, 255);
}

@media (max-width: 768px) {
  .tituloContenedorLibro {
    font-size: 1.5rem; /* ✅ más pequeño en pantallas chicas */
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .tituloContenedorLibro {
    font-size: 1.2rem; /* ✅ aún más reducido en móviles */
  }
}

.tituloContenedorSUB {
  text-align: center;
  font-size: 2rem; /* tamaño base */
  font-weight: bold;
  margin: 1rem 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 90%; /* ✅ no ocupa todo el ancho */
  color: #447dc2;
  text-shadow: 2px 2px 5px white; /* Sombra blanca */
}

.tituloUsuario {
  text-align: center;
  font-size: 20px;
  color: #b38a02;
  text-shadow: 2px 2px 5px white; /* Sombra blanca */
  margin-bottom: 3%;
}

.tituloCapitulo {
  text-align: center;
  font-size: 20px;
  color: #128096;
  text-shadow: 2px 2px 5px white; /* Sombra blanca */
  margin-bottom: 3%;
}

.comentario {
  border: 3px dashed #fffffff9;
  background-color: #e5edf8d4;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 20px;
}

/* --------------------------- */
/* ---------- CARD ---------- */
/* --------------------------- */
.contenedor-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1em;
  padding: 1em;
}

.card-libros img {
  height: 450px; /* altura fija para todas las imágenes */
  object-fit: top; /* recorta la imagen centrada, mantiene proporción */
  clip-path: polygon(0 0, 0 100%, 100% 85%, 100% 0%);
}

.card-libros {
  font-family: Arial, Helvetica, sans-serif;
  width: 300px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.description {
  padding: 0.15em;
  flex-grow: 1;
}

.description h2 {
  color: #1d497e;
  font-size: 1.5em;
  font-weight: bold;
  font-style: italic;
  text-decoration: underline overline #f3efb9f1;
}

.description p {
  max-height: 4.5em; /* ajusta según la altura de tus líneas */
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.5em; /* importante para calcular altura */
}

.card-footer {
  border-top: none !important;
  background-color: transparent !important;
}

.button-card {
  font-size: 1em;
  padding: 0.5em 1em;
  color: #fff !important; /* fuerza el color blanco */
  background-color: #1d497e;
  border: none;
  cursor: pointer;
  text-decoration: none !important; /* quita subrayado */
  display: inline-block;
  border-radius: 4px;
}

.button-card:hover {
  background-color: #16365c;
  text-decoration: none !important;
  color: #fff !important;
}

.button-card:visited {
  color: #fff !important;
  text-decoration: none !important;
}

.img-wrapper {
  position: relative;
}

.img-wrapper img {
  width: 100%;
  display: block;
}

.genero-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #d3b000;
  color: #fff;
  font-size: 0.75em;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}

.contenedor-ver-libro {
  max-width: 600px; /* o el ancho que prefieras */
  margin: 0 auto; /* margen automático horizontal para centrar */
  padding: 1em;
}

.button-container {
  display: flex;
  justify-content: center; /* centra horizontalmente el grupo */
  gap: 1rem; /* espacio entre botones */
  flex-wrap: wrap; /* permite que se envuelvan en pantallas pequeñas */
  max-width: 400px; /* opcional, para limitar ancho total */
  margin: 0 auto; /* centra el contenedor */
}

.button-container a {
  flex: 1 1 150px; /* crecen y encogen, base mínimo 150px */
  text-align: center;
  padding: 0.5em 1em;
  text-decoration: none;
  color: white;
  border-radius: 4px;
  display: inline-block;
}

/* para pantallas pequeñas, los botones ocupan 100% y se apilan */
@media (max-width: 480px) {
  .button-container a {
    flex-basis: 100%;
  }
}

/* --------------------------- */

/* --------------------------- */
/* -----  HISTORIAS ------ */
/* --------------------------- */

.contenedor-ver-historia {
  max-width: 1000px; /* o el ancho que prefieras */
  margin: 0 auto; /* margen automático horizontal para centrar */
  padding: 1em;
}

.portada-historia {
  width: auto;
  border-radius: 25px; /* Redondea las esquinas */
  border: thick double #1d497e;
}

.button-card-historia {
  font-size: 1em;
  padding: 0.5em 1em;
  color: #fff !important; /* fuerza el color blanco */
  background-color: #1d497e;
  border: none;
  cursor: pointer;
  text-decoration: none !important; /* quita subrayado */
  display: inline-block;
  border-radius: 4px;
}

.button-card-historia:hover {
  background-color: #16365c;
  text-decoration: none !important;
  color: #fff !important;
}

.button-card-historia:visited {
  color: #fff !important;
  text-decoration: none !important;
}

/*--------------------------- */
/*---------- BOTON ---------- */
/* --------------------------- */
.button-card-comentarios {
  font-size: 1em;
  padding: 0.5em 1em;
  color: #fff !important; /* fuerza el color blanco */
  background-color: #2b9ecb;
  border: none;
  cursor: pointer;
  text-decoration: none !important; /* quita subrayado */
  display: inline-block;
  border-radius: 4px;
}

.button-card-comentarios:hover {
  background-color: #2d80a1;
  text-decoration: none !important;
  color: #fff !important;
}

.button-card-comentarios:visited {
  color: #fff !important;
  text-decoration: none !important;
}

/* --------------------------- */

.genero-tag-historia {
  position: absolute;
  bottom: -15px;

  background-color: #9f8401;
  color: #fff;
  font-size: 0.85em;
  padding: 5px 15px;
  border-radius: 20px;
  z-index: 2;
}

.button-container-historia {
  display: flex;
  justify-content: center; /* centra horizontalmente el grupo */
  gap: 1rem; /* espacio entre botones */
  flex-wrap: wrap; /* permite que se envuelvan en pantallas pequeñas */
  max-width: 400px; /* opcional, para limitar ancho total */
  margin: 0 auto; /* centra el contenedor */
}

.button-container-historia a {
  flex: 1 1 150px; /* crecen y encogen, base mínimo 150px */
  text-align: center;
  padding: 0.5em 1em;
  text-decoration: none;
  color: white;
  border-radius: 4px;
  display: inline-block;
}

/* para pantallas pequeñas, los botones ocupan 100% y se apilan */
@media (max-width: 480px) {
  .button-container-historia a {
    flex-basis: 100%;
  }
}

/* --------------------------- */
/* -----  COMENTARIO ------ */
/* --------------------------- */

.contacto-comentario {
  background: #ffffffe8;
  margin: 3% auto 2% auto;
  width: 100%;
  max-width: 600px; /* ✅ límite en pantallas grandes */
  border-radius: 1.25rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 6px 20px rgba(0, 0, 0, 0.19);
  overflow-wrap: break-word; /* ✅ evita textos largos que rompan */
}

.contacto-comentario .form-control {
  border-radius: 1rem;
}
.contacto-comentario-image {
  text-align: center;
}
.contacto-comentario-image img {
  border-radius: 50%;
  max-width: 120px; /* ✅ control absoluto */
  width: 100%;
  height: auto;
  margin-top: -5%;
  margin-bottom: 5%;
  transform: rotate(5deg);
  border: solid 3px rgba(29, 56, 86, 0.785);
}

.contacto-comentario-image img:hover {
  transform: rotate(0deg);
  border: solid 3px rgba(179, 149, 17, 0.918);
}
.contacto-comentario form {
  padding: 5%;
}
.contacto-comentario form .row {
  margin-bottom: -5%;
}
.contacto-comentario h3 {
  margin-bottom: 5%;
  margin-top: -10%;
  text-align: center;
  color: #1e4d7e;
}

.button-comentario {
  font-size: 1.25em;
  padding: 0.5em 1em;
  color: #fff !important; /* fuerza el color blanco */
  background-color: #d3b934;
  border: none;
  cursor: pointer;
  text-decoration: none !important; /* quita subrayado */
  display: inline-block;
  border-radius: 4px;
}

.button-comentario:hover {
  background-color: #16365c;
  text-decoration: none !important;
  color: #fff !important;
}

.button-comentario:visited {
  color: #fff !important;
  text-decoration: none !important;
}

@media (max-width: 768px) {
  /* ✅ evita desborde de fondo fijo */
  .col-12[style*="background-attachment"] {
    background-attachment: scroll !important;
  }

  .contacto-comentario {
    margin: 1rem;
    width: 100%;
    max-width: 100%;
  }
}

/* ------------------------------- */
/* ------- C O N T A C T O --------*/
/* ------------------------------- */

.contacto-form {
  border: 2px dashed #1d497e; /* Borde discontinuo de 2px y color negro */
  margin: 10%;
  width: 50%;
  border-radius: 20px; /* Aumenta el valor para bordes más redondeados */
}
.contacto-form .form-control {
  border-radius: 1rem;
}
.contacto-image {
  text-align: center;
}
.contacto-image img {
  width: 20%;
  margin-top: -3%;
}
.contacto-form form {
  padding: 10%;
}
.contacto-form form .row {
  margin-bottom: -7%;
}
.contacto-form h3 {
  margin-bottom: 8%;
  margin-top: -10%;
  text-align: center;
  color: rgba(110, 1, 110, 0.859);
}

.btnContacto {
  width: 50%;
  border-radius: 1rem;
  padding: 1.5%;
  color: #fff;
  background-color: rgba(24, 66, 171, 0.859);
  border: none;
  cursor: pointer;
}

.btnContacto:hover {
  background: rgba(8, 36, 129, 0.859) !important;
  box-shadow: 0px 5px 1rem rgba(233, 190, 243, 0.5);
}

/* -------------------------------------- */
/* -------- Form CREAR Cursos ----------- */
/* -------------------------------------- */

.contenedor-formCursos {
  max-width: 900px;
  margin: auto;
  padding: 2rem;
  background-color: #f6f3fb;
  border-radius: 25px;
  box-shadow: 0 5px 10px rgba(80, 1, 132, 0.308);
  overflow: hidden; /* Esto ayuda a que nada sobresalga, como radios internos */
}

.botones-formCursos {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  margin-top: -0.5rem; /* sube los botones para alinearlos con el borde */
}

.botones-formCursos button {
  flex: 1;
  padding: 1rem;
  font-size: 1.2rem;
  background-color: #6d8fe4;
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  font-weight: 500 !important;
}
.botones-formCursos button.active {
  background-color: #4246b7;
}

.boton-historia {
  border-top-left-radius: 25px;
}

.boton-capitulo {
  border-top-right-radius: 25px;
}

.form-version {
  display: none;
}

.form-version.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.form-version form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-version input,
.form-version textarea,
.form-version select {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

.form-version button[type="submit"] {
  padding: 0.75rem;
  background-color: #9e8910;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.form-version button[type="submit"]:hover {
  background-color: #2e76b1;
}

.input-personalizado,
.textarea-personalizado,
.select-personalizado {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.titulo-contenedor2 {
  display: flex;
  justify-content: center; /* centra horizontalmente el grupo */
  background-color: #1b496d;
  border-top-left-radius: 25px;
  border-top-right-radius: 25px;
  width: 100%;
  font-size: 20px;
  color: #ffffff;
  text-shadow: 1px 1px 2px rgb(248, 248, 248), 0 0 5px rgb(199, 165, 113);
  margin-bottom: 3%;
}

/* --------------------------- */
/* ---------- Footer ----------*/
/* --------------------------- */

footer {
  position: relative;
  margin-top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #0b2341;
  text-align: center;
  padding-top: 2%;
  padding-bottom: 2%;
}

.footer p {
  color: rgb(213, 212, 212);
}
