/* ============================================================
   SEARCH PAGE — hero search bar, results cards, pagination
   ============================================================ */

/* ── HERO SEARCH SECTION ─────────────────────────────────── */
.ha-search-hero {
  position: relative;
  height: 250px;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--container-pad);
  overflow: hidden;
  background-color: #1D1D1B;
}
.ha-search-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.45)),
              url('https://images.unsplash.com/photo-1488521787991-ed7bbaae773c?w=1600&q=80') center/cover;
  background-color: #1D1D1B;
  z-index: 0;
}
.ha-search-hero-inner {
  max-width: 900px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ── SEARCH BAR ──────────────────────────────────────────── */
.ha-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 60px;
  padding: 10px 16px 10px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.15);
  transition: var(--transition-base);
}
.ha-search-bar:focus-within {
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 4px rgba(10,143,60,0.55);
}
.ha-search-bar-icon {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ha-search-bar-input {
  flex: 1;
  border: 0 !important;
  outline: none;
  font-size: 26px;
  font-family: 'Oakes Grotesk', 'Inter', sans-serif;
  font-weight: 500;
  color: var(--text);
  padding: 0 !important;
  background: transparent;
  box-shadow: none !important;
  min-width: 0;
}
.ha-search-bar-input:focus {
  border: 0 !important;
  box-shadow: none !important;
}
.ha-search-bar-input::placeholder {
  color: #9ca3af;
  font-style: normal;
}
.ha-search-bar-input::-webkit-search-cancel-button {
  display: none;
}
.ha-search-bar-clear {
  --ha-clear-icon-size: 20px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  border: none;
  padding: 0 !important;
  background: #f3f4f6;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  appearance: none;
  transition: all 0.15s;
}
.ha-search-bar-clear-label {
  display: block;
  font-size: var(--ha-clear-icon-size);
  line-height: 1;
  transform: translateY(-1px);
  pointer-events: none;
}
.ha-search-bar-clear:hover {
  background: #e5e7eb;
  color: var(--text);
}
.ha-search-bar-submit {
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  min-width: 112px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-base);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.ha-search-bar-submit-icon {
  display: none;
  width: 20px;
  height: 20px;
}
.ha-search-bar-submit:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(216, 20, 115, 0.5);
}

.ha-search-hint {
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  margin-top: var(--space-4);
  font-weight: 400;
}

/* ── SCOPE TOGGLE ────────────────────────────────────────── */
.ha-search-scope {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-5);
}
.ha-search-scope-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 8px 20px;
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ha-search-scope-btn:hover,
.ha-search-scope-btn.active {
  background: var(--color-haa-pink);
  border-color: var(--color-haa-pink);
  color: #FFFFFF;
}

/* ── RESULTS COUNT ───────────────────────────────────────── */
.ha-search-count {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  font-weight: 500;
}
.ha-search-count strong {
  color: var(--text);
  font-weight: 700;
}

/* ── SECTION HEADING & OTHER HEADER ──────────────────────── */
.ha-search-section-heading {
  font-family: 'Fields Display', 'DM Serif Display', Georgia, serif;
  font-weight: 500;
  font-size: 32px;
  color: var(--text);
  margin: var(--space-7) 0 var(--space-5);
}
.ha-search-other-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: var(--space-7) 0 var(--space-5);
}
.ha-search-other-header .ha-search-section-heading {
  margin: 0;
}
.ha-search-section-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-7) 0;
}
.ha-search-empty-block {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
}

/* ── CONTENT-TYPE FILTER DROPDOWN ───────────────────────── */
.ha-search-filter {
  position: relative;
  display: inline-block;
}
.ha-search-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border, #CCCCCC);
  color: var(--text, #1D1D1B);
  padding: 9px 16px;
  border-radius: 8px;
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.ha-search-filter-trigger:hover {
  border-color: var(--green, #01aa01);
  color: var(--green, #01aa01);
}
.ha-search-filter.open .ha-search-filter-trigger {
  border-color: var(--green, #01aa01);
  box-shadow: 0 0 0 3px rgba(1,170,1,0.12);
}
.ha-search-filter-trigger .ha-search-filter-icon,
.ha-search-filter-trigger .ha-search-filter-caret {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.ha-search-filter-trigger .ha-search-filter-caret {
  transition: transform 0.2s ease;
  opacity: 0.7;
}
.ha-search-filter.open .ha-search-filter-trigger .ha-search-filter-caret {
  transform: rotate(180deg);
}

.ha-search-filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 280px;
  background: #FFFFFF;
  border: 1px solid var(--border, #CCCCCC);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.06);
  padding: 6px;
  animation: ha-filter-pop 0.15s ease-out;
}
@keyframes ha-filter-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ha-search-filter-panel[hidden] {
  display: none;
}
.ha-search-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--border, #CCCCCC);
}
.ha-search-filter-item {
  margin: 0;
  padding: 0;
  position: relative;
}
.ha-search-filter-checkbox {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  margin: 0;
}
.ha-search-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease;
  user-select: none;
}
.ha-search-filter-row:hover {
  background: var(--bg, #F5F5F5);
}
.ha-search-filter-mark {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border, #CCCCCC);
  border-radius: 5px;
  background: #FFFFFF;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.ha-search-filter-text {
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #1D1D1B);
}
.ha-search-filter-checkbox:checked ~ .ha-search-filter-row .ha-search-filter-mark {
  background: var(--green, #01aa01);
  border-color: var(--green, #01aa01);
}
.ha-search-filter-checkbox:checked ~ .ha-search-filter-row .ha-search-filter-mark::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ha-search-filter-checkbox:focus-visible ~ .ha-search-filter-row .ha-search-filter-mark {
  box-shadow: 0 0 0 3px rgba(1,170,1,0.25);
}
.ha-search-filter-checkbox:hover ~ .ha-search-filter-row .ha-search-filter-mark {
  border-color: var(--green, #01aa01);
}
.ha-search-filter-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 8px 6px;
}
.ha-search-filter-all {
  background: transparent;
  border: none;
  padding: 8px 12px;
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  color: var(--green, #01aa01);
}
.ha-search-filter-all:hover:not(:disabled) {
  background: rgba(1,170,1,0.08);
}
.ha-search-filter-all:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 767px) {
  .ha-search-other-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .ha-search-filter {
    width: 100%;
  }
  .ha-search-filter-trigger {
    width: 100%;
    justify-content: space-between;
  }
  .ha-search-filter-panel {
    right: auto;
    left: 0;
    width: 100%;
    min-width: 0;
  }
}

/* ── APPEAL CARDS IN SEARCH (shared card renderer) ───────── */
#ha-search-grid-a {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: start;
  min-width: 0;
}
@media (max-width: 1199px) { #ha-search-grid-a { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991px)  { #ha-search-grid-a { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px)  { #ha-search-grid-a { grid-template-columns: 1fr; } }

#ha-search-grid-a .ha-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 310px;
  min-width: 0;
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base), z-index 0s 0.3s;
}
#ha-search-grid-a .ha-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
#ha-search-grid-a .ha-card.expanded {
  box-shadow: var(--shadow-lg);
  z-index: 10;
  transition: transform var(--transition-base), box-shadow var(--transition-base), z-index 0s;
  min-height: auto;
}

#ha-search-grid-a .ha-card-image-wrap {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
#ha-search-grid-a .ha-card-image-link { display: block; line-height: 0; }
#ha-search-grid-a .ha-card-image {
  width: 100%;
  height: 250px;
  background-size: cover;
  background-position: center;
  background-color: #ddd;
  transition: height 0.3s ease;
}
#ha-search-grid-a .ha-card.expanded .ha-card-image { height: 140px; }

#ha-search-grid-a .ha-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: help;
  overflow: hidden;
}
#ha-search-grid-a .ha-card-badge .fi { width: 22px; height: 16px; border-radius: 2px; }
#ha-search-grid-a .ha-card-badge svg { width: 18px; height: 18px; stroke-width: 2; }
#ha-search-grid-a .ha-card-badge.where-needed { background: rgba(10,143,60,0.9); color: #FFFFFF; }
#ha-search-grid-a .ha-card.expanded .ha-card-badge { opacity: 0; pointer-events: none; }

#ha-search-grid-a .ha-card-body {
  padding: 14px 20px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
}
#ha-search-grid-a .ha-card-title {
  font-family: 'Oakes Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 6px;
  min-height: 52px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#ha-search-grid-a .ha-card-title-link {
  color: inherit;
  text-decoration: none;
}
#ha-search-grid-a .ha-card-title-link:hover {
  color: var(--color-haa-green);
  text-decoration: none;
}
#ha-search-grid-a .ha-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}
#ha-search-grid-a .ha-card-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
#ha-search-grid-a .ha-card-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
#ha-search-grid-a .ha-card-meta > span:not(.ha-card-subtitle):not(.ha-card-meta-dot) {
  white-space: nowrap;
  flex-shrink: 0;
}
#ha-search-grid-a .ha-card.expanded .ha-card-subtitle {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

#ha-search-grid-a .ha-card-expand {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  opacity: 0;
  transition: grid-template-rows 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
  padding: 0 20px;
  background: linear-gradient(to bottom, transparent, var(--green-faint));
  border-top: 1px solid transparent;
}
#ha-search-grid-a .ha-card-expand-inner { min-height: 0; }
#ha-search-grid-a .ha-card.expanded .ha-card-expand {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(204,204,204,0.35);
  transition: grid-template-rows 0.3s ease, opacity 0.25s 0.1s ease, padding 0.3s ease;
  overflow: visible;
}

#ha-search-grid-a .ha-direction-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
#ha-search-grid-a .ha-dir-label { font-weight: 500; }
#ha-search-grid-a .ha-country-select { position: relative; width: 100%; }
#ha-search-grid-a .ha-country-select-btn {
  border: 2px solid var(--border);
  background: var(--bg);
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  text-align: left;
}
#ha-search-grid-a .ha-country-select-btn .fi { width: 18px; height: 13px; border-radius: 2px; }
#ha-search-grid-a .ha-country-select-btn .ha-csc-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ha-search-grid-a .ha-country-select-btn svg { width: 16px; height: 16px; opacity: 0.5; flex-shrink: 0; margin-left: auto; transition: transform 0.2s; }
#ha-search-grid-a .ha-country-select.open .ha-country-select-btn svg { transform: rotate(180deg); }
#ha-search-grid-a .ha-country-select-btn:hover,
#ha-search-grid-a .ha-country-select.open .ha-country-select-btn { border-color: var(--green); background: var(--green-faint); }

#ha-search-grid-a .ha-country-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 99999;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
#ha-search-grid-a .ha-country-select.open .ha-country-select-menu { display: block; }
#ha-search-grid-a .ha-country-select-option {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}
#ha-search-grid-a .ha-country-select-option:hover { background: var(--green-faint); }
#ha-search-grid-a .ha-country-select-option.selected { background: var(--green-light); color: var(--green-dark); font-weight: 600; }
#ha-search-grid-a .ha-country-select-option.where-needed-row {
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
  padding-bottom: 10px;
  color: var(--green-dark);
  font-weight: 600;
}
#ha-search-grid-a .ha-country-select-option .fi { width: 18px; height: 13px; border-radius: 2px; }
#ha-search-grid-a .ha-country-select-option svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--green-dark); }

#ha-search-grid-a .ha-amount-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
#ha-search-grid-a .ha-amount-btn {
  border: 2px solid var(--border);
  background: var(--white);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  text-align: center;
  height: 44px;
  box-sizing: border-box;
}
#ha-search-grid-a .ha-amount-btn:hover { border-color: var(--green); color: var(--green); }
#ha-search-grid-a .ha-amount-btn.selected { border-color: var(--green); background: var(--green); color: #FFFFFF; font-weight: 700; }

#ha-search-grid-a .ha-qty-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 8px;
  height: 44px;
  box-sizing: border-box;
}
#ha-search-grid-a .ha-qty-btn {
  background: #FFFFFF;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#ha-search-grid-a .ha-qty-btn:disabled { opacity: 0.3; cursor: not-allowed; }
#ha-search-grid-a .ha-qty-display {
  border-left: 2px solid var(--border);
  border-right: 2px solid var(--border);
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
#ha-search-grid-a .ha-qty-total {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 12px;
}
#ha-search-grid-a .ha-qty-unit-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -6px;
  margin-bottom: 12px;
}
#ha-search-grid-a .ha-custom-input {
  width: 100%;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  margin-bottom: 12px;
  outline: none;
  color: var(--text);
  height: 44px;
  box-sizing: border-box;
}
#ha-search-grid-a .ha-custom-input:focus { border-color: var(--green); }

#ha-search-grid-a .ha-donate-cta {
  width: 100%;
  background: var(--pink);
  color: #FFFFFF;
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  box-sizing: border-box;
}
#ha-search-grid-a .ha-donate-cta:hover { transform: scale(1.04); box-shadow: 0 0 20px rgba(216, 20, 115, 0.5); }
#ha-search-grid-a .ha-cta-destination { font-size: 11px; font-weight: 400; opacity: 0.88; }

#ha-search-grid-a .ha-card-error {
  color: var(--pink);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
}

/* ── SPECIAL PROJECT CARD IN SEARCH ──────────────────────── */
#ha-search-grid-a .ha-card--special {
  background: linear-gradient(180deg, var(--green-dark) 0%, var(--green) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 8px rgba(1,170,1,0.18);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 310px;
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base), z-index 0s 0.3s;
}
#ha-search-grid-a .ha-card--special:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(1,170,1,0.35);
}
#ha-search-grid-a .ha-card--special.expanded {
  box-shadow: var(--shadow-lg);
  z-index: 10;
  transition: transform var(--transition-base), box-shadow var(--transition-base), z-index 0s;
  min-height: auto;
}
#ha-search-grid-a .ha-card--special .ha-card-body {
  padding: 14px 20px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
  min-height: 0;
}
#ha-search-grid-a .ha-card--special .ha-card-title {
  color: #FFFFFF;
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 6px;
  min-height: 52px;
  -webkit-line-clamp: 2;
}
#ha-search-grid-a .ha-card--special .ha-card-title-link {
  color: #FFFFFF;
  text-decoration: none;
}
#ha-search-grid-a .ha-card--special .ha-card-title-link:hover {
  color: rgba(255,255,255,0.85);
}
#ha-search-grid-a .ha-card--special .ha-card-meta {
  color: rgba(255,255,255,0.9);
}
#ha-search-grid-a .ha-card--special .ha-card-subtitle {
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ha-search-grid-a .ha-card--special.expanded .ha-card-subtitle {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
#ha-search-grid-a .ha-card--special .ha-card-meta-dot {
  background: rgba(255,255,255,0.6);
}
#ha-search-grid-a .ha-card--special .ha-card-image-wrap {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
#ha-search-grid-a .ha-card--special .ha-card-image {
  width: 100%;
  height: 250px;
  background-size: cover;
  background-position: center;
  background-color: #1d6b34;
}
#ha-search-grid-a .ha-card--special.expanded .ha-card-image { height: 140px; }
/* Special card badge inherits standard .ha-card-badge styles (white default,
   green pill via .where-needed). Per Omar feedback 6: do not invert the globe icon. */
#ha-search-grid-a .ha-card--special.expanded .ha-card-badge { opacity: 0; pointer-events: none; }

#ha-search-grid-a .ha-card--special .ha-card-expand {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  opacity: 0;
  transition: grid-template-rows 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
  padding: 0 20px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.04));
  border-top: 1px solid rgba(255,255,255,0.18);
}
#ha-search-grid-a .ha-card--special.expanded .ha-card-expand {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 16px 20px 20px;
  transition: grid-template-rows 0.3s ease, opacity 0.25s 0.1s ease, padding 0.3s ease;
  overflow: visible;
}
#ha-search-grid-a .ha-card--special .ha-special-regions {
  margin-bottom: 12px;
}
#ha-search-grid-a .ha-card--special .ha-special-excerpt {
  margin: 0;
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255,255,255,0.92);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ha-search-grid-a .ha-card--special .ha-special-excerpt::after {
  content: '…';
  margin-left: 1px;
}
#ha-search-grid-a .ha-card--special .ha-special-cta {
  margin-top: 4px;
}
#ha-search-grid-a .ha-card--special .ha-special-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--pink);
  color: #FFFFFF;
  border-radius: 4px;
  padding: 14px 20px;
  font-family: 'Oakes Grotesk', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
#ha-search-grid-a .ha-card--special .ha-special-cta a:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(216,20,115,0.45);
  color: #FFFFFF;
}
#ha-search-grid-a .ha-card--special .ha-special-cta a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 800px) {
  #ha-search-grid-a .ha-card { min-height: 0; }
  #ha-search-grid-a .ha-card-title { min-height: 0; margin-bottom: 2px; }
  #ha-search-grid-a .ha-card-subtitle { white-space: normal; overflow: visible; text-overflow: clip; }
  #ha-search-grid-a .ha-card-meta { flex-wrap: wrap; }
  #ha-search-grid-a .ha-card-expand,
  #ha-search-grid-a .ha-card--special .ha-card-expand {
    grid-template-rows: 1fr;
    opacity: 1;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border-light);
    overflow: visible;
    transition: none;
  }
  #ha-search-grid-a .ha-card--special .ha-card-expand {
    border-top: 1px solid rgba(255,255,255,0.18);
  }
  #ha-search-grid-a .ha-card--special .ha-card-subtitle {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  #ha-search-grid-a .ha-card--special .ha-card-body { min-height: 0; }
}
@media (max-width: 575px) {
  #ha-search-grid-a .ha-card { min-height: 0; }
  #ha-search-grid-a .ha-card-image { height: 180px; }
  #ha-search-grid-a .ha-card--special .ha-card-image { height: 180px; }
  #ha-search-grid-a .ha-card-title { font-size: 18px; min-height: 0; }
  #ha-search-grid-a .ha-card--special .ha-card-title { font-size: 18px; min-height: 0; }
}

/* ── INITIATIVE BANNER ───────────────────────────────────── */
.ha-search-initiative-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
}
.ha-search-initiative-text {
  flex: 1;
  min-width: 0;
}
.ha-search-initiative-title {
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-1) 0;
}
.ha-search-initiative-desc {
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0;
}
.ha-search-initiative-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}
.ha-search-initiative-btn {
  display: inline-block;
  background: var(--green-dark);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-base);
}
.ha-search-initiative-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(51,158,67,0.45);
  color: #FFFFFF;
  text-decoration: none;
}
@media (max-width: 767px) {
  .ha-search-initiative-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .ha-search-initiative-actions {
    width: 100%;
    flex-direction: column;
  }
  .ha-search-initiative-btn {
    text-align: center;
    width: 100%;
  }
}

/* ── SEARCH RESULTS GRID ─────────────────────────────────── */
.ha-search-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.ha-search-grid--uniform {
  align-items: stretch;
}
@media (max-width: 1199px) { .ha-search-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991px)  { .ha-search-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px)  { .ha-search-grid { grid-template-columns: 1fr; } }

/* ── SEARCH CARD ─────────────────────────────────────────── */
.ha-search-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition-base);
}
.ha-search-grid--uniform .ha-search-card {
  height: 100%;
}
.ha-search-grid--uniform .ha-search-card-body {
  height: calc((1.3em * 3) + var(--space-2) + (1.55em * 3));
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 16px;
}
.ha-search-card:hover {
  border-color: var(--text-muted);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* ── FILTER ANIMATION (Other content cards + empty block) ──
 * Smooth fade-in/out when the user toggles a content-type filter.
 * The JS adds .is-fading-out, waits FADE_MS, then sets display:none
 * (or removes display + fades in). The grid reflow happens once cards
 * have faded — the user sees motion instead of jumps. */
.ha-search-grid,
.ha-pagination {
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ha-search-grid .ha-search-card.is-fading-out {
  opacity: 0;
  transform: translateY(4px) scale(0.985);
  pointer-events: none;
}
.ha-search-grid .ha-search-card.is-entering {
  opacity: 0;
  transform: translateY(4px) scale(0.985);
}
.ha-search-grid.is-fading-out,
.ha-pagination.is-fading-out {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}
.ha-search-grid.is-entering,
.ha-pagination.is-entering {
  opacity: 0;
  transform: translateY(4px);
}
.ha-search-empty-block.is-fading-out {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}
.ha-search-empty-block.is-entering {
  opacity: 0;
  transform: translateY(4px);
}

/* ── LIVE RESULTS INDICATOR ────────────────────────────────
 * Shows the visible/total count under the "Other content" header.
 * Updates live as the user toggles filter checkboxes. */
.ha-search-results-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 var(--space-5);
  font-weight: 500;
  min-height: 20px;
}
.ha-search-results-indicator strong {
  color: var(--text);
  font-weight: 700;
}
.ha-search-results-indicator.is-pulsing .ha-search-results-indicator-text {
  animation: ha-results-flash 0.45s ease;
}
@keyframes ha-results-flash {
  0%   { opacity: 0.35; }
  100% { opacity: 1; }
}

.ha-search-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 10px;
}
.ha-search-type.type-appeal     { color: #e91e63; }
.ha-search-type.type-fundraiser { color: #7c3aed; }
.ha-search-type.type-news       { color: #1e40af; }
.ha-search-type.type-event      { color: #c2410c; }
.ha-search-type.type-community-care { color: #0891b2; }
.ha-search-type.type-campaign      { color: var(--color-haa-green, var(--green)); }
.ha-search-type.type-webpage        { color: #374151; }

.ha-search-title {
  font-family: 'Oakes Grotesk', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text);
}
.ha-search-grid--uniform .ha-search-title {
  margin-bottom: 8px;
  max-height: calc(1.3em * 3);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  word-break: break-word;
}
.ha-search-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}
.ha-search-grid--uniform .ha-search-desc {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ha-search-grid--uniform .ha-search-link {
  margin-top: auto;
}
.ha-search-link {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s, gap 0.2s;
}
.ha-search-link:hover {
  color: var(--green);
  border-bottom-color: var(--green);
  gap: 8px;
}
.ha-search-link::after {
  content: '\2192';
  font-size: 14px;
}

/* ── EMPTY PLACEHOLDER (per-section "no results" UI) ──────
 * Shown when a section (Appeals / Other content) has zero matches.
 * Renders a centered icon + heading + description + optional CTA. */
.ha-search-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-5);
  color: var(--text-muted);
  gap: var(--space-3);
}
.ha-search-empty-placeholder-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--green-dark);
  margin-bottom: var(--space-2);
}
.ha-search-empty-placeholder-icon svg {
  width: 28px;
  height: 28px;
  display: block;
  stroke-width: 1.75;
}
.ha-search-empty-placeholder-title {
  font-family: 'Fields Display', 'DM Serif Display', Georgia, serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
}
.ha-search-empty-placeholder-desc {
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0;
}
.ha-search-empty-placeholder-desc strong {
  color: var(--text);
  font-weight: 600;
}
.ha-search-empty-placeholder-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}
.ha-search-empty-placeholder-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 4px;
  font-family: 'Oakes Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  line-height: 1.2;
}
.ha-search-empty-placeholder-btn--primary {
  background: var(--green);
  color: #FFFFFF;
}
.ha-search-empty-placeholder-btn--primary:hover,
.ha-search-empty-placeholder-btn--primary:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 0 20px rgba(1, 170, 1, 0.4);
  color: #FFFFFF;
}
.ha-search-empty-placeholder-btn--outline {
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
}
.ha-search-empty-placeholder-btn--outline:hover,
.ha-search-empty-placeholder-btn--outline:focus-visible {
  background: var(--green);
  color: #FFFFFF;
}
@media (max-width: 575px) {
  .ha-search-empty-placeholder {
    padding: var(--space-7) var(--space-4);
  }
  .ha-search-empty-placeholder-title {
    font-size: 22px;
  }
  .ha-search-empty-placeholder-actions {
    flex-direction: column;
    width: 100%;
  }
  .ha-search-empty-placeholder-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── EMPTY SEARCH DISCOVERY ──────────────────────────────── */
.ha-search-discovery {
  background: var(--bg);
  padding: var(--space-7) 0 var(--space-8);
}
.ha-search-discovery-inner {
  max-width: 760px;
  text-align: center;
}
.ha-search-discovery-copy h2 {
  font-size: 48px;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-3);
}
.ha-search-discovery-copy p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}

/* ── NO RESULTS ──────────────────────────────────────────── */
.ha-search-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.ha-search-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.ha-search-empty h2 {
  font-family: 'Fields Display', 'DM Serif Display', Georgia, serif;
  font-weight: 500;
  font-size: 36px;
  margin-bottom: 12px;
  color: var(--text);
}
@media (max-width: 575px) {
  .ha-search-empty h2 { font-size: 28px; }
}
.ha-search-empty p {
  font-size: 16px;
  max-width: 400px;
  margin: 0 auto 24px;
}
.ha-search-empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── FEATURED SECTIONS (empty state) ─────────────────────── */
.ha-search-section {
  margin-bottom: 48px;
}
.ha-search-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.ha-search-section-header h2 {
  font-family: 'Oakes Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
}
.ha-search-section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}
.ha-search-section-link:hover {
  gap: 8px;
}

/* ── RESPONSIVE SEARCH BAR (inline) ──────────────────────── */
@media (max-width: 991px) {
  .ha-search-bar-input {
    font-size: clamp(16px, 2.4vw + 12px, 20px);
    padding: 0 !important;
  }
  .ha-search-bar-submit {
    padding: 12px 22px;
  }
}

@media (max-width: 767px) {
  .ha-search-discovery {
    padding: var(--space-6) 0 var(--space-7);
  }
  .ha-search-discovery-copy h2 {
    font-size: 32px;
  }

  .ha-search-bar {
    gap: 8px;
    padding: 6px 6px 6px 16px;
    border-radius: 999px;
  }
  .ha-search-bar-icon {
    display: none;
  }
  .ha-search-bar-input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
    font-weight: 500;
    padding: 0 !important;
  }

  .ha-search-bar-clear {
    --ha-clear-icon-size: 18px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }
  .ha-search-bar-submit-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .ha-search-bar-submit {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .ha-search-bar-submit-icon {
    display: block;
  }
}

@media (max-width: 575px) {
  .ha-search-hero {
    height: 250px;
    min-height: 250px;
    padding: var(--space-6) var(--space-4);
  }
  .ha-search-bar {
    gap: 6px;
    padding: 5px 5px 5px 14px;
  }
}

/* ── LOADING OVERLAY ─────────────────────────────────────── */
.ha-search-loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.ha-search-loading.show {
  display: flex;
}
.ha-search-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: ha-spin 0.6s linear infinite;
}
@keyframes ha-spin {
  to { transform: rotate(360deg); }
}

/* ── SEARCH CONTENT WRAPPER ──────────────────────────────── */
.ha-search-content {
  margin-top: var(--space-8);
  padding-bottom: var(--space-8);
}

/* ── REDUCED MOTION ────────────────────────────────────────
 * Disable the fade/scale animation for users who request reduced motion.
 * Cards still hide/show (display: none toggles), but instantly. */
@media (prefers-reduced-motion: reduce) {
  .ha-search-grid,
  .ha-pagination,
  .ha-search-grid .ha-search-card,
  .ha-search-empty-block,
  .ha-search-results-indicator.is-pulsing .ha-search-results-indicator-text {
    transition: none !important;
    animation: none !important;
  }
  .ha-search-grid .ha-search-card.is-fading-out,
  .ha-search-grid .ha-search-card.is-entering,
  .ha-search-grid.is-fading-out,
  .ha-search-grid.is-entering,
  .ha-pagination.is-fading-out,
  .ha-pagination.is-entering,
  .ha-search-empty-block.is-fading-out,
  .ha-search-empty-block.is-entering {
    transform: none !important;
    opacity: 0 !important;
  }
}

