/* --- Header --- */
header {
  position: fixed;
  height: 10rem;
}

header.mobile-nav-closed {
  animation: delayTriggerBoxShadow ease-out 500ms;
  animation-fill-mode: forwards;
}

header,
#navLists .header-nav {
  font-size: 2.2rem;
  width: 100vw;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  padding: 1rem 4rem;
  background-color: var(--color-primary);
  color: var(--color-dark);
  overflow-x: hidden;
}

header nav {
  justify-content: space-between;
  height: 100%;
  position: relative;
  overflow-y: visible;
}

header .central-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-55%);
}

header ul,
nav ul {
  list-style-type: none;
}

nav a {
  text-decoration: none;
  color: var(--color-dark);
  position: relative;
  transition: color 0.3s ease-in-out;
}

nav a,
nav button {
  margin: 0 0.7rem;
}

nav a:hover {
  color: var(--color-secondary);
}

/* --- Footer --- */
footer {
  font-size: 2.2rem;
  width: 100vw;
  transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  padding: 2rem 15rem 2rem 12rem;
  color: var(--color-primary);
  background-color: var(--color-secondary);
  box-shadow: 0 0 2rem var(--color-grey);
  height: 7rem;
  margin-top: auto;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  z-index: 1000;
}

footer .social-media {
  gap: 2rem;
  list-style-type: none;
}

footer .social-media li a {
  color: var(--color-secondary-light);
}

footer .social-media li.left {
  transform: translateX(-1rem);
}

footer .social-media li.right {
  transform: translateX(1rem);
}

footer .social-media li:hover {
  transform: scale(1.4);
}

/* --- Responsive --- */
.bars {
  width: 3rem;
  height: 3rem;
  justify-content: center;
  align-self: center;
}

.bar {
  position: absolute;
  width: 100%;
  height: 0;
  border: 0.17rem solid var(--color-secondary);
  border-radius: 1.5rem;
}

.bar:nth-child(1) {
  top: 0.7rem;
}

.bar:nth-child(2) {
  top: 1.6rem;
}

.bar:nth-child(3) {
  top: 2.5rem;
}

.bars.x-mark .bar {
  top: 50%;
}

.bars.x-mark .bar:nth-child(1) {
  transform: rotate(45deg);
}

.bars.x-mark .bar:nth-child(2) {
  opacity: 0;
  border: none;
}

.bars.x-mark .bar:nth-child(3) {
  transform: rotate(-45deg);
}

@media (max-width: 600px) {
  header {
    padding: 1.5rem 5rem;
  }

  header.mobile-nav {
    box-shadow: none;
  }

  header nav {
    height: 7rem;
  }

  header .header-nav {
    display: none;
  }

  #bars {
    display: flex;
    visibility: visible;
    opacity: 1;
    transform: scale(1);
    cursor: pointer;
  }

  #navLists {
    height: fit-content;
    position: fixed;
    z-index: 100;
    top: -50vh;
    left: 0;
    width: 100%;
    gap: 0;
    padding: 1.5rem 5rem;
    border-radius: 0 0 2rem 2rem;
    background-color: var(--color-primary);
  }

  #navLists.show {
    display: flex;
    animation: scrollDown ease-out 500ms, delayTriggerBoxShadow linear 900ms;
    animation-fill-mode: forwards;
  }

  #navLists.hide {
    animation: scrollUp ease-in 500ms;
    animation-fill-mode: forwards;
  }

  #navLists .header-nav {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 2rem 5rem;
    gap: 1.5rem;
    font-size: 3rem;
    width: 100%;
  }

  #navLists .header-nav:first-child {
    margin-top: 1rem;
  }

  #navLists .header-nav:not(:last-child) {
    border-bottom: 0.1rem solid var(--color-secondary);
  }

  footer {
    padding: 1.5rem 5rem;
  }
}

/* --- Animations ---  */
@keyframes scrollDown {
  from {
    top: -50vh;
  }
  to {
    top: 10rem;
  }
}

@keyframes scrollUp {
  0% {
    top: 10rem;
    display: flex;
  }
  99% {
    top: -50vh;
    display: flex;
  }
  100% {
    display: none;
  }
}

@keyframes delayTriggerBoxShadow {
  0% {
    box-shadow: none;
  }
  40% {
    box-shadow: none;
  }
  100% {
    box-shadow: 0.5rem 0.5rem 1rem var(--color-grey);
  }
}
