/* ==========================================================================
   Resource Hub Styles
   ========================================================================== */

[x-cloak] {
  display: none !important;
}

/* ==========================================================================
   Base / Layout
   ========================================================================== */

.resource-hub__header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 8px 34px 8px;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  position: relative;
}

.resource-hub__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.resource-hub__header h1 {
  color: #51534A;
  text-align: center;
  font-family: Comfortaa;
  font-size: 2.875rem;
  font-weight: 700;

  &::after {
    content: "";
    width: 80px;
    display: block;
    border-radius: 8px;
    margin: 10px auto;
    height: 6px;
    background-color: #93d500;
  }

  @media (max-width: 768px) {
    font-size: 2rem;
  }

  @media (max-width: 480px) {
    font-size: 1.75rem;
  }
}

.resource-hub__header-icon {
  @media (max-width: 480px) {
    width: 50px;
    height: 50px;
  }
}

.resource-hub__header-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;

  @media (max-width: 1024px) {
    gap: 20px;
  }
}


/* ==========================================================================
   Search
   ========================================================================== */

.resource-hub__search {
  /* position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%); */
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: white;
  border-radius: 100px;
  width: 100%;
  max-width: 304px;
  height: 44px;
  border: 2px solid #F0F0F0;

  @media (max-width: 768px) {
    position: static;
    height: 40px;
    max-width: 280px;
    transform: none;
  }
}

.resource-hub__search-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 16px;
}

.resource-hub__search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.resource-hub__search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: Lato;
  font-size: 1rem;
  color: #51534A;
  padding-right: 8px;
}

.resource-hub__search-input::placeholder {
  color: #999;
}

/* ==========================================================================
   Category Filter
   ========================================================================== */

/* Desktop Category Filter - Buttons */
.resource-hub__category-filter-desktop {
  display: block;

  @media (max-width: 1024px) {
    display: none;
  }
}

/* Mobile Category Filter - Select Dropdown */
.resource-hub__category-filter-mobile {
  display: none;

  @media (max-width: 1024px) {
    display: block;
    width: 304px;
  }

  @media (max-width: 768px) {
    width: 280px;
  }

  @media (max-width: 300px) {
    width: 100%;
  }
}

.resource-hub__category-select {
  width: 100%;
  padding: 12px 40px 12px 16px;
  height: 48px;
  background-color: white;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  color: #51534A;
  font-family: Lato;
  font-size: 1rem;
  font-weight: 400;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2351534A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;

  @media (max-width: 768px) {
    height: 42px;
  }
}

.resource-hub__category-filter {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
}

.resource-hub__category-filter li {
  flex: 1;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.resource-hub__category-filter li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: auto;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 30px;
  background-color: #F5F5F5;
  z-index: 0;
}

.resource-hub__category-filter button {
  padding: 0 20px;
  height: 100%;
  width: 160px;
  background-color: white;
  border: none;
  cursor: pointer;
  margin: 0;
  color: rgb(81, 83, 74);
  text-align: center;
  font-family: Lato;
  font-size: 0.875rem;
  font-weight: 400;
  border: 2px solid transparent;
}

.resource-hub__category-filter button.active {
  border: 2px solid #51534A;
  z-index: 1;
}

.resource-hub__category-filter li:first-of-type button {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.resource-hub__category-filter li:last-of-type button {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* ==========================================================================
   Content Container
   ========================================================================== */

.resource-hub__container {
  padding: 18px 16px 100px;
  max-width: 1370px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   Product / Grade Tabs
   ========================================================================== */

/* ==========================================================================
   Filters Button (Mobile)
   ========================================================================== */

.resource-hub__filters-button {
  position: relative;
  width: 100%;
  height: 40px;
  font-family: Zilla Slab;
  font-size: 1rem;
  font-weight: 400;
  display: none;
  background-color: #572c81;
  color: white;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  max-width: 280px;

  @media (max-width: 640px) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
}

.resource-hub__filters-button img {
  width: 22px;
  height: 22px;
}

.resource-hub__filters-button-badge {
  margin-left: -5px;
  margin-top: -8px;
  border-radius: 50%;
  background-color: white;
  color: #572c81;
  font-size: 0.875rem;
  font-weight: 500;
  width: 12px;
  height: 12px;
  padding: 2px;
  text-align: center;
  line-height: 10px;
}

/* ==========================================================================
   Filters Desktop (Hidden on Mobile)
   ========================================================================== */

.resource-hub__filters-desktop {
  @media (max-width: 640px) {
    display: none;
  }
}

/* ==========================================================================
   Filter Tabs
   ========================================================================== */

.resource-hub__filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  gap: 36px;
  width: 300px;
  border-bottom: 2px solid #F5F5F5;

  @media (max-width: 400px) {
    width: 100%;
    border-bottom: none;
    gap: 24px;
  }
}

.resource-hub__filter-tab {
  width: 95px;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: Lato;
  font-size: 1.25rem;
  font-weight: 400;
  color: #51534A;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding-bottom: 8px;
}

.resource-hub__filter-tab::after {
  content: '';
  position: absolute;
  margin-bottom: -4px;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-color: transparent;
  border-radius: 100px;
  transition: background-color 0.2s;

  @media (max-width: 400px) {
    height: 4px;
    margin: 0;
  }
}

.resource-hub__filter-tab.active {
  font-weight: 700;
}

.resource-hub__filter-tab.active::after {
  background-color: #93d500;
}

.resource-hub__filter-tab-text {
  position: relative;
}

.resource-hub__filter-tab-badge {
  position: absolute;
  top: -8px;
  right: -4px;
  width: 18px;
  height: 18px;
  background-color: #51534A;
  border-radius: 50%;
  color: white;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-hub__filter-content {
  padding-top: 32px;
}

/* ==========================================================================
   Product Filter
   ========================================================================== */

.resource-hub__product-filter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 12px;
  list-style: none;
  padding: 0; 
  margin: 0;

  @media (max-width: 1370px) {
    grid-template-columns: repeat(3, 1fr);
  }

  @media (max-width: 1024px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media (max-width: 768px) {
    grid-template-columns: repeat(1, 1fr);
  }
}

.resource-hub__product-filter li {
  width: 318px;
  height: 56px;

  @media (max-width: 640px) {
    width: 380px;
  }

  @media (max-width: 400px) {
    width: 100%;
  }
}

.resource-hub__product-filter button {
  width: 100%;
  height: 100%;
  padding: 18px 16px;
  border-radius: 8px;
  background: #F5F5F5;
  border: none;
  cursor: pointer;
  font-family: Comfortaa;
  font-size: .875rem;
  color: #51534A;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.resource-hub__product-filter button:hover {
  background: #f0f0f0;
}

.resource-hub__product-filter-brand {
  font-weight: 700;
  color: #572C81;
}

.resource-hub__product-filter-brand sup {
  font-size: .5rem;
}

.resource-hub__product-filter-product-name sup {
  font-size: 0.6250rem;
  padding: 1px 5px;
  font-family: Lato;
  border-radius: 3px;
  background-color: #E0DAE4;
  color: #000;
  letter-spacing: 0px;
  font-weight: 300;
}

.resource-hub__product-filter-product-count {
  font-family: Lato;
  font-weight: 400;
  color: #51534A;
}

.resource-hub__product-filter-product-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resource-hub__product-filter-product-info img {
  flex-shrink: 0;
}

.resource-hub__product-filter button.active {
  border: 2px solid #51534A;
}

/* ==========================================================================
   Grade Filter
   ========================================================================== */
.resource-hub__grade-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  width: 100%;

  @media (max-width: 1094px) {
    max-width: 880px;
  }

  @media (max-width: 912px) {
    max-width: 789px;
  }

  @media (max-width: 822px) {
    max-width: 698px;
  }

  @media (max-width: 742px) {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 100%;
  }

  @media (max-width: 542px) {
    grid-template-columns: repeat(3, 1fr);
  }

  @media (max-width: 400px) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.resource-hub__grade-filter li {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  @media (max-width: 742px) {
    width: 120px;
  }
  
  @media (max-width: 400px) {
    width: 100%;
  }
}

.resource-hub__grade-filter button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 18px 16px;
  border-radius: 8px;
  background: #F5F5F5;
  border: none;
  cursor: pointer;
  color: #51534A;
  font-family: Lato;
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
  min-width: fit-content;
  width: auto;
  box-sizing: border-box;
  overflow: visible;
  @media (max-width: 742px) {
    width: 100%;
  }
}

.resource-hub__grade-filter-name,
.resource-hub__grade-filter-count {
  flex-shrink: 0;
  white-space: nowrap;
}

.resource-hub__grade-filter-name {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100px;
  border: 1px solid #51534A;
  background-color: #E3DDEB;
  padding: 2px 8px;
  font-weight: 700;
  line-height: 20px;
  cursor: pointer;
}

.resource-hub__grade-filter button.active {
  outline: 2px solid #51534A;
}

.resource-hub__grade-filter-name {
  font-weight: 700;
}

.resource-hub__grade-filter-count {
  flex-shrink: 0;
  font-family: Lato;
  font-weight: 400;
  color: #51534A;
  white-space: nowrap;
}

/* ==========================================================================
   Results
   ========================================================================== */

.resource-hub__results {
  padding: 54px 16px 0;
  width: 100%;
  max-width: 1370px;

  @media (max-width: 1450px) {
    max-width: 924px;
  }
}

.resource-hub__results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 14px;
  row-gap: 24px;

  @media (max-width: 1450px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media (max-width: 1000px) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
}

.resource-hub__result-item {
  width: 100%;
  max-width: 448px;
  display: flex;
  justify-content: center;

  @media (max-width: 550px) {
    max-width: 100%;
  }
}

.resource-hub__load-more-toggle {
  border: none;
  background: none;
  cursor: pointer;
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 18px;
  margin-left: auto;
  margin-right: auto;
}

.resource-hub__load-more-toggle:hover {
  opacity: 0.9;
}

.resource-hub__load-more-toggle strong {
  color: #572C81;
  font-family: Zilla Slab, serif;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0;
  line-height: 29px;
  text-align: center;
}

.resource-hub__load-more-toggle img {
  transform: rotate(90deg);
}

.resource-hub__load-more-toggle-icon {
  cursor: pointer;
  height: 36px;
  width: 36px;
  border-radius: 50%;
  background-color: #572C81;
  line-height: 2.75rem;
  border: none;
}

/* ==========================================================================
   Resource Card
   ========================================================================== */

.resource-hub__resource-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  border-radius: 10px;
  background: #FFF;
  box-shadow: 0 0 23px 0 rgba(0, 0, 0, 0.07);
}

.resource-hub__resource-card-header {
  flex: 1;
  display: flex;
  width: 100%;
  padding: 20px 16px 8px;
  flex-direction: column;
  justify-content: flex-start;
  flex-shrink: 0;
  box-sizing: border-box;
  margin: 0;
  align-self: stretch;
}

.resource-hub__resource-card-header-title {
  display: flex;
  align-items: flex-start;
  margin-bottom: 5px;
  flex-shrink: 0;
  gap: 12px;
}

.resource-hub__resource-card-header-title img,
.resource-hub__resource-card-header-title svg {
  width: 17px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 5px;
}

.resource-hub__resource-card-header-title h3 {
  color: #572C81;
  font-family: Lato;
  font-size: 1.25rem;
  line-height: 1.25;
  font-style: normal;
  font-weight: 700;
  margin: 0;
  text-align: left;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;

  @media (max-width: 550px) {
    font-size: 1.125rem;
    line-height: 1.125;
  }
}

.resource-hub__resource-card-header h4 {
  padding-top: 4px;
  color: #51534A;
  font-family: Lato;
  font-size: 1rem;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  margin: 0;
  text-align: left;
  flex-shrink: 0;
}

.resource-hub__resource-card-header h4.no-subtitle {
  text-transform: capitalize;
}

.resource-hub__resource-card-icon-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 216px;
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
  padding: 44px 0;
  border-bottom: 6px solid #F5F5F5;
}

.resource-hub__resource-card-icon-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.resource-hub__resource-card-icon-container > a {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 50px;
  border-width: 2px 0 0 2px;
  border-style: solid;
  border-color: #FFFFFF;
  border-top-left-radius: 10px;
}

.resource-hub__resource-card-icon-container > a img {
  width: 11px;
  height: 13px;
  object-fit: contain;
  mix-blend-mode: normal;
}

.resource-hub__resource-card-icon-container-circle {
  width: 130px;
  height: 130px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  border-width: 3px;
  border-style: solid;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-hub__resource-card-icon-container-circle-inner {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-hub__resource-card-icon-container-circle-inner svg {
  width: auto;
  height: auto;
}

.resource-hub__resource-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 60px;
  padding: 16px 0 24px;
}

.resource-hub__resource-card-footer a {
  display: flex;
  align-items: center;
  column-gap: 5px;
  color: #646464;
  font-family: "Zilla Slab";
  font-size: 1.125rem;
  font-weight: 400;
  text-decoration: none;
}

.resource-hub__resource-card-footer a span {
  display: inline-flex;
  align-items: center;
}

.resource-hub__resource-card-footer a span img {
  width: 9px;
  height: 15px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.resource-hub__loading {
  text-align: center;
  padding: 48px 16px;
  color: #51534A;
  font-family: Lato;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-hub__loading p {
  margin: 0;
}

.resource-hub__no-results {
  text-align: center;
  padding: 48px 16px;
  color: #51534A;
  font-family: Lato;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.resource-hub__no-results-title {
  font-family: Zilla Slab;
  font-size: 1.5rem;
  font-weight: 700;
  color: #51534A;
}

.resource-hub__no-results p {
  margin: 0;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

[x-cloak] {
  display: none !important;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to main content link */
.resource-hub__skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #51534A;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
}

.resource-hub__skip-link:focus {
  top: 0;
}

/* ==========================================================================
   Filters Modal (Mobile)
   ========================================================================== */

.resource-hub__filters-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow-x: hidden;
}

.resource-hub__filters-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.resource-hub__filters-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  background-color: white;
  display: flex;
  flex-direction: column;
  z-index: 1;
  overflow: hidden;
}

.resource-hub__filters-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #F5F5F5;
  flex-shrink: 0;
}

.resource-hub__filters-modal-header h2 {
  margin: 0;
  font-family: Zilla Slab;
  font-size: 1.5rem;
  color: #51534A;
}

.resource-hub__filters-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #51534A;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.resource-hub__filters-modal-close:hover {
  background-color: #F5F5F5;
}

.resource-hub__filters-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


/* ==========================================================================
   Loader
   ========================================================================== */

.loader {
  width: 172px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  background: #c8e8b3;
  border: 4px solid transparent;
  box-sizing: border-box;
  overflow: hidden;
}

.loader .segment {
  flex: 1;
  height: 100%;
  background-color: white;
  animation: pulse 2s infinite ease-in-out;
  position: relative;
}

/* Stagger the animation */
.loader .segment:nth-child(1) { 
  animation-delay: 0s; 
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.loader .segment:nth-child(2) { 
  animation-delay: 0.5s; 
}

.loader .segment:nth-child(3) { 
  animation-delay: 1s; 
}

.loader .segment:nth-child(4) { 
  animation-delay: 1.5s; 
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

@keyframes pulse {
  0%, 100% {
    opacity: .25;
  }
  50% {
    opacity: 1;
  }
}
