@import url("https://fonts.googleapis.com/css?family=Sacramento|Dancing+Script");

/* Contenedor principal */
#card {
  width: 95%;
  max-width: 900px;
  margin: 2em auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  flex-wrap: wrap; /* para móviles */
  padding: 20px;
}

/* Lado 1: carta (sobre + corazón) */
.side.one {
  flex: 1;
  min-width: 280px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(90deg, #fff, #f7f7f7);
  position: relative;
  overflow: visible;
  top: -20px; /* subir un poco el sobre */
}
.side.one img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Lado 2: texto de la carta */
.side.two {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;


  background: linear-gradient(-90deg, #fff, #f9f9f9);
  padding: 20px;
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.2em, 2vw, 1.5em);
  line-height: 1.9;
  color: #333;
  max-height: 500px; 
  overflow-y: auto;
  align-items: center;
  text-align: justify; 
  
}
.side.two p {
  text-align: justify;
  margin-bottom: 1em;
  
}.side.two p {
  text-align: justify;
  max-width: 90%;          /* Evita que el texto se extienda demasiado */
  margin: 10px 0;
  line-height: 1.6;
  font-size: 1.2em;
}

/* Texto centrado y color del título */
#card h2 {
  font-size: clamp(2em, 4vw, 3em);
  margin-bottom: 15px;
  color: pink;
  text-align: center;
}

/* ===== CARTA ORIGINAL ===== */
body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-family: "Sacramento", cursive;
  background-color: #f1e3d3;
  overflow: hidden;
}

.valentines-day {
  position: relative;
  cursor: pointer;
}

.envelope {
  position: relative;
  filter: drop-shadow(0 0 25px rgba(0, 0, 0, 0.3));
}

.envelope:before {
  content: "";
  position: absolute;
  width: 254px;
  height: 254px;
  background-color: #ff9494;
  transform: rotate(-45deg);
  border-radius: 0 15px 0 0;
  left: -37px;
  top: -82px;
}

.envelope:after {
  content: "";
  position: absolute;
  background-color: #ff9494;
  width: 360px;
  height: 225px;
  left: -90px;
  top: 45px;
}

.heart {
  position: relative;
  background-color: #e01911;
  display: inline-block;
  height: 180px;
  top: 50px;
  left: 0;
  transform: rotate(-45deg);
  width: 180px;
  filter: drop-shadow(0 -10px 25px rgba(0, 0, 0, 0.3));
  transition: 0.5s;
}

.heart:before,
.heart:after {
  content: "";
  background-color: #e01911;
  border-radius: 50%;
  height: 180px;
  width: 180px;
  position: absolute;
}

.heart:before {
  top: -100px;
  left: 0;
}

.heart:after {
  left: 100px;
  top: 0;
}

.front {
  position: absolute;
  width: 0;
  height: 0;
  border-right: 190px solid #fbd2d2;
  border-top: 113px solid transparent;
  border-bottom: 113px solid transparent;
  top: 44px;
  left: 80px;
  z-index: 4;
}

.front:before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-left: 190px solid #fbd2d2;
  border-top: 113px solid transparent;
  border-bottom: 113px solid transparent;
  top: -113px;
  left: -170px;
}

.front:after {
  width: 0;
  height: 0;
  position: absolute;
  content: "";
  border-bottom: 150px solid #fce7e9;
  border-right: 180px solid transparent;
  border-left: 180px solid transparent;
  top: -36px;
  left: -170px;
}

.text {
  position: absolute;
  font-family: arial;
  letter-spacing: 3.5px;
  text-align: center;
  color: white;
  z-index: 2;
  top: 80px;
  left: 15px;
  transition: 0.5s;
}

.valentines-day:hover .heart {
  transform: translateY(-50px) rotate(-45deg);
}

.valentines-day:hover .text {
  transform: translateY(-50px);
}

/* ===== RESPONSIVE MÓVIL ===== */
@media only screen and (max-width: 700px) {
  #card {
    flex-direction: column; 
    align-items: center;
  }
  .side {
    width: 100%;
    min-width: unset;
  }
  .side.two {
    max-height: 300px;
  }
  #card p {
    font-size: 1.2em;
    padding: 0 10px;
  }
  .side.one img {
    max-height: 250px;
  }
}
