@import url("https://fonts.googleapis.com/css2?family=Pacifico&display=swap");

.background-img {
  margin: 0;
  padding: 0;
  background-image: url("../images/background.jpg"); /* Update this path to your actual image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  transition: background-image 1s ease-out;
  min-height: -webkit-fill-available; /* Soluciona el corte en iOS */
  height: 100vh;
  width: 100vw;
}
/* Asegurar que el contenedor principal sea responsivo */
.container-index {
  display: grid;
  align-content: center;
  place-items: center;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px;
  box-sizing: border-box;
}

.invitation-instructions {
  padding-top: 4em; /* Reducido de 8em */
  text-align: center;
  color: #333;
  width: 90%;
  margin: 0 auto;
}

.invitation-instructions h3 {
  margin: 0;
  font-family: "Pacifico", cursive;
  font-size: calc(2em + 1vw);
  margin-bottom: 15px;
  font-weight: 100;
  color: #0b2f47;
  text-shadow: 2px 2px 2px rgb(231, 231, 231);
  text-transform: capitalize;
}

.invitation-instructions p {
  font-size: calc(1em + 0.5vw); /* Tamaño responsivo */
  line-height: 1.5;
  font-family: "Times New Roman", Times, serif;
  font-style: oblique;
  font-weight: 500;
}

.center,
.envelope-wrapper .letter,
.container-index {
  place-items: center;
}

.envelope-wrapper {
  width: 90%;
  max-width: 800px;
  margin: 3vh auto;
  aspect-ratio: 16/11;
  position: relative;
  cursor: pointer;
  outline: none;
  background-color: #f5f5dc;
  box-shadow: 0 0 10px #999;
  border-radius: 20px;
}
.envelope-wrapper .envelope {
  width: 100%;
  height: 0;
  position: relative;
  border-top: calc(600px / 2) solid transparent;
  border-bottom: calc(600px / 2) solid #dfdab9;
  border-right: calc(800px / 2) solid #eae6ca;
  border-left: calc(800px / 2) solid #eae6ca;
  z-index: 2;
  border-radius: 20px;
}
.envelope-wrapper .opened-envelope {
  width: 0;
  height: 0;
  position: absolute;
  border-top: calc(800px / 2.3) solid #f5f5dc;
  border-bottom: none;
  border-right: calc(800px / 2) solid transparent;
  border-left: calc(800px / 2) solid transparent;
  z-index: 3;
  border-radius: 20px;
}
.envelope-wrapper .letter {
  position: absolute;
  margin: 10px;
  width: calc(800px - 20px);
  height: calc(600px - 20px);
  color: #3a3a3a;
  font-size: clamp(16px, 2vw, 22px);
  font-style: italic;
  z-index: 1;
  background-color: #fff;
  box-shadow: 0 0 20px #9999998f;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 480px;
  border-radius: 20px;
}

.letter h1,
.letter p {
  font-family: "Pacifico", cursive; /* Aplica la fuente Pacifico */
  margin: 0; /* Elimina los márgenes predeterminados */
}

.letter h1 {
  font-size: 3.5em; /* Ajusta el tamaño según tus preferencias */
  margin-bottom: 25px;
}

.letter p {
  font-size: 1.3em; /* Ajusta el tamaño según tus preferencias */
  font-family: "Times New Roman", Times, serif;
  font-style: oblique;
  font-weight: 500;
  line-height: 1.5;
}

.fade-transition {
  transition: opacity 1s ease-out;
}

#index-content,
#invitation-content {
  transition: opacity 1s ease-in-out;
}

#invitation-content {
  visibility: hidden;
  opacity: 0;
}

@media screen and (max-width: 699px) {
  .background-img {
    background-position: center; /* Mejor posicionamiento en móviles */
  }

  .invitation-instructions {
    padding-top: 2em;
  }
  .envelope-wrapper {
    margin-bottom: 4em;
    max-width: 280px;
  }

  .envelope-wrapper .envelope {
    width: 100%;
    max-width: 300px;
    height: 200px;
    margin: 0 auto;
    border-top: calc(200px / 2) solid transparent;
    border-bottom: calc(200px / 2) solid #dfdab9;
    border-right: calc(300px / 2) solid #eae6ca;
    border-left: calc(300px / 2) solid #eae6ca;
  }
  .envelope-wrapper .opened-envelope {
    border-top: calc(300px / 2.5) solid #f5f5dc;
    border-right: calc(300px / 2) solid transparent;
    border-left: calc(300px / 2) solid transparent;
  }
  .envelope-wrapper .letter {
    width: calc(300px - 20px);
    height: calc(200px - 20px);
    min-height: 180px;
    padding: 15px;
  }
  .invitation-instructions h3 {
    font-size: clamp(2.5rem, 4vw, 3rem);
    margin-bottom: 15px;
    margin-top: 2em;
    line-height: 1.5;
  }

  .invitation-instructions p {
    font-size: 1.3em;
    line-height: 1.5;
  }

  .letter h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin-bottom: 10px;
  }

  .letter p {
    font-size: 0.8em;
    line-height: 1.4;
  }
}
@media (min-width: 700px) and (max-width: 1024px) {
  .background-img {
    background-position: center top;
  }

  .envelope-wrapper {
    max-width: 600px;
    margin-top: 8vh;
  }

  .letter p {
    font-size: 1.1rem;
  }

  .invitation-instructions {
    padding-top: 6vh;
  }
}
/* Ajustes para pantallas muy pequeñas */
@media screen and (max-width: 320px) {
  .invitation-instructions h3 {
    font-size: 1.5em;
  }

  .invitation-instructions p {
    font-size: 0.9em;
  }

  .letter h1 {
    font-size: 1.5em;
  }

  .letter p {
    font-size: 0.9em;
  }
}
/* Añadir este nuevo media query específico para iPad */
@media (min-width: 760px) and (max-width: 1024px) and (orientation: portrait) {
  .envelope-wrapper .opened-envelope {
    width: 0;
    height: 0;
    position: absolute;
    border-top: calc(600px / 1.8) solid #f5f5dc;
    border-bottom: none;
    border-right: calc(600px / 2) solid transparent;
    border-left: calc(600px / 2) solid transparent;
    z-index: 3;
    border-radius: 20px;
  }
  .envelope-wrapper .envelope {
    width: 100%;
    height: 0;
    position: relative;
    border-top: calc(600px / 2) solid transparent;
    border-bottom: calc(300px / 2) solid #dfdab9;
    border-right: calc(600px / 2) solid #eae6ca;
    border-left: calc(600px / 2) solid #eae6ca;
    z-index: 2;
    border-radius: 20px;
  }
  .invitation-instructions {
    padding-top: 20vh;
  }
  .envelope-wrapper {
    max-width: 600px;
    margin-top: 0;
    margin-bottom: 20vh;
  }
  .envelope-wrapper .letter {
    width: calc(600px - 20px);
    height: calc(460px - 20px);
    min-height: 440px;
  }
  .letter h1 {
    font-size: 2.5em;
  }

  .letter p {
    font-size: 1.8em;
  }
  .invitation-instructions h3 {
    font-size: 2.5em;
  }

  .invitation-instructions p {
    font-size: 2em;
  }
}
