/* ==========================================================================
   The Barney Planter Trust — stylesheet
   Palette grounded in the subject: sun-baked soil, maize-leaf green,
   ochre seed, terracotta spear-tool rust.
   ========================================================================== */

:root {
  --sand:        #F6F1E4;   /* page background — dry-season field */
  --sand-deep:   #ECE3CC;   /* panel background */
  --soil:        #3B2A1E;   /* primary text — turned earth */
  --leaf:        #2F5233;   /* primary green — maize leaf */
  --leaf-deep:   #223C26;   /* hover / dark green */
  --rust:        #B5502C;   /* accent — spear-tool rust / terracotta */
  --rust-deep:   #93401F;
  --ochre:       #D9A441;   /* highlight — seed / sun */
  --line:        #D8CBAA;   /* hairline rule */
  --white:       #FFFDF8;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Work Sans', 'Segoe UI', Arial, sans-serif;
  --font-caption: 'JetBrains Mono', 'Courier New', monospace;

  --max-width: 1120px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--soil);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rust-deep); text-decoration-thickness: 1px; }
a:hover { color: var(--leaf-deep); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--leaf-deep);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.1rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

/* -- Row motif -------------------------------------------------------------
   Signature device: a line of evenly-spaced dots, echoing the planter's
   fixed 25cm seed-spacing / 75cm row-width. Used as section dividers. */
.row-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 3.2rem 0;
  color: var(--ochre);
}
.row-divider::before,
.row-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    to right, var(--line) 0 6px, transparent 6px 14px
  );
}
.row-divider span {
  font-family: var(--font-caption);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust-deep);
  white-space: nowrap;
}

/* -- Skip link / accessibility --------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--leaf-deep);
  color: var(--white);
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* -- Header / nav -------------------------------------------------------
   Full-width logo banner on top, nav bar below — same on every page. */
.site-header { background: var(--white); }

.header-banner {
  width: 100%;
  background: var(--white);
  text-align: center;
  padding: 14px 0;
}
.brand { display: inline-block; text-decoration: none; }
.banner-logo {
  display: block;
  width: 90%;
  max-width: 760px;
  height: auto;
  margin: 0 auto;
}

.main-nav {
  width: 100%;
  background: var(--leaf-deep);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-bottom: 4px solid var(--ochre);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  cursor: pointer;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-menu a {
  display: inline-block;
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: rgba(255,255,255,0.14);
  color: var(--ochre);
}
.nav-menu a.is-current {
  background: var(--ochre);
  color: var(--leaf-deep);
  font-weight: 600;
}
.nav-menu a.donate-link {
  background: var(--rust);
  color: var(--white);
  font-weight: 600;
}
.nav-menu a.donate-link:hover { background: var(--rust-deep); color: var(--white); }

@media (max-width: 860px) {
  .nav-bar { justify-content: space-between; }
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    justify-content: flex-start;
  }
  .nav-menu.is-open { display: flex; }
}

/* -- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--sand);
  color: var(--soil);
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
  padding-top: 44px;
  padding-bottom: 44px;
}
.hero h1 {
  color: var(--leaf-deep);
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.35em;
}
.hero .eyebrow {
  font-family: var(--font-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--rust-deep);
  margin-bottom: 0.4em;
  display: block;
}
.hero p { color: var(--soil); font-size: 1.05rem; margin-bottom: 0.6em; line-height: 1.5; }
.hero p:last-of-type { margin-bottom: 0; }
.hero .btn { margin-top: 0.4em; }
.hero-figure {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 16px 34px rgba(59,42,30,0.12);
}
.hero-figure img { border-radius: 2px; }
.hero-figure figcaption {
  font-family: var(--font-caption);
  font-size: 0.72rem;
  color: var(--soil);
  text-align: center;
  padding-top: 8px;
  letter-spacing: 0.04em;
}
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 40px; }
}

/* -- Page header (non-home pages) ------------------------------------------
   Matches the homepage's light palette now, instead of a dark green
   banner — just a slim title strip, not a second hero. */
.page-hero {
  background: var(--sand);
  color: var(--soil);
  padding: 20px 0;
  border-bottom: 3px solid var(--leaf);
}
.page-hero h1 {
  color: var(--leaf-deep);
  margin-bottom: 0.15em;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}
.page-hero .eyebrow {
  font-family: var(--font-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--rust-deep);
}

/* -- Content sections ------------------------------------------------------ */
.section { padding: 36px 0; }
.section--tint { background: var(--sand-deep); }
.lead { font-size: 1.15rem; color: var(--leaf-deep); font-family: var(--font-display); font-weight: 500; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 780px) {
  .two-col { grid-template-columns: 1fr; }
}
/* Stretches the figure so the photo fills exactly the height of the
   text block next to it, rather than the photo's own natural size. */
.two-col--match-height { align-items: start; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.figure {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 10px;
  border-radius: var(--radius);
}
.figure figcaption {
  font-family: var(--font-caption);
  font-size: 0.72rem;
  color: var(--soil);
  padding-top: 8px;
  letter-spacing: 0.03em;
}
/* Used where a portrait photo sits beside a text block — caps the image
   so it doesn't tower over the paragraphs next to it. */
.figure--compact { align-self: start; }
.figure--compact img {
  max-height: 260px;
  width: auto;
  margin: 0 auto;
}
.figure--barney img {
  max-height: 300px;
  width: auto;
  margin: 0 auto;
}

.problem-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.problem-list li {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--rust);
  padding: 12px 14px;
  font-size: 0.92rem;
}
@media (max-width: 700px) {
  .problem-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .problem-list { grid-template-columns: 1fr; }
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--soil);
}
.video-embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* -- Trustee grid -----------------------------------------------------
   Fixed-size thumbnails so every trustee photo reads at the same scale —
   a portrait-orientation original (like Stanley's) no longer stretches
   the whole row and squeezes the bio text into a narrow column. */
.trustee {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.trustee:first-of-type { border-top: none; }
.trustee img {
  width: 140px;
  height: 170px;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.trustee h3 { margin-bottom: 0.2em; }
.trustee .role {
  font-family: var(--font-caption);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rust-deep);
  display: block;
  margin-bottom: 0.7em;
}
@media (max-width: 600px) {
  .trustee { grid-template-columns: 96px 1fr; }
  .trustee img { width: 96px; height: 120px; }
}

/* -- Aims list ---------------------------------------------------------- */
.aims {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: aim;
}
.aims li {
  counter-increment: aim;
  position: relative;
  padding-left: 46px;
  margin-bottom: 1.1em;
}
.aims li::before {
  content: counter(aim);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--leaf);
  color: var(--white);
  font-family: var(--font-caption);
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}

/* -- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  font-family: var(--font-body);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.98rem;
}
.btn--donate {
  background: var(--rust);
  color: var(--white);
}
.btn--donate:hover { background: var(--rust-deep); color: var(--white); }
.btn--outline {
  background: transparent;
  border-color: var(--leaf);
  color: var(--leaf-deep);
}
.btn--outline:hover { background: var(--leaf); color: var(--white); }

.donate-banner {
  background: var(--ochre);
  color: var(--soil);
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--radius);
}
.donate-banner h2 { color: var(--soil); }
.donate-banner .btn--donate { margin-top: 8px; }

/* -- Contact form ----------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }

.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--leaf-deep);
}
.form-field .required { color: var(--rust-deep); }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.98rem;
  background: var(--white);
  color: var(--soil);
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--leaf);
}
.form-field textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 0.85rem; color: #6a6152; }

.form-field--checkbox { margin-bottom: 20px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--soil);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--leaf);
  flex-shrink: 0;
}

/* honeypot field — hidden from sighted users and real browsers,
   left in the tab order for nothing; bots that auto-fill every
   field will trip it. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-status {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: none;
}
.form-status.is-success { display: block; background: #E4EFE1; border: 1px solid var(--leaf); color: var(--leaf-deep); }
.form-status.is-error   { display: block; background: #F6E3DA; border: 1px solid var(--rust); color: var(--rust-deep); }

.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sand-deep);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.captcha-row label { margin: 0; font-weight: 600; font-size: 0.92rem; white-space: nowrap; }
.captcha-row input { width: 90px; flex: none; }

/* -- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--soil);
  color: rgba(255,253,248,0.85);
  padding: 40px 0 28px;
  margin-top: 40px;
  font-size: 0.9rem;
}
.site-footer a { color: var(--ochre); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
.footer-grid h4 {
  color: var(--white);
  font-family: var(--font-caption);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin-bottom: 0.9em;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: rgba(255,253,248,0.6);
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* -- Back to top ------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--leaf-deep);
  color: var(--white);
  border: 2px solid var(--ochre);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 150;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
