/* ═══════════════════════════════════════════════════════════════
   The Fairhaven Field Guide — pressed-flower botanical journal
   Palette: twilight lavender paper, elderberry ink, moonlit petals
   ═══════════════════════════════════════════════════════════════ */

:root {
  --paper: #e7e0f2;        /* twilight lavender pages */
  --sheet: #fbf9fe;        /* a moonlit specimen sheet */
  --ink: #3b2d52;          /* elderberry ink */
  --ink-soft: #71638f;     /* faded violet annotations */
  --line: #d8cdea;         /* ruled lines & borders */
  --rose: #b06a92;         /* wild rose */
  --sage: #6f8b74;         /* pressed sage */
  --lavender: #8a6fc4;     /* lavender sprig */
  --amethyst: #6d4fa6;     /* deep amethyst */
  --ochre: #b8923f;        /* marigold gold */
  --plum: #9c5f8f;         /* ripe plum */
  --tape: rgba(197, 181, 226, 0.55); /* lilac washi tape */
  --shadow: 59, 45, 82;    /* shadow tint (rgb of the ink) */
  --sunny: #ffcf40;        /* buttercup yellow headline fill */
  --outline: #2b2140;      /* near-black outline around headlines */

  --font-display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", Verdana, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  padding: 0 16px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  background-color: var(--paper);
  /* subtle paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.28 0 0 0 0 0.20 0 0 0 0 0.42 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Typography ────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400; /* Lilita One ships one chunky weight */
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

h1 { font-size: 2.5rem; margin: 0.4em 0 0.3em; }
h2 { font-size: 1.8rem; margin: 1.4em 0 0.4em; color: var(--amethyst); }
h3 { font-size: 1.3rem; margin: 1.2em 0 0.3em; }

/* fun highlighter-swipe titles: dark ink over a tilted buttercup
   marker stroke, so contrast stays full strength */
h1, .specimen h2 {
  width: fit-content;
  max-width: 100%;
  color: var(--ink);
  background: linear-gradient(104deg,
    transparent 0.5%, rgba(255, 207, 64, 0.85) 3%,
    var(--sunny) 50%, rgba(255, 207, 64, 0.9) 97%, transparent 99.5%);
  border-radius: 0.4em 0.7em 0.5em 0.8em / 0.7em 0.4em 0.8em 0.5em;
  transform: rotate(-0.6deg);
}

h1 { padding: 0.04em 0.5em 0.1em; }

.latin, em.latin {
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
}

.handwritten {
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 1.25em;
  color: var(--ink-soft);
  transform: rotate(-1.2deg);
  display: inline-block;
}

.specimen-label {
  font-family: var(--font-body);
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

a {
  color: var(--amethyst);
  text-decoration-color: var(--rose);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

blockquote {
  margin: 1.2em 0;
  padding: 0.2em 1.2em;
  border-left: 3px solid var(--lavender);
  background: rgba(138, 111, 196, 0.08);
  font-style: italic;
  color: var(--ink-soft);
}

hr {
  border: none;
  height: 1.2em;
  margin: 2em auto;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20' width='120' height='20'%3E%3Cpath d='M4 10 h38 M78 10 h38' stroke='%23a894cc' stroke-width='1'/%3E%3Cpath d='M60 4 c3 3 3 9 0 12 c-3 -3 -3 -9 0 -12z' fill='%236f8b74'/%3E%3Ccircle cx='49' cy='10' r='1.6' fill='%23b06a92'/%3E%3Ccircle cx='71' cy='10' r='1.6' fill='%23b06a92'/%3E%3C/svg%3E");
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
  background: var(--sheet);
  font-size: 0.95em;
}

th, td {
  border: 1px solid var(--line);
  padding: 0.5em 0.8em;
  text-align: left;
}

th {
  font-family: var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85em;
  background: rgba(216, 205, 234, 0.4);
}

code {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.9em;
  background: rgba(216, 205, 234, 0.45);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

img { max-width: 100%; }

/* ── The journal page (site chrome) ────────────────────────── */

.journal-header {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.4rem 0 0.6rem;
  text-align: center;
}

.journal-header .site-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}

.journal-header .site-title:hover { color: var(--amethyst); }

/* ── Sidebar + sheet layout ────────────────────────────────── */

.journal-body {
  display: flex;
  align-items: flex-start;
  gap: 1.6rem;
  max-width: 1160px;
  margin: 0 auto;
}

/* ── Site menu (left sidebar) ──────────────────────────────── */

.site-nav {
  flex: 0 0 236px;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  margin: 1rem 0 2rem;
  padding: 0.9rem 0 1rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow:
    0 1px 3px rgba(var(--shadow), 0.12),
    0 12px 28px rgba(var(--shadow), 0.10);
  z-index: 20;
}

.menu-toggle { display: none; }

.menu-label {
  display: none;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amethyst);
  padding: 0.4em 1.2em;
  cursor: pointer;
  user-select: none;
}

.nav-group + .nav-group {
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.nav-group-home ul li a { font-weight: 600; }

.nav-heading {
  margin: 0;
  padding: 0.3em 1.1em 0.15em;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-heading.active { color: var(--amethyst); }

.nav-group ul {
  margin: 0;
  padding: 0 0 0.25rem;
  list-style: none;
}

.nav-group ul li a {
  display: block;
  padding: 0.24em 1.1em 0.24em 1.45em;
  font-size: 0.92rem;
  line-height: 1.45;
  text-decoration: none;
  color: var(--ink);
}

.nav-group ul li a:hover {
  background: rgba(138, 111, 196, 0.1);
  color: var(--amethyst);
}

.nav-group ul li a.current {
  color: var(--amethyst);
  font-weight: 600;
}

.nav-group ul li a.current::before { content: "✿ "; color: var(--rose); }

/* stack the menu above the page behind a toggle on small screens */
@media (max-width: 900px) {
  .journal-body { display: block; }

  .site-nav {
    position: static;
    max-height: none;
    overflow-y: visible;
    margin: 0.4rem 0 0;
    padding: 0;
    text-align: center;
  }

  .menu-label { display: block; }

  .nav-groups {
    display: none;
    padding: 0.3rem 0 0.6rem;
    text-align: left;
    border-top: 1px solid var(--line);
  }

  .menu-toggle:checked ~ .nav-groups { display: block; }
}

/* the specimen sheet each page sits on */
.sheet {
  position: relative;
  flex: 1;
  min-width: 0;
  margin: 1rem 0 2rem;
  padding: 2.4rem clamp(1.2rem, 5vw, 3.2rem) 2.8rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow:
    0 1px 3px rgba(var(--shadow), 0.12),
    0 12px 28px rgba(var(--shadow), 0.10);
}

@media (max-width: 900px) {
  .sheet { margin-top: 1.2rem; }
}

/* stitched spine along the left edge */
.sheet::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 13px;
  border-left: 2px dashed rgba(113, 99, 143, 0.35);
  pointer-events: none;
}

/* a strip of washi tape at the top of every sheet */
.sheet::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 128px;
  height: 26px;
  transform: translateX(-50%) rotate(-1.6deg);
  background: var(--tape);
  border-left: 1px dashed rgba(255, 255, 255, 0.6);
  border-right: 1px dashed rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 2px rgba(var(--shadow), 0.12);
  pointer-events: none;
}

.breadcrumb {
  margin-bottom: 1.4rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

.breadcrumb a:hover { color: var(--amethyst); }

.breadcrumb .crumb-sep { color: var(--rose); font-size: 0.8em; }
.breadcrumb .crumb-here { color: var(--amethyst); }

/* ── Prev / next page turns ────────────────────────────────── */

.page-turn {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.page-turn a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-width: 46%;
  text-decoration: none;
}

.page-turn .turn-next { text-align: right; margin-left: auto; }

.page-turn .turn-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--amethyst);
}

.page-turn a:hover .turn-title { color: var(--plum); }
.page-turn .turn-spacer { flex: 1; }

.journal-footer {
  max-width: 1160px;
  margin: 0 auto 2.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.journal-footer .flourish { font-size: 1.1rem; color: var(--lavender); }

.journal-footer .footer-links a {
  color: var(--ink-soft);
  text-decoration: underline dotted;
}

/* ── The cover / table of contents ─────────────────────────── */

.cover {
  text-align: center;
  padding: 1rem 0 1.6rem;
}

.cover .volume {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.cover h1 {
  font-size: clamp(2.6rem, 7vw, 4rem);
  margin: 0.15em auto 0; /* fit-content title still centers on the cover */
}

.cover .subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0.3em 0 0;
}

.cover .pressed { display: block; margin: 1.1rem auto 0.2rem; }

/* specimen cards: one per section of the guide */
.specimens {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 1.6rem;
  padding: 0;
  margin: 1.6rem 0 0;
  list-style: none;
}

.specimen {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 1.5rem 1.4rem 1.1rem;
  box-shadow: 0 2px 6px rgba(var(--shadow), 0.1);
}

.specimen:nth-child(odd) { transform: rotate(-0.5deg); }
.specimen:nth-child(even) { transform: rotate(0.45deg); }

.specimen::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 22px;
  width: 84px;
  height: 20px;
  transform: rotate(-2deg);
  background: var(--tape);
  border-left: 1px dashed rgba(255, 255, 255, 0.6);
  border-right: 1px dashed rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 2px rgba(var(--shadow), 0.12);
}

.specimen .flower {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 54px;
  height: 72px;
  opacity: 0.9;
}

.specimen h2 {
  margin: 0 3.4rem 0.2rem 0;
  padding: 0.02em 0.45em 0.08em;
  font-size: 1.5rem;
}

.specimen .latin {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

.specimen ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.specimen li {
  padding: 0.28em 0 0.28em 1.35em;
  position: relative;
  border-bottom: 1px dotted var(--line);
  font-size: 0.98rem;
}

.specimen li:last-child { border-bottom: none; }

.specimen li::before {
  content: "✿";
  position: absolute;
  left: 0.1em;
  color: var(--accent, var(--lavender));
  font-size: 0.85em;
  top: 0.42em;
}

.specimen li a { text-decoration: none; color: var(--ink); }
.specimen li a:hover { text-decoration: underline; color: var(--amethyst); }

.specimen footer {
  margin-top: 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

/* per-part accent colors */
.specimen.rose      { --accent: var(--rose); }
.specimen.sage      { --accent: var(--sage); }
.specimen.lavender  { --accent: var(--lavender); }
.specimen.ochre     { --accent: var(--ochre); }
.specimen.plum      { --accent: var(--plum); }

/* ── Seedling (stub) notice ────────────────────────────────── */

.seedling {
  border: 1px dashed var(--lavender);
  background: rgba(138, 111, 196, 0.07);
  padding: 0.8em 1.1em;
  font-style: italic;
  color: var(--ink-soft);
}

/* ── Photographs taped into the journal ────────────────────── */

figure.snapshot {
  position: relative;
  margin: 2rem auto;
  max-width: 560px;
  background: #fffdf8;
  padding: 10px 10px 0.3rem;
  border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(66, 58, 44, 0.18);
  transform: rotate(-0.8deg);
}

figure.snapshot:nth-of-type(even) { transform: rotate(0.7deg); }

figure.snapshot::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 96px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--tape);
  border-left: 1px dashed rgba(255, 255, 255, 0.6);
  border-right: 1px dashed rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 2px rgba(66, 58, 44, 0.12);
  pointer-events: none;
}

figure.snapshot img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
}

figure.snapshot figcaption {
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 1.15rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 0.4rem 0.5rem 0.45rem;
}

/* two snapshots side by side on wide screens */
.snapshot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  justify-content: center;
  margin: 2rem 0;
}

.snapshot-row figure.snapshot { margin: 0.6rem 0; flex: 1 1 260px; }

/* the key-art cover plate on the table of contents */
.cover .cover-banner {
  max-width: 720px;
  margin: 1.8rem auto 0.6rem;
}

/* ── Wide tables scroll within their own frame on small screens ── */
@media (max-width: 900px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
