/* FILTER BAR */

#resources-filter-bar .filter-dropdown {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.dropdown-option {
  cursor: pointer; 
}

.dropdown-label {
  display: flex;
  gap: 8px;
}

#resources-clear-filters, .filters-label {
  text-transform: uppercase;
  padding: 8px 15px;
}

/* RESOURCES ARCHIVE */

.resource-grid {
  display: grid;
  gap: 35px;
}

/* Container for each resource item, most styles in media queries */
.resource-item {
  display: flex;
}

/* Left column: Featured image */
.resource-image {
  width: 381px;
  height: 381px;
  overflow: hidden;
  border-radius: 5px;
}

.resource-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Right column: Resource information (title, excerpt, button) */
.resource-info {
  flex: 1; 
  display: flex;
  flex-direction: column; 
  justify-content: flex-start; 
}

.resource-taxonomies {
  font-size: var(--copyFontSmall);
  line-height: 1.4;
}

a.taxonomy-link {
  color: var(--blue);
}

/* Post title */
.resource-title {
  color: var(--black);
  margin-bottom: 10px;
}

/* Excerpt */
.resource-excerpt {
  font-size: var(--copyFontLarge);
  color: var(--black); /* Optional: make the excerpt text slightly lighter */
  margin-bottom: 20px;
}

.hcd-resource-grid {
  display: grid;
  gap: 20px;
}

.hcd-resource-item {
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  border-radius: 5px;
}

.hcd-resource-item .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(2, 32, 39, 0.7); /* 70% opacity overlay */
  z-index: 1; /* Ensures the overlay sits above the background */
  border-radius: 5px;
}

.hcd-resource-content .resource-format,
.hcd-resource-content .resource-title,
.hcd-resource-content .resource-excerpt {
  color: var(--white);
  line-height: 1.1;
}

.hcd-resource-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.hcd-resource-content .resource-format {
  text-transform: uppercase;
}

.resource-button {
  background-color: var(--blue);
  padding: 8px 16px;
  border-radius: 4px;
}

.resource-button .button-link {
  color: var(--yellow);
  text-decoration: none;
  text-transform: uppercase;
}

@media only screen and (min-width: 981px) {
  .resource-item {
    flex-direction: row;
    max-width: 1250px;
    gap: 50px;
  }
  
  .resource-image {
    width: 381px;
    height: 381px;
  }

  .hcd-resource-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mobile-filter-icon {
    display: none;
  }

  #resources-filter-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 4px;
    background-color: #dddddd80;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #ddd;
  }

  .filter-dropdown:hover .dropdown-options {
    display: block; /* Show dropdown options on hover */
  }

  .filter-dropdown {
    text-transform: uppercase;
  }

  .filter-dropdown:not(:last-child) {
    border-right: 1px solid #ddd;
  }

  .dropdown-label {
    padding: 8px 15px;
    color: var(--black);
  }

  .filter-dropdown-icon {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
    transform: rotate(0deg);
  }

  .filter-dropdown:hover .filter-dropdown-icon {
    transform: rotate(180deg);
  }

  .dropdown-options {
    display: none; /* Hide dropdown options initially */
    width: 250px;
    position: absolute; /* Position it absolutely within the dropdown */
    top: 44px;
    border-radius: 5px;
    background-color: white; /* Background for dropdown options */
    z-index: 1000; /* Ensure dropdown appears above other content */
    border: 1px solid #ddd;
  }

  .dropdown-option {
    padding: 10px; /* Space out the options */
  }

  .dropdown-option:hover {
    background-color: #dddddd80;
  }

  #resources-clear-filters, .filters-label {
    color: var(--black);
  }

  #resources-clear-filters a {
    color: var(--black);
  }

  #resources-clear-filters {
    margin-left: auto;
  }

  .hcd-resource-item {
    padding: 40px;
  }
}

@media only screen and (max-width: 980px) {
  .resource-item {
    flex-direction: column;
  }

  .resource-image {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
  }

  .hcd-resource-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .mobile-filter-icon {
    display: block;
  }
  
  #resources-filter-bar {
    flex-direction: column;
    padding: 0;
    align-items: flex-start;
    position: fixed;
    left: 100%;
    top: 74px;
    background: #022027d6;
    backdrop-filter: blur(2px);
    border-left: 1px solid #f0f0f1;
    z-index: 999999999;
    width: 65%;
    height: calc(100vh - 74px);
    overflow: scroll;
    padding: 20px 0;
    margin: 0;
    transition: left .4s ease;
    font-size: var(--copyFontLarge)
  }

  #resources-filter-bar.active {
    left: 35%;
  }

  .mobile-filter-icon {
    background-color: #022027d6;
    padding: 8px;
    border-radius: 5px;
    width: 44px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-filter-icon img {
    width: 100%;
    height: 100%;
  }

  .filter-dropdown-icon {
    width: 20px;
    height: 20px;
  }

  .filter-dropdown-icon path {
    fill: var(--white);
  }

  #resources-clear-filters a,
  .filters-label,
  #resources-filter-bar .filter-dropdown {
    color: var(--white);
    margin-bottom: 12px;
  }

  .filters-label, .dropdown-label {
    font-weight: 600;
  }

  .dropdown-label {
    padding: 6px 15px;
  }

  .dropdown-options {
    display: block;
    position: relative;
  }

  .dropdown-option {
    padding: 6px 20px;
  }

  .hcd-resource-item {
    min-height: 350px;
    padding: 40px;
  }
}