*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
    font-family: 'Georgia', serif;
    background-color: #fdfcf8;
    color: #333;
    margin: 0;
    /*padding: 2em;*/
  }
  
.contenedor {
    margin: 0 auto;
    padding: 2em;
    background-color: #fdfcf8;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    height: auto;
    flex-wrap: wrap;
}
a{
  text-decoration: none;
  color: #333;
  margin: 0.5%;
}
.titulo {
  text-align: center;
  font-size: 2em;
  margin-bottom: 2em;
}

.cuento, .mesa_cuento {
  background-color: #fff;
  padding: 0.3em;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  height: 100%;
  width: 100%;
}
.cuento:hover {
  transform: scale(1.03);
  transition: all 0.3s ease;
}
.volver {
  display: block;
  margin-top: 2em;
  text-align: center;
  text-decoration: none;
  color: #0077cc;
}
.visor{
  display: flex;
  justify-content: center; 
  align-items: center;
  width: 100%;
  height: 100%;
}
.galeria{
  display: flex;
  justify-content: center; 
  align-items: center;
  flex-direction: column;
  border: #333 solid 1px;
  border-radius: 5px;
  width: 200px;
  height: 280px;
}
.galeria > img{
  width: 80%;
  height: 70%;
  border-radius: 6px;
}

/* hero */
  .hero {
    position: relative;
    width: 100%;
    height: 100dvh; /* Ocupa toda la altura del viewport */
    background: url('../img/background_4.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: start;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
}

.aqui {
    width: 100px;
    height: 40px;
    background-color: #96d3fe;
    border-radius: 6px;
    text-align: center;
}

/* -----------------------------------------LOADER-BOOK----------------------------------------- */
.loader-text {
  color: #000;
  text-align: center;
  font-family: sans-serif;
  text-transform: uppercase;
  font-size: 20px;
  position: relative;
}

.loader-text:after {
  position: absolute;
  content: "";
  -webkit-animation: Dots 2s cubic-bezier(0, .39, 1, .68) infinite;
  animation: Dots 2s cubic-bezier(0, .39, 1, .68) infinite;
}

.loader {
  margin: 5% auto 30px;
}

.book {
  border: 4px solid #a87878;
  width: 60px;
  height: 45px;
  position: relative;
  perspective: 150px;
}

.page {
  display: block;
  width: 30px;
  height: 45px;
  border: 4px solid #8d0000;
  border-left: 1px solid #8455b2;
  margin: 0;
  position: absolute;
  right: -4px;
  top: -4px;
  overflow: hidden;
  background: #8455b2;
  transform-style: preserve-3d;
  -webkit-transform-origin: left center;
  transform-origin: left center;
}

.book .page:nth-child(1) {
  -webkit-animation: pageTurn 1.2s cubic-bezier(0, .39, 1, .68) 1.6s infinite;
  animation: pageTurn 1.2s cubic-bezier(0, .39, 1, .68) 1.6s infinite;
}

.book .page:nth-child(2) {
  -webkit-animation: pageTurn 1.2s cubic-bezier(0, .39, 1, .68) 1.45s infinite;
  animation: pageTurn 1.2s cubic-bezier(0, .39, 1, .68) 1.45s infinite;
}

.book .page:nth-child(3) {
  -webkit-animation: pageTurn 1.2s cubic-bezier(0, .39, 1, .68) 1.2s infinite;
  animation: pageTurn 1.2s cubic-bezier(0, .39, 1, .68) 1.2s infinite;
}


/* Page turn */

@-webkit-keyframes pageTurn {
  0% {
    -webkit-transform: rotateY( 0deg);
    transform: rotateY( 0deg);
  }
  20% {
    background: #4b1e77;
  }
  40% {
    background: rebeccapurple;
    -webkit-transform: rotateY( -180deg);
    transform: rotateY( -180deg);
  }
  100% {
    background: rebeccapurple;
    -webkit-transform: rotateY( -180deg);
    transform: rotateY( -180deg);
  }
}

@keyframes pageTurn {
  0% {
    transform: rotateY( 0deg);
  }
  20% {
    background: #4b1e77;
  }
  40% {
    background: rebeccapurple;
    transform: rotateY( -180deg);
  }
  100% {
    background: rebeccapurple;
    transform: rotateY( -180deg);
  }
}


/* Dots */

@-webkit-keyframes Dots {
  0% {
    content: "";
  }
  33% {
    content: ".";
  }
  66% {
    content: "..";
  }
  100% {
    content: "...";
  }
}

@keyframes Dots {
  0% {
    content: "";
  }
  33% {
    content: ".";
  }
  66% {
    content: "..";
  }
  100% {
    content: "...";
  }
}
@media(max-width: 600px) {
  .galeria{
    width: 150px;
    height: 220px;
  }
}

@media(max-width: 400px) {
  body {
    padding: 0;
    max-width: 100%;
  }
  .titulo {
    font-size: 1.5em;
  }
  .cuento {
    padding: 0.5em;
  }
  .hero{
    background: url('../img/background_5.webp');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: calc(100% + 250px);
  }
}
@media(max-width: 320px) {
  .galeria{
    width: 100px;
    height: 180px;
  }
    .hero{
    background-position: calc(100% - 0px);
  }
}