/* PlantaeLight User Manual — main stylesheet.
   Clean, printable, responsive. Avoid framework bloat; vanilla CSS only. */

:root {
  --green-700: #2b6b3a;
  --green-600: #3a8a4b;
  --green-500: #4fa85f;
  --green-50:  #ecf6ee;
  --text:      #111111;   /* body text — near-black for max readability */
  --text-soft: #2a2a2a;   /* slightly lighter for secondary prose */
  --text-muted:#555555;   /* for labels, version, caption text */
  --border:    #d4d4d4;
  --bg-page:   #ffffff;
  --bg-soft:   #f5f5f5;
  --bg-panel:  #fafafa;
  --bg-input:  #ffffff;
  --amber-500: #d89417;
  --red-500:   #c44a4a;
  --note-bg:   #ecf6ee;
  --warn-bg:   #fdf5e6;
  --tip-bg:    #f4eefa;
  --tip-border:#9b6dd4;
  --search-hit:#fff3b0;
  --radius:    6px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}

/* Dark theme — opt-in only via the sidebar toggle (no prefers-color-scheme). */
[data-theme="dark"] {
  --green-700: #7fcf91;   /* brighter for headings on dark bg */
  --green-600: #6cc97c;   /* link color */
  --green-500: #5ec06f;
  --green-50:  #1d2a22;   /* tinted dark for note callouts */
  --text:      #e8eaed;
  --text-soft: #c8ccd1;
  --text-muted:#8b9097;
  --border:    #2e3438;
  --bg-page:   #15181a;
  --bg-soft:   #1f2326;
  --bg-panel:  #181b1d;
  --bg-input:  #1f2326;
  --amber-500: #e2a849;
  --red-500:   #e26666;
  --note-bg:   #1d2a22;
  --warn-bg:   #2a2419;
  --tip-bg:    #25202d;
  --tip-border:#a584d6;
  --search-hit:#5a4a18;
  --shadow:    0 1px 3px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-page);
  transition: background 200ms, color 200ms;
}

/* ——————— layout ——————— */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  color: var(--text);
}
/* Brand row — mirrors plantaelight.com nav__brand: logo + wordmark side by side. */
.sidebar .brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 6px;
  padding: 4px 6px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: background 120ms;
}
.sidebar .brand-row:hover { background: var(--bg-soft); }
.sidebar .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  filter: drop-shadow(0 0 8px rgba(79, 168, 95, 0.45));
  flex: none;
}
.sidebar .brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--green-700);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.sidebar .version {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 8px 20px;
}
.sidebar .lang-switch {
  margin: 0 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar .lang-switch label {
  font-size: 14px;
  color: var(--text-muted);
}
.sidebar .lang-switch select {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
}
.sidebar .lang-switch .theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.sidebar .lang-switch .theme-btn:hover {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--green-500);
}
.sidebar .search {
  margin: 0 8px 16px;
}
.sidebar .search input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
}
.sidebar .search input::placeholder { color: var(--text-muted); }
.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar nav li { margin-bottom: 2px; }
.sidebar nav a {
  display: block;
  padding: 8px 12px;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 14px;
  transition: background 120ms;
}
.sidebar nav a:hover { background: var(--bg-soft); color: var(--text); }
.sidebar nav a.active {
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 600;
}

.content {
  padding: 48px 64px;
  max-width: 900px;
  color: var(--text);
}
.content h1 {
  font-size: 32px;
  color: var(--green-700);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.content h2 {
  font-size: 22px;
  margin: 32px 0 8px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  font-weight: 700;
}
.content h3 {
  font-size: 17px;
  margin: 20px 0 4px;
  color: var(--text);
  font-weight: 700;
}
.content p { margin: 8px 0 12px; color: var(--text-soft); }
.content ul, .content ol { color: var(--text-soft); padding-left: 24px; }
.content li { margin-bottom: 4px; }
.content a { color: var(--green-600); font-weight: 500; }
.content a:hover { text-decoration: underline; }
.content strong { color: var(--text); font-weight: 700; }

.content code, .content pre {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--text);
}
.content code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.content pre {
  background: var(--bg-soft);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  line-height: 1.5;
}
.content pre code { background: transparent; border: none; padding: 0; }

.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text);
}
.content th, .content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.content th {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--text);
}

/* ——————— callouts ——————— */
.note, .warn, .tip {
  border-left: 3px solid;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  color: var(--text);
}
.note { background: var(--note-bg); border-color: var(--green-500); }
.warn { background: var(--warn-bg); border-color: var(--amber-500); }
.tip  { background: var(--tip-bg); border-color: var(--tip-border); }
.note strong, .warn strong, .tip strong { color: var(--text); }

/* ——————— sections ——————— */
section.tab { display: none; animation: fade 200ms ease-in; }
section.tab.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ——————— responsive ——————— */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .content { padding: 24px 20px; }
}

/* ——————— search highlight ——————— */
mark.search-hit {
  background: var(--search-hit);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
}
.sidebar nav a.hidden-by-search { display: none; }
