/* Rem and em do not depend on browser font-size in media queries
1 rem = 1 em = 16px 
In some browsers rem is not working correctly for media queries, so we 
will use always "em" as measure unit*/

@media (max-width: 84em) {
  /* 1344px, close to HD ready 1366px width*/

  .hero {
    max-width: 120rem;
  }

  .container-large {
    max-width: 100rem;
  }

  .container {
    max-width: 90rem;
  }
}

/* 1200px*/
@media (max-width: 75em) {
  html {
    font-size: 62.5%;
    /* Rem size definition: 1rem = 10px - Use percentage to mantain the possibility to enlarge font in accessibility settings*/
  }

  .container-large {
    max-width: 90rem;
  }

  .container {
    max-width: 80rem;
  }
}

/* 944px*/
@media (max-width: 63em) {
  html {
    font-size: 62.5%;
    /* Rem size definition: 1rem = 10px - Use percentage to mantain the possibility to enlarge font in accessibility settings*/
  }

  .header {
    justify-content: space-between;
  }

  .header-logo {
    margin-left: 0;
  }

  .hero {
    max-width: 90rem;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* cambia da flex-start a stretch */
    gap: 4.8rem;
  }

  .hero-image-box {
    /* rimuovi concetti grid */
    width: 100%;
    margin:auto;
    /* opzionale: spostare sopra il testo
    order: 1;
    }
    .hero-text-box { order: 2; } */
  }

  .hero-image-box .hero-slider {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 10;
    /* fallback se aspect-ratio non supportato o width collassa */
    min-height: 220px;
  }

  .topic {
    align-items: center;
    max-width: 50rem;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
  }

  .topic-image-box {
    grid-column: 1;
    grid-row: 2;
  }

  .topic-description {
    margin-bottom: 0;
  }

  .about-grid {
    grid-template-columns: auto;
    grid-template-rows: auto auto;
    margin-bottom: 3.2rem;
  }
  
  .about-grid-picture {
    max-width: 80%;
    justify-self: center !important;
    margin-bottom: 1.6rem;
  }

  .about-grid:nth-child(2) {
    order: 1;
  }

  .about-grid:nth-child(1) {
    order: 2;
  }

  .carousel-box .image-carousel {
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 220px;
  }
}

/* 700px */
@media (max-width: 44em) {
  html {
    font-size: 70%;
    /* Rem size definition: 1rem = 10px - Use percentage to mantain the possibility to enlarge font in accessibility settings*/
  }

  .section-hero {
    padding-top: 1.6rem;
  }

  .hero {
    gap: 3.2rem;
  }

  .container,
  .container-large {
    padding: 1rem;
  }

  body.sticky {
    margin-top: 10rem;
  }

  /* HEADER */

  .sticky .header {
    height: 8rem;
  }

  .header-logo {
    max-height: 6rem;
  }

  .contact-box {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 2.4rem;
  }
  .contact-text-box {
    grid-column: 1;
    grid-row: 1;
  }
  .contact-form-box {
    grid-column: 1;
    grid-row: 2;
  }

  /* FOOTER */

  footer {
    padding: 0 0;
    margin: 0;
  }

  .footer-grid {
    padding: 0 1.6rem;
    gap:1.6rem;
    grid-template-columns: auto auto auto;
  }

  .copyright {
    font-size: 1.2rem;
  }

  .footer-contact-col {
    justify-self: left;
    font-size: 1.2rem;
  }

  .footer-contact-col p {
    text-align: right;
  }

  .footer-policies-col {
    font-size: 1.2rem;
    justify-self: left;
  }

  .footer-hyperlink--policy:link,
  .footer-hyperlink--policy:visited,
  .footer-hyperlink--policy:hover,
  .footer-hyperlink--policy:active {
    font-size: 1.2rem;
  }

  .footer-policies-list {
    font-size: 1.2rem;
  }

  .footer-policies-list-item {
    font-size: 1.2rem;
  }
  .footer-heading {
    font-size: 1.6rem;
  }

  .section-activities {
    padding: 0 0;
  }
}

/* 944px*/
@media (max-width: 59em) {
  .project-card {
    align-items: center;
    max-width: 50rem;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
  }

  .project-image-box {
    grid-column: 1;
    grid-row: 2;
  }

  .project-text {
    margin-bottom: 1.6rem;
  }
}

/* Flexbox gap fix for safari*/

.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;
  }
}
.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;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-carousel .slide {
    transition: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}