@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', sans-serif;
  background-color: #ffffff;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Header ── */
.main-header {
  background-color: #0d1b2a;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.header-inner {
  padding: 44px 24px 40px;
}

.header-flag-stripe {
  height: 5px;
  background-color: #B22234;
}

.header-flag-stripe--blue {
  background-color: #3C3B6E;
}

.title {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -1.5px;
  line-height: 1.05;
}

.subtitle {
  margin-top: 14px;
  font-size: clamp(0.875rem, 2vw, 1.05rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.03em;
}

/* ── Results counter ── */
.results-meta {
  max-width: 1100px;
  margin: 28px auto 0;
  padding: 0 24px;
}

#results-counter {
  font-size: 0.8rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  max-width: 400px;
  margin: 0 auto;
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.empty-sub {
  font-size: 0.9rem;
  color: #999;
  line-height: 1.6;
}

/* ── Controls ── */
.controls {
  max-width: 960px;
  margin: 36px auto 0;
  padding: 0 24px;
}

#search-input {
  width: 100%;
  padding: 16px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
  background: #f5f5f5;
  border: 2px solid transparent;
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

#search-input::placeholder {
  color: #999;
  font-weight: 400;
}

#search-input:focus {
  background: #ffffff;
  border-color: #FFFC00;
  box-shadow: 0 0 0 4px rgba(255, 252, 0, 0.18);
}

/* ── Filter Buttons ── */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1a1a1a;
  background: #f0f0f0;
  border: 2px solid transparent;
  border-radius: 50px;
  padding: 10px 20px;
  height: auto;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.14s, box-shadow 0.18s;
  letter-spacing: 0.01em;
}

button:hover {
  background: #FFFC00;
  border-color: #FFFC00;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255, 252, 0, 0.4);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

button.active {
  background: #FFFC00;
  border-color: #e6e300;
  box-shadow: 0 2px 10px rgba(255, 252, 0, 0.35);
}

/* ── Card Grid ── */
#card-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 16px auto 60px;
  padding: 0 24px;
  justify-content: start;
}

/* ── Cards ── */
.card {
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px solid #ebebeb;
  border-left: 5px solid #FFFC00;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 24px 22px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: default;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border-color: #ebebeb;
  border-left-color: #FFFC00;
}

/* Category-based left border colors */
.card[data-category="Shelter"] { border-left-color: #4361ee; }
.card[data-category="Food"]    { border-left-color: #f72585; }
.card[data-category="Mental Health"] { border-left-color: #7209b7; }
.card[data-category="Medical"] { border-left-color: #06d6a0; }
.card[data-category="Employment"] { border-left-color: #fb8500; }
.card[data-category="Legal Aid"] { border-left-color: #ef233c; }

.card h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 12px;
  line-height: 1.3;
}

.card p {
  font-size: 0.875rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 6px;
}

.card p:last-child {
  margin-bottom: 0;
  margin-top: 10px;
  color: #777;
  font-style: italic;
}

.card p strong {
  font-weight: 700;
  color: #1a1a1a;
}

.call-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 18px;
  background: #FFFC00;
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 50px;
  transition: background 0.18s, transform 0.14s;
}

.call-btn:hover {
  background: #e6e300;
  transform: translateY(-1px);
}

#urgentBtn {
  margin-top: 14px;
  background: #B22234;
  color: #ffffff;
  border-color: transparent;
}

#urgentBtn:hover {
  background: #8f1a28;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(178, 34, 52, 0.4);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  #card-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  #card-container {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  .controls {
    padding: 0 16px;
  }

  .main-header {
    padding: 36px 16px 32px;
  }

  .filter-buttons {
    gap: 8px;
  }
}
