/*
 * Dhara of Humanity - public site styles.
 * Plain CSS on purpose: Hostinger shared hosting has no Node build step, so
 * what is in this file is exactly what ships. Ported from the Next.js SCSS.
 * Page-specific rules live in /css/pages/<page>.css.
 */

/* Earth green + warm clay. Reads as environment/relief work rather than the
   default charity red, and stays legible against photography. */
:root {
  --brand: #2e7d32;
  --brand-dark: #1f5b25;
  --brand-light: #e8f3e9;
  --accent: #c2703a;
  --ink: #1b2a20;
  --ink-muted: #5f7167;
  --bg: #ffffff;
  --surface-tint: #f4f8f5;
  --line: #dfe7e2;
  --danger: #b91c1c;
  --night: #14251a;
  --radius: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
p { margin: 0 0 1rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--brand);
  color: #fff;
}
.skip-link:focus { left: 16px; top: 12px; }

/* ---------- layout primitives ---------- */

.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 16px;
}

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--tint { background: var(--surface-tint); }

.section-head { max-width: 44rem; margin-bottom: 2.5rem; }
.section-head p { color: var(--ink-muted); margin-bottom: 0; }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn--outline { border-color: var(--line); background: #fff; color: var(--ink); }
.btn--outline:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn--ghost { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.24); }
.btn--block { width: 100%; }
.btn--sm { padding: 0.45rem 1rem; font-size: 0.85rem; }

/* ---------- cards ---------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover { box-shadow: 0 12px 28px rgba(20, 37, 26, 0.09); transform: translateY(-2px); }

.card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--surface-tint);
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--surface-tint) 0%, #e4eee7 100%);
}
.card__placeholder--brand { background: linear-gradient(135deg, var(--brand-light) 0%, #d7e9d9 100%); }

.card__body {
  padding: 1.15rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.card__body .tag { align-self: flex-start; }
.card__title { font-size: 1.05rem; font-weight: 650; margin: 0; }
.card__text { color: var(--ink-muted); font-size: 0.9rem; margin: 0; flex: 1; }
.card__meta { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.8rem; color: var(--ink-muted); }

.card__urgent {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* campaign card */
.campaign-progress { margin-top: 0.35rem; }
.campaign-figures {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.campaign-figures strong { color: var(--brand-dark); font-size: 0.98rem; }
.campaign-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.campaign-card__donors { font-size: 0.82rem; color: var(--ink-muted); }

/* ---------- misc ---------- */

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag--urgent { background: #fee2e2; color: #991b1b; }

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

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-size: 0.82rem; font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 0.92rem;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.14);
}
.field textarea { resize: vertical; min-height: 120px; }
.field__error { color: var(--danger); font-size: 0.78rem; }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--danger); }

.checkbox { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.87rem; margin-bottom: 0.75rem; }
.checkbox input { margin-top: 0.2rem; flex: 0 0 auto; width: auto; }

.form-alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.form-alert--error { background: #fee2e2; color: #991b1b; }
.form-alert--success { background: var(--brand-light); color: var(--brand-dark); }

.prose { max-width: 44rem; }
.prose h2, .prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.35rem; }
.prose img { border-radius: var(--radius); margin-block: 1.5rem; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.15rem;
  border-left: 3px solid var(--brand);
  color: var(--ink-muted);
  font-style: italic;
}

.empty { text-align: center; padding: 4rem 1rem; color: var(--ink-muted); }
.empty h1, .empty h2, .empty h3 { color: var(--ink); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.02rem; flex: 0 0 auto; }
.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-dark) 100%);
  flex: 0 0 auto;
}
.brand__logo { height: 34px; width: auto; }
.brand__text { white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 1.35rem; }
.site-nav__link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}
.site-nav__link:hover { color: var(--brand); }
.site-nav__link.is-active { color: var(--brand); font-weight: 600; }
.site-nav__cta { padding: 0.5rem 1rem; font-size: 0.88rem; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}
.burger span { display: block; height: 2px; width: 18px; margin-inline: auto; background: var(--ink); border-radius: 2px; }

@media (max-width: 1023px) {
  .burger { display: flex; }
  .site-nav {
    position: absolute;
    inset: 68px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 16px 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    /* Collapsed by default; the burger toggles .is-open. */
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav__link { padding-block: 0.7rem; border-bottom: 1px solid var(--line); }
  .site-nav__cta { margin-top: 0.75rem; width: 100%; }
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--night);
  color: rgba(255, 255, 255, 0.72);
  padding-block: 3.5rem 1.5rem;
  font-size: 0.9rem;
}
.site-footer a:hover { color: #fff; }
.site-footer h4 {
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.55rem; }

.site-footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.site-footer__brand { color: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: 0.6rem; }
.site-footer__about p { max-width: 24rem; }
.site-footer__socials { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; font-size: 0.85rem; }
.site-footer__contact p { margin-bottom: 0.4rem; }
.site-footer__address { white-space: pre-line; color: rgba(255, 255, 255, 0.55); font-size: 0.85rem; }

.site-footer__registrations {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-block: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}
.site-footer__registrations strong { color: rgba(255, 255, 255, 0.85); font-weight: 600; }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 1.25rem; }

@media (max-width: 900px) { .site-footer__top { grid-template-columns: repeat(2, 1fr); gap: 2rem; } }
@media (max-width: 560px) { .site-footer__top { grid-template-columns: 1fr; } }

/* newsletter (footer) */
.newsletter { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.newsletter input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.87rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.newsletter input::placeholder { color: rgba(255, 255, 255, 0.45); }
.newsletter input:focus { outline: none; border-color: var(--brand); }
.newsletter button {
  font: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}
.newsletter button:disabled { opacity: 0.6; cursor: not-allowed; }
.newsletter button:hover:not(:disabled) { background: var(--brand-dark); }

/* ---------- page hero (every inner page) ---------- */

.page-hero {
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  background: var(--surface-tint);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { margin-bottom: 0.4rem; }
.page-hero p { color: var(--ink-muted); max-width: 46rem; margin-bottom: 0; }
/* With a photo behind it the copy flips to light so it stays readable. */
.page-hero--image { border-bottom: 0; }
.page-hero--image h1 { color: #fff; }
.page-hero--image p { color: rgba(255, 255, 255, 0.85); }
.page-hero--image .eyebrow { color: #a6d6a9; }

/* ---------- pagination ---------- */

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-top: 2.5rem; }
.pagination__item {
  min-width: 40px;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  background: #fff;
}
.pagination__item:hover { border-color: var(--brand); color: var(--brand); }
.pagination__item.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- stat strip ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat-strip__item { background: #fff; padding: 1.5rem 1.25rem; text-align: center; }
.stat-strip__value {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1.1;
}
.stat-strip__label { display: block; margin-top: 0.35rem; font-size: 0.82rem; color: var(--ink-muted); }

/* ---------- home sections ---------- */

.home-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(420px, 62vh, 620px);
  display: flex;
  align-items: center;
  background: linear-gradient(140deg, var(--night) 0%, var(--brand-dark) 100%);
  color: #fff;
  overflow: hidden;
}
.home-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.45;
}
.home-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(20, 37, 26, 0.88) 0%, rgba(20, 37, 26, 0.55) 60%, rgba(20, 37, 26, 0.3) 100%);
}
.home-hero__inner { padding-block: 3.5rem; max-width: 44rem; }
.home-hero__inner h1 { color: #fff; }
.home-hero__inner p { color: rgba(255, 255, 255, 0.86); font-size: clamp(1rem, 1.5vw, 1.12rem); max-width: 38rem; }
.home-hero__actions, .donate-cta__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.quote {
  margin: 0;
  padding: 1.75rem 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.quote blockquote { margin: 0; font-size: 0.97rem; color: var(--ink); flex: 1; }
.quote figcaption { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.85rem; }
.quote figcaption strong { color: var(--brand-dark); }
.quote figcaption span { color: var(--ink-muted); }

.partner-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2.5rem; }
/* Desaturated at rest so a wall of brand colours does not compete with the
   page; full colour on hover. */
.partner-strip__logo { filter: grayscale(1); opacity: 0.65; transition: filter 0.2s ease, opacity 0.2s ease; }
.partner-strip__logo:hover { filter: none; opacity: 1; }
.partner-strip__logo img { width: 140px; height: 56px; object-fit: contain; }

.donate-cta {
  background: linear-gradient(140deg, var(--brand-dark) 0%, var(--night) 100%);
  color: #fff;
  padding-block: clamp(3rem, 6vw, 4.5rem);
  text-align: center;
}
.donate-cta h2 { color: #fff; }
.donate-cta p { color: rgba(255, 255, 255, 0.82); max-width: 42rem; margin-inline: auto; }
.donate-cta__actions { justify-content: center; margin-top: 1.5rem; }

/* ---------- toasts (site.js) ---------- */

.toast-stack {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(420px, calc(100% - 32px));
}
.toast {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 24px rgba(20, 37, 26, 0.18);
}
.toast--success { background: var(--brand); }
.toast--error { background: var(--danger); }
