/* Stocks & Green brand: Main Green #4F8823, Background #EFF7EF, Accent Dark Purple #540663,
   Assistant (Google Fonts) for text, Jenna Sue (self-hosted) for handwritten touches. */
@font-face {
  font-family: "Jenna Sue";
  src: url("/assets/fonts/JennaSue.woff2") format("woff2");
  font-display: swap;
}

:root {
  --green: #4F8823;
  --green-dark: #3d6a1b;
  --paper: #EFF7EF;
  --surface: #ffffff;
  --purple: #540663;
  --ink: #1f2a1c;
  --muted: #55644f;
  --line: #d3e3d0;
  --sow-in: #d9952b;
  --sow-out: #4F8823;
  --flower: #8d3a9c;
  --harvest: #8a5a2b;
  --cal-empty: #e0ebdf;
  --radius: 14px;
  --hand: "Jenna Sue", "Segoe Script", cursive;
  --sans: "Assistant", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--purple); }
h1, h2 { font-family: var(--sans); font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.5rem); }
h2 { font-size: 1.3rem; margin-bottom: 0.6rem; color: var(--green-dark); }
p { margin: 0 0 0.8rem; }
p:last-child { margin-bottom: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(0.55rem + env(safe-area-inset-top)) 16px 0.55rem;
  background: var(--green); color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: #fff; }
.brand-logo { height: 42px; width: auto; }
.brand-label {
  font-family: var(--hand); font-size: 1.9rem; line-height: 1; padding-top: 0.2rem;
  border-left: 1.5px solid rgba(255, 255, 255, 0.55); padding-left: 0.75rem;
}
.topbar-link { color: #fff; font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap; }
.topbar-link:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 360px) { .brand-label { font-size: 1.6rem; } .brand-logo { height: 36px; } }

/* Guide page */
.guide, .index, .simple { max-width: 760px; margin: 0 auto; padding: 0 16px 2rem; }
.hero { display: block; margin: 0 -16px; background: var(--cal-empty); }
.hero-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (min-width: 760px) {
  .hero { margin: 1.5rem 0 0; border-radius: var(--radius); overflow: hidden; }
}
.guide-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: 1.4rem 0 0.8rem; }
.eyebrow { font-family: var(--hand); font-size: 1.7rem; line-height: 1; color: var(--purple); margin-bottom: 0.3rem; }
.subtitle { color: var(--muted); font-size: 1.15rem; margin: 0.35rem 0 0; font-style: italic; }
.rhs-badge { width: 60px; height: 60px; flex: none; }
.intro { font-size: 1.15rem; margin-bottom: 1.2rem; }
.intro ul { padding-left: 1.2rem; }

.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  margin: 0 0 1rem; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 560px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fact { background: var(--surface); padding: 0.75rem 0.9rem; }
.fact dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.fact dd { margin: 0.15rem 0 0; font-weight: 700; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.2rem; margin-bottom: 1rem;
}

/* Calendar */
.cal { display: grid; gap: 6px; }
.cal-row { display: grid; grid-template-columns: 6.2rem 1fr; align-items: center; gap: 8px; }
.cal-label { font-size: 0.92rem; font-weight: 700; }
.cal-cells { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.cal-m { text-align: center; font-size: 0.8rem; color: var(--muted); font-weight: 700; border-radius: 4px; }
.cal-m.is-now { background: var(--purple); color: #fff; }
.cal-c { height: 22px; border-radius: 4px; background: var(--cal-empty); }
.cal-c.is-now { outline: 2px solid var(--purple); outline-offset: -2px; }
.cal-c.on.sow-in { background: var(--sow-in); }
.cal-c.on.sow-out { background: var(--sow-out); }
.cal-c.on.flower { background: var(--flower); }
.cal-c.on.harvest { background: var(--harvest); }
@media (max-width: 380px) { .cal-row { grid-template-columns: 5rem 1fr; } .cal-label { font-size: 0.82rem; } }

/* Gallery */
.gallery-section { margin-top: 1.6rem; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.g-item { display: block; border-radius: 10px; overflow: hidden; background: var(--cal-empty); }
.g-item img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform 0.3s; }
.g-item:hover img { transform: scale(1.03); }
.sku-ref { margin-top: 1.6rem; color: var(--muted); font-size: 0.85rem; }

.lightbox {
  border: 0; padding: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  background: rgba(16, 24, 12, 0.94);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, 0.14); color: #fff; border: 0;
  width: 48px; height: 48px; border-radius: 999px; font-size: 1.9rem; line-height: 1; cursor: pointer;
}
.lb-close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* Index */
.index-hero { padding: 1.8rem 0 1rem; }
.index-hero h1 { font-family: var(--hand); font-weight: 400; color: var(--purple); font-size: clamp(2.8rem, 11vw, 3.8rem); line-height: 1; letter-spacing: 0; }
.index-hero > p { color: var(--muted); margin-top: 0.4rem; font-size: 1.1rem; }
.search input {
  width: 100%; margin-top: 0.8rem; font: inherit; padding: 0.8rem 1.1rem;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(79, 136, 35, 0.25); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.9rem; }
.chip {
  font: inherit; font-size: 0.95rem; font-weight: 600; padding: 0.3rem 0.95rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.chip.is-on { background: var(--green); border-color: var(--green); color: #fff; }
.install, .button {
  display: inline-block; margin-top: 1rem; font: inherit; font-weight: 700; padding: 0.6rem 1.2rem;
  border-radius: 999px; border: 0; background: var(--purple); color: #fff; cursor: pointer; text-decoration: none;
}
.install:hover, .button:hover { background: #6b0a7e; }
.count { color: var(--muted); font-size: 0.92rem; margin: 0.4rem 0 0.8rem; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tiles li[hidden] { display: none; }
.tile {
  display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; height: 100%;
}
.tile:hover { border-color: var(--green); }
.card-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--cal-empty); }
.tile-text { display: block; padding: 0.6rem 0.75rem 0.75rem; }
.tile-title { display: block; font-weight: 700; line-height: 1.3; }
.tile-sub { display: block; color: var(--muted); font-size: 0.92rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 0; }

.simple { padding-top: 3rem; text-align: center; }
.simple p { color: var(--muted); }

/* Footer */
.footer {
  text-align: center; padding: 2rem 16px calc(2.5rem + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 4px solid var(--green); color: var(--muted);
}
.footer-roundel { width: 84px; height: 84px; margin: 0 auto 0.6rem; }
.footer .tagline { text-wrap: balance; font-family: var(--hand); font-size: 2rem; line-height: 1.1; color: var(--purple); margin-bottom: 0.4rem; }
.footer-link a { color: var(--green-dark); font-weight: 700; }
