/* Conteúdo Ranking Alimentos */

.content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 20px;
}

h1 {
  font-size: 1.5rem;
  color: #2a1a1f;
}

@media screen and (min-width: 992px) {
  h1 {
    font-size: 2rem;
  }
}

.ranked-foods {
  display: flex;
  flex-direction: column;
}

.ranked-foods h4 {
  margin-top: 40px;
}

.bibliographic-source {
  font-size: 0.875rem;
  color: #2a1a1f;
  margin-top: 10px;

  a {
    color: #a1c643;
    text-decoration: none;
    font-weight: bold;
  }
}

.cards-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px 0px;
}

@media screen and (min-width: 992px) {
  .cards-wrapper {
    flex-direction: row;
  }
}

.ranked-card {
  background: #fffdfd;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 0, 0.1, 0.2);
  padding: 10px;
  margin-top: 1rem;
  height: 400px;
  width: 100%;
  gap: 20px;

  .ranked-card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    .rank-position-label {
      color: #2a1a1f;
      font-size: 2rem;
      margin-bottom: 0.75rem;
    }

    h5 {
      font-size: 2rem;
      color: #2a1a1f;
    }

    .ranked-card-image {
      width: 250px;
      height: 200px;
      object-fit: contain;
    }
  }

  .ranked-card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 10px;

    p {
      font-size: 20px;
      color: #2a1a1f;
    }
  }
}

@media screen and (min-width: 992px) {
  .ranked-card {
    transition: transform 0.4s;
    &:hover {
      transform: scale(1.05);
    }
  }

  .ranked-card:nth-child(2) {
    order: -1;
  }

  .highlighted-card {
    height: 450px;
    &:hover {
      border: 2px solid #a1c643;
    }
  }
}

/* Ranked Table */

.ranked-table {
  width: 100%;
  padding-bottom: 40px;
  background-color: #fff5;
  backdrop-filter: blur(7px);
  box-shadow: 0 0.4rem 0.8rem #0005;
  border-radius: 0.8rem;
  overflow: hidden;
  margin-top: 2rem;
  padding: 2rem;
}

.table-header {
  flex-direction: column;
  padding-bottom: 20px;
  display: flex;
}

@media screen and (min-width: 992px) {
  .table-header {
    width: 100%;
    background-color: #fff4;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .filter-buttons {
    margin-top: 0;
    width: 40%;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.table-header h3 {
  font-size: 1.25rem;
  color: #2a1a1f;
}

.table-title {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.table-title p {
  font-size: 0.875rem;
  color: #2a1a1f;
  opacity: 0.8;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  overflow: auto;
  padding-bottom: 1rem;
}

.filter-buttons::-webkit-scrollbar {
  width: 0.3rem;
  height: 0.3rem;
}

.filter-buttons::-webkit-scrollbar-thumb {
  background-color: #0004;
  border-radius: 0.3rem;
  visibility: hidden;
}

.filter-buttons span {
  font-size: 14px;
  color: #2a1a1f;
  background-color: #a1c643;
  display: flex;
  align-items: center;
  padding: 0.375rem 1rem;
  max-height: 36px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.filter-buttons span:hover {
  background-color: #a1c643e0;
}

table,
th,
td {
  padding: 1rem;
  border-collapse: collapse;
  text-align: center;
}

.table-body {
  width: 100%;
  max-height: calc(89% - 1.6rem);
  background-color: #fffb;
  border-radius: 0.6rem;
  overflow: auto;
}

.table-body::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

.table-body::-webkit-scrollbar-thumb {
  background-color: #0004;
  border-radius: 0.5rem;
  visibility: hidden;
}

.table-body:hover::-webkit-scrollbar-thumb {
  visibility: visible;
}

table {
  width: 100%;
}

thead {
  background-color: #d5d1defe;
  position: sticky;
  top: 0;
}

thead th {
  font-weight: 500;
}

.active-header {
  background-color: #e2ebcbe0;
  font-weight: bold;
}

.active-header:hover {
  background-color: #a1c643;
  transition: background-color 0.6s;
}

tbody tr:nth-child(even) {
  background-color: #0000000b;
}

tbody tr:hover {
  background-color: #e2ebcbe0;
}

tbody td {
  min-height: 20px;
}

@media screen and (min-width: 992px) {
  tbody td {
    height: 71px;
  }

  tbody tr td {
    font-size: 0.875rem;
  }

  td:not(:first-of-type) {
    min-width: 6rem;
  }

  td:first-of-type {
    font-size: 1rem;
  }
}

@media (max-width: 1000px) {
  td:not(:first-of-type) {
    min-width: 4rem;
  }
}

.access-all-foods-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 40px;

  a {
    font-size: 1rem;
    font-weight: 600;
    color: #2a1a1f;
    text-decoration: none;
    background-color: #a1c643;
    padding: 0.7rem 2rem;
    border-radius: 20px;
    transition: background-color 0.3s;
  }

  a:hover {
    background-color: #a1c643e0;
  }
}
