#filter-by {
  color: #fff;
  max-width: 1440px;
  position: relative;
}

.rm-filter-wrapper {
  min-width: 350px;
  margin-bottom: 100px;

  @media (max-width: 768px) {
    width: 100%;
    margin-bottom: 40px;
  }
}

.dropdown.rm-filter {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

#filter-by .filter-menu {
  padding: 0;
  margin: 0;
}

#filter-by .filter-menu li {
  font-size: 16px;
  font-style: normal;
  list-style: none;
  margin-bottom: 28px;
}

.rm-filter-wrapper .rm-filter h3 {
  font-size: clamp(28px, 24px + 1vw, 32px);
  font-style: normal;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0 !important;
}

.rm-filter-wrapper .rm-filter #filter-btns-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;

  @media (max-width: 768px) {
    justify-content: start;
    overflow-x: scroll;
    padding-bottom: 1rem;
    scrollbar-color: rgba(255, 255, 255, 0.6) transparent;
    scrollbar-width: thin;
  }
}

/* Grouped results — sub-header sections for hierarchical taxonomies */
.filter-results-group {
  grid-column: 1 / -1;
}

.filter-results-group-label {
  font-size: clamp(28px, 24px + 1vw, 32px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 40px;
  text-align: center;
}

.filter-results-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 50px;
}

@media screen and (max-width: 640px) {
  .filter-results-group-grid {
    gap: 40px;
  }
}

.rm-filter-wrapper .rm-filter #filter-btns-container button {
  border-radius: 6px;
  padding: 12px 8px;
  font-size: 16px;
  font-weight: 400;
  background: #00bedd;
  color: #0c0a08;
  border: none;
  text-wrap: nowrap;
}

.rm-filter-wrapper .rm-filter #filter-btns-container button.active {
  background: #fff;
}

.rm-filter-results.grid-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 50px;
}

.rm-filter-results {
  @media screen and (max-width: 1024px) {
    position: relative;
    padding-top: 40px;
  }
}

.rm-filter-results.is-loading {
  opacity: 0.5;
}

.rm-filter-results > a {
  padding: 8px;
  border-radius: 4px;
}

.rm-filter-results > a:hover {
  background: #1aa0db;
}

.rm-meta-info {
  display: flex;
  align-items: flex-end;
  flex-grow: 1;
  gap: 8px;
  flex-wrap: wrap;
}

.rm-meta-info .rm-term {
  font-size: 15px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
}

@media screen and (max-width: 1024px) {
  #filter-by {
    flex-direction: column;
    gap: 20px;
  }

  .rm-filter-wrapper {
    display: flex;
    flex-direction: column;
  }

  .dropdown.rm-filter {
    margin-bottom: 5px;
  }

  #filter-by .filter-menu {
    display: inline;
    margin-top: 24px;
  }

  #filter-by .filter-menu li {
    list-style: none;
    margin-right: 16px;
    margin-bottom: 0;
    float: left;
  }
}

@media screen and (max-width: 640px) {
  .rm-filter-results.grid-cols {
    gap: 40px;
  }
}

/* Articles styles */

.rm-filter-results {
  width: 100%;
  text-align: center;
}

#featured-results {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(424px, 1fr));
  margin-bottom: 80px;
}

#featured-results.active {
  display: grid;
}

@media screen and (max-width: 640px) {
  #featured-results {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

#featured-results .article-info {
  margin-bottom: 30px;
}

#featured-results .team-link a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #00bedd;
}

.rm-filter-results .article-content {
  width: 100%;
  border: none;
  margin-bottom: 20px;
}

.rm-filter-results .article-content .team-image-container {
  position: relative;
  height: auto;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background-color: #fff;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 30px;
}

.rm-filter-results .team-image-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 200px;
  width: 200px;
  background: transparent;
  z-index: 40;
  transition: 0.3s all ease;
  pointer-events: none;
}

.rm-filter-results#featured-results .team-image-container::after {
  height: 424px;
  width: 424px;
}

.rm-filter-results .article-content:hover .team-image-container::after {
  background: #00beddb2;
}

.rm-filter-results#featured-results .article-content .team-image-container {
  max-width: 424px;
}

.rm-filter-results .article-content picture {
  width: 100%;
  height: 100%;
}

.rm-filter-results .article-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rm-filter-results .article-content .article-info > a {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rm-filter-results .article-content .article-info a * {
  color: #fff;
  text-align: center;
  transition: 0.3s all ease;
}

.rm-filter-results .article-content .article-info a:hover * {
  color: #00bedd;
}

.rm-filter-results .article-content .article-info .filtered-post-title {
  margin-top: 0;
  margin-bottom: 0;
}

.rm-filter-results .article-content .article-info .filtered-post-title a {
  font-size: 18px;
  font-weight: 700;
  line-height: 38px;
  color: #fff;
  transition: 0.3s all ease;
}

.rm-filter-results .article-content:hover .article-info .filtered-post-title a {
  color: #00bedd;
}

.rm-filter-results#featured-results
  .article-content
  .article-info
  .filtered-post-title
  a {
  font-size: 28px;
}

.rm-filter-results .filtered-post-position {
  font-size: 14px;
  text-transform: uppercase;
  line-height: 22px;
  margin-top: 0;
  margin-bottom: 0;
  transition: 0.3s all ease;
}

.rm-filter-results .article-content:hover .filtered-post-position {
  color: #00bedd;
}

@media screen and (max-width: 640px) {
  .rm-filter-results.articles .article-content img {
    max-width: 100%;
  }

  .rm-filter-results.articles .article-content {
    flex-direction: column;
  }
}

/*NO FILTER STYLES*/
.rm-no-filter-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2%;
  max-width: 100%;
  flex-wrap: wrap;
}

.rm-no-filter-container a {
  margin-bottom: 20px;
  padding: 8px;
  border: 1px solid #f0f0f1;
  border-radius: 5px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.rm-no-filter-container .filtered-post-permalink {
  margin-top: 10px;
  border: none;
  padding: 0px;
}

.rm-no-filter-container.grid-1 a {
  width: 100%;
}

.rm-no-filter-container.grid-2 a {
  width: 48%;
}

.rm-no-filter-container.grid-3 a {
  width: 32%;
}

.rm-no-filter-container.grid-4 a {
  width: 23%;
}

.rm-no-filter-container .article-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rm-no-filter-container .filtered-post-title {
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
}

.rm-no-filter-container .filtered-post-position {
  font-size: 15px;
  font-style: normal;
  font-weight: 400;
}

@media screen and (max-width: 1024px) {
  .rm-no-filter-container.grid-3 a {
    width: 48%;
  }

  .rm-no-filter-container.grid-4 a {
    width: 48%;
  }
}

@media screen and (max-width: 640px) {
  .rm-no-filter-container.grid-1 a {
    width: 100%;
  }

  .rm-no-filter-container.grid-2 a {
    width: 100%;
  }

  .rm-no-filter-container.grid-3 a {
    width: 100%;
  }

  .rm-no-filter-container.grid-4 a {
    width: 100%;
  }
}

.rm-podcast {
  display: block;
  height: 30px;
  background: #353535;
  margin-top: 20px;
  margin-bottom: 20px;
}

.pagination {
  grid-column: 1/-1;
}

.filtered-post-image {
  display: none;
}

/* Loading spinner */
.rm-loading {
  position: absolute;
  top: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px 0;
  z-index: 20;
}

.rm-loading.is-append {
  top: 98%;
}

.rm-loading .spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #00bedd;
  border-radius: 50%;
  animation: rm-spin 0.8s linear infinite;
}

@keyframes rm-spin {
  to {
    transform: rotate(360deg);
  }
}

.rm-filter-results .filtered-post-image {
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  position: relative;
}

.toggle-icon {
  display: none;
}

/*Hide or show the filter on mobile*/
@media (max-width: 768px) {
  .filter-menu.hidden {
    display: none !important;
  }

  /* Ensure the show class makes the dropdown visible */
  .filter-menu.show {
    display: inline !important;
  }

  /* Style the toggle icon (+/-) */
  .toggle-icon {
    cursor: pointer;
    float: right;
    font-weight: bold;
    font-size: 18px;
    display: block;
  }
}

/* Ensure the filter-menu is always visible on larger screens (desktop) */
@media (min-width: 769px) {
  .filter-menu {
    display: block;
  }
}
