:root {
  --rose:    #4990e2;
  --rose-lt: #FAEDEB;
  --rose-md: #E8897F;
  --teal:    #0D7A6B;
  --teal-lt: #E8F5F3;
  --teal-md: #6DBFB1;
  --gold:    #B7791F;
  --gold-lt: #FEF9EE;
  --ink:     #1A1A2E;
  --ink-60:  rgba(26,26,46,0.6);
  --ink-15:  rgba(26,26,46,0.08);
  --white:   #FFFFFF;
  --off-white: #F8F6F2;
  --surface:   #FDFCFA;
  --border:    rgba(26,26,46,0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 12px rgba(26,26,46,0.06);
  --shadow-md: 0 8px 32px rgba(26,26,46,0.1);
  --shadow-lg: 0 20px 60px rgba(26,26,46,0.14);
  --sans: 'DM Sans', system-ui, sans-serif;
  --serif: 'DM Serif Display', Georgia, serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--off-white);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}

/* ── Emergency Banner ───── */
.emergency-banner {
  background: var(--rose);
  color: white;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.emergency-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pulse-dot {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.4); }
}
.emergency-banner a {
  color: white;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  transition: border-color 0.2s;
}
.emergency-banner a:hover { border-color: white; }
.sep { opacity: 0.4; }
.banner-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 2px 6px;
  border-radius: 4px;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.banner-close:hover { opacity: 1; background: rgba(255,255,255,0.15); }

/* ── Header ───── */
.site-header {
  background: rgba(248,246,242,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.logo-mark { color: var(--teal); }
.logo-text {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--ink-60);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--rose) !important;
  color: white !important;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(192,57,43,0.35) !important; }

/* ── Hero ───── */
.hero {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  padding: 40px 32px 20px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(13,122,107,0.12), transparent 70%);
  top: -100px; right: -100px;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(192,57,43,0.08), transparent 70%);
  bottom: -50px; left: 10%;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26,26,46,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,26,46,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-content {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-lt);
  border: 1px solid rgba(13,122,107,0.2);
  color: var(--teal);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.badge-dot {
  width: 6px; height: 6px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}
.hero-title em {
  color: var(--teal);
  font-style: italic;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-60);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Search Bar ────── */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 100px;
  padding: 6px 6px 6px 20px;
  max-width: 600px;
  margin: 0 auto 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-md);
}
.search-bar:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13,122,107,0.1), var(--shadow-md);
}
.search-icon { color: var(--ink-60); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  padding: 8px 14px;
}
.search-bar input::placeholder { color: var(--ink-60); }
.search-btn {
  background: var(--teal);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.search-btn:hover  { background: #0A5E52; transform: scale(1.02); }
.search-btn:active { transform: scale(0.98); }

/* ── Hero Stats ────── */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--ink-60);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.stat-div {
  width: 1px; height: 36px;
  background: var(--border);
}

/* ── Services Section ────── */
.services-section { padding: 20px 0 60px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.section-title.light { color: white; }
.section-sub { color: var(--ink-60); font-size: 1rem; }
.section-sub.light { color: rgba(255,255,255,0.7); }

/* ── Filter Bar ───── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 48px;
}
.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 9px 20px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-60);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-lt);
}
.filter-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}
.filter-icon { font-size: 0.9rem; }

/* ── Results Grid ─────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* ── Facility Card ─────── */
.facility-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  animation: fadeInUp 0.4s ease both;
  cursor: default;
}
.facility-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13,122,107,0.2);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card-icon {
  width: 44px; height: 44px;
  background: var(--teal-lt);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--teal-lt);
  color: var(--teal);
}
.card-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--ink-60);
}
.meta-icon { font-size: 0.85rem; flex-shrink: 0; }
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
  background: var(--off-white);
  color: var(--ink-60);
  border: 1px solid var(--border);
}
.tag.medical  { background: #EFF6FF; color: #2563EB; border-color: #BFDBFE; }
.tag.legal    { background: #F5F3FF; color: #7C3AED; border-color: #DDD6FE; }
.tag.shelter  { background: var(--teal-lt); color: var(--teal); border-color: rgba(13,122,107,0.2); }
.tag.mental   { background: #FFF7ED; color: #C2410C; border-color: #FED7AA; }

.card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.btn-detail {
  flex: 1;
  background: var(--ink);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-detail:hover { background: #0D0D20; }
.btn-call {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-call:hover { background: var(--teal); color: white; }

/* ── Skeleton Loading ────── */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.skeleton-card {
  height: 240px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(26,26,46,0.04) 50%, var(--border) 75%);
  background-size: 400% 100%;
  border-radius: var(--radius-lg);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

/* ── States ─────── */
.hidden { display: none !important; }
.error-state, .empty-state {
  text-align: center;
  padding: 80px 32px;
}
.error-icon, .empty-icon { font-size: 2.5rem; margin-bottom: 16px; }
.error-state h3, .empty-state h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--ink);
}
.error-state p, .empty-state p { color: var(--ink-60); margin-bottom: 24px; }
.retry-btn {
  background: var(--teal);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 100px;
  font-family: var(--sans);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.retry-btn:hover { background: #0A5E52; }

/* ── Pagination ─────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}
.page-btn {
  width: 40px; height: 40px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-60);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.page-btn:hover { border-color: var(--teal); color: var(--teal); }
.page-btn.active { background: var(--teal); border-color: var(--teal); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Modal ────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: var(--off-white);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink-60);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--border); color: var(--ink); }
.modal-facility-name {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.modal-section { margin-top: 24px; }
.modal-section h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-60);
  font-weight: 600;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.modal-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--ink);
}
.modal-detail-icon { flex-shrink: 0; font-size: 0.9rem; margin-top: 2px; }

/* ── Emergency Section ───── */
.emergency-section {
  background: linear-gradient(135deg, #1A1A2E 0%, #16213E 50%, #0D2137 100%);
  padding: 80px 0 90px;
}
.emergency-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.emergency-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  transition: background 0.2s, transform 0.2s;
}
.emergency-card:hover {
  background: rgba(255,255,255,0.11);
  transform: translateY(-3px);
}
.ec-icon { font-size: 1.8rem; }
.ec-info h3 {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.ec-number {
  display: block;
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--teal-md);
  text-decoration: none;
  line-height: 1;
  margin-bottom: 4px;
  transition: color 0.2s;
}
.ec-number:hover { color: white; }
.ec-info p { font-size: 0.78rem; color: rgba(255,255,255,0.45); }

/* ── Footer ───── */
.site-footer {
  background: var(--ink);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-logo .logo-text { color: white; font-size: 1.1rem; display: block; margin-bottom: 4px; }
.footer-logo p { font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.footer-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  max-width: 440px;
  line-height: 1.6;
}
.site-footer {
  color: white;
}

.site-footer p {
  color: rgba(255,255,255,0.8);
  text-align: center;
}

/* ── Responsive ────── */
@media (max-width: 768px) {
  .header-inner { padding: 0 20px; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { padding: 60px 20px 48px; min-height: auto; }
  .hero-stats { gap: 20px; }
  .container { padding: 0 20px; }
  .results-grid { grid-template-columns: 1fr; }
  .emergency-cards { grid-template-columns: 1fr; }
  .modal { padding: 28px 22px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
