/* =====================================================================
   Volunteering Module — Public site styles
   Clean, calm, trustworthy look. No external fonts/CDNs (fast + offline-safe
   on shared hosting) — uses the visitor's native system font.
   ===================================================================== */

:root {
  --color-bg:        #f8f7f4;
  --color-surface:   #ffffff;
  --color-border:    #e6e2d8;
  --color-text:      #2b2a27;
  --color-text-soft: #665f52;
  --color-primary:   #1f6f5c;   /* deep teal-green — trust, calm */
  --color-primary-dark: #165445;
  --color-primary-soft: #eef4f1; /* light tint used behind the hero and image placeholders */
  --color-accent:    #c9922a;   /* warm gold accent, used sparingly */
  --color-whatsapp:  #25d366;
  --color-whatsapp-dark: #1da851;
  --color-ongoing:   #1f6f5c;
  --color-completed: #5b6470;
  --color-paused:    #b3821f;
  --color-seeking:   #a16207;   /* "Seeking funding" badge */
  --radius: 14px;
  --shadow: 0 2px 10px rgba(30, 30, 25, 0.06);
  --shadow-hover: 0 8px 24px rgba(30, 30, 25, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans Arabic", "Noto Naskh Arabic", sans-serif;
  --container-width: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 14px; }

/* ---------------- Header ---------------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
}
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.4rem; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }

.lang-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-link {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--color-text-soft);
  border: 1px solid transparent;
}
.lang-link:hover { text-decoration: none; background: var(--color-bg); }
.lang-link.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 48px 0 28px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-primary-soft) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
}
.hero h1 { margin-bottom: 8px; }
.hero-subtitle { color: var(--color-text-soft); max-width: 620px; margin: 0 auto; }

/* ---------------- Filters ---------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 24px;
}
.filter-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-soft);
  font-size: 0.9rem;
}
.filter-pill:hover { text-decoration: none; border-color: var(--color-primary); }
.filter-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ---------------- Project grid ---------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
  margin-bottom: 48px;
}
.project-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  box-shadow: var(--shadow);
  transition: box-shadow .18s ease, transform .18s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.project-card:focus-within { z-index: 2; } /* keep an open share menu above the next card */
.project-card-link {
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-card-link:hover { text-decoration: none; }
.project-card-link:hover .project-title { color: var(--color-primary); }
.project-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--color-primary-soft);
  overflow: hidden;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.project-card-image img { width: 100%; height: 100%; object-fit: cover; }
.project-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
}
.status-badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.status-ongoing   { background: var(--color-ongoing); }
.status-completed { background: var(--color-completed); }
.status-paused    { background: var(--color-paused); }
.status-seeking_funding { background: var(--color-seeking); }

.project-card-body { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.project-category { font-size: 0.78rem; color: var(--color-accent); font-weight: 600; }
.project-title { font-size: 1.1rem; margin: 0; }
.project-summary { color: var(--color-text-soft); font-size: 0.92rem; flex: 1; margin-bottom: 4px; }
.project-cta { font-weight: 600; font-size: 0.9rem; }

.project-card-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.82rem;
  color: var(--color-text-soft);
}
.funding-mini { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.funding-mini-text { font-size: 0.78rem; color: var(--color-text-soft); font-weight: 600; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary);
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 14px;
  border-top: 1px solid var(--color-border);
}

/* ---------------- Share buttons ---------------- */
.share-menu { position: relative; }
.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-soft);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.share-toggle::-webkit-details-marker { display: none; }
.share-toggle:hover, .share-menu[open] .share-toggle { border-color: var(--color-primary); color: var(--color-primary); }
.share-menu-list {
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 30;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
}
.share-menu-list .share-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
  text-align: start;
  cursor: pointer;
}
.share-menu-list .share-item:hover { background: var(--color-bg); text-decoration: none; }

.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}
.share-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-soft);
  margin-inline-end: 4px;
}
.share-bar .share-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.share-bar .share-item:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.share-bar .share-whatsapp { border-color: var(--color-whatsapp); color: var(--color-whatsapp-dark); }
.share-bar .share-native { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ---------------- At a glance (project page) ---------------- */
.project-lead { font-size: 1.1rem; color: var(--color-text-soft); margin: 4px 0 0; }
.glance {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 8px 0 22px;
  box-shadow: var(--shadow);
}
.glance-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-primary);
  margin-bottom: 12px;
}
.glance-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 24px;
  margin: 0;
}
.glance-item { margin: 0; }
.glance-item-wide { grid-column: 1 / -1; }
.glance-item dt { font-size: 0.78rem; color: var(--color-text-soft); font-weight: 600; }
.glance-item dd { margin: 2px 0 0; font-weight: 600; }
.glance-item .progress { margin-top: 6px; }
.glance-muted { color: var(--color-text-soft); font-weight: 400; font-size: 0.88rem; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-soft);
}

/* ---------------- Project detail ---------------- */
.project-detail { padding-top: 24px; padding-bottom: 60px; }
.back-link { font-weight: 600; font-size: 0.92rem; }
.project-detail-header { display: flex; gap: 10px; align-items: center; margin: 14px 0 6px; }
.project-detail-header .status-badge { position: static; display: inline-block; }
.project-meta { color: var(--color-text-soft); }
.project-detail-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.project-description { font-size: 1.02rem; margin: 20px 0; }

/* Text typed in the admin (project descriptions, About page) */
.rich-text h2 { font-size: 1.2rem; margin: 26px 0 8px; }
.rich-text h2:first-child { margin-top: 0; }
.rich-text ul { margin: 0 0 14px; padding-inline-start: 22px; }
.rich-text li { margin-bottom: 4px; }

/* ---------------- Budget breakdown (project page) ---------------- */
.budget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 22px;
  box-shadow: var(--shadow);
}
.budget-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.budget-intro { color: var(--color-text-soft); font-size: 0.92rem; margin-bottom: 12px; }
.budget-list { list-style: none; margin: 0; padding: 0; }
.budget-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.budget-label { flex: 1 1 200px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.budget-amount { font-weight: 700; min-width: 80px; text-align: end; font-variant-numeric: tabular-nums; }
.budget-action { min-width: 140px; text-align: end; }
.budget-item.is-funded .budget-label,
.budget-item.is-funded .budget-amount { color: var(--color-text-soft); text-decoration: line-through; text-decoration-thickness: 1px; }
.budget-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.budget-tag-priority { background: #fdf0d8; color: var(--color-seeking); }
.budget-tag-funded { background: var(--color-primary-soft); color: var(--color-primary); }
.budget-fund {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-whatsapp);
  color: var(--color-whatsapp-dark);
  font-size: 0.82rem;
  font-weight: 700;
}
.budget-fund:hover { background: var(--color-whatsapp); color: #fff; text-decoration: none; }
.budget-summary { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; }
.budget-summary div { margin: 0; }
.budget-summary dt { font-size: 0.78rem; color: var(--color-text-soft); font-weight: 600; }
.budget-summary dd { margin: 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.budget-summary-priority dd { color: var(--color-seeking); }
@media (max-width: 560px) {
  .budget-amount, .budget-action { min-width: 0; text-align: start; }
}

/* ---------------- Main navigation + About page ---------------- */
.main-nav { display: flex; gap: 4px; margin-inline-end: auto; margin-inline-start: 12px; }
.main-nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--color-text-soft);
  font-weight: 600;
  font-size: 0.92rem;
}
.main-nav-link:hover { background: var(--color-bg); text-decoration: none; }
.main-nav-link.active { color: var(--color-primary); }
.hero-compact { padding: 36px 0 22px; }
.about-page { max-width: 760px; padding-top: 28px; padding-bottom: 50px; }
.about-body { font-size: 1.04rem; }
.about-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 8px; }
.footer-more { margin-top: 8px !important; font-weight: 600; }
@media (max-width: 560px) {
  .main-nav { margin-inline-start: 0; order: 3; width: 100%; }
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 20px 0 30px;
}
.project-gallery img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

/* ---------------- Buttons ---------------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
}
.button:hover { background: var(--color-primary-dark); text-decoration: none; }

.whatsapp-cta { margin: 30px 0 10px; }
.button-whatsapp { background: var(--color-whatsapp); }
.button-whatsapp:hover { background: var(--color-whatsapp-dark); }
.wa-icon { font-size: 1.1rem; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 0 40px;
  color: var(--color-text-soft);
  font-size: 0.85rem;
  background: var(--color-surface);
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px 40px;
  padding-bottom: 24px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--color-border);
}
.footer-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text);
  margin-bottom: 10px;
}
.footer-about p { margin: 0; }
.footer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.footer-list span { color: var(--color-text); font-weight: 600; }
.social-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.social-link {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-soft);
}
.social-link:hover { text-decoration: none; border-color: var(--color-primary); color: var(--color-primary); }
.footer-bottom { text-align: center; }
.footer-note { max-width: 560px; margin: 0 auto 10px; }
.footer-rights { margin: 0; }

/* ---------------- Floating WhatsApp button ---------------- */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  z-index: 20;
  transition: transform .15s ease, background .15s ease;
}
.whatsapp-float:hover { background: var(--color-whatsapp-dark); transform: scale(1.06); }

/* ---------------- Admin preview bar / maintenance page ---------------- */
.admin-preview-bar {
  background: #7a5410;
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 16px;
}
.admin-preview-bar a { color: #fff; text-decoration: underline; font-weight: 700; }

.maintenance-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(180deg, var(--color-primary-soft) 0%, var(--color-bg) 100%);
}
.maintenance-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow);
}
.maintenance-icon { font-size: 2.6rem; margin-bottom: 8px; }
.maintenance-logo { width: 96px; height: 96px; object-fit: contain; margin: 0 auto 12px; }
.maintenance-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-weight: 600; }
.maintenance-langs { justify-content: center; margin-top: 18px; }

.not-found { padding-top: 40px; padding-bottom: 40px; text-align: center; }
.not-found .empty-state { padding: 10px 20px 20px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 560px) {
  .hero { padding: 34px 0 22px; }
  h1 { font-size: 1.5rem; }
  .header-inner { padding: 12px 16px; }
}
