/*
Theme Name: EarthWays Field Journal
Description: Custom theme carrying the approved 2026 EarthWays design. Built for EarthWays Foundation.
Version: 1.1
Text Domain: earthways
*/

/* ============================================================
   EarthWays Foundation -- "The Field Journal"
   Ink Forest / Canopy / Paper / Stone / Ochre
   Zilla Slab (display) - Albert Sans (body) - IBM Plex Mono (marginalia)
   Deliberately single-theme: this is paper and ink, in every light.
   ============================================================ */

:root {
  --ink-forest: #16241B;
  --ink-forest-soft: #1E3025;
  --canopy: #2E5339;
  --canopy-light: #9CC5A5;
  --paper: #FAF8F0;
  --paper-deep: #F1EEE1;
  --stone: #66705F;
  --rose: #DFB56A;      /* Ochre: antique-map gold, chosen 2026-08-24 */
  --rose-deep: #8D651E;
  --line: rgba(22, 36, 27, 0.16);
  --line-light: rgba(250, 248, 240, 0.22);
  --paper-70: rgba(250, 248, 240, 0.7);
  --paper-82: rgba(250, 248, 240, 0.82);

  --font-display: 'Zilla Slab', 'Rockwell', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Albert Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-pad: clamp(4rem, 9vw, 7.5rem);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-forest);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--rose-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--rose); color: var(--ink-forest);
  padding: 0.6rem 1rem; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 0; }

.wrap { max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- typography ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500; line-height: 1.14; letter-spacing: -0.005em;
  text-wrap: balance;
}
.display-xl { font-size: clamp(2.4rem, 6.2vw, 4.6rem); }
.display-lg { font-size: clamp(1.9rem, 4vw, 3rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--stone); display: block; margin-bottom: 1.1rem;
}
.on-dark .eyebrow { color: var(--rose); }

.lede { font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.55; max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1.1em; }
.prose a { color: var(--canopy); text-decoration-color: var(--rose); text-underline-offset: 3px; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 240, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 4.25rem; position: relative;
}
.wordmark { display: flex; align-items: center; text-decoration: none; flex: none; }
.wordmark img { width: clamp(9.5rem, 19vw, 13.5rem); height: auto; }

.site-nav ul { display: flex; gap: clamp(0.9rem, 2.2vw, 1.9rem); list-style: none; align-items: center; }
.site-nav a {
  text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: 0.4rem 0.1rem; border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.site-nav a:hover { border-bottom-color: var(--rose); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--canopy); }
.site-nav a.btn:hover, .site-nav a.btn[aria-current="page"] { border-bottom-color: transparent; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  font-size: 0.95rem; padding: 0.7rem 1.5rem; border-radius: 999px;
  border: 1.5px solid var(--ink-forest); cursor: pointer;
  font-family: var(--font-body); line-height: 1.4;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-solid { background: var(--ink-forest); color: var(--paper); }
.btn-solid:hover { background: var(--canopy); border-color: var(--canopy); }
.btn-rose { background: var(--rose); border-color: var(--rose); color: var(--ink-forest); }
.btn-rose:hover { background: var(--rose-deep); border-color: var(--rose-deep); color: var(--paper); }
.btn-ghost-light { border-color: var(--line-light); color: var(--paper); background: transparent; }
.btn-ghost-light:hover { background: var(--paper); color: var(--ink-forest); border-color: var(--paper); }

.nav-toggle { display: none; }

.site-nav li.has-sub { position: relative; }
.site-nav li.has-sub > a::after { content: " \25BE"; font-size: 0.7em; color: var(--stone); }
.site-nav .subnav {
  display: none; position: absolute; top: 100%; left: -0.9rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.45rem 0.9rem; min-width: 12rem; list-style: none; z-index: 60;
}
.site-nav li.has-sub:hover .subnav, .site-nav li.has-sub:focus-within .subnav { display: block; }

.vol {
  justify-self: start; padding-top: 0.3rem;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--stone);
}
.btn-amazon { margin-top: 1.1rem; }

@media (max-width: 1000px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: none; border: 1.5px solid var(--line);
    border-radius: 999px; padding: 0.45rem 1rem;
    font: 600 0.85rem var(--font-body); color: var(--ink-forest); cursor: pointer;
  }
  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 1rem var(--gutter) 1.5rem;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
  .site-nav a { font-size: 1.05rem; }
  .site-nav .subnav { display: block; position: static; border: none; background: transparent; padding: 0.3rem 0 0 1.1rem; min-width: 0; }
  .site-nav .subnav a { font-size: 0.95rem; color: var(--stone); }
}

/* ---------- views (client-side pages) ---------- */

.view { display: none; }
.view.current { display: block; }

/* ---------- hero ---------- */

.hero { background: var(--ink-forest); color: var(--paper); position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 3; padding-block: clamp(5rem, 12vw, 9.5rem); }

/* the graticule -- a map's latitude/longitude net, drawn in ink-light hairlines */
.hero-grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, rgba(250,248,240,0.09) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(to bottom, rgba(250,248,240,0.06) 0 1px, transparent 1px 88px);
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 35%, transparent 100%);
}
.hero-earth {
  position: absolute; z-index: 2;
  right: clamp(1.5rem, 6vw, 6rem); top: clamp(4.5rem, 11vw, 8.5rem);
  width: min(30vw, 380px); aspect-ratio: 1;
  border-radius: 50%;
  background-image: url('assets/img/bg-8c8cb6b99a.jpg');
  background-size: cover; background-position: center;
  filter: saturate(0.9);
  box-shadow: 0 0 90px rgba(223, 181, 106, 0.3), 0 0 26px rgba(223, 181, 106, 0.18);
  opacity: 0.95;
  animation: rise 1s ease 0.55s both;
}
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 1.6rem; color: var(--paper-82); max-width: 44ch; }
.hero-actions { margin-top: 2.4rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-meta {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(250, 248, 240, 0.68);
  display: flex; gap: 2rem; flex-wrap: wrap;
  position: relative; z-index: 4;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .hero-earth { right: -14vw; top: 2.5rem; width: 52vw; opacity: 0.35; }
}

.page-hero { background: var(--ink-forest); color: var(--paper); position: relative; overflow: hidden; }
.page-hero .wrap { padding-block: clamp(3.5rem, 8vw, 6rem); position: relative; z-index: 3; }
.page-hero .lede { margin-top: 1.2rem; color: var(--paper-82); }

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

.section { padding-block: var(--section-pad); }
.section-deep { background: var(--paper-deep); }
.section-dark { background: var(--ink-forest); color: var(--paper); }
.section-head { margin-bottom: clamp(2.2rem, 5vw, 3.5rem); max-width: 46rem; }
.section-head p { margin-top: 1rem; color: var(--stone); }
.section-dark .section-head p { color: var(--paper-70); }

.split {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  align-items: start;
}
.stack { display: grid; gap: 1.4rem; justify-items: start; }

.pledge { border-left: 4px solid var(--rose); padding-left: clamp(1.2rem, 3vw, 2rem); }
.pledge strong {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1; display: block;
  color: var(--canopy); font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.section-dark .pledge strong { color: var(--rose); }
.pledge span { display: block; margin-top: 0.6rem; max-width: 30ch; }

/* ---------- the field ledger (signature) ---------- */

.ledger { border-top: 1px solid var(--line); }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) 1fr minmax(8rem, 10rem);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.4rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.ledger-row .coord {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.08em; color: var(--stone);
  line-height: 1.8; text-transform: uppercase;
}
.ledger-row h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
.ledger-row p { margin-top: 0.5rem; color: var(--stone); font-size: 0.97rem; max-width: 58ch; }
.section-dark .ledger, .section-dark .ledger-row { border-color: var(--line-light); }
.section-dark .ledger-row p, .section-dark .ledger-row .coord { color: rgba(250, 248, 240, 0.65); }

.ledger-photo {
  grid-column: 3; justify-self: end; align-self: start;
  width: 100%; max-width: 11rem; margin: 0;
  background: #fff; border: 1px solid var(--line);
  padding: 0.4rem 0.4rem 0;
  box-shadow: 0 10px 24px rgba(22, 36, 27, 0.14);
  transform: rotate(var(--tilt, -1.6deg));
}
.ledger-photo img { width: 100%; height: auto; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
.ledger-photo figcaption {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--stone); padding: 0.45rem 0.1rem; line-height: 1.5;
}
.section-dark .ledger-photo { border-color: var(--line-light); }

.ledger-gallery {
  grid-column: 2 / -1; display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
}
.ledger-gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); padding: 0.3rem 0.3rem 0; }
.ledger-gallery img { width: 100%; height: auto; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
.ledger-gallery figcaption {
  font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--stone); padding: 0.35rem 0.1rem; line-height: 1.4;
}

/* click-to-enlarge for project photos */
.ledger-photo img, .ledger-gallery img { cursor: zoom-in; }
.ledger-photo img:focus-visible, .ledger-gallery img:focus-visible { outline: 3px solid var(--rose-deep); outline-offset: 3px; }
.photo-viewer {
  border: none; padding: 0; background: transparent;
  max-width: 100vw; max-height: 100vh; margin: auto; overflow: visible;
}
.photo-viewer::backdrop { background: rgba(22, 36, 27, 0.88); }
.photo-viewer figure {
  margin: 0; background: #fff; padding: 0.6rem 0.6rem 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.photo-viewer img {
  display: block; width: auto; height: auto;
  max-width: min(92vw, 68rem); max-height: 78vh; cursor: zoom-out;
}
.photo-viewer figcaption {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--stone); padding: 0.6rem 0.2rem;
}
.photo-viewer button {
  font: 600 0.72rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  background: none; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.35rem 0.9rem; color: var(--ink-forest); cursor: pointer; flex: none;
}
.photo-viewer button:hover { background: var(--ink-forest); color: var(--paper); border-color: var(--ink-forest); }

.stamp {
  justify-self: start;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em;
  text-transform: uppercase; padding: 0.3rem 0.7rem;
  border: 1px solid currentColor; border-radius: 3px;
  transform: rotate(-2deg); white-space: nowrap;
}
.stamp-active { color: var(--canopy); }
.stamp-spun { color: var(--rose-deep); }
.section-dark .stamp-active { color: var(--canopy-light); }
.section-dark .stamp-spun { color: var(--rose); }

@media (max-width: 640px) {
  .ledger-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .ledger-photo { grid-column: 1; justify-self: start; max-width: 14rem; margin-top: 0.9rem; }
  .ledger-gallery { grid-column: 1; grid-template-columns: repeat(2, 1fr); margin-top: 0.6rem; }
  .stamp { margin-top: 0.4rem; }
}

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

.card-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: clamp(1.5rem, 3vw, 2.2rem);
}
.section-dark .card { background: var(--ink-forest-soft); border-color: var(--line-light); }
.card h3 { font-size: 1.25rem; margin-bottom: 0.7rem; }
.card p { color: var(--stone); font-size: 0.97rem; }
.section-dark .card p { color: var(--paper-70); }
.card .eyebrow { margin-bottom: 0.8rem; }
.card-link {
  text-decoration: none; display: inline-block; margin-top: 1rem;
  font-weight: 600; font-size: 0.92rem; color: var(--canopy);
  background: none; border: 0; font-family: var(--font-body); cursor: pointer;
}
.card-link::after { content: " \2192"; }
.card-link:hover { text-decoration: underline; text-decoration-color: var(--rose); text-underline-offset: 3px; }
.section-dark .card-link { color: var(--rose); }
.ledger-row p.ledger-contact { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.04em; }
.ledger-contact a { color: inherit; text-decoration-color: var(--rose); text-underline-offset: 3px; }

.book-feature {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(12rem, 17rem) 1fr; align-items: center;
}
.book-feature img { border-radius: 6px; box-shadow: 0 24px 60px rgba(22, 36, 27, 0.35); transform: rotate(-1.5deg); }
@media (max-width: 640px) { .book-feature { grid-template-columns: 1fr; } }

blockquote.pull {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.35; max-width: 26ch;
}
blockquote.pull footer {
  margin-top: 1.4rem; font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--stone);
}
.section-dark blockquote.pull footer { color: var(--rose); }

/* people */
.people { list-style: none; columns: 2; column-gap: 3rem; max-width: 40rem; }
.people li { padding-block: 0.55rem; border-bottom: 1px solid var(--line-light); break-inside: avoid; }
.people li small {
  display: block; font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-70);
}
@media (max-width: 560px) { .people { columns: 1; } }

/* timeline */
.timeline { list-style: none; border-left: 2px solid var(--rose); max-width: var(--measure); }
.timeline li { padding: 0 0 1.8rem 1.6rem; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 0.5em;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper-deep); border: 2.5px solid var(--canopy);
}
.timeline .year {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em;
  color: var(--canopy); display: block; margin-bottom: 0.2rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- contact details ---------- */

.contact-line { font-size: 0.95rem; color: var(--stone); }
.section-dark .contact-line { color: var(--paper-70); }
.contact-line a { color: var(--canopy); text-underline-offset: 3px; }
.section-dark .contact-line a { color: var(--rose); }

.contact-list { display: grid; grid-template-columns: minmax(5.5rem, auto) 1fr; gap: 0.55rem 1.5rem; }
.contact-list dt {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--stone); padding-top: 0.25rem;
}
.contact-list dd { margin: 0; }
.contact-list a { color: var(--canopy); text-underline-offset: 3px; }

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

.site-footer { background: var(--ink-forest); color: var(--paper-70); font-size: 0.94rem; }
.site-footer .wrap { padding-block: clamp(3rem, 6vw, 4.5rem); }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 2fr 1fr 1fr; }
.site-footer img { width: 160px; margin-bottom: 1.2rem; }
.site-footer h4 {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--rose); margin-bottom: 1rem; font-weight: 500;
}
.site-footer ul { list-style: none; }
.site-footer li { padding-block: 0.25rem; }
.site-footer a { color: var(--paper-82); text-decoration: none; }
.site-footer a:hover { color: var(--rose); text-decoration: underline; }
.footer-legal {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line-light);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: rgba(250, 248, 240, 0.5);
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- reveal on scroll ---------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* ---------- field photos (signature) ---------- */

figure.field-photo {
  background: #fff; border: 1px solid var(--line);
  padding: 0.55rem 0.55rem 0;
  box-shadow: 0 14px 34px rgba(22, 36, 27, 0.16);
  transform: rotate(var(--tilt, -1.2deg));
  margin: 0;
}
.field-photo img { width: 100%; height: auto; }
.field-photo figcaption {
  font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--stone); padding: 0.6rem 0.15rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.field-photo figcaption span:last-child { font-variant-numeric: tabular-nums; }
.photo-strip {
  display: grid; gap: clamp(1.4rem, 3.5vw, 2.75rem);
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  align-items: start;
}
.photo-strip .field-photo:nth-child(2) { --tilt: 1.1deg; margin-top: 1.5rem; }
.photo-strip .field-photo:nth-child(3) { --tilt: -0.5deg; margin-top: 0.5rem; }
.photo-strip-inset { margin-top: clamp(2.2rem, 5vw, 3.5rem); }
@media (max-width: 640px) {
  .photo-strip .field-photo { --tilt: 0deg; margin-top: 0 !important; }
}


/* ---------- hero load-in ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.view.current .hero .eyebrow, .view.current .page-hero .eyebrow { animation: rise 0.6s ease 0.05s both; }
.view.current .hero h1, .view.current .page-hero h1 { animation: rise 0.7s ease 0.18s both; }
.view.current .hero .lede, .view.current .page-hero .lede { animation: rise 0.7s ease 0.34s both; }
.view.current .hero .hero-actions { animation: rise 0.7s ease 0.5s both; }
.view.current .hero .hero-meta { animation: rise 0.9s ease 0.68s both; }


/* WordPress theme additions */
.view { display: block; }
.ew-photo-placeholder { background: var(--paper-deep); border: 1px dashed var(--line); padding: 1rem; font-family: var(--font-mono); font-size: .75rem; color: var(--stone); }
body:not(.js) .reveal { opacity: 1 !important; transform: none !important; }
