/*
 * Berkshire Local Nature Partnership — site stylesheet.
 *
 * The palette and type are deliberately the same as the map story at
 * /explore/ (engine/src/styles/main.css), so moving between the two feels
 * like one site: a warm off-white paper, deep green ink, one accent green.
 *
 * Headings are set in the story's serif; running text is set in a system
 * sans for readability on long policy-ish pages.
 */

:root {
  --ink: #1e2a22;
  --ink-soft: #4a5a50;
  --ink-faint: #6f7d74;
  --paper: #fbfaf6;
  --paper-warm: #f4f1e8;
  --paper-deep: #1e2a22;
  --accent: #2f7d3a;
  --accent-deep: #1f5c2b;
  --accent-pale: #e8f1e3;
  --rule: #ddd8cc;
  --focus: #b8860b;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --wrap: 68rem;
  --measure: 38rem;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.1rem); margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2rem); margin: 2.75rem 0 0.9rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; font-family: var(--sans); font-weight: 700; letter-spacing: -0.005em; }

p { margin: 0 0 1.1rem; }

a {
  color: var(--accent-deep);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

a:hover { color: var(--accent); }

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

strong { font-weight: 650; }

ul, ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
li { margin-bottom: 0.45rem; }
li:last-child { margin-bottom: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

blockquote {
  margin: 1.75rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--accent-deep);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------- Header and navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--accent-deep);
  color: var(--accent-pale);
}

.brand-mark svg { display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-size: 0.7rem;
  white-space: nowrap;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.15rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item { margin: 0; }

.nav-link {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}

.nav-link:hover {
  background: var(--paper-warm);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  color: var(--accent-deep);
  background: var(--accent-pale);
  font-weight: 650;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

@media (max-width: 62rem) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 10px 24px rgba(20, 35, 25, 0.1);
  }

  .site-nav.is-open { display: block; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    max-width: var(--wrap);
    margin: 0 auto;
  }

  .nav-link {
    padding: 0.7rem 0.75rem;
    font-size: 1rem;
  }
}

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

.section {
  padding: 3.5rem 0;
}

.section + .section { padding-top: 0; }

.section-tinted {
  background: var(--paper-warm);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 3.5rem 0;
}

.prose { max-width: var(--measure); }

.prose > h2:first-child,
.prose > h3:first-child,
.prose > .eyebrow:first-child + h2 { margin-top: 0; }

/* Buttons at the end of a text block (the CMS "Buttons" field). */
.prose > .button-row { margin-top: 1.5rem; }

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.lede {
  max-width: 42rem;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
}

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

.page-head {
  padding: 3.25rem 0 2.25rem;
  border-bottom: 1px solid var(--rule);
}

.page-head h1 { margin-bottom: 0.9rem; }

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  padding: 4.5rem 0 4rem;
  background:
    radial-gradient(90rem 40rem at 78% -12%, rgba(47, 125, 58, 0.16), transparent 62%),
    linear-gradient(180deg, var(--paper-warm), var(--paper));
  border-bottom: 1px solid var(--rule);
}

.hero-inner > * { max-width: 46rem; }

.hero h1 { margin-bottom: 1.1rem; }

.hero .lede { margin-bottom: 1.9rem; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  border-radius: 7px;
  border: 1.5px solid var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button-secondary {
  background: transparent;
  color: var(--accent-deep);
}

.button-secondary:hover {
  background: var(--accent-pale);
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.1rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 48rem) {
  .card-grid.cols-2 { grid-template-columns: 1fr; }
}

.card-grid > li { display: flex; flex-direction: column; }

.card-grid > li > .card { flex: 1; }

.card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  transition: border-color 130ms ease, box-shadow 130ms ease, transform 130ms ease;
}

.card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }

.card p { margin: 0 0 0.9rem; font-size: 0.95rem; color: var(--ink-soft); }

.card p:last-child { margin-bottom: 0; }

.card-link { margin-top: auto; font-weight: 600; font-size: 0.92rem; }

a.card {
  text-decoration: none;
  color: inherit;
}

a.card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 22px rgba(20, 35, 25, 0.08);
  transform: translateY(-2px);
}

a.card .card-link { color: var(--accent-deep); }

a.card:hover .card-link { text-decoration: underline; }

/* ---------- Key facts ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.5rem 2rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.facts li { margin: 0; }

.fact-figure {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.5rem);
  line-height: 1.05;
  color: var(--accent-deep);
  letter-spacing: -0.01em;
}

.fact-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Definition-style lists ---------- */

.stack {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.stack > li {
  margin: 0;
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
}

.stack > li:last-child { border-bottom: 1px solid var(--rule); }

.stack h3 { margin: 0 0 0.4rem; }

.stack p { margin: 0 0 0.6rem; max-width: var(--measure); color: var(--ink-soft); }

.stack p:last-child { margin-bottom: 0; }

/* ---------- Document list ---------- */

.doclist {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.doclist li { margin: 0; }

.doc {
  display: block;
  padding: 1.2rem 1.4rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.doc:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 22px rgba(20, 35, 25, 0.08);
}

.doc-title {
  display: block;
  font-weight: 650;
  color: var(--accent-deep);
  margin-bottom: 0.25rem;
}

.doc:hover .doc-title { text-decoration: underline; }

.doc-meta {
  display: block;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- Callout ---------- */

.callout {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--accent-pale);
  border-radius: 10px;
}

.callout > :last-child { margin-bottom: 0; }

.callout h3 { margin-top: 0; }

.note {
  margin: 2rem 0;
  padding: 1.1rem 1.3rem;
  background: #fff;
  border: 1px dashed var(--rule);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.note > :last-child { margin-bottom: 0; }

/* ---------- Call to action band ---------- */

.cta {
  margin-top: 4rem;
  padding: 3.25rem 0;
  background: var(--paper-deep);
  color: #ece9df;
}

.cta h2 { color: #fff; margin-top: 0; }

.cta p { color: #c4ccc5; max-width: 40rem; }

.cta .button {
  background: #fff;
  border-color: #fff;
  color: var(--accent-deep);
}

.cta .button:hover { background: var(--accent-pale); border-color: var(--accent-pale); }

.cta .button-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.cta .button-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 0;
  padding: 3rem 0 2.5rem;
  background: var(--paper-warm);
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.cta + .site-footer { margin-top: 0; }

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  justify-content: space-between;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.footer-name {
  margin: 0 0 0.2rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.footer-blurb { margin: 0; font-size: 0.88rem; }

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav li { margin: 0; }

.footer-nav a { color: var(--ink-soft); text-decoration: none; }

.footer-nav a:hover { color: var(--accent-deep); text-decoration: underline; }

.footer-note {
  margin: 1.75rem 0 0;
  max-width: 52rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-faint);
}

.footer-legal {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- Small screens ---------- */

@media (max-width: 40rem) {
  .hero { padding: 3rem 0 2.75rem; }
  .section, .section-tinted { padding: 2.5rem 0; }
  .section + .section { padding-top: 0; }
  .page-head { padding: 2.25rem 0 1.75rem; }
  .cta { padding: 2.5rem 0; margin-top: 2.5rem; }
  .button { width: 100%; justify-content: center; }
  .button-row { gap: 0.6rem; }
}
