
/* initiative.css – shared by every initiative child page */

:root {
  --bg: #e0e6d8;
  --card: #fdf8ef;
  --ink: #3b2616;
  --muted: #6a5846;
  --green: #4f6b3a;
  --dark: #2a1a10;
  --onDark: #fdf8ef;

  --g1: #c8963a;
  --g2: #6b4a22;

  --hf: 'Bitter', Georgia, serif;
  --bf: 'Figtree', system-ui, sans-serif;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* DARK MODE */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171b15;
    --card: #252b21;
    --ink: #f3ecdf;
    --muted: #c2baa9;
    --green: #b2cf91;
    --dark: #0e120c;
    --onDark: #fdf8ef;

    color-scheme: dark;
  }

  html,
  body {
    background-color: var(--bg);
    color: var(--ink);
  }

  /* Prevent conflicting light backgrounds */
  .about,
  section {
    background-color: transparent;
    color: var(--ink);
  }

  .about p,
  .about h2,
  .about h3,
  section h2,
  section h3 {
    color: var(--ink);
  }

  .facts,
  .card,
  .row {
    background-color: var(--card);
    color: var(--ink);
  }

  .facts ul,
  .card p,
  .row span {
    color: var(--muted);
  }

  .back {
    color: var(--green);
  }

  .pill {
    color: var(--green);
    border-color: var(--green);
  }

  .pill:hover {
    background: var(--green);
    color: #171b15;
  }

  .foot a {
    background: var(--dark);
    color: var(--onDark);
  }

  dialog#lightbox {
    background: var(--card);
    color: var(--ink);
  }
}

/* Per-initiative colours */
body[data-initiative="education"] {
  --g1: #c8963a;
  --g2: #6b4a22;
}

body[data-initiative="medical"] {
  --g1: #b8892f;
  --g2: #5a3d17;
}

body[data-initiative="skills"] {
  --g1: #6b4a33;
  --g2: #2a1a10;
}

body[data-initiative="trees"] {
  --g1: #4f6b3a;
  --g2: #1d2a14;
}

body[data-initiative="elderly"] {
  --g1: #c8963a;
  --g2: #5a3d28;
}

/* GLOBAL */
* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--bf);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}

section {
  margin: 10px 0;
}

h1,
h2,
h3 {
  font-family: var(--hf);
  line-height: 1.15;
  margin: 0;
}

h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  margin-bottom: 18px;
}

/* BACK NAVIGATION */
.back {
  display: inline-block;
  margin: 22px 0 14px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.back:hover {
  text-decoration: underline;
}

.foot {
  text-align: center;
  margin: 0 0 56px;
}

.foot a {
  display: inline-block;
  background: var(--dark);
  color: var(--onDark);
  border-radius: 99px;
  padding: 14px 32px;
  font-weight: 600;
  text-decoration: none;
}

/* BANNER */
.banner {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  color: #fdf8ef;
  min-height: 340px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  display: flex;
  align-items: flex-end;
}

.banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner.noimg img {
  display: none;
}

.banner .emoji {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(84px, 16vw, 170px);
  line-height: 1;
  display: none;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .35));
}

.banner.noimg .emoji {
  display: block;
}

.banner .txt {
  position: relative;
  width: 100%;
  padding: clamp(28px, 6vw, 56px);
  background: linear-gradient(
    0deg,
    rgba(20, 12, 6, .78),
    rgba(20, 12, 6, 0)
  );
}

.banner h1 {
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 800;
  margin-bottom: 10px;
}

.banner p {
  margin: 0;
  max-width: 46ch;
  font-size: 19px;
}

/* ABOUT */
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  background: transparent;
  color: var(--ink);
}

.about p {
  margin: 0 0 14px;
  max-width: 62ch;
  color: var(--ink);
}

.facts {
  background: var(--card);
  color: var(--ink);
  border-radius: 22px;
  padding: 22px 24px;
  align-self: start;
}

.facts h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--ink);
}

.facts ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

/* ACTIVITIES */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  color: var(--ink);
  border-radius: 22px;
  padding: 22px 24px;
}

.card h3 {
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--ink);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* GALLERY */
.gal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ph {
  position: relative;
  overflow: hidden;
  border: 0;
  padding: 0;
  cursor: zoom-in;
  border-radius: 18px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  color: #fdf8ef;
  font: inherit;
}

.ph:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ph .fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 44px;
}

.ph .fallback small {
  font: 500 13px var(--bf);
  margin-top: 4px;
}

.ph.noimg img {
  display: none;
}

.ph.noimg .fallback {
  display: flex;
}

dialog#lightbox {
  border: 0;
  border-radius: 20px;
  padding: 0;
  max-width: min(92vw, 980px);
  background: var(--card);
  color: var(--ink);
}

dialog#lightbox::backdrop {
  background: rgba(10, 8, 4, .75);
}

dialog#lightbox img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
}

dialog#lightbox .cap {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

dialog#lightbox button {
  background: var(--dark);
  color: var(--onDark);
  border: 0;
  border-radius: 99px;
  padding: 8px 18px;
  font: 600 15px var(--bf);
  cursor: pointer;
}

/* NEWSLETTERS AND NEWS */
.list {
  display: grid;
  gap: 12px;
}

.row {
  background: var(--card);
  color: var(--ink);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.row b {
  font-family: var(--hf);
  font-size: 18px;
  display: block;
}

.row span {
  color: var(--muted);
  font-size: 15px;
}

.pill {
  border: 2px solid var(--green);
  color: var(--green);
  border-radius: 99px;
  padding: 8px 18px;
  font: 600 15px var(--bf);
  background: none;
  cursor: pointer;
  text-decoration: none;
}

.pill:hover {
  background: var(--green);
  color: var(--card);
}

.news .row {
  align-items: flex-start;
}

.news time {
  font-weight: 600;
  color: var(--green);
  min-width: 96px;
  font-size: 15px;
}

.news .t {
  flex: 1;
  min-width: 200px;
}

.news .row[hidden] {
  display: none;
}

.more {
  margin-top: 16px;
}

/* DONATION CTA */
.cta {
  background: #2a1a10;
  color: #fdf8ef;
  border-radius: 28px;
  padding: clamp(28px, 5vw, 56px);
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cta h2 {
  margin: 0 0 8px;
  color: #fdf8ef;
}

.cta p {
  margin: 0;
  max-width: 48ch;
  opacity: .9;
  color: #fdf8ef;
}

.btn {
  background: #fdf8ef;
  color: #2a1a10;
  border-radius: 99px;
  padding: 14px 30px;
  font: 600 17px var(--bf);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: #e8dcc4;
}

/* MOBILE */
@media (max-width: 720px) {
  .about {
    grid-template-columns: 1fr;
  }

  .gal {
    grid-template-columns: 1fr 1fr;
  }

  .ph:nth-child(1) {
    grid-column: span 2;
    grid-row: auto;
    aspect-ratio: 16 / 9;
  }
}


/* =========================================
   CHILD INITIATIVE DONATION MODAL
   ========================================= */

body[data-initiative] dialog#dd {
  width: min(92vw, 760px);
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  border: 1px solid rgba(106, 88, 70, .3);
  border-radius: 24px;
  background: var(--card);
  color: var(--ink);
  color-scheme: light;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}

body[data-initiative] dialog#dd::backdrop {
  background: rgba(0, 0, 0, .72);
}

body[data-initiative] #dd h2,
body[data-initiative] #dd p,
body[data-initiative] #dd label,
body[data-initiative] #dd label span {
  color: var(--ink);
}

body[data-initiative] #dd .sm,
body[data-initiative] #dd .receipt-hint {
  color: var(--muted);
}

body[data-initiative] #dd label {
  display: block;
  margin-bottom: 14px;
}

body[data-initiative] #dd input:not([type="checkbox"]),
body[data-initiative] #dd select,
body[data-initiative] #dd textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid rgba(106, 88, 70, .4);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

body[data-initiative] #dd input::placeholder {
  color: var(--muted);
  opacity: 1;
}

body[data-initiative] #dd .amount-option {
  margin: 4px;
  padding: 9px 16px;
  border: 1px solid var(--green);
  border-radius: 30px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

body[data-initiative] #dd .amount-option.active {
  background: var(--green);
  color: var(--dark);
}

body[data-initiative] #dd .btn {
  border: 0;
  background: var(--green);
  color: var(--dark);
  cursor: pointer;
}

body[data-initiative] #dd .x {
  position: sticky;
  float: right;
  top: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  cursor: pointer;
}

body[data-initiative] #dd a {
  color: var(--green);
}

body[data-initiative] #dd input[type="checkbox"] {
  accent-color: var(--green);
}

body[data-initiative] #dd .err {
  color: #c0392b;
}

body[data-initiative] #dd .ty > div[style] {
  background: var(--card) !important;
  color: var(--ink);
}

body[data-initiative] #dd .ty > div[style] p {
  color: var(--ink);
}

/* DARK MODE */
@media (prefers-color-scheme: dark) {
  body[data-initiative] dialog#dd {
    background: #252b21;
    color: #f3ecdf;
    border-color: #59634f;
    color-scheme: dark;
  }

  body[data-initiative] #dd h2,
  body[data-initiative] #dd p,
  body[data-initiative] #dd label,
  body[data-initiative] #dd label span {
    color: #f3ecdf;
  }

  body[data-initiative] #dd .sm,
  body[data-initiative] #dd .receipt-hint {
    color: #c2baa9;
  }

  body[data-initiative] #dd input:not([type="checkbox"]),
  body[data-initiative] #dd select,
  body[data-initiative] #dd textarea {
    background: #171d16;
    color: #f5eddf;
    border-color: #68735e;
  }

  body[data-initiative] #dd input::placeholder {
    color: #aaa995;
  }

  body[data-initiative] #dd .amount-option {
    background: #30392b;
    color: #f5eddf;
    border-color: #b2cf91;
  }

  body[data-initiative] #dd .amount-option.active {
    background: #b2cf91;
    color: #171b15;
  }

  body[data-initiative] #dd .btn {
    background: #b2cf91;
    color: #171b15;
  }

  body[data-initiative] #dd .x {
    color: #f5eddf;
  }

  body[data-initiative] #dd a {
    color: #b2cf91;
  }

  body[data-initiative] #dd input[type="checkbox"] {
    accent-color: #b2cf91;
  }

  body[data-initiative] #dd .ty > div[style] {
    background: #30392b !important;
    color: #f5eddf;
  }

  body[data-initiative] #dd .ty > div[style] p {
    color: #f5eddf;
  }

  body[data-initiative] #dd::backdrop {
    background: rgba(0, 0, 0, .82);
  }
}
