/* =====================================================
   Resource Library — Card Styles
   Teal accent: adjust --rl-teal to match theme exactly
   ===================================================== */

:root {
  --rl-teal: #1a7872;
  --rl-teal-light: #e8f4f3;
  --rl-text: #2d3748;
  --rl-text-muted: #718096;
  --rl-border: #e2e8f0;
  --rl-radius: 6px;
  --rl-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --rl-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.14);
}

/* =====================================================
   Facet / Filter Bar
   ===================================================== */

/* Wrapper — add class="resource-filters" to your HTML element */
.resource-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
  background: #009685;
  padding: 20px;
  border-radius: 6px;
  h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 10px;
  }
}

.resource-filters .facetwp-facet {
  margin: 0;
}

.resource-filters .facet-wrap:has(.facetwp-type-sort) {
  align-self: flex-end;
}

/* ----- Search ----- */
.resource-filters .facetwp-type-search .facetwp-search-wrap {
  position: relative;
}

.resource-filters .facetwp-type-search .facetwp-search {
  appearance: none;
  width: 260px;
  padding: 0.5rem 2.25rem 0.5rem 0.875rem;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  font-size: 0.9rem;
  color: var(--rl-text);
  background: #fff;
  box-shadow: var(--rl-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.resource-filters .facetwp-type-search .facetwp-search:focus {
  border-color: var(--rl-teal);
  box-shadow: 0 0 0 3px rgba(26, 120, 114, 0.15);
}

.resource-filters .facetwp-type-search .facetwp-icon {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rl-text-muted);
  pointer-events: none;
}

/* ----- Checkboxes (type & topic) ----- */
.resource-filters .facetwp-type-checkboxes .facetwp-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0;
  font-size: 0.875rem;
  color: var(--rl-text);
  cursor: pointer;
  user-select: none;
}

.resource-filters .facetwp-type-checkboxes .facetwp-checkbox::before {
  content: "";
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border: 2px solid var(--rl-border);
  border-radius: 3px;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.resource-filters .facetwp-type-checkboxes .facetwp-checkbox.checked::before {
  background: var(--rl-teal);
  border-color: var(--rl-teal);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l3 3 5-6' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 8px;
}

.resource-filters .facetwp-type-checkboxes .facetwp-checkbox:hover::before {
  border-color: var(--rl-teal);
}

.resource-filters .facetwp-type-checkboxes .facetwp-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--rl-text-muted);
  padding-left: 0.5rem;
}

/* ----- Sort dropdown ----- */
.resource-filters .facetwp-type-sort select,
.resource-filters .facetwp-type-sort .facetwp-dropdown {
  appearance: none;
  padding: 0.5rem 2rem 0.5rem 0.875rem;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  font-size: 0.9rem;
  color: var(--rl-text);
  background: #fff
    url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 0.625rem center / 10px 6px;
  box-shadow: var(--rl-shadow);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.resource-filters .facetwp-type-sort select:focus,
.resource-filters .facetwp-type-sort .facetwp-dropdown:focus {
  border-color: var(--rl-teal);
  box-shadow: 0 0 0 3px rgba(26, 120, 114, 0.15);
}

/* ----- Dropdown facets (e.g. resource_category) ----- */
.resource-filters .facetwp-type-dropdown .facetwp-dropdown {
  appearance: none;
  padding: 0.5rem 2rem 0.5rem 0.875rem;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  font-size: 0.9rem;
  color: var(--rl-text);
  background: #fff
    url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 0.625rem center / 10px 6px;
  box-shadow: var(--rl-shadow);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.resource-filters .facetwp-type-dropdown .facetwp-dropdown:focus {
  border-color: var(--rl-teal);
  box-shadow: 0 0 0 3px rgba(26, 120, 114, 0.15);
}

/* ----- Grid (FacetWP listing container) ----- */
.facetwp-template {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.facetwp-template .resource-card,
.resource-cards-grid .resource-card {
  height: 100%;
}

/* ----- Card ----- */
.resource-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  overflow: hidden;
  box-shadow: var(--rl-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.resource-card:hover {
  box-shadow: var(--rl-shadow-hover);
  transform: translateY(-2px);
}

/* ----- Image ----- */
.resource-card__image-link {
  display: block;
}

.resource-card__image {
  display: block;
  max-height: 160px;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.resource-card__image-placeholder img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.6;
}

/* ----- Body ----- */
.resource-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;
  gap: 0.75rem;
}

/* ----- Tags (type & topic) ----- */
.resource-card__type,
.resource-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.resource-card__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  line-height: 1.4;
}

.resource-card__tag--type {
  background: var(--rl-teal);
  color: #fff;
}

.resource-card__tag--topic {
  background: var(--rl-teal-light);
  color: var(--rl-teal);
  border: 1px solid rgba(26, 120, 114, 0.25);
}

/* ----- Title ----- */
.resource-card__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.resource-card__title a {
  color: var(--rl-text);
  text-decoration: none;
  transition: color 0.15s ease;
  font-weight: bold;
}

.resource-card__title a:hover {
  color: var(--rl-teal);
}

/* ----- Excerpt ----- */
.resource-card__excerpt {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--rl-text-muted);
}

.resource-card__excerpt p {
  margin: 0;
}

/* ----- Content (full post body) ----- */
.resource-card__content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--rl-text);
}

.resource-card__content p:first-child {
  margin-top: 0;
}

.resource-card__content p:last-child {
  margin-bottom: 0;
}

/* ----- Actions ----- */
.resource-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.resource-card__cta {
  display: inline-block;
  padding: 0.5rem 1.125rem;
  border-radius: var(--rl-radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  background: var(--rl-teal);
  color: #fff;
  border: 2px solid var(--rl-teal);
}

.resource-card__cta:hover {
  background: #155f5a;
  border-color: #155f5a;
  color: #fff;
}

.resource-card__cta--secondary {
  background: transparent;
  color: var(--rl-teal);
}

.resource-card__cta--secondary:hover {
  background: var(--rl-teal);
  color: #fff;
}
