/* =============================================
   SADAQAH DIRECTORY — Muslim Life Hub
   Signature: gold donate buttons, trust badges,
   green verified ticks
============================================= */
:root {
  --gold:        #C9973A;
  --gold-light:  #E8C97A;
  --gold-pale:   #FDF6E8;
  --green-deep:  #1A3A2A;
  --green-mid:   #2D5A3D;
  --green-light: #EAF3ED;
  --cream:       #FAF8F3;
  --white:       #FFFFFF;
  --text:        #1C1C1C;
  --text-mid:    #4B5563;
  --text-muted:  #9CA3AF;
  --border:      #E5DDD0;
  --urgent:      #FEF2F2;
  --urgent-border:#FECACA;
  --radius:      12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--cream); color: var(--text); font-family: 'Inter', sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--green-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- HEADER ---- */
.site-header { background: var(--green-deep); border-bottom: 3px solid var(--gold); padding: 1.1rem 1.25rem 0; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; }
.header-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.85rem; flex-wrap: wrap; }
.site-brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand-moon { font-size: 1.5rem; color: var(--gold); filter: drop-shadow(0 0 6px rgba(201,151,58,0.4)); }
.brand-name { font-family: 'Amiri', serif; font-size: 1.25rem; color: #fff; line-height: 1.1; }
.brand-tagline { font-size: 0.65rem; color: var(--gold-light); opacity: 0.7; font-weight: 300; }

/* Search */
.header-search { display: flex; gap: 0; border-radius: 999px; overflow: hidden; border: 1px solid rgba(201,151,58,0.3); flex: 1; max-width: 360px; }
.search-input { flex: 1; background: rgba(255,255,255,0.07); color: #fff; border: none; padding: 0.48rem 1rem; font-size: 0.82rem; font-family: 'Inter', sans-serif; outline: none; }
.search-input::placeholder { color: rgba(255,255,255,0.35); }
.search-btn { background: var(--gold); color: var(--green-deep); border: none; padding: 0.48rem 1rem; font-size: 0.78rem; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer; }

/* Filter nav */
.filter-nav { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; margin: 0 -1.25rem; padding: 0 1.25rem; }
.filter-nav::-webkit-scrollbar { display: none; }
.filter-link { font-size: 0.75rem; color: rgba(232,201,122,0.65); white-space: nowrap; padding: 0.5rem 0.85rem; border-bottom: 2px solid transparent; transition: color 0.14s, border-color 0.14s; text-decoration: none; flex-shrink: 0; }
.filter-link:hover { color: var(--gold); text-decoration: none; }
.filter-link.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---- MAIN ---- */
.site-main { flex: 1; }
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.page-wrap-narrow { max-width: 820px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* ---- HERO ---- */
.home-hero { background: var(--green-deep); border-radius: var(--radius); padding: 2.75rem 2rem; text-align: center; margin-bottom: 2rem; position: relative; overflow: hidden; }
.home-hero::before { content: ''; position: absolute; top: -20px; right: -20px; width: 200px; height: 200px; background: rgba(201,151,58,0.05); border-radius: 50%; }
.hero-bismillah { font-family: 'Amiri', serif; font-size: 1.6rem; color: var(--gold); margin-bottom: 0.6rem; }
.hero-title { font-family: 'Amiri', serif; font-size: clamp(1.6rem,4vw,2.4rem); color: #fff; margin-bottom: 0.5rem; line-height: 1.2; }
.hero-sub { font-size: 0.88rem; color: rgba(255,255,255,0.7); max-width: 480px; margin: 0 auto 1.5rem; line-height: 1.65; }
.hero-stats { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; }
.hero-stat-num { font-family: 'Amiri', serif; font-size: 1.8rem; color: var(--gold); line-height: 1; }
.hero-stat-label { font-size: 0.7rem; color: rgba(255,255,255,0.5); margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* Sadaqah type filter boxes */
.giving-types { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.85rem; margin-bottom: 2rem; }
.giving-type-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; text-align: center; text-decoration: none; color: inherit; transition: box-shadow 0.15s, transform 0.15s; display: block; }
.giving-type-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-2px); text-decoration: none; }
.giving-type-card.active { border-color: var(--gold); background: var(--gold-pale); }
.giving-icon { font-size: 1.6rem; margin-bottom: 0.35rem; }
.giving-name { font-weight: 600; font-size: 0.85rem; color: var(--green-deep); }
.giving-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; line-height: 1.4; }

/* Focus browse grid */
.focus-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: 0.75rem; margin-bottom: 2rem; }
.focus-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; text-decoration: none; color: inherit; transition: box-shadow 0.15s, transform 0.15s; display: block; }
.focus-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-2px); text-decoration: none; }
.focus-icon { font-size: 1.5rem; margin-bottom: 0.3rem; }
.focus-name { font-size: 0.75rem; font-weight: 600; color: var(--text-mid); }
.focus-count { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Section heading */
.section-heading { font-family: 'Amiri', serif; font-size: 1.3rem; color: var(--green-deep); margin: 1.75rem 0 1.1rem; display: flex; align-items: baseline; gap: 0.5rem; }
.section-count { font-family: 'Inter', sans-serif; font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }

/* ---- CHARITY GRID ---- */
.charity-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 1.1rem; }

/* ---- CHARITY CARD ---- */
.charity-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.18s, transform 0.18s;
  position: relative;
  overflow: hidden;
}
.charity-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }
.charity-card.urgent { border-color: var(--urgent-border); background: var(--urgent); }
.charity-card.featured { border-top: 3px solid var(--gold); }

.featured-ribbon {
  position: absolute; top: 0; right: 0;
  background: var(--gold); color: var(--green-deep);
  font-size: 0.65rem; font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 0 var(--radius) 0 8px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.card-top { display: flex; align-items: flex-start; gap: 0.85rem; }
.charity-logo {
  width: 52px; height: 52px; border-radius: 10px;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0; overflow: hidden;
  border: 1px solid var(--border);
}
.charity-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; padding: 2px; }

.card-title-wrap { flex: 1; }
.charity-name { font-weight: 700; font-size: 0.95rem; color: var(--text); line-height: 1.2; margin-bottom: 0.2rem; }
.verified-tick { color: #16A34A; font-size: 0.75rem; margin-left: 0.25rem; }
.star-rating { display: flex; gap: 1px; margin-bottom: 0.15rem; }
.star-filled { color: var(--gold); font-size: 0.75rem; }
.star-empty  { color: var(--border); font-size: 0.75rem; }
.charity-base { font-size: 0.7rem; color: var(--text-muted); }

.charity-desc { font-size: 0.82rem; color: var(--text-mid); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.badge-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.trust-badge { font-size: 0.68rem; font-weight: 600; padding: 0.18rem 0.55rem; border-radius: 999px; white-space: nowrap; }

.focus-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.focus-chip { font-size: 0.68rem; background: var(--green-light); color: var(--green-mid); padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap; }

.countries-row { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }

.card-actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.25rem; flex-wrap: wrap; }
.btn-donate { background: var(--gold); color: var(--green-deep); font-weight: 700; font-size: 0.82rem; padding: 0.5rem 1.1rem; border-radius: 999px; text-decoration: none; transition: opacity 0.14s; white-space: nowrap; }
.btn-donate:hover { opacity: 0.88; text-decoration: none; }
.btn-website { background: transparent; color: var(--text-muted); border: 1px solid var(--border); font-size: 0.78rem; padding: 0.5rem 0.9rem; border-radius: 999px; text-decoration: none; transition: background 0.14s, color 0.14s; }
.btn-website:hover { background: var(--green-light); color: var(--green-mid); text-decoration: none; }

/* ---- CHARITY PROFILE PAGE ---- */
.charity-profile-header { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem; border-top: 4px solid var(--gold); }
.profile-top { display: flex; align-items: flex-start; gap: 1.25rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.profile-logo { width: 80px; height: 80px; border-radius: 14px; background: var(--green-light); display: flex; align-items: center; justify-content: center; font-size: 2.2rem; flex-shrink: 0; border: 1px solid var(--border); overflow: hidden; }
.profile-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; padding: 4px; }
.profile-name { font-family: 'Amiri', serif; font-size: clamp(1.4rem,4vw,2rem); color: var(--green-deep); line-height: 1.2; margin-bottom: 0.35rem; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.82rem; color: var(--text-mid); margin-bottom: 0.85rem; }
.profile-meta strong { color: var(--green-deep); }
.profile-desc { font-size: 0.92rem; color: var(--text-mid); line-height: 1.75; white-space: pre-line; margin-bottom: 1.25rem; }
.profile-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-donate-lg { background: var(--gold); color: var(--green-deep); font-weight: 700; font-size: 0.95rem; padding: 0.7rem 2rem; border-radius: 999px; text-decoration: none; }
.btn-donate-lg:hover { opacity: 0.88; text-decoration: none; }

.info-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1rem; }
.info-card-title { font-family: 'Amiri', serif; font-size: 1rem; color: var(--green-deep); margin-bottom: 0.85rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.why-trust-box { background: var(--gold-pale); border: 1px solid var(--gold-light); border-radius: var(--radius); padding: 1rem 1.25rem; font-size: 0.88rem; color: var(--text-mid); line-height: 1.65; margin-bottom: 1rem; }
.why-trust-box::before { content: '☪️  Why We Trust This Charity'; display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--green-deep); margin-bottom: 0.45rem; }

/* ---- SEARCH ---- */
.search-info { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.search-info strong { color: var(--text); }

/* ---- EMPTY ---- */
.state-empty { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); }

/* ---- BACK LINK ---- */
.back-link { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.back-link:hover { color: var(--green-mid); text-decoration: none; }

/* ---- FOOTER ---- */
.site-footer { background: var(--green-deep); border-top: 3px solid var(--gold); padding: 1.75rem 1rem; text-align: center; margin-top: auto; }
.footer-bismillah { font-family: 'Amiri', serif; font-size: 1.3rem; color: var(--gold); margin-bottom: 0.4rem; opacity: 0.8; }
.footer-hadith { font-size: 0.8rem; color: rgba(232,201,122,0.6); font-style: italic; margin-bottom: 0.5rem; }
.footer-links { font-size: 0.72rem; color: rgba(232,201,122,0.4); }
.footer-links a { color: var(--gold); opacity: 0.7; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) { .charity-grid { grid-template-columns: 1fr; } .giving-types { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 480px) { .giving-types { grid-template-columns: 1fr; } .profile-top { flex-direction: column; } }
