/* rem and em do NOT depend on html font-size in media queries! Instead, 1rem = 1em = 16px */

/**************************/
/* BELOW 2544px (Native Dev Desktop) */
/**************************/

@media (max-width: 159em) {
  html {
    font-size: 60%;
  }

  .header-name .heading-secondary {
    font-size: 4.4rem;
  }

  footer {
    font-size: 100%;
  }
}

/**************************/
/* BELOW 2288px */
/**************************/
@media (max-width: 159em) {
  .header-name .heading-secondary {
    font-size: 4rem;
  }
}

/**************************/
/* BELOW 2112px */
/**************************/

@media (max-width: 132em) {
  html {
    font-size: 58%;
  }

  .header-name .heading-secondary {
    font-size: 3.2rem;
  }
}

/**************************/
/* BELOW 1888px */
/**************************/

@media (max-width: 118em) {
  .header-name .heading-secondary {
    font-size: 2.8rem;
  }
}

/**************************/
/* BELOW 1600px */
/**************************/

@media (max-width: 100em) {
  html {
    font-size: 50%;
  }
}

/**************************/
/* BELOW 1344px (Smaller desktops) */
/**************************/

/* STARTING TO STACK ELEMENTS */

@media (max-width: 86em) {
  html {
    /* 9px / 16px  */
    font-size: 45%;
  }
  .header {
    /* background-color: red; */
  }
  .header-name .heading-secondary {
    font-size: 2.4rem;
  }

  .project-item {
    grid-template-columns: repeat(1, 1fr);
    gap: 2.4rem;
    padding: 4.8rem 2.4rem;
    /* grid-template-row: 0; */
  }

  .project-item .grid--cell,
  .project-item .grid--cell-description {
    padding: 0;
  }

  .project-item:nth-child(2) .grid--cell-description,
  .project-item:nth-child(4) .grid--cell-description {
    grid-row: 2;
  }

  .grid--project-description-cols {
    grid-template-columns: 1fr 1fr;
    /* grid-template-rows: 1fr 1fr; */
    gap: 2.4rem;
  }

  .project-info--description {
    padding-bottom: 2.4rem;
    border-bottom: 1px solid var(--color-black);
  }
}

/**************************/
/* BELOW 1200px (Landscape Tablets) */
/**************************/

@media (max-width: 75em) {
  html {
    /* 9px / 16px  */
    font-size: 38%;
  }

  .header-logo {
    margin: auto;
    padding: 0;
  }

  .header-name {
    display: none;
  }

  .footer {
    justify-content: center;
    align-items: center;
  }

  .contact-info {
    display: flex;
    flex-direction: column;
    padding: 2.4rem 0 1.2rem 0;
    gap: 0.8rem;
  }

  .social-links {
    align-self: center;
  }

  .legal-links {
    text-align: center;
  }

  .copyright {
    text-align: center;
  }

  .heading-primary {
    font-size: 8.4rem;
  }

  .main-about .grid {
    grid-template-columns: 1fr;
    gap: 0rem;
  }

  /* MOBILE NAVIGATION */
  .btn-mobile-nav {
    display: block;
    z-index: 9999;
    padding: 0 !important;
    margin: 2.4rem auto;
  }

  .btn-mobile-nav ion-icon {
    /* align-self: center; */
    margin: auto !important;
  }

  .icon-mobile-nav {
    padding: 0.8rem;
  }

  .main-nav {
    z-index: 9998;
    background-color: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(5px);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transform: translateX(-100%);
    /* margin: auto; */

    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in;

    /* Hide navigation */
    /* Allows NO transitions at all */
    /* display: none; */

    /* 1) Hide it visually */
    opacity: 0;

    /* 2) Make it unaccessible to mouse and keyboard */
    pointer-events: none;

    /* 3) Hide it from screen readers */
    visibility: hidden;
  }

  .nav-open .main-nav {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
  }

  .nav-open .icon-mobile-nav[name="close-outline"] {
    display: block;
  }

  .nav-open .icon-mobile-nav[name="menu-outline"] {
    display: none;
  }

  .main-nav-list {
    justify-items: center;
    align-items: center;
    /* gap: 4.8rem; */
    z-index: 15000;
    height: auto;
    width: 40%;
    /* background-color: red; */
  }

  .main-nav-item {
    width: 27rem;
    text-align: left;
    /* background-color: #111; */
    padding: 0.8rem !important;
    /* height: auto !important; */
    border-radius: 0.5%;
    font-size: 4.8rem;
  }
}

/**************************/
/* BELOW 944px (Tablets) */
/**************************/

@media (max-width: 59em) {
  html {
    /* background-color: yellow; */
    font-size: 35%;
  }

  .section-header {
    flex-direction: column;
    text-align: left;
    /* gap: 0rem; */
    /* padding: 0; */
    justify-content: center;
  }
  .section-header h1 {
    align-self: start !important;
    font-size: 6.4rem;
  }
  .section-header h3 {
    align-self: start !important;
  }

  .legal-links {
    flex-direction: column;
    text-align: center;
  }

  /* MOBILE NAVIGATION */
  .btn-mobile-nav {
    display: block;
    z-index: 9999;
    /* margin: 0;  */
  }

  .main-nav {
    background-color: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(5px);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transform: translateX(-100%);

    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease-in;

    /* Hide navigation */
    /* Allows NO transitions at all */
    /* display: none; */

    /* 1) Hide it visually */
    opacity: 0;

    /* 2) Make it unaccessible to mouse and keyboard */
    pointer-events: none;

    /* 3) Hide it from screen readers */
    visibility: hidden;
  }

  .nav-open .main-nav {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
  }

  .nav-open .icon-mobile-nav[name="close-outline"] {
    display: block;
  }

  .nav-open .icon-mobile-nav[name="menu-outline"] {
    display: none;
  }
}

/**************************/
/* BELOW 768px (Smaller tablets) */
/**************************/

@media (max-width: 48em) {
}

/**************************/
/* BELOW 640px (Phones) */
/**************************/

@media (max-width: 40em) {
  .header {
    padding: 2.4rem;
    margin: 0;
    /* background-color: blue; */
    width: 12%;
  }

  main {
    width: 88%;
    padding: 2.4rem;
  }

  .header-logo {
    height: 6rem;
  }

  footer .social-links {
    flex-direction: column;
  }

  .grid--2-cols,
  .grid--3-cols,
  .grid--4-cols,
  .grid--project,
  .main-about .grid {
    grid-template-columns: 1fr;
  }

  .grid--cell-spread-1to2,
  .grid--cell-spread-2to3,
  .grid--cell-spread-3to4,
  .main-about .grid {
    grid-template-columns: 1fr;
    grid-column: 1;
  }
}

/**************************/
/* BELOW 512px (Small Phones) */
/**************************/

@media (max-width: 32em) {
  .header-logo {
    height: 5rem;
  }

  .btn-mobile-nav {
    width: 5rem;
    height: 5rem;
  }

  .icon-mobile-nav {
    width: 3rem;
    height: 3rem;
  }
}

/* 
- Font sizes (px)
10 / 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 44 / 52 / 62 / 74 / 86 / 98

- Spacing system (px)
2 / 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 / 128
*/

/**************************/
/* Fixing Safari Flexbox gap */
/**************************/

.no-flexbox-gap .main-nav-list li:not(:last-child) {
  margin-right: 4.8rem;
}

.no-flexbox-gap .list-item:not(:last-child) {
  margin-bottom: 1.6rem;
}

.no-flexbox-gap .list-icon:not(:last-child) {
  margin-right: 1.6rem;
}

.no-flexbox-gap .delivered-faces {
  margin-right: 1.6rem;
}

.no-flexbox-gap .meal-attribute:not(:last-child) {
  margin-bottom: 2rem;
}

.no-flexbox-gap .meal-icon {
  margin-right: 1.6rem;
}

.no-flexbox-gap .footer-row div:not(:last-child) {
  margin-right: 6.4rem;
}

.no-flexbox-gap .social-links li:not(:last-child) {
  margin-right: 2.4rem;
}

.no-flexbox-gap .footer-nav li:not(:last-child) {
  margin-bottom: 2.4rem;
}

@media (max-width: 75em) {
  .no-flexbox-gap .main-nav-list li:not(:last-child) {
    margin-right: 3.2rem;
  }
}

@media (max-width: 59em) {
  .no-flexbox-gap .main-nav-list li:not(:last-child) {
    margin-right: 0;
    margin-bottom: 4.8rem;
  }
}
