/* ========================================
   CF Resource Search Block
   ======================================== */

.cf-resource-search-block {
  margin: 0 auto;
  font-family: inherit;
}

/* --- Filter Bar --- */
.cf-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 0;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cf-filter-item {
  flex: 1;
  padding: 16px 20px;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cf-filter-item.cf-filter-search {
  flex: 1.5;
}

.cf-filter-item label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #374151;
  margin-bottom: 2px;
}

.cf-filter-input,
.cf-filter-select {
  border: none;
  background: transparent;
  font-size: 15px;
  color: #1f2937;
  padding: 4px 0;
  outline: none;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
}

.cf-filter-input::placeholder {
  color: #9ca3af;
}

.cf-filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 20px;
}

/* --- Filter Actions (Button Group) --- */
.cf-filter-actions {
  display: flex;
  align-self: stretch;
}

.cf-filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 28px;
  background: #1a5632;
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0;
  transition: background 0.2s;
}

.cf-filter-btn:hover {
  background: #14472a;
}

.cf-filter-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cf-filter-reset {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 20px;
  background: #f3f4f6;
  color: #4b5563;
  border: none;
  border-left: 1px solid #e5e7eb;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.cf-filter-reset.is-visible {
  display: flex;
}

.cf-filter-reset:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.cf-filter-reset svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Results --- */
.cf-resource-results {
  margin-top: 32px;
}

.cf-resource-results-status {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 16px;
}

.cf-resource-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* --- Resource Card --- */
.cf-resource-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}

.cf-resource-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.cf-resource-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.cf-resource-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f3f4f6;
}

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

.cf-resource-card-content {
  padding: 20px;
}

.cf-resource-card-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 0;
  margin-bottom: 10px;
  background: #ecfdf5;
  color: #065f46;
}

.cf-type-blog-posts { background: #fef3c7; color: #92400e; }
.cf-type-articles { background: #dbeafe; color: #1e40af; }
.cf-type-videos { background: #ede9fe; color: #5b21b6; }
.cf-type-info-sheets { background: #e0e7ff; color: #3730a3; }
.cf-type-publications { background: #fce7f3; color: #9d174d; }
.cf-type-other-resources { background: #f3f4f6; color: #374151; }

.cf-resource-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
  line-height: 1.35;
}

.cf-resource-card-excerpt {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.cf-resource-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #9ca3af;
}

.cf-resource-card-topic {
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 12px;
  color: #6b7280;
}

/* --- Loading & States --- */
.cf-loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.cf-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #1a5632;
  border-radius: 50%;
  animation: cf-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.cf-no-results,
.cf-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
  font-size: 16px;
}

.cf-load-more-btn {
  display: block;
  margin: 32px auto 0;
  padding: 12px 36px;
  background: #fff;
  color: #1a5632;
  border: 2px solid #1a5632;
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cf-load-more-btn:hover {
  background: #1a5632;
  color: #fff;
}

.cf-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .cf-resource-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cf-filter-bar {
    flex-wrap: wrap;
    border-radius: 0;
  }

  .cf-filter-item {
    flex: 1 1 calc(50% - 1px);
    border-bottom: 1px solid #e8e8e8;
  }

  .cf-filter-actions {
    width: 100%;
  }

  .cf-filter-btn {
    flex: 1;
    justify-content: center;
    padding: 16px;
    border-radius: 0;
  }

  .cf-filter-reset {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .cf-resource-results-grid {
    grid-template-columns: 1fr;
  }

  .cf-filter-bar {
    flex-direction: column;
  }

  .cf-filter-item {
    flex: 1 1 100%;
    border-right: none;
  }
}
