/* THE PLANT LIBRARY'S LOOK — every page under /plants, and the index.
 *
 * Hand-written, like legal.css beside it, and the pages themselves are
 * GENERATED by `npm run plant-pages` from the bank. One stylesheet rather than
 * a <style> block in each of a thousand pages: a thousand copies of a palette is
 * a thousand copies that drift, and every page would carry the weight.
 *
 * The tokens are the landing page's own. LIGHT ONLY, like the landing page and
 * the legal pages — a library page that flipped to dark while the page it links
 * back to did not would look like a fault.
 *
 * The four safety tones are measured, not picked: each ink clears 4.5:1 on its
 * own wash (see the note at `.row`). A colour that "looks fine" is how this
 * project has failed contrast four times.
 */

:root {
  --paper: #EFEBDD;
  --card: #F7F4E9;
  --ink: #212D1B;
  --ink-soft: #55614A;
  --ink-faint: #5F6852;
  --forest: #24331D;
  --moss: #47593A;
  --earth: #8A6A4F;
  --sepia: #5B4A36;
  --grass-wash: #E5EDD5;
  --line: #DBD2BE;
  --plate-sill: #F2E9D3;
  --plate-patch: #D9E7C9;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--moss); }

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.6rem 1rem 3.5rem;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
}
.brand .s { color: var(--moss); }
.brand .p { color: var(--earth); }
header.top .go {
  font-weight: 700;
  text-decoration: none;
  font-size: .95rem;
}

.crumbs {
  font-size: .85rem;
  color: var(--ink-faint);
  margin: 0 0 1.2rem;
}
.crumbs a { color: var(--ink-soft); }

/* ── ONE PLANT ─────────────────────────────────────────────────────────── */

.head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.medal {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
}
/* The medallion is parchment in a Sill and sage in a Patch, as in the app. The
   engravings fill occluding shapes with `var(--plate)`, so setting it here is
   what makes those shapes cover what is behind them rather than leaving a
   green shape on a parchment plate. */
.medal.sill { --plate: var(--plate-sill); }
.medal.patch { --plate: var(--plate-patch); }

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: 1.1;
  margin: 0;
  color: var(--forest);
  letter-spacing: -.01em;
}
.latin {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
  margin: .2rem 0 0;
}
.aka {
  font-size: .9rem;
  color: var(--ink-soft);
  margin: .3rem 0 0;
}
.room {
  display: inline-block;
  margin-top: .45rem;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--moss);
  background: var(--grass-wash);
  border-radius: 999px;
  padding: .15rem .6rem;
}

.lede {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--forest);
  margin: .4rem 0 1.4rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--forest);
  margin: 2rem 0 .7rem;
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .3rem 1rem;
}
.facts div {
  display: flex;
  gap: .8rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.facts div:last-child { border-bottom: none; }
.facts dt {
  flex: 0 0 6.5rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: .15rem;
}
.facts dd { margin: 0; color: var(--ink); }
.facts dd small { display: block; color: var(--ink-soft); font-size: .88rem; }

.gauge { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; }

/* THE SAFETY ROWS. The words are the app's own — client/src/lib/safety.js,
   called by the generator, never retyped — so a keeper and a stranger read the
   same sentence about the same plant. The inks below, each on its own wash:
     bad      #8B3A25 on #F4E4DC
     care     #74501A on #F3EAD3
     ok       #2F5A2B on #E5EDD5
     unknown  #4F5A45 on #ECE9DF
   all measured above 4.5:1 by `npm run plant-pages` itself, which refuses to
   write a page if one of these falls under. */
.row {
  border-radius: 12px;
  padding: .75rem .9rem;
  margin-bottom: .6rem;
}
.row .label {
  display: block;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .85;
}
.row .verdict {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  margin: .1rem 0 .15rem;
}
.row p { margin: 0; color: var(--ink); font-size: .95rem; }
.row.bad { background: #F4E4DC; color: #8B3A25; }
.row.care { background: #F3EAD3; color: #74501A; }
.row.ok { background: #E5EDD5; color: #2F5A2B; }
.row.unknown { background: #ECE9DF; color: #4F5A45; }

.prov {
  font-size: .85rem;
  color: var(--ink-faint);
  margin: .3rem 0 0;
}

/* THE GUIDE NOTE, under every safety answer (2026-09-30). The Terms say this
   in §5, but a stranger arriving from a search never reads the Terms, so it
   sits where the claim is made. Worded for every plant at once — "call your vet
   now" under a lettuce would be alarming rather than careful. Ink and moss on
   the card, both measured by the generator. */
.guide {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .9rem;
  margin: .8rem 0 0;
  font-size: .9rem;
  color: var(--ink);
}
.guide a { font-weight: 700; }
footer.foot span { flex-basis: 100%; }

.trouble { list-style: none; padding: 0; margin: 0; }
.trouble li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .9rem;
  margin-bottom: .55rem;
  color: var(--ink);
}
.trouble li small {
  display: block;
  margin-top: .2rem;
  color: var(--ink-soft);
  font-size: .85rem;
}

.cta {
  margin: 2.2rem 0 0;
  background: var(--forest);
  color: #F2EFE3;
  border-radius: 16px;
  padding: 1.1rem 1.1rem 1.2rem;
}
.cta b {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: .3rem;
}
.cta p { margin: 0 0 .9rem; color: #E4E8D8; }
.cta a {
  display: inline-block;
  background: #F2EFE3;
  color: var(--forest);
  font-weight: 800;
  text-decoration: none;
  border-radius: 999px;
  padding: .6rem 1.1rem;
}

.related { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .8rem; }
.related a { font-weight: 700; text-decoration: none; }
.related small { display: block; color: var(--ink-faint); font-style: italic; font-family: var(--font-display); }

/* ── THE INDEX ─────────────────────────────────────────────────────────── */

.search {
  width: 100%;
  font: inherit;
  font-size: 16px; /* under 16px, iOS zooms the page on focus and stays there */
  padding: .7rem .9rem;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  margin: .6rem 0 .4rem;
}
.count { font-size: .85rem; color: var(--ink-faint); margin: 0 0 1rem; }
.group h2 { margin-top: 1.8rem; }
.group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2 14rem;
  column-gap: 1.2rem;
}
.group li { break-inside: avoid; padding: .2rem 0; }
.group li a { font-weight: 700; text-decoration: none; }
.group li small { color: var(--ink-faint); font-style: italic; font-family: var(--font-display); }

footer.foot {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--ink-faint);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .medal { width: 136px; height: 136px; flex-basis: 136px; }
  .facts { grid-template-columns: 1fr 1fr; column-gap: 1.4rem; }
  .facts div:nth-last-child(2):nth-child(odd) { border-bottom: none; }
  .related { grid-template-columns: 1fr 1fr 1fr; }
}
