/* ──────────────────────────────────────────────────────────────
   Rideekanda — Herbal Plant Planting Programme
   Paper palette, forest-green accent. Matches the family look used
   across the other project pages.
   ────────────────────────────────────────────────────────────── */
:root {
  --bg: #f4ede0;
  --bg-deep: #ece3d1;
  --card: #fdfbf6;
  --ink: #1f1a14;
  --ink-soft: #4a4034;
  --muted: #8a7d68;
  --line: #e6dcc6;
  --accent: #2d4a32;
  --accent-soft: #5b7a5f;
  --accent-tint: #e2e9dd;
  --gold: #c08a3e;
  --shadow-sm: 0 1px 2px rgba(57,44,22,.04), 0 0 0 1px rgba(57,44,22,.04);
  --shadow-md: 0 12px 32px -16px rgba(57,44,22,.18), 0 2px 6px -2px rgba(57,44,22,.06), 0 0 0 1px rgba(57,44,22,.04);
  --shadow-lg: 0 32px 64px -32px rgba(57,44,22,.25), 0 8px 24px -12px rgba(57,44,22,.1), 0 0 0 1px rgba(57,44,22,.05);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --sinhala: "Noto Serif Sinhala", "Iskoola Pota", serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.si { font-family: var(--sinhala); }
a { color: inherit; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

.eyebrow {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.section-heading { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-heading h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05;
  letter-spacing: -.015em; margin: 14px 0 14px; text-wrap: balance;
}
.section-heading h2 em { font-style: italic; font-weight: 400; color: var(--accent); }
.section-heading .kicker {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(17px, 1.6vw, 21px); color: var(--muted);
  margin: 0 auto; max-width: 640px; line-height: 1.5;
}

.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: .3px;
  border-radius: 999px; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.btn-primary {
  padding: 13px 24px; background: var(--accent); color: #fdfbf6;
  border: 1px solid rgba(0,0,0,.05); box-shadow: 0 8px 22px -10px rgba(45,74,50,.55);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost { padding: 12px 22px; background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  position: relative; text-align: center;
  padding: clamp(60px, 9vw, 110px) 28px clamp(40px, 6vw, 72px);
  max-width: 1000px; margin: 0 auto;
}
.hero-lotus { width: 78px; height: auto; opacity: .95; margin: 0 auto 14px; display: block; }
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(42px, 7vw, 84px); line-height: 1.02;
  letter-spacing: -.02em; margin: 16px 0 10px; text-wrap: balance;
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.hero-si { font-family: var(--sinhala); font-size: clamp(15px, 1.8vw, 20px); color: var(--ink-soft); margin-bottom: 20px; }
.hero-kicker {
  font-family: var(--serif); font-style: italic; font-size: clamp(17px, 1.8vw, 22px);
  color: var(--muted); max-width: 620px; margin: 0 auto 28px; line-height: 1.55;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
/* Hero carrying a few paragraphs rather than a single lede. */
.hero-body { max-width: 760px; margin: 0 auto 26px; text-align: left; }
.hero-body p { font-size: clamp(15px, 1.5vw, 17.5px); line-height: 1.85; color: var(--ink-soft); margin-bottom: 15px; }
.hero-body p:last-child { margin-bottom: 0; }
.hero-body .hero-call {
  color: var(--accent); font-weight: 600;
  padding-top: 12px; border-top: 1px solid var(--line); margin-top: 20px;
}
@media (max-width: 560px) { .hero-body p { font-size: 15px; line-height: 1.85; } }

.lang-switch {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 18px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink-soft); text-decoration: none;
  transition: border-color .15s, color .15s;
}
.lang-switch:hover { border-color: var(--accent-soft); color: var(--accent); }

/* ── PROGRESS STATS ───────────────────────────────────────── */
.stats { max-width: 1000px; margin: 0 auto; padding: 0 28px clamp(48px, 7vw, 88px); }
.stats-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-md); padding: 34px 32px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.stat { text-align: center; }
.stat-num { font-family: var(--serif); font-size: clamp(30px, 3.6vw, 44px); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 8px; font-weight: 600; }
.progress-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); border-radius: 999px; transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* ── ABOUT ────────────────────────────────────────────────── */
.about { padding: clamp(48px, 7vw, 88px) 28px; max-width: 1180px; margin: 0 auto; }
/* The prose column was removed, so this is the four steps alone. One column,
   centred, rather than the old text-beside-steps split. */
.about-grid { display: grid; grid-template-columns: 1fr; }
.about-text h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 4vw, 50px); line-height: 1.06; letter-spacing: -.015em; margin: 14px 0 20px; text-wrap: balance; }
.about-text h2 em { font-style: italic; font-weight: 400; color: var(--accent); }
.about-text p { color: var(--ink-soft); margin-bottom: 15px; line-height: 1.75; }
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 940px; margin: 0 auto; width: 100%; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.step-n {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 18px; font-weight: 600;
}
.step-t { font-weight: 600; margin-bottom: 3px; }
.step-d { font-size: 14.5px; color: var(--muted); line-height: 1.6; }

/* ── PLANT LISTS ──────────────────────────────────────────── */
.plants { padding: clamp(48px, 7vw, 88px) 28px; max-width: 1180px; margin: 0 auto; }
.list-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.list-tab {
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.list-tab:hover { border-color: var(--accent-soft); }
.list-tab.on { background: var(--accent); border-color: var(--accent); color: #fdfbf6; }
.list-tab small { display: block; font-size: 10.5px; font-weight: 500; opacity: .75; letter-spacing: .04em; }

.search-row { display: flex; gap: 10px; align-items: center; max-width: 560px; margin: 0 auto 26px; }
.search-box { position: relative; flex: 1; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-box input {
  width: 100%; padding: 13px 14px 13px 40px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font-family: var(--sans); font-size: 14.5px; color: var(--ink);
}
.search-box input:focus { outline: none; border-color: var(--accent-soft); }
.list-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.filter-select {
  flex: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 34px 9px 16px; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a7d68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}
.filter-select:hover { border-color: var(--accent-soft); }
.filter-select:focus { outline: none; border-color: var(--accent-soft); }

/* ── tile / list view switch ───────────────────────────────── */
.view-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); flex: none; }
.view-switch button {
  width: 34px; height: 30px; display: grid; place-items: center; cursor: pointer;
  border: 0; background: transparent; color: var(--muted); border-radius: 999px;
  transition: background .15s, color .15s;
}
.view-switch button svg { width: 16px; height: 16px; }
.view-switch button:hover { color: var(--accent); }
.view-switch button.on { background: var(--accent); color: #fdfbf6; }

/* ── list view ─────────────────────────────────────────────── */
.plant-rows { display: flex; flex-direction: column; gap: 8px; }
.plant-row {
  display: grid; grid-template-columns: 62px 1.15fr 1.1fr 1.25fr auto;
  gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; box-shadow: var(--shadow-sm);
  transition: border-color .2s;
}
.plant-row:hover { border-color: var(--accent-soft); }
.plant-row .pr-no { font-family: var(--sans); font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.plant-row .pr-name { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.plant-row .plant-si { font-size: 17px; }
.plant-row .pr-roman { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.plant-row .pr-en { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.plant-row .pr-sci { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.plant-row .pr-act { display: flex; align-items: center; gap: 12px; justify-content: flex-end; white-space: nowrap; }
.plant-row .plant-pledged { font-size: 11px; }

@media (max-width: 900px) {
  .plant-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }
  .plant-row .pr-act {
    justify-content: space-between; margin-top: 8px; padding-top: 10px;
    border-top: 1px solid var(--line);
    /* A long pledger name beside the button overflowed the row on phones. */
    white-space: normal; flex-wrap: wrap; gap: 8px 12px;
  }
  .plant-row .plant-pledged { flex: 1 1 auto; min-width: 0; }
  .plant-row .pr-sci, .plant-row .pr-en { overflow-wrap: anywhere; }
}

.plant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.plant-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 3px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.plant-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
.plant-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.plant-no { font-family: var(--sans); font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
/* Shown on search results so it is clear which list a plant came from —
   the same species in the two lists is two separate claims. */
.plant-list-tag {
  font-family: var(--sans); font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent);
}
.plant-list-tag.ref { background: var(--bg-deep); color: var(--muted); }
.plant-si { font-family: var(--sinhala); font-size: 19px; line-height: 1.35; color: var(--ink); }
.plant-name { font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.2; color: var(--ink); }
.plant-en { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.plant-sci { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.plant-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.plant-pledged { font-size: 11.5px; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.plant-pledged svg { width: 13px; height: 13px; }
.plant-pledged.none { color: var(--muted); font-weight: 500; }
.btn-pledge {
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: var(--accent-tint); border: 1px solid transparent; color: var(--accent);
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  transition: background .15s, color .15s;
}
.btn-pledge:hover { background: var(--accent); color: #fdfbf6; }
.btn-pledge.is-upload {
  background: var(--accent); color: #fdfbf6; border-color: var(--accent);
}
.btn-pledge.is-upload:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn-pledge.is-taken {
  background: transparent; border-color: var(--line);
  color: var(--muted); cursor: default;
}
.btn-pledge.is-taken:hover { background: transparent; color: var(--muted); }
.plant-card:has(.is-taken) { opacity: .72; }
.plant-card:has(.is-taken):hover { transform: none; border-color: var(--line); box-shadow: var(--shadow-sm); }

.more-row { text-align: center; margin-top: 28px; }
.list-empty { text-align: center; padding: 60px 20px; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 20px; }

/* ── PLANTED GALLERY ──────────────────────────────────────── */
.planted { padding: clamp(48px, 7vw, 88px) 28px; max-width: 1180px; margin: 0 auto; }
.planted-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.planted-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.planted-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--bg-deep); }
.planted-body { padding: 14px 16px 16px; }
.planted-name { font-family: var(--serif); font-size: 18px; font-weight: 500; }
.planted-si { font-family: var(--sinhala); font-size: 14px; color: var(--ink-soft); }
.planted-by { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 99600; display: none; }
.modal.is-open { display: block; }
.modal-overlay { position: absolute; inset: 0; background: rgba(31,26,20,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 28px 28px 26px;
}
.modal-x { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; border-radius: 50%; }
.modal-x:hover { background: var(--bg-deep); color: var(--ink); }
.modal-panel h3 { font-family: var(--serif); font-weight: 500; font-size: 27px; line-height: 1.15; margin: 8px 0 4px; }
.modal-plant { background: var(--bg-deep); border-radius: 12px; padding: 14px 16px; margin: 14px 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-family: var(--sans); font-size: 15px; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent-soft); }
.field textarea { resize: vertical; min-height: 70px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.form-err { color: #a8351a; font-size: 13.5px; margin-bottom: 12px; }
.claim-box { background: var(--accent-tint); border-radius: 12px; padding: 16px; margin: 16px 0; }
.claim-link { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; color: var(--accent); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: block; margin-top: 8px; }
.ok-mark { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; }
.ok-mark svg { width: 26px; height: 26px; }

/* ── FOOTER NOTE ──────────────────────────────────────────── */
.closing { padding: clamp(48px, 7vw, 80px) 28px clamp(60px, 8vw, 100px); max-width: 780px; margin: 0 auto; text-align: center; }
.closing-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-md); padding: 44px 40px 46px; }
.closing-card p { color: var(--ink-soft); line-height: 1.8; margin-bottom: 14px; }
.closing-verse { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); line-height: 1.6; }
.closing-src { font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-top: 14px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .stats-card { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; padding: 26px 22px; }
}
@media (max-width: 560px) {
  .hero { padding: 44px 18px 32px; }
  .about, .plants, .planted { padding-left: 18px; padding-right: 18px; }
  .stats { padding-left: 18px; padding-right: 18px; }
  .plant-grid { grid-template-columns: 1fr; }
  /* Search on its own line, with the count and the view switch sharing the
     next one rather than each taking a full row. */
  .search-row { flex-wrap: wrap; align-items: center; row-gap: 12px; }
  .search-box { flex: 1 1 100%; }
  .list-count { flex: 1 1 auto; text-align: left; }
  .filter-select { flex: 1 1 auto; }
  .view-switch { margin-left: auto; }
  .list-count { text-align: center; }
  .modal-panel { padding: 24px 20px 22px; }
  .closing-card { padding: 32px 22px 34px; }
}
