/* RISE UP FOUNDATION — Modern NGO UI */
@import url("header.css");
@import url("chat.css");
@import url("survey.css");
@import url("footer.css");
@import url("pages.css");
:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --orange: #f59e0b;
  --navy: #1a237e;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --header-h: 72px;
  --glass: rgba(255, 255, 255, 0.85);
  --gradient-hero: linear-gradient(135deg, #15803d 0%, #2563eb 50%, #1a237e 100%);
}

[data-theme="dark"] {
  --text: #f1f5f9;
  --muted: #94a3b8;
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --glass: rgba(30, 41, 59, 0.9);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.65;
  background: var(--bg);
  transition: background 0.3s, color 0.3s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--green-dark); }
.container { width: min(1200px, 92%); margin-inline: auto; }

/* Top bar */
.top-bar {
  background: linear-gradient(90deg, #0f172a, var(--navy), #15803d);
  color: #e2e8f0;
  font-size: 0.78rem;
  padding: 0.45rem 0;
  font-weight: 500;
}
.top-bar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.top-bar a { color: #a5f3fc; }
.social-top a {
  margin-left: 0.75rem;
  opacity: 0.9;
}
.social-top a:hover { opacity: 1; color: #fff; }

/* Header — see css/header.css */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
}
.btn-primary:hover { color: #fff; }
.btn-accent {
  background: linear-gradient(135deg, var(--orange), #ea580c);
  color: #fff;
}
.btn-accent:hover { color: #fff; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
}
.btn-ghost {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
}
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.25); }
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; }

/* Hero */
.hero-modern {
  position: relative;
  min-height: min(92vh, 720px);
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
}
/* legacy hero-modern — homepage uses home.css */
.hero-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(245,158,11,0.2) 0%, transparent 40%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 0 5rem;
  max-width: 720px;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.3);
}
.hero-modern h1 {
  font-size: clamp(2.2rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-modern .lead {
  font-size: 1.15rem;
  opacity: 0.95;
  margin-bottom: 1.75rem;
  max-width: 560px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Impact band */
.impact-band {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  margin-top: -3rem;
  position: relative;
  z-index: 10;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-inline: auto;
  width: min(1140px, 92%);
}
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
}
.impact-item {
  text-align: center;
  padding: 1.75rem 1rem;
  border-right: 1px solid var(--border);
}
.impact-item:last-child { border-right: none; }
.impact-item strong {
  display: block;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  color: var(--green);
  font-weight: 800;
  line-height: 1.1;
}
.impact-item span {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Sections */
section { padding: 4.5rem 0; }
section.alt { background: var(--surface); }
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}
.section-head h2 {
  color: var(--text);
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  margin: 0 0 0.5rem;
  font-weight: 800;
}
.section-head p { color: var(--muted); margin: 0; }
.section-label {
  display: inline-block;
  color: var(--green);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.filter-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-tab:hover,
.filter-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.program-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.25s, box-shadow 0.25s;
}
.program-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.program-card-img {
  height: 160px;
  overflow: hidden;
  background: var(--bg);
}
.program-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.program-card:hover .program-card-img img { transform: scale(1.05); }
.program-card-body { padding: 1.35rem; }
.program-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--text);
}
.program-card p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.card-link {
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Campaign cards */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.campaign-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.campaign-card h3 { margin: 0 0 0.5rem; color: var(--text); }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 1rem 0 0.5rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 999px;
  transition: width 1s ease;
}
.campaign-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Story spotlight */
.story-spotlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.story-spotlight-img {
  min-height: 320px;
  background: var(--gradient-hero);
}
.story-spotlight-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}
.story-spotlight-body { padding: 2rem 2.5rem 2rem 0; }
.quote-mark {
  font-size: 3rem;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Instagram */
.instagram-section {
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}
.instagram-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: start;
}
.instagram-cta-card {
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.instagram-cta-card h3 { margin: 0 0 0.5rem; color: #fff; }
.instagram-cta-card p { opacity: 0.95; margin-bottom: 1.25rem; }
.instagram-cta-card .btn { background: #fff; color: #833ab4; }
.instagram-embed-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 400px;
}
.instagram-embed-wrap iframe {
  width: 100%;
  min-height: 480px;
  border: none;
}
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: block;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.75));
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* Trust / transparency */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.trust-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.trust-card .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

/* Newsletter */
.newsletter-box {
  background: var(--gradient-hero);
  color: #fff;
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 480px;
  margin: 1.5rem auto 0;
  justify-content: center;
}
.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
}

/* CTA band */
.cta-band {
  background: var(--navy);
  color: #e2e8f0;
  text-align: center;
  padding: 4rem 0;
}
.cta-band h2 { color: #fff; margin: 0 0 0.5rem; }
.cta-band p { opacity: 0.9; margin-bottom: 1.5rem; }

/* Page hero */
.page-hero {
  background: var(--gradient-hero);
  color: #fff;
  padding: 3.5rem 0;
  text-align: center;
}
.page-hero h1 { margin: 0 0 0.5rem; font-size: 2.25rem; }
.page-intro {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.7;
}

/* Forms */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  align-items: start;
  max-width: 960px;
  margin: 0 auto;
}
.contact-info-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.contact-info-panel h3 {
  margin: 0 0 1.25rem;
  color: var(--text);
  font-size: 1.25rem;
}
.contact-details {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-details li {
  margin-bottom: 1.25rem;
  color: var(--muted);
  line-height: 1.5;
}
.contact-details a {
  color: var(--green);
  font-weight: 500;
  word-break: break-word;
}
.contact-details strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}
.contact-layout .form-panel {
  max-width: none;
  margin: 0;
}
.form-panel {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg);
  color: var(--text);
}
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* Lightbox — lazima [hidden] ifanye kazi (display:flex ilikuwa inafunua kila wakati) */
#lightbox[hidden] {
  display: none !important;
}
#lightbox:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
#lightbox img { max-height: 90vh; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

/* Legacy footer (pages without --modern class only) */
.site-footer:not(.site-footer--modern) {
  background: #0f172a;
  color: #94a3b8;
  padding: 3.5rem 0 1.5rem;
}
.site-footer:not(.site-footer--modern) .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.site-footer:not(.site-footer--modern) h4 { color: #f8fafc; margin: 0 0 1rem; font-size: 0.95rem; }
.site-footer:not(.site-footer--modern) ul { list-style: none; padding: 0; margin: 0; }
.site-footer:not(.site-footer--modern) li { margin-bottom: 0.45rem; }
.site-footer:not(.site-footer--modern) a { color: #94a3b8; }
.site-footer:not(.site-footer--modern) a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-social,
.social-top-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.footer-logo-wrap {
  display: inline-block;
  background: #ffffff;
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  line-height: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.footer-logo-wrap:hover {
  opacity: 0.95;
}
.footer-logo {
  width: auto;
  max-width: 200px;
  height: 56px;
  object-fit: contain;
  display: block;
}
.header-utility .social-link,
.footer-social a,
.social-top-icons a {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  transition: transform 0.2s, color 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.header-utility .social-link:hover,
.footer-social a:hover,
.social-top-icons a:hover {
  background: linear-gradient(135deg, var(--green), #22c55e);
  color: #fff;
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.45);
}
.header-utility .social-link--whatsapp:hover,
.social-top-icons .social-link--whatsapp:hover { background: #25d366; }
.header-utility .social-link--instagram:hover,
.social-top-icons .social-link--instagram:hover { background: #e4405f; }
.header-utility .social-link--youtube:hover,
.social-top-icons .social-link--youtube:hover { background: #ff0000; }
.header-utility .social-link--tiktok:hover,
.social-top-icons .social-link--tiktok:hover { background: #000000; }
.social-top-icons a {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}
.social-top-icons svg {
  width: 18px;
  height: 18px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
}

.badge-api {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.6rem;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  font-size: 0.72rem;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Legacy card compat */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-top: 4px solid var(--green);
}
.card.orange { border-top-color: var(--orange); }

/* Responsive */
@media (max-width: 900px) {
  .story-spotlight,
  .instagram-layout,
  .trust-grid { grid-template-columns: 1fr; }
  .story-spotlight-body { padding: 1.5rem; }
  .impact-item { border-right: none; border-bottom: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
}
