/* DESKTOP */
@media (max-width: 1000px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cards-container {
    grid-template-columns: repeat(1, 1fr);
  }

  footer > div {
    flex: 0 0 100%;
    width: 100%;
  }
}

/* NAVBAR */
.menu-toggle {
  display: none;
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 1200px), ((pointer: coarse) and (hover: none)) {
  header {
    position: sticky;
    padding: 2.5rem 0 !important;
    z-index: 1003 !important;
  }

  header > img {
    top: 45% !important;
    z-index: 1004 !important;
  }

  .menu-toggle {
    display: block;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
  }

  .menu-toggle img {
    width: 28px;
    height: 28px;
    display: block;
  }

  .menu-toggle-open {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
  }

  .menu-toggle-close {
    display: none;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
  }

  .menu-toggle-open.is-hidden {
    display: none;
  }

  .menu-toggle-close.is-visible {
    display: block;
  }

  .nav-wrapper {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100dvh - 6rem);
    background: var(--white);
    padding: 28px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
  }

  .nav-wrapper.is-open {
    display: block;
  }

  .nav-wrapper nav ul {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .nav-wrapper nav ul li a {
    font-size: 1.5rem;
  }

  .nav-actions {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    position: static;
    transform: none;
  }

  .nav-actions-lang {
    display: flex;
    gap: 12px;
  }

  .nav-actions-cta {
    display: flex;
    gap: 12px;
  }

  .nav-actions p {
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #e3e3e3;
    background: #f3f3f3;
    display: inline-block;
  }

  .nav-actions .highlightparagraph {
    background: var(--white);
  }

  .nav-actions button {
    width: auto;
  }
}

/* TOUCH ONLY DEVICES */
@media (pointer: coarse) and (hover: none) {
  /* TABLET */
  @media (min-width: 601px) {
    :root {
      /* Font Size Reductions */
      --maior: var(--maior-tablet);
      --titulo: var(--titulo-tablet);
      --subtitulo: var(--subtitulo-tablet);
      --mcorpo: var(--mcorpo-tablet);
      --tx: var(--tx-tablet);
      --botnav: var(--botnav-tablet);

      /* Layout Scaling */
      --bubble-size: 160px; /* Smaller circles for narrow screens */
      --section-gap: 30px; /* Less space between text and images */
      --padding-side: 20px; /* Standard mobile gutter */
    }
    .hero p {
      display: none;
    }

    .botaored,
    .botaowhite {
      width: 50% !important;
      padding: 0.8rem !important;
    }

    .button-hero,
    .button-news {
      display: block !important;
      margin: 1rem auto !important;
      width: auto;
    }
    .cards-container {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  /* SMARTPHONE */
  @media (max-width: 600px) {
    :root {
      --maior: var(--maior-smartphone);
      --titulo: var(--titulo-smartphone);
      --subtitulo: var(--subtitulo-smartphone);
      --mcorpo: var(--mcorpo-smartphone);
      --tx: var(--tx-smartphone);
      --botnav: var(--botnav-smartphone);

      /* Layout Scaling */
      --bubble-size: 160px; /* Smaller circles for narrow screens */
      --section-gap: 30px; /* Less space between text and images */
      --padding-side: 10px; /* Standard mobile gutter */
    }

    /* Buttons Scalling */
    .botaored,
    .botaowhite {
      width: 80% !important;
      padding: 1rem !important;
    }
    .button-hero,
    .button-news {
      display: block !important;
      margin: 1rem auto !important;
    }

    .hero-home {
      text-align: center;
    }

    .hero-image-container {
      width: min(96vw, calc(var(--maior) * 11));
      max-width: calc(var(--maior) * 11);
      margin: 0 auto;
    }

    .hero p {
      display: none;
    }
    .hero img {
      height: 175px !important;
      width: 100% !important;
      object-fit: cover !important;
    }

    .departments > div {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      text-align: left;
    }

    .departments > div > img {
      width: 70px;
      aspect-ratio: 1/1;
      min-width: unset;
      margin: 0.5rem;
    }

    .departments > div > div {
      flex: 1;
      text-align: left;
    }

    .departments > div > div a {
      align-items: center;
      width: 90% !important;
      text-align: center;
      display: block;
      margin: 0 auto;
    }

    .cards-container {
      grid-template-columns: 1fr;
    }

    .sponsor-logos {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.8rem;
      justify-items: center;
      align-items: center;
    }

    .sponsor-home img {
      height: 5rem;
      margin: 0.4rem;
    }
  }

  /* NEWS CARD CHANGES */
  @media (max-width: 600px) {
    .home-news-title {
      text-align: center;
    }

    .card-news img {
      display: none;
    }

    .card-news-link-mobile {
      display: block;
      margin-top: 1rem;
      color: var(--red);
      font-family: var(--ff1);
      font-weight: var(--fw3);
      font-size: var(--tx);
      text-decoration: none;
    }
  }

  /* MUDA OS BOTOES DA NAVBAR PAR SMARTPHONE */
  @media (max-width: 600px) {
    .nav-wrapper nav ul {
      align-items: flex-start;
      text-align: left;
      width: 100%;
    }

    .nav-actions {
      align-items: flex-start;
    }

    .nav-actions-lang,
    .nav-actions-cta {
      justify-content: flex-start;
    }

    .nav-actions-cta {
      flex-direction: column;
      width: 100%;
    }

    .nav-actions button {
      display: block;
      width: 100% !important;
      margin-left: 0;
      margin-right: 0;
    }
  }
  .cards-container {
    grid-template-columns: repeat(1, 1fr);
  }
}
