/*===== RESPONSIVE DESIGN - MEDIA QUERIES =====*/

/*===== Small devices (max-width: 320px) =====*/
@media screen and (max-width: 320px) {
  .home {
    row-gap: 2rem;
  }

  .home__img {
    width: 200px;
  }
}

/*===== Medium devices (min-width: 576px) =====*/
@media screen and (min-width: 576px) {
  .home {
    padding: 4rem 0 2rem;
  }

  .home__social {
    padding-top: 0;
    padding-bottom: 2.5rem;
    flex-direction: row;
    align-self: flex-end;
  }

  .home__social-icon {
    margin-bottom: 0;
    margin-right: var(--mb-4);
  }

  .home__img {
    width: 300px;
    bottom: 25%;
  }

  .about__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    text-align: initial;
  }

  .skills__container {
    grid-template-columns: 0.7fr;
    justify-content: center;
    column-gap: 1rem;
  }

  .work__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    padding-top: 2rem;
  }

  .contact__form {
    width: 360px;
    padding-top: 2rem;
  }

  .contact__container {
    justify-items: center;
  }
}

/*===== Medium-Large devices (min-width: 600px) =====*/
@media (max-width: 600px) {
  .hero__title {
    font-size: 2rem;
  }

  .hero__img,
  .about__img {
    width: 120px;
    height: 120px;
  }

  .project__card {
    width: 95vw;
    min-width: 0;
  }

  .timeline__container {
    padding-left: 1rem;
  }

  .timeline__item:before {
    left: -1.2rem;
    width: 0.7rem;
    height: 0.7rem;
  }

  .timeline__item {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 2.5rem;
    margin-bottom: 2.2rem;
    padding-left: 2.2rem;
  }

  .timeline__icon {
    margin-left: -2.5rem;
    margin-bottom: 0.7rem;
    margin-right: 0.7rem;
    margin-left: -2.2rem;
    margin-right: 1rem;
  }

  .timeline__date {
    margin-bottom: 0.5rem;
    margin-right: 0;
  }

  .timeline__content {
    padding-left: 0;
  }
}

/*===== Tablets (min-width: 768px) =====*/
@media screen and (min-width: 768px) {
  body {
    margin: 0;
  }

  .section {
    padding-top: 4rem;
    padding-bottom: 3rem;
  }

  .section-title {
    margin-bottom: var(--mb-6);
  }

  .section-title::after {
    width: 80px;
    top: 3rem;
  }

  .nav {
    height: calc(var(--header-height) + 1.5rem);
  }

  .nav__list {
    display: flex;
    padding-top: 0;
  }

  .nav__item {
    margin-left: var(--mb-6);
    margin-bottom: 0;
  }

  .nav__toggle {
    display: none;
  }

  .nav__link {
    color: var(--second-color);
  }

  .home {
    padding: 8rem 0 2rem;
  }

  .home__img {
    width: 400px;
    bottom: 10%;
  }

  .about__container {
    padding-top: 2rem;
  }

  .about__img img {
    width: 300px;
  }

  .skills__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    align-items: center;
    text-align: initial;
  }

  .work__container {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 2rem;
  }
}

/*===== Timeline alternating layout (min-width: 800px) =====*/
@media (min-width: 800px) {
  .timeline__container {
    border-left: none;
    position: relative;
    padding-left: 0;
    max-width: 900px;
  }

  .timeline__item {
    width: 48%;
    margin-bottom: 3.5rem;
    padding-left: 0;
    padding-right: 0;
  }

  .timeline__item.left {
    float: left;
    clear: both;
    margin-right: 52%;
  }

  .timeline__item.left .timeline__header {
    justify-content: flex-start;
  }

  .timeline__item.left .timeline__content {
    text-align: left;
  }

  .timeline__item.right {
    float: right;
    clear: both;
    margin-left: 52%;
  }

  .timeline__item.right .timeline__header {
    justify-content: flex-start;
  }

  .timeline__item.right .timeline__content {
    text-align: left;
  }

  .timeline__container:before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--first-color);
    border-radius: 2px;
    z-index: 0;
    transform: translateX(-50%);
  }

  .timeline__icon {
    position: relative;
  }
}

/*===== Timeline responsive (max-width: 799px) =====*/
@media (max-width: 799px) {
  .timeline__item {
    flex-direction: row;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
  }

  .timeline__icon {
    margin-right: 1rem;
    position: static;
    left: auto;
    right: auto;
    transform: none;
  }
}

/*===== General responsive (max-width: 900px) =====*/
@media (max-width: 900px) {
  .hero,
  .about__container,
  .skills__container,
  .projects__container {
    flex-direction: column;
    align-items: center;
  }

  .hero__img-wrapper,
  .about__img-wrapper {
    margin-bottom: 1.5rem;
  }

  .timeline__container {
    padding-left: 1.2rem;
  }

  .timeline__icon {
    margin-left: -2.2rem;
    margin-right: 1.1rem;
  }
}

/*===== Large devices (min-width: 992px) =====*/
@media screen and (min-width: 992px) {
  .bd-grid {
    margin-left: auto;
    margin-right: auto;
  }

  .home {
    padding: 10rem 0 2rem;
  }

  .home__img {
    width: 450px;
  }
}
