/* Reset global */
* {
  box-sizing: border-box;
}

/* Body */
body {
  margin: 40px;
  padding: 0;
  background-color: white;
  font-family: 'Roboto', sans-serif;
  height: calc(100vh - 40px);
  position: relative;
  overflow: hidden;
}
.mobile {
  display: none;
}
/* Title */
.title {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36rem;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: fadeInTitle 2s ease-in-out 0s forwards;
  transition: all 0.5s ease-in-out;
  z-index: 2;
}
@keyframes fadeInTitle {
  to { opacity: 1; }
}
.title.minimized {
  width: 0px;
}
.title img {
  width: 100%;
}

/* Title small */
.title-small {
  position: absolute;
  left: 51px;
  top: 54px;
  width: 0rem;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: fadeInTitleSmall 1s ease-in-out 1s forwards;
  transition: all 0.1s ease-in-out;
  z-index: 2;
}
@keyframes fadeInTitleSmall {
  to { opacity: 1; }
}
.title-small.minimized {
    cursor: pointer;

  width: 100px;
}
.title-small img {
  width: 100%;
}

/* Subtitle */
.subtitle {
  position: absolute;
  left: 50%;
  top: calc(50% + 6rem);
  transform: translate(-50%, -50%);
  white-space: nowrap;
  opacity: 0;
  animation: fadeInSubtitle 4s ease-in-out 0s forwards;
  transition: all 0.1s ease-in-out;
  z-index: 2;
  font-size: 2rem;
  font-weight: 500;
}

@keyframes fadeInSubtitle {
  to { opacity: 1; }
}
.subtitle.hidden {
  opacity: 0;
  font-size: 0px;
}

/* Footer */
.footer {
  position: absolute;
  bottom: 20px;
  left: 0px;
  right: 0px;
  display: flex;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 1;
}
.footer.visible { opacity: 1; }
.footer.hidden {
  opacity: 0;
  transform: translateX(20px);
}
#book-container {
      left: 50%;
    transform: translate(-50%, 0%)!important;
}
/* Logos */
.logo {
  height: 60px;
  opacity: 0;
  transform: translateX(-20px);
}
.logo.upm {
  margin-top: -10px;
  height: 80px;
  margin-right: -12px;
}
.logo.mp {
  width: 150px;
  height: 40px;
  margin-top: 11px;
  margin-left: 17px;
}
.logo.mrs {
  width: 80px;
  height: 40px;
  margin-top: 11px;
}
.logo.fjm {
  height: 60px;
  margin-top: 0px;
  margin-left: 10px;
}
.logo.fa {
  width: 150px;
  height: 40px;
  margin-top: 20px;
}
.logo.ca {
  width: 150px;
  height: 70px;
  margin-top: 0px;
}
.logo.ea {
  width: 150px;
  height: 40px;
  margin-top: 11px;
}
.logo.fade-in {
  animation: logoFadeIn 0.5s ease-out forwards;
}
@keyframes logoFadeIn {
  to { opacity: 1; transform: translateX(0); }
}

.chevron {
  display: none;
}
/* Menú (sin cambios) */
.menu {
  display: none;
  position: absolute;
  top: 140px;
  width: 220px;
  font-size: 1rem;
  font-weight: 400;
  color: black;
  text-align: left;
  z-index: 3;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.3s ease;
}
.menu.visible {
  display: flex;
  opacity: 1;
}
.menu a {
  text-decoration: none;
  color: black;
  opacity: 0;
  transform: translateY(-20px);
  animation: fallIn 0.5s ease-out forwards;
}
.menu a:nth-child(1) { animation-delay: 0.1s; }
.menu a:nth-child(2) { animation-delay: 0.15s; }
.menu a:nth-child(3) { animation-delay: 0.20s; }
.menu a:nth-child(4) { animation-delay: 0.25s; }
.menu a:nth-child(5) { animation-delay: 0.30s; }
.menu a:nth-child(6) { animation-delay: 0.35s; }
.menu a:nth-child(7) { animation-delay: 0.36s; }
.menu a:nth-child(8) { animation-delay: 0.37s; }
@keyframes fallIn {
  to { opacity: 1; transform: translateY(0); }
}
.menu a:hover { text-decoration: underline; font-weight: 400; }

/* Contenedor de contenido responsive */
.content-container {
  margin-left: 20px;
  position: absolute;
  left: 200px;
  width: calc(100vw - 300px);
  height: calc(100vh - 80px);
  opacity: 0;
  overflow: hidden; /* Evita que los image-box se salgan del contenedor */
}

#close-container { 
  display: none;  
  position: absolute;
    bottom: 0px;
    left: calc(50% - 8px);
    transform: translateX(-50%);
    display: none;
    color: #000;
    width: 40px;
    height: 40px;
    padding: 10px 15px;
    border-radius: 6px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid black;
}

#close-container span {
    cursor: pointer;
}

/* Image-box: centrados en el contenedor */
.image-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: transform 1s ease, opacity 1s ease;
  cursor: pointer;
}
.image-box span {
  font-size: 0.7rem;
}

/* Anchos relativos para escalar proporcionalmente */
.image-box:nth-child(1) {
  width: 20%;
}
.image-box:nth-child(2),
.image-box:nth-child(3) {
  width: 16%;
}
.image-box:nth-child(n+4) {
  width: 8%;
}

.image-box.spread-in {
  opacity: 0;
  transform: translate(-50%, -50%);
}

@keyframes spreadOut1 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(-240%,-46vh); opacity: 1; }
}
.image-box:nth-child(1).animate {
  animation: spreadOut1 0.5s ease-out forwards;
}

@keyframes spreadOut2 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(-125%, -100%); opacity: 1; }
}
.image-box:nth-child(2).animate {
  animation: spreadOut2 1.2s ease-out forwards;
}

@keyframes spreadOut3 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(-174%, 5vh); opacity: 1; }
}
.image-box:nth-child(3).animate {
  animation: spreadOut3 1s ease-out forwards;
}

@keyframes spreadOut4 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(5%, 55%); opacity: 1; }
}
.image-box:nth-child(4).animate {
  animation: spreadOut4 1.4s ease-out forwards;
}

@keyframes spreadOut5 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(-125%, 113%); opacity: 1; }
}
.image-box:nth-child(5).animate {
  animation: spreadOut5 1.2s ease-out forwards;
}

@keyframes spreadOut6 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(120%, -180%); opacity: 1; }
}
.image-box:nth-child(6).animate {
  animation: spreadOut6 1s ease-out forwards;
}

@keyframes spreadOut7 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(-10%, -199%); opacity: 1; }
}
.image-box:nth-child(7).animate {
  animation: spreadOut7 1.5s ease-out forwards;
}

@keyframes spreadOut8 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(285%, -205%); opacity: 1; }
}
.image-box:nth-child(8).animate {
  animation: spreadOut8 1.6s ease-out forwards;
}

@keyframes spreadOut9 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(420%, -195%); opacity: 1; }
}
.image-box:nth-child(9).animate {
  animation: spreadOut9 1.7s ease-out forwards;
}

@keyframes spreadOut10 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(420%, -33%); opacity: 1; }
}
.image-box:nth-child(10).animate {
  animation: spreadOut10 1.8s ease-out forwards;
}

@keyframes spreadOut11 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(300%, 33%); opacity: 1; }
}
.image-box:nth-child(11).animate {
  animation: spreadOut11 2s ease-out forwards;
}

@keyframes spreadOut12 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(450%, 100%); opacity: 1; }
}
.image-box:nth-child(12).animate {
  animation: spreadOut12 2.2s ease-out forwards;
}

@keyframes spreadOut13 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(267%, -100%); opacity: 1; }
}
.image-box:nth-child(13).animate {
  animation: spreadOut13 2.5s ease-out forwards;
}

@keyframes spreadOut14 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(7%, 45%); opacity: 1; }
}
.image-box:nth-child(14).animate {
  animation: spreadOut14 1.4s ease-out forwards;
}

@keyframes spreadOut15 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(-195%, 83%); opacity: 1; }
}
.image-box:nth-child(15).animate {
  animation: spreadOut15 1.2s ease-out forwards;
}

@keyframes spreadOut16 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(76%, -120%); opacity: 1; }
}
.image-box:nth-child(16).animate {
  animation: spreadOut16 1s ease-out forwards;
}

@keyframes spreadOut17 {
  0% { transform: translate(-50%, -50%); opacity: 0; }
  100% { transform: translate(-180%, -199%); opacity: 1; }
}
.image-box:nth-child(17).animate {
  animation: spreadOut17 1.5s ease-out forwards;
}



/* Animaciones inversas para cada uno de los casos */
@keyframes spreadIn1 {
  0% { transform: translate(-240%, -46vh); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(1).animate-reverse {
  animation: spreadIn1 0.5s ease-in forwards;
}

@keyframes spreadIn2 {
  0% { transform: translate(-125%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(2).animate-reverse {
  animation: spreadIn2 1.2s ease-in forwards;
}

@keyframes spreadIn3 {
  0% { transform: translate(-174%, 5vh); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(3).animate-reverse {
  animation: spreadIn3 1s ease-in forwards;
}

@keyframes spreadIn4 {
  0% { transform: translate(5%, 55%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(4).animate-reverse {
  animation: spreadIn4 1.4s ease-in forwards;
}

@keyframes spreadIn5 {
  0% { transform: translate(-125%, 113%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(5).animate-reverse {
  animation: spreadIn5 1.2s ease-in forwards;
}

@keyframes spreadIn6 {
  0% { transform: translate(120%, -180%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(6).animate-reverse {
  animation: spreadIn6 1s ease-in forwards;
}

@keyframes spreadIn7 {
  0% { transform: translate(-10%, -199%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(7).animate-reverse {
  animation: spreadIn7 1.5s ease-in forwards;
}

@keyframes spreadIn8 {
  0% { transform: translate(285%, -205%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(8).animate-reverse {
  animation: spreadIn8 1.6s ease-in forwards;
}

@keyframes spreadIn9 {
  0% { transform: translate(420%, -195%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(9).animate-reverse {
  animation: spreadIn9 1.7s ease-in forwards;
}

@keyframes spreadIn10 {
  0% { transform: translate(420%, -33%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(10).animate-reverse {
  animation: spreadIn10 1.8s ease-in forwards;
}

@keyframes spreadIn11 {
  0% { transform: translate(300%, 33%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(11).animate-reverse {
  animation: spreadIn11 2s ease-in forwards;
}

@keyframes spreadIn12 {
  0% { transform: translate(450%, 100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(12).animate-reverse {
  animation: spreadIn12 2s ease-in forwards;
}

@keyframes spreadIn13 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.image-box:nth-child(13).animate-reverse {
  animation: spreadIn13 2s ease-in forwards;
}

@keyframes spreadIn14 {
  100% { transform: translate(-50%, -50%); opacity: 0; }
  0% { transform: translate(7%, 45%); opacity: 1; }
}
.image-box:nth-child(14).animate-reverse {
  animation: spreadIn14 2s ease-in forwards;
}

@keyframes spreadIn15 {
  100% { transform: translate(-50%, -50%); opacity: 0; }
  0% { transform: translate(-195%, 83%); opacity: 1; }
}
.image-box:nth-child(15).animate-reverse {
  animation: spreadIn15 2s ease-in forwards;
}

@keyframes spreadIn16 {
  100% { transform: translate(-50%, -50%); opacity: 0; }
  0% { transform: translate(76%, -120%); opacity: 1; }
}
.image-box:nth-child(16).animate-reverse {
  animation: spreadIn16 2s ease-in forwards;
}

@keyframes spreadIn17 {
  100% { transform: translate(-50%, -50%); opacity: 0; }
  0% { transform: translate(-180%, -199%); opacity: 1; }
}
.image-box:nth-child(17).animate-reverse {
  animation: spreadIn17 2s ease-in forwards;
}

@keyframes center3 {
  0% { transform: translate(-174%, 5vh); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(3).center {
  animation: center3 1s ease-in forwards;
}
@keyframes center4 {
  0% { transform: translate(5%, 55%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(4).center {
  animation: center4 1s ease-in forwards;
}
@keyframes center5 {
  0% { transform: translate(-125%,113%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(5).center {
  animation: center5 1s ease-in forwards;
}
@keyframes center6 {
  0% { transform: translate(120%, -180%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(6).center {
  animation: center6 1s ease-in forwards;
}
@keyframes center6 {
  0% { transform: translate(120%, -180%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(6).center {
  animation: center6 1s ease-in forwards;
}
@keyframes center7 {
  0% { transform: translaºte(-10%, -199%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(7).center {
  animation: center7 1s ease-in forwards;
}
@keyframes center8 {
  0% { transform: translate(285%, -205%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(8).center {
  animation: center8 1s ease-in forwards;
}
@keyframes center9 {
  0% { transform: translate(420%, -195%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(9).center {
  animation: center9 1s ease-in forwards;
}
@keyframes center10 {
  0% { transform: translate(420%, -33%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(10).center {
  animation: center10 1s ease-in forwards;
}
@keyframes center11 {
  0% { transform: translate(300%, 33%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(11).center {
  animation: center11 1s ease-in forwards;
}
@keyframes center12 {
  0% { transform: translate(450%, 100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(12).center {
  animation: center12 1s ease-in forwards;
}
@keyframes center13 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(13).center {
  animation: center13 1s ease-in forwards;
}
@keyframes center14 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(14).center {
  animation: center14 1s ease-in forwards;
}

@keyframes center15 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(15).center {
  animation: center15 1s ease-in forwards;
}
@keyframes center16 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(16).center {
  animation: center16 1s ease-in forwards;
}
@keyframes center17 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35% }
}
.image-box:nth-child(17).center {
  animation: center17 1s ease-in forwards;
}





@keyframes book1 {
  0% { transform: translate(-240%,-46vh); opacity: 1; }
  100% { transform: translate(17%, -45%); opacity: 1; width: 38%; }
}
.image-box:nth-child(1).book-opened {
  animation: book1 1s ease-in forwards;
}

@keyframes book2 {
  0% { transform: translate(-125%, -100%); opacity: 1; }
  100% { transform: translate(-13%, -50%); opacity: 1; width: 40%; }
}
.image-box:nth-child(2).book-opened {
  animation: book2 1s ease-in forwards;
}

@keyframes book3 {
  0% { transform: translate(-174%, 5vh); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(3).book-opened {
  animation: book3 1s ease-in forwards;
}

@keyframes book4 {
  0% { transform: translate(5%, 55%); opacity: 1; }
  100% { transform: translate(-23%, -50%); opacity: 1; width: 37%; }
}
.image-box:nth-child(4).book-opened {
  animation: book4 1s ease-in forwards;
}

@keyframes book5 {
  0% { transform: translate(-125%, 113%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(5).book-opened {
  animation: book5 1s ease-in forwards;
}

@keyframes book6 {
  0% { transform: translate(120%, -180%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(6).book-opened {
  animation: book6 1s ease-in forwards;
}

@keyframes book7 {
  0% { transform: translate(-10%, -199%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(7).book-opened {
  animation: book7 1s ease-in forwards;
}

@keyframes book8 {
  0% { transform: translate(285%, -205%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(8).book-opened {
  animation: book8 1s ease-in forwards;
}

@keyframes book9 {
  0% { transform: translate(420%, -195%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(9).book-opened {
  animation: book9 1s ease-in forwards;
}

@keyframes book10 {
  0% { transform: translate(420%, -33%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(10).book-opened {
  animation: book10 1s ease-in forwards;
}

@keyframes book11 {
  0% { transform: translate(300%, 33%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(11).book-opened {
  animation: book11 1s ease-in forwards;
}

@keyframes book12 {
  0% { transform: translate(450%, 100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(12).book-opened {
  animation: book12 1s ease-in forwards;
}

@keyframes book13 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(13).book-opened {
  animation: book13 1s ease-in forwards;
}
@keyframes book14 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(14).book-opened {
  animation: book14 1s ease-in forwards;
}

@keyframes book15 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(15).book-opened {
  animation: book15 1s ease-in forwards;
}
@keyframes book16 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(16).book-opened {
  animation: book16 1s ease-in forwards;
}
@keyframes book17 {
  0% { transform: translate(267%, -100%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 1; width: 35%; }
}
.image-box:nth-child(17).book-opened {
  animation: book17 1s ease-in forwards;
}




.image-box img {
  width: 100%;
  height: 100%;
  box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}

/* Hover Zoom */
.hover-zoom {
  transition: transform 0.2s ease;
}
.hover-zoom:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* Zoomable */
.zoomable {
  transition: all 0.3s ease-in-out;
}

/* Hidden */
.hidden {
  display: none;
}

/* Book */
.book {
  position: absolute;
  display: none;
  left: 280px;
  width: calc((100vh - 120px) * 0.71 * 2);
  height: calc(100vh - 120px);
  z-index: 9999;
  box-shadow: 12px 12px 12px rgba(0,0,0,0.3);
  border: 1px solid;
}
.book.show {
  display: block;
}
.book .turn-page {
  box-shadow: inset -5px 0px 10px rgba(0, 0, 0, 0.1);
  background-size: 100% 100%;
}

/* Book Navigation Bar */
#book-nav-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 10000;
}
#book-nav-bar button {
  background: white;
  border: none;
  color: black;
  padding: 1px 10px;
  width: 46px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #000;
}
#book-nav-bar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#slider-container {
  position: absolute;
  display: none;
  left: 280px;
  width: calc(100vw - 400px);
  height: calc(100vh - 120px);
  z-index: 9999;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid;
  background-color: black;
}

#slider-container.show {
  display: block;
}

#slides-wrapper {
  position: relative;
  width: 100%;
  height: 99.7%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes sliderFade {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
  }
}

.slides {
  overflow: hidden;
  animation-name: sliderFade;
  animation-duration: 2s;
  display: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slides img,
.slides video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: auto;
}

#slider-dot {
  width: calc(100vw - 400px);
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 1000;
}

.slider-dot {
  display: inline-block;
  border-radius: 50%;
  background: #d3d3d3;
  padding: 8px;
  margin: 5px;
}

.slider-dot.active {
  background: black;
}
#close-slider {
  position: absolute;
    top: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 18px;
    margin-left: 10px;
    cursor: pointer;
    z-index: 1001;
    border-radius: 30px;
    display: inline-block;
}

#close-slider:hover {
  background: red;
}

#slider-pdf-download svg {
  padding-top: 6px;
}
#slider-pdf-download a {
  color: black;
}
#slider-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 0.3%;
  background: red;
  transition: width linear;
}

#social-footer {
  display:none;
  opacity: 0;
  position: absolute;
  bottom: 20px;
}
#social-footer.visible {
  display: block;
  opacity: 1;
}
#social-footer ul {
    display: flex;
    justify-content: left;
    list-style: none;
    margin: 0px;
    padding: 17px 0px 0px;
}

#social-footer li {
    margin-right: 20px;
}

#social-footer .contact-email {
    margin-left: auto;
    color: rgb(255, 255, 255);
    text-decoration: none;
}

#social-footer .contact-email img {
    position: relative;
    top: -8px;
    width: 35px;
    height: 35px;
}

#social-footer .contact-instagram {
    margin-left: auto;
    color: rgb(255, 255, 255);
    text-decoration: none;
}

#social-footer .contact-instagram img {
    position: relative;
    top: -10px;
    width: 35px;
    height: 35px;
}

#social-footer .contact-youtube {
    margin-left: auto;
    color: rgb(255, 255, 255);
    text-decoration: none;
}
#social-footer .contact-youtube img {
    position: relative;
    width: 28px;
    height: 27px;
}
#social-footer .contact-ep {
    margin-left: auto;
    color: rgb(255, 255, 255);
    text-decoration: none;
}
#social-footer .contact-ep img {
    position: relative;
    top: -8px;
    width: 30px;
    height: 30px;
    border-radius: 30%;
}


.email-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  color: black;
  border-radius: 5px;
  font-size: 1.5rem;
  text-align: center;
  visibility: hidden; /* Inicialmente invisible */
  transform-origin: center; /* Para animar desde el centro */
  opacity: 0; /* Inicialmente invisible */
}

.email-text {
  font-size: 1.5rem; /* Tamaño pequeño del texto */
  opacity: 0;
}

.email-text a {
  color: black;
  text-decoration: none;
}

.email-box.animate {
  visibility: visible; /* Hacemos visible el div */
  animation: expandFromCenter 1s forwards; /* Añadimos la animación de expansión */
}

.email-text.animate {
  animation: fadeInText 1s 0.5s forwards; /* La animación del texto */
}

.custom-link {
  cursor: pointer;
  position: absolute;
  z-index: 999999999;
}

@keyframes expandFromCenter {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes fadeInText {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.burger {
  display: none;
}

#book-next-page-over {
            position: absolute;
        width: 80px;
        height: 100%;
        left: calc(100% - 80px);
        top: 0px;
        opacity: 0;
        background: #fff;
        z-index: 99;
        animation: fadeInOut 2s infinite ease-in-out;
  }
  #book-next-page-over span {
    cursor: pointer;
    font-size: 3rem;
    vertical-align: middle;
    position: absolute;
    top: 45%;
    left: 45%;
  }
.mobile-menu {
    display: none;
}
  @keyframes fadeInOut {
  0% { opacity: 0; }
  50% { opacity: 0.6; }
  100% { opacity: 0; }
}
/* Responsive ajuste para footer en pantallas estrechas */
@media (max-width: 768px) {
  #menu {
    display: none;
  }
  #social-footer.mobile {
    opacity: 1;
    position: absolute;
    bottom: 0px;
    width: 100%;
  }
  .burger {
    display: block;
    top: 29px;
    right: 20px;
    position: fixed;
  }
  .burger img {
    width: 27px;
    cursor: pointer;
  }
  
	.mobile-menu {
	    display: none;
	    position: fixed;
	    top: 0;
	    left: 0;
	    width: 100%;
	    height: 100%;
	    background-color: #fff;
	    color: #000;
	    z-index: 9999999;
	    flex-direction: column;
	    align-items: center;
	    justify-content: flex-start;
	    overflow-y: auto;
	    transition: transform 0.3s ease;
	    transform: translateX(100%);
        display: flex;
        justify-content: center;
        align-items: center;
	}
	
	.mobile-menu.open {
	    display: flex;
	    transform: translateX(0);
	}

	.mobile-menu .mobile-menu-header {
	    display: flex;
	    align-items: center;
	    justify-content: space-between;
	    width: 100%;
	        margin-top: 40px;
	    padding: 20px;
	}

	.mobile-menu .mobile-search {
	       width: calc(100% - 40px);
    margin-left: 40px;
    padding: 20px;
    border: none;
    border-bottom: 2px solid #000;
    font-size: 25px;
	}

	.mobile-menu .mobile-search:focus {
	    outline: none;
	}

	.mobile-menu .mobile-search-icon {
	       width: 24px;
    height: 24px;
    margin-left: 13px;
    position: relative;
    right: 39px;
	}

	.mobile-menu .close-btn {
	    font-size: 25px;
        cursor: pointer;
        position: absolute;
        left: 20px;
        top: 20px;
	}
	
	
	.mobile-menu ul {
    list-style: none;
}

.mobile-menu ul li {
    margin: 30px 0 30px -30px;
}

.mobile-menu ul li a {
    text-decoration: none;
    color: #000;
    font-weight: 400;
    font-size: 23px;
    line-height: 0;
}

.mobile-menu ul li:hover {
  text-decoration: underline;
}

	@keyframes slideIn {
	    from {
		transform: translateX(100%);
	    }
	    to {
		transform: translateX(0);
	    }
	}

	@keyframes slideOut {
	    from {
		transform: translateX(0);
	    }
	    to {
		transform: translateX(100%);
	    }
	}

	.mobile-menu.open {
	    animation: slideIn 0.3s forwards;
	}

	.mobile-menu.close {
	    animation: slideOut 0.3s forwards;
	}
  .content-container {
    margin-left: 0px;
    margin-top: 80px;
    padding-bottom: 120px;
    width: calc(100vw - 20px);
    height: auto;
    left: 0px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
  }
  header {
    opacity: 0;
    width: calc(100% + 20px);
    position: fixed;
    top: 0px;
    left: -20px;
    align-items: center;
    z-index: 10;
    height: 80px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px;
    background: rgb(255, 255, 255);
    transition: opacity 1s ease;
    display: flex;
    justify-content: space-between;
  }
  header.visible {
    opacity: 1;
  }
  body {
    margin: 20px;
    height: 100vh;
    height: 100svh;
    overflow: scroll;
  }
  @keyframes titleFadeOut {
  0% { opacity: 0; }
  25% { opacity: 1; }
  25% { opacity: 1; }
  25% { opacity: 1; }
  50% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

  .title {
    top: 45vh;
    width: 100%;
    animation: titleFadeOut 3s ease-in-out 0s forwards;
    transition: all 0.5s ease-in-out;
  }
  .subtitle {
    position: absolute;
        top: calc(45vh + 3.4rem);
        font-size: 3.2vw;
        animation: titleFadeOut 3s ease-in-out 0s forwards;
        transition: all 0.5s ease-in-out;

     }
  .title-small {
    transform: none;
    top: 14px;
    left: 40px;
  }
  .title-small.minimized {
    width: 50px;
  }

  .image-box {
    position: relative;
    left: 0px;
    right: 0px;
    opacity: 1;
    transform: none;
    margin-bottom: 0px;

  }
.image-box:nth-child(1).animate,
.image-box:nth-child(2).animate,
.image-box:nth-child(3).animate,
.image-box:nth-child(4).animate,
.image-box:nth-child(5).animate,
.image-box:nth-child(6).animate,
.image-box:nth-child(7).animate,
.image-box:nth-child(8).animate,
.image-box:nth-child(9).animate,
.image-box:nth-child(10).animate,
.image-box:nth-child(11).animate,
.image-box:nth-child(12).animate,
.image-box:nth-child(13).animate,
.image-box:nth-child(14).animate,
.image-box:nth-child(15).animate,
.image-box:nth-child(16).animate,
.image-box:nth-child(17).animate {
  width: 45%;
  height: calc((45%* 0.71) - 20px);
  animation: none;
}
/*
.image-box:nth-child(14).animate {
  width: 45%;
  height: calc((45%* 0.71) - 20px);
  animation: none;
  display: none;
}
*/

@keyframes hiddenImageBox {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
.image-box:nth-child(1).animate-hidden,
.image-box:nth-child(2).animate-hidden,
.image-box:nth-child(3).animate-hidden,
.image-box:nth-child(4).animate-hidden,
.image-box:nth-child(5).animate-hidden,
.image-box:nth-child(6).animate-hidden,
.image-box:nth-child(7).animate-hidden,
.image-box:nth-child(8).animate-hidden,
.image-box:nth-child(9).animate-hidden,
.image-box:nth-child(10).animate-hidden,
.image-box:nth-child(11).animate-hidden,
.image-box:nth-child(12).animate-hidden,
.image-box:nth-child(13).animate-hidden,
.image-box:nth-child(14).animate-hidden,
.image-box:nth-child(15).animate-hidden,
.image-box:nth-child(16).animate-hidden,
.image-box:nth-child(17).animate-hidden {
  animation: hiddenImageBox 1s ease-in forwards;
}

 
.book {
    top: 80px;
    left: 0px;
    width: calc(100vw - 40px);
    height: calc((100vw - 40px) / 0.71);
  }

  #book-next-page-over {
            position: absolute;
        width: 80px;
        height: 100%;
        left: calc(100% - 80px);
        top: 0px;
        opacity: 0;
        background: #fff;
        z-index: 99;
        animation: fadeInOut 3s infinite ease-in-out;
  }
  #book-next-page-over span {
    cursor: pointer;
    font-size: 3rem;
    vertical-align: middle;
    position: absolute;
    top: 45%;
    left: 45%;
  }
  .book .turn-page {
    box-shadow: none;
  }
  #book-nav-bar {
    left: 50%;
    margin-bottom: calc(env(safe-area-inset-bottom) + 8px);
    height: 42px;
    position: absolute;
    transform: translateX(-50%);
  }
  #book-nav-bar button {
    padding: 1px 10px;
}
  #slider-container {
    left: 0px;
    top: 80px;
    width: calc(100vw - 40px);
    height: calc((100vw - 40px) / 0.71);
  }
  .slider-dot {
    display: none;
  }
  #close-slider {
    margin-left: -18px!important;
    top: -40px;
    position: absolute;
    margin-left: 10px;
    z-index: 1001;
    display: inline-block;
  background: white;
  color: black;
  padding: 6px 10px;
  width: 46px;
  height: 30px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #000;
  }
     @keyframes footerFadeIn {
  0% { opacity: 0; }
  15% { opacity: 1; }
  25% { opacity: 1; }
  25% { opacity: 1; }
  50% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}
 
  .footer {
    gap: 0.25rem;
    position: absolute;
    bottom: unset;
    flex-direction: column;
    align-items: center;
    animation: footerFadeIn 7s ease-in-out 2s forwards;
    transition: all 0.5s ease-in-out;

  }
  .footer.visible {
    opacity: 0;
  }

  .desktop {
    display: none;
  }
  .mobile {
    display: block;
  }

  .logo.upm {
    margin-left: 10px;
  }
.visible {
  display: flex!important;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.chevron {
    display: none;
  position: fixed;

    bottom: 15px;
    right: 20px;
    font-size: 2.5em;
    color: #f8f8f8;
    z-index: 9;
    cursor: pointer;
    animation: bounce 1s ease-in-out infinite;
    
  }

  
.email-box.animate {
  visibility: visible; /* Hacemos visible el div */
  animation: expandFromCenter 0.1s forwards; /* Añadimos la animación de expansión */
}

.email-text.animate {
  animation: fadeInText 0.1s 0.1s forwards; /* La animación del texto */
}
.logo.fjm {
  margin-top: 10px;
}

.logo.fa {
  margin-top: 10px;
  z-index: 2;
}
.logo.ca {
  margin-top: -35px;
  z-index: 1;
}
.logo.ea {
  margin-top: -20px;
  z-index: 2;
}
#book-container {
      left: unset;
    transform: none!important;
}

@keyframes bookOpened {
  to {
    transform: translate(0%, 0%);
    opacity: 1;
    width: calc(100% - 20px)
  }
}
.image-box:nth-child(1).book-opened, 
.image-box:nth-child(2).book-opened, 
.image-box:nth-child(3).book-opened, 
.image-box:nth-child(4).book-opened, 
.image-box:nth-child(5).book-opened, 
.image-box:nth-child(6).book-opened, 
.image-box:nth-child(7).book-opened, 
.image-box:nth-child(8).book-opened, 
.image-box:nth-child(9).book-opened, 
.image-box:nth-child(10).book-opened, 
.image-box:nth-child(11).book-opened, 
.image-box:nth-child(12).book-opened,
.image-box:nth-child(13).book-opened,
.image-box:nth-child(14).book-opened,
.image-box:nth-child(15).book-opened,
.image-box:nth-child(16).book-opened,
.image-box:nth-child(17).book-opened {
  animation: bookOpened 1s ease-in forwards;
}

.image-box:nth-child(1).center,
.image-box:nth-child(2).center,
.image-box:nth-child(3).center,
.image-box:nth-child(4).center,
.image-box:nth-child(5).center,
.image-box:nth-child(6).center,
.image-box:nth-child(7).center,
.image-box:nth-child(8).center,
.image-box:nth-child(9).center,
.image-box:nth-child(10).center,
.image-box:nth-child(11).center,
.image-box:nth-child(12).center,
.image-box:nth-child(13).center,
.image-box:nth-child(14).center,
.image-box:nth-child(15).center,
.image-box:nth-child(16).center,
.image-box:nth-child(17).center {
  animation: bookOpened 1s ease-in forwards;
}

#close-container {
  bottom: 92px;
}
}

