/* ---------- ESTILOS BASE ---------- */

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  width: 100%;
  max-width: 1200px;
  /* Limitar el ancho máximo del body para mantenerlo alineado con el contenido */
  margin: 20px auto 0 auto;
  font-family: Georgia, 'Times New Roman', Times, serif;
  background-image: url(../img/corea.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  box-sizing: border-box;
  /* Asegura que el tamaño de los elementos no se vea afectado por los bordes */
}

header {
  padding: 10px 0;
  margin-bottom: 10px;
}

header,
main,
nav {
  border: 5px solid darkmagenta;
  background-color: whitesmoke;
  margin-bottom: 30px;
  box-sizing: border-box;
  /* Asegura que el borde no afecte el tamaño del elemento */
}


/* ----------- NAV ----------- */
nav {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: whitesmoke;
  border: 5px solid darkmagenta;
  height: 60px;
  margin-bottom: 30px;
}

/* ----------- UL DINS DEL NAV ----------- */
nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 50px;
  flex-wrap: wrap;
}

/* ----------- LI ----------- */
nav ul li {
  padding: 0 10px;
}

main {
  padding: 30px;
  margin-top: 30px;
}

h1 {
  text-align: center;
}

h1,
h2,
h3,
h4 {
  color: blueviolet;
  font-weight: bold;
}

.posicion {
  text-align: center;
}

ul {
  list-style-type: none;
}


.box {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 5px solid darkmagenta;
  gap: 2rem;
  text-align: center;
  flex-wrap: wrap;
}

p {
  text-align: justify;
}

/* ---------- ANIMACIONES ---------- */
@keyframes corazonCoreano {
  0% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.5) rotate(25deg);
  }

  100% {
    transform: scale(2) rotate(180deg);
  }
}

@keyframes latidoCorazon {
  0% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.2) rotate(10deg);
  }

  100% {
    transform: scale(1) rotate(360deg);
  }
}

@keyframes latir {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.animacion-gesto img {
  width: 150px;
  animation: latidoCorazon 5s infinite ease-in-out;
  display: inline-block;
  transform-origin: center center;
}

.animados.corazon {
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto;
}

.animados {
  text-align: center;
  font-size: 60px;
}

.corazon {
  display: inline-block;
  width: 100px;
  height: 100px;
  line-height: 100px;
  font-size: 80px;
  color: blueviolet;
  animation: latir 1.5s ease-in-out infinite;
  margin: 0 auto;
  -webkit-user-select: none;
  user-select: none;
}

footer p {
  font-weight: bold;
  color: rgb(249, 228, 249);
  font-size: small;
  text-align: center;
}

/* ---------- VIDEO RESPONSIVE ---------- */
.responsive-video {
  position: relative;
  padding-bottom: 56.25%;
  padding-top: 25px;
  height: 0;
  overflow: hidden;
}

.responsive-video video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ------------------- MEDIA QUERIES ------------------- */

/* Mòbils petits (fins a 480px) */
@media (max-width: 480px) {
  body {
    width: 95%;
    margin-top: 5%;
  }

  nav {
    flex-direction: column;
    height: auto;
  }

  nav ul {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
  }

  .box {
    flex-direction: column;
    padding-right: 0;
    gap: 1rem;
    justify-content: center;
    align-items: center;
  }

  .animados {
    font-size: 40px;
  }

  .corazon {
    width: 70px;
    height: 70px;
    font-size: 50px;
    line-height: 70px;
  }

  .animacion-gesto img {
    width: 100px;
  }

  footer p {
    font-size: 0.8rem;
  }
}

/* Mòbils i tauletes petites (fins a 768px) */
@media (max-width: 768px) {
  body {
    width: 90%;
    margin-top: 10%;
  }

  nav {
    flex-direction: column;
    height: auto;
  }

  nav ul {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin: 0;
  }

  div img {
    width: 70%;
  }

  .box {
    flex-direction: column;
    padding-right: 0;
    justify-content: center;
    align-items: center;
  }

  .corazon {
    width: 80px;
    height: 80px;
    font-size: 60px;
    line-height: 80px;
  }
}

/* Tauletes grans (769px a 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    width: 85%;
    margin-top: 5%;
  }

  nav {
    flex-direction: row;
    height: auto;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 0;
    margin: 0;
  }

  .box {
    flex-wrap: wrap;
    justify-content: center;
    padding-right: 0;
    gap: 1.5rem;
    align-items: center;
  }

  .animacion-gesto img {
    width: 120px;
  }
}

/* Pantalles horitzontals fins a 1024px */
@media (max-width: 1024px) and (orientation: landscape) {
  body {
    width: 95%;
    margin-top: 2%;
    font-size: 1rem;
  }

  nav {
    flex-direction: row;
    height: auto;
  }

  nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0;
    margin: 0;
  }

  .box {
    flex-wrap: wrap;
    justify-content: center;
    padding-right: 0;
    gap: 1rem;
    align-items: center;
  }

  .corazon {
    width: 80px;
    height: 80px;
    font-size: 60px;
    line-height: 80px;
  }

  .animacion-gesto img {
    width: 100px;
  }

  footer p {
    font-size: 0.9rem;
  }
}
