/* jQuery and flex boxes 2021 */
/* Write the rules of style in an orderly and optimal way */
@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:wght@500&family=Lobster&display=swap");

/*
Paleta de colores
https://coolors.co/27187e-758bfd-aeb8fe-f1f2f6-ff8600-000000
*/

:root {
  --negro: #000000;
  --naranja: #ff8600;
  --blanco: #f1f2f6;
  --azul-claro: #aeb8fe;
  --azul: #758bfd;
  --azul-oscuro: #27187e;
}

*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  display: grid;
  background-color: var(--azul-claro);
  height: 100vh;
  width: 99%;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--azul-oscuro);
  color: var(--naranja);
  height: 12vh;
  font-family: "Lobster", cursive;
  font-size: 0.4rem;
  min-height: 22vw;
  width: 100vw;
}

header * {
  text-align: center;
}

header img {
  height: 22vw;
  object-fit: contain;
  margin: 5px;
}

header img:nth-of-type(1) {
  position: relative;
  animation: animacion forwards 10s;
}

nav {
  display: flex;
  justify-content: space-around;
  margin: 20px auto;
  height: 7vh;
  min-width: 250px;
}

nav p {
  text-align: center;
  padding: 5px;
  width: 30vw;
  margin: 5px;
  color: var(--naranja);
  background-color: var(--negro);
  font-size: 4vw;
  box-shadow: 2px 2px 2px rgb(65, 64, 64);
}

nav p:hover {
  color: var(--negro);
  background-color: var(--naranja);
}

main {
  width: 100%;
  display: grid;
}

section {
  background-color: var(--naranja);
  padding: 7px;
  margin: 0 auto 15px auto;
  min-height: 320px;
  height: auto;
  width: 95%;
  display: flex;
  font-size: 14px;
  align-items: center;
  flex-direction: column;
  font-family: "EB Garamond", serif;
  box-shadow: 2px 2px 2px rgb(65, 64, 64);
  position: relative;
  z-index: 1001;
}

section:nth-child(even) {
  background-color: var(--blanco);
}

section p {
  margin-bottom: 10px;
  text-align: justify;
}

a {
  bottom: 50px;
  margin-top: 20px;
  text-decoration: none;
  padding: 5px;
  border: 1px solid var(--azul-claro);
  border-radius: 25px;
  transition: 2s;
  background-color: var(--blanco);
}

section:nth-child(even) a {
  background-color: var(--negro);
  color: var(--blanco);
}

section > a + div {
  top: 0;
  left: 0;
  position: absolute;
  display: none;
  width: 100%;
  height: 100%;
}

section > div > img:nth-child(1) {
  position: absolute;
  object-fit: cover;
  width: 100%;
  height: 100%;
  border: 2px solid white;
  top: 0;
  left: 0;
  z-index: 1000;
}

section > div > img:nth-child(2) {
  position: absolute;
  top: 16px;
  right: 16px;
  height: 20px;
  z-index: 1000;
}

footer {
  background-color: var(--azul-oscuro);
  color: var(--naranja);
  height: 7vh;
  min-height: 40px;
  font-size: 0.5rem;
}

footer::after {
  content: "";
  clear: both;
  display: table;
}

footer h3 {
  float: left;
  line-height: 50px;
}

footer h3:nth-child(2) {
  float: right;
}

/* Tablets*/
@media screen and (min-width: 600px) and (max-width: 899px) {
  body {
    row-gap: 10px;
  }

  header {
    font-size: 1rem;
    min-height: 10vw;
  }

  header img {
    height: 10vw;
  }

  main {
    grid-template-columns: repeat(2, 1fr);
  }

  nav p {
    min-height: 40px;
  }

  section {
    width: 98%;
  }

  section a {
    position: absolute;
    bottom: 20px;
  }

  section:nth-child(3) {
    grid-column: span 3;
  }

  footer {
    font-size: 0.7rem;
  }
}

/* PC */
@media screen and (min-width: 900px) {
  body {
    /* width: 100vw; */
    grid-template-columns: 1fr 8fr;
    column-gap: 100px;
  }

  header {
    grid-column: span 2;
    min-height: 100px;
    font-size: 1.6rem;
    height: 13vh;
  }

  header img {
    width: 6vw;
  }

  nav {
    min-width: 0px;
    flex-direction: column;
    height: 90%;
  }

  nav p {
    font-size: 1.5rem;
    width: 150px;
    height: 20%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  main {
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 1fr 1fr;
    height: 75vh;
    width: 78vw;
    margin: 1vh;
  }

  section {
    margin: 0;
    width: 90%;
  }

  section h2 {
    font-size: 2.5rem;
  }

  section p {
    font-size: 0.7rem;
  }

  section a {
    position: absolute;
    bottom: 20px;
  }

  footer {
    grid-column: span 2;
    height: 10vh;
    min-height: 70px;
    font-size: 1.2rem;
    width: 100vw;
  }
}

@keyframes animacion {
  from {
    transform: scale(0.3);
    opacity: 0;
    left: 80%;
  }
  to {
    transform: scale(1);
    opacity: 1;
    left: 0;
  }
}
