/* Fonts are vendored by `npm run vendor`. Licences: /fonts/*-LICENSE.txt */
@font-face {
  font-family: "Lora";
  src: url("/fonts/lora-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --forest: #1f4433;
  --forest-dark: #163226;
  --forest-ink: #15211b;
  --gold: #f2c97a;
  --gold-dark: #e6b85f;
  --ochre: #8c6520;
  --sand: #f3ede3;
  --cream: #faf7f2;
  --note: #f8f0df;

  --ink: #1c2420;
  --muted: #5a625e;
  --line: #e3ddd2;
  --surface: #ffffff;
  --error: #b42318;

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 0.5rem;
  --shadow: 0 1px 2px rgba(28, 36, 32, 0.06), 0 12px 32px rgba(28, 36, 32, 0.1);
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: var(--forest); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }

h1, h2, h3 { text-wrap: balance; }

img { max-width: 100%; height: auto; }

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: -10rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--forest);
  color: #fff;
}
.skip:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }

/* Buttons that are links */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.375rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s;
}
.pill-forest { background: var(--forest); color: #fff; }
.pill-forest:hover { background: var(--forest-dark); color: #fff; }
.pill-gold { background: var(--gold); color: var(--forest-ink); }
.pill-gold:hover { background: var(--gold-dark); color: var(--forest-ink); }

.arrow-link {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.arrow-link::after { content: "\00a0\2192"; display: inline-block; text-decoration: none; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}
.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding-block: 0.625rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}
/* The logo carries the CPALI wordmark, so it needs more height than a plain mark to stay legible. */
.brand img { width: auto; height: 3.5rem; }
.brand-long { display: none; font-size: 1.0625rem; letter-spacing: -0.005em; }

/* On a phone the nav takes its own row under the logo. */
.site-nav {
  display: flex;
  order: 3;
  justify-content: space-between;
  width: 100%;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}
.site-nav a {
  padding: 0.375rem 0.25rem;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--forest); text-decoration: underline; }

@media (min-width: 40rem) {
  .site-nav { justify-content: flex-start; gap: 1.5rem; }
}

@media (min-width: 64rem) {
  .header-bar { flex-wrap: nowrap; gap: 1.75rem; padding-block: 0.875rem; }
  .brand img { height: 4rem; }
  .brand-long { display: inline; }
  .site-nav { order: 0; width: auto; gap: 1.75rem; padding: 0; border: 0; }
  .site-nav a { padding-inline: 0; }
}

/* Hero: intro, form, then photo on a phone; intro and photo beside the form on a wide screen. */

.hero { padding-block: 2rem 2.5rem; background: var(--sand); }
.hero-grid {
  display: grid;
  grid-template-areas: "intro" "form" "photo";
  gap: 1.75rem;
}
.hero-intro { grid-area: intro; }
.hero-photo {
  grid-area: photo;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 0.75rem;
  object-fit: cover;
}
.give-form { grid-area: form; }

h1 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.875rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.lede { max-width: 36rem; margin: 0; color: #3d4541; font-size: 1.0625rem; }

@media (min-width: 60rem) {
  .hero { padding-block: 3.5rem 2.5rem; }
  .hero-grid {
    grid-template-areas: "intro form" "photo form";
    grid-template-columns: minmax(0, 1fr) 27rem;
    grid-template-rows: auto 1fr;
    column-gap: 3.5rem;
    row-gap: 2rem;
  }
  .hero-photo { align-self: start; }
  .nowrap-lg { white-space: nowrap; }
}

/* Gift form */

.give-form {
  align-self: start;
  padding: 1.5rem 1.25rem;
  border-radius: 0.875rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 7rem;
}
@media (min-width: 60rem) {
  .give-form { padding: 1.75rem 1.75rem 1.5rem; scroll-margin-top: 5.5rem; }
}

.give-form h2 { margin: 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 500; }
.form-sub { margin: 0.25rem 0 1.25rem; color: var(--muted); font-size: 0.8125rem; }

fieldset { min-width: 0; margin: 0 0 1.25rem; padding: 0; border: 0; }
legend { padding: 0; }
.field-label { margin-bottom: 0.5rem; font-size: 0.8125rem; font-weight: 600; }

/* Two options side by side in one track, like a switch. */
.toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.25rem;
  border-radius: 999px;
  background: #efe9de;
}
.toggle label { position: relative; display: block; }
.toggle input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.toggle span {
  display: block;
  padding: 0.5rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  transition: background-color 0.12s, box-shadow 0.12s;
}
.toggle input:checked + span { background: var(--surface); box-shadow: 0 1px 3px rgba(28, 36, 32, 0.15); font-weight: 600; }
.toggle input:focus-visible + span { outline: 3px solid var(--ochre); outline-offset: 1px; }

.amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.amount { position: relative; display: block; }
.amount input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.amount span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  border: 1px solid #cfc8bb;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.amount:hover span { border-color: var(--forest); }
.amount input:checked + span { border-color: var(--forest); background: var(--forest); color: #fff; }
.amount input:focus-visible + span { outline: 3px solid var(--ochre); outline-offset: 2px; }

.field { margin-top: 0.875rem; }
.field label { display: block; margin-bottom: 0.375rem; font-size: 0.875rem; font-weight: 600; }
.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #cfc8bb;
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
}
.field textarea { resize: vertical; }
.field input:focus,
.field textarea:focus { border-color: var(--forest); outline: 3px solid rgba(31, 68, 51, 0.2); }

.money { position: relative; }
.money span {
  position: absolute;
  top: 50%;
  left: 0.875rem;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 600;
}
.field .money input { padding-left: 1.75rem; font-weight: 600; }

.impact-note {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  background: var(--note);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.impact-note svg { flex: none; margin-top: 0.05rem; color: var(--ochre); }

.options { display: grid; gap: 0.75rem; margin-bottom: 1.25rem; }
.check { display: flex; gap: 0.625rem; align-items: flex-start; font-size: 0.8125rem; line-height: 1.45; cursor: pointer; }
.check input {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--forest);
}

.dedication { padding: 1rem; border-radius: var(--radius); background: var(--cream); }
/* A floated legend sits inside the fieldset's padding instead of on its edge. */
.dedication legend { float: left; width: 100%; margin-bottom: 0.625rem; font-size: 0.8125rem; font-weight: 600; }
.dedication legend + * { clear: both; }
.dedication .toggle { background: #ebe4d7; }

.hint { margin: 0.875rem 0 0; color: var(--muted); font-size: 0.8125rem; }
.error { margin: 0.5rem 0 0; color: var(--error); font-size: 0.875rem; font-weight: 500; }
.give-form > .error { margin: 0 0 1rem; }

.turnstile { margin-bottom: 0.75rem; }
.turnstile:empty { margin: 0; }

.donate,
.button {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--forest);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s;
}
.donate:hover,
.button:hover { background: var(--forest-dark); color: #fff; }
.donate:disabled { opacity: 0.6; cursor: wait; }

.secure {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: center;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}
.secure svg { flex: none; margin-top: 0.15rem; }
.legal { margin: 0.375rem 0 0; color: var(--muted); font-size: 0.75rem; text-align: center; }

/* Trust strip */

.trust { border-block: 1px solid var(--line); background: var(--surface); }
.trust-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2.5rem;
  margin: 0 auto;
  padding-block: 1rem;
  list-style: none;
  font-size: 0.8125rem;
}
.trust-list li { display: flex; gap: 0.625rem; align-items: center; }
.trust-badge { display: block; width: 8rem; height: 8rem; }
.trust-list a { display: block; border-radius: 0.75rem; }
.trust-list a:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; }

/* Content sections */

.band { padding-block: 3rem; }
.band-cream { background: var(--cream); }
@media (min-width: 48rem) {
  .band { padding-block: 4.5rem; }
}

.eyebrow {
  margin: 0 0 0.625rem;
  color: var(--ochre);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-title {
  max-width: 34rem;
  margin: 0 0 2rem;
  font-family: var(--serif);
  font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem);
  font-weight: 500;
  line-height: 1.2;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stats li {
  padding: 1.125rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.stats strong {
  display: block;
  margin-bottom: 0.375rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.375rem);
  font-weight: 400;
  line-height: 1.1;
}
.stats span { display: block; color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }
@media (min-width: 56rem) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
  .stats li { padding: 1.375rem 1.25rem; }
}

.impacts { display: grid; gap: 2rem; }
.impact img { display: block; width: 100%; aspect-ratio: 3 / 2; border-radius: var(--radius); object-fit: cover; }
.impact h3 { margin: 1rem 0 0.375rem; font-size: 1rem; font-weight: 600; }
.impact p { margin: 0; color: var(--muted); font-size: 0.875rem; }
.more { margin: 2rem 0 0; }
@media (min-width: 48rem) {
  .impacts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
}

.band-forest { background: var(--forest); color: #fff; }
.band-forest .eyebrow { color: var(--gold); }
.band-forest .section-title { margin-bottom: 0.75rem; }
.monthly { display: grid; gap: 1.5rem; align-items: center; }
.monthly p:last-child { max-width: 34rem; margin: 0; color: rgba(255, 255, 255, 0.86); font-size: 0.9375rem; }
.monthly .pill { justify-self: start; padding: 0.75rem 1.5rem; }
@media (min-width: 48rem) {
  .monthly { grid-template-columns: 1fr auto; gap: 3rem; }
}

.ways { display: grid; gap: 1rem; }
.way {
  display: flex;
  flex-direction: column;
  padding: 1.375rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  background: var(--surface);
}
.way-icon { color: var(--forest); }
.way h3 { margin: 0.875rem 0 0.5rem; font-size: 0.9375rem; font-weight: 600; }
.way p { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.8125rem; line-height: 1.55; }
.way .arrow-link { margin-top: auto; font-size: 0.8125rem; }
.way-shop { border-color: #e7dcc6; background: var(--sand); }

.ein {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.25rem 0 1.25rem;
  padding: 0.5rem 0.5rem 0.5rem 0.875rem;
  border-radius: 0.375rem;
  background: var(--sand);
  font-size: 0.8125rem;
}
.ein button {
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.3125rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.ein button:hover { border-color: var(--forest); }

/* Tanana's logo, from tananasilk.com. Its faded moths are darkened slightly so they show on the sand card. */
.tanana { align-self: flex-start; width: 14rem; }

@media (min-width: 40rem) {
  .ways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 60rem) {
  .ways { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
}

.faq-band { border-top: 1px solid var(--line); }
.faq { max-width: 46rem; }
.faq .section-title { margin-bottom: 1.25rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.25rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.15s;
}
.faq details[open] summary::after { transform: translateY(25%) rotate(-135deg); }
.faq details p { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.9375rem; }

/* Footer */

.site-footer { padding-block: 2.5rem 2rem; background: var(--forest-ink); color: rgba(255, 255, 255, 0.86); font-size: 0.8125rem; }
.site-footer a { color: var(--gold); }
.site-footer a:hover { color: #fff; }

.signup { display: grid; gap: 1.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.signup h2 { margin: 0 0 0.375rem; color: #fff; font-family: var(--serif); font-size: 1.375rem; font-weight: 500; line-height: 1.25; }
.signup p { margin: 0; }
.signup-form label { display: block; margin-bottom: 0.5rem; color: #fff; font-weight: 600; }
.signup-row { display: flex; gap: 0.5rem; }
.signup-row input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font: inherit;
}
.signup-row input::placeholder { color: rgba(255, 255, 255, 0.45); }
.signup-row input:focus { border-color: var(--gold); outline: 2px solid rgba(242, 201, 122, 0.35); }
.signup-status { margin-top: 0.75rem !important; }

.footer-base { display: grid; gap: 1.5rem; padding-top: 2rem; }
.footer-places { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; margin: 0; }
.footer-places dt { color: #fff; font-weight: 600; }
.footer-places dd { margin: 0.125rem 0 0; }
.footer-legal { margin: 0; }
.footer-credit { margin: 1.5rem 0 0; color: rgba(255, 255, 255, 0.6); font-size: 0.6875rem; }

@media (min-width: 48rem) {
  .signup { grid-template-columns: 1fr minmax(0, 24rem); align-items: end; gap: 3rem; }
  .footer-base { grid-template-columns: 1fr auto; align-items: start; }
  .footer-legal { text-align: right; }
}

/* Thank-you and not-found pages */

.page-plain { background: var(--sand); }
.narrow { max-width: 42rem; padding-block: 2.5rem 4rem; }
.panel {
  padding: 2rem 1.5rem;
  border-radius: 0.875rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel h1 { font-size: 1.875rem; }
.panel .badge { display: block; margin-bottom: 1rem; color: var(--forest); }
.panel .button { display: inline-block; width: auto; padding: 0.75rem 1.5rem; font-size: 1rem; }

@media (min-width: 60rem) {
  .panel { padding: 2.5rem; }
}
