/* ==========================================================================
   Houseplant Doctor — theme.css
   Site: houseplant-doctor.hekatix.com
   Identity: Clinical plant clinic — clean, precise, trustworthy diagnostic feel.
   Green-forward palette on cool paper field with citrus accent for urgent fixes.
   Every color/font/spacing/radius/shadow is a custom property on :root, so a
   reskin = edit tokens only (never generator code).

   Palette (WCAG-AA checked):
     paper    #f3f7f5  cool green-gray field (clinical)
     surface  #ffffff  cards / raised panels (pure white)
     tint     #e6f0ed  soft teal wash (tags, callouts)
     ink      #1f2b28  deep clinical green-black body text (12.5:1 on paper)
     muted    #5a6b66  secondary text (5.4:1)
     green    #2d8a72  primary surgical teal (7.5:1 on white)
     green-dk #236d5b  hover / strong ink accents
     citrus   #e89b3b  citrus accent (urgent fixes, warnings)
     leaf     #5fb38a  decorative secondary green
     gray     #91a09a  light decorative
   ========================================================================== */

:root {
  /* ---- color ---------------------------------------------------------- */
  --color-bg:        #f3f7f5;   /* cool green-gray field */
  --color-surface:   #ffffff;   /* cards, raised panels */
  --color-surface-2: #e6f0ed;   /* soft teal wash — tags, callouts */
  --color-ink:       #1f2b28;   /* body text */
  --color-ink-head:  #0f1816;   /* headings — slightly deeper */
  --color-muted:     #5a6b66;   /* secondary text, captions */
  --color-accent:    #2d8a72;   /* primary surgical teal */
  --color-accent-dk: #236d5b;   /* hover / strong */
  --color-accent-on: #ffffff;   /* text on accent */
  --color-citrus:    #e89b3b;   /* citrus accent — urgent fixes, warnings */
  --color-citrus-dk: #c98228;   /* citrus hover */
  --color-citrus-on: #ffffff;   /* text on citrus */
  --color-leaf:      #5fb38a;   /* decorative secondary green */
  --color-gray:      #91a09a;   /* light decorative */
  --color-border:    #d1dcd8;   /* hairline dividers */
  --color-border-hi: #bdc8c3;   /* stronger dividers */
  --color-link:      #2d8a72;   /* inline links (same as primary) */
  --color-link-visit:#236d5b;   /* visited */
  --color-focus:     #2d8a72;   /* visible focus ring */
  --color-shadow:    rgba(15, 24, 22, 0.08);

  /* ---- type ----------------------------------------------------------- */
  --font-body:    ui-sans-serif, system-ui, -apple-system, "Segoe UI",
                  Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-heading: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
                  Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "SFMono-Regular", Menlo, Consolas,
                  "Liberation Mono", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;
  --text-3xl: 2.75rem;

  --leading-body: 1.65;
  --leading-head: 1.15;
  --tracking-tight: -0.01em;
  --measure: 68ch;              /* comfortable reading measure */

  /* ---- spacing (8px scale, mobile-first) ------------------------------ */
  --space-1: 0.25rem;  /*  4px */
  --space-2: 0.5rem;   /*  8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-9: 6rem;     /* 96px */

  /* ---- radius --------------------------------------------------------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ---- shadow --------------------------------------------------------- */
  --shadow-sm: 0 1px 2px var(--color-shadow);
  --shadow-md: 0 4px 16px var(--color-shadow);
  --shadow-lg: 0 14px 40px var(--color-shadow);

  /* ---- layout --------------------------------------------------------- */
  --wrap: 1080px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --nav-h: 4rem;
}

/* ==========================================================================
   Base / reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-link); text-decoration: none;
    text-underline-offset: 0.14em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-accent-dk); text-decoration: underline; }
a:visited { color: var(--color-link-visit); }

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

/* Visible skip link for keyboard users */
.skip-link {
  position: absolute; left: var(--space-4); top: -100%;
  background: var(--color-accent); color: var(--color-accent-on);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  z-index: 100; font-weight: 700;
}
.skip-link:focus { top: var(--space-2); }

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-ink-head);
  line-height: var(--leading-head);
  letter-spacing: var(--tracking-tight);
  font-weight: 800;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); margin-top: var(--space-7); }
h3 { font-size: var(--text-lg); margin-top: var(--space-6); }
h4 { font-size: var(--text-md); margin-top: var(--space-5); }

p { margin: 0 0 var(--space-5); max-width: var(--measure); }

ul, ol { margin: 0 0 var(--space-5); padding-left: 1.4em; max-width: var(--measure); }
li { margin-bottom: var(--space-2); }
li::marker { color: var(--color-accent); }

strong, b { color: var(--color-ink-head); font-weight: 700; }
em, i { font-style: italic; }

blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-5) var(--space-6);
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-ink);
  font-style: italic;
}
blockquote > *:last-child { margin-bottom: 0; }

hr { border: 0; border-top: 1px solid var(--color-border);
     margin: var(--space-7) 0; }

/* ==========================================================================
   Site header & nav
   ========================================================================== */
header.site {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}

nav.top {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex; align-items: center; gap: var(--space-5);
}

.wordmark {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-ink-head);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
  white-space: nowrap;
}
.wordmark:hover { color: var(--color-accent-dk); text-decoration: none; }
.wordmark .leaf {
  width: 1.25em; height: 1.25em; border-radius: 50% 50% 50% 0;
  background: var(--color-accent);
  transform: rotate(-45deg);
  flex: 0 0 auto;
}

nav.top ul {
  display: flex; gap: var(--space-4); margin: 0; padding: 0;
  list-style: none; margin-left: auto;
}
nav.top li { margin: 0; }
nav.top a {
  text-decoration: none; color: var(--color-muted);
  font-weight: 600; font-size: var(--text-sm);
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
}
nav.top a:hover { color: var(--color-accent-dk); text-decoration: underline; }
nav.top a[aria-current="page"] { color: var(--color-accent); background: var(--color-surface-2); }

/* ==========================================================================
   Container for main content
   ========================================================================== */
.container {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ==========================================================================
   Hero (home — symptom picker)
   ========================================================================== */
.hero {
  background:
    radial-gradient(60% 120% at 85% -10%, rgba(95,179,138,0.16), transparent 60%),
    radial-gradient(50% 110% at 8% 10%, rgba(45,138,114,0.10), transparent 55%),
    var(--color-bg);
  padding: var(--space-7) var(--gutter) var(--space-8);
  text-align: center;
}
.hero .inner { max-width: 720px; margin: 0 auto; }

.kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-surface-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}

.hero h1 { font-size: var(--text-3xl); margin-bottom: var(--space-4); }
.hero p.lead { font-size: var(--text-lg); color: var(--color-muted);
               margin: 0 auto var(--space-5); }

/* ==========================================================================
   Symptom / plant grid + cards
   ========================================================================== */
.card-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: var(--space-3);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-hi);
}
.card a { text-decoration: none; color: inherit; }
.card a:hover { color: inherit; text-decoration: none; }

.card-tag {
  align-self: flex-start;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-dk);
  background: var(--color-surface-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
}
.card-tag.warm { color: var(--color-citrus); background: rgba(232,155,59,0.12); }

.card-title {
  font-size: var(--text-lg);
  margin: 0;
  color: var(--color-ink-head);
}
.card-desc {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  flex-grow: 1;
}

/* ==========================================================================
   Main / article layout
   ========================================================================== */
main { padding-bottom: var(--space-8); }

article.layout {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) 0;
}

/* Two-column reading layout for article body on wide screens */
@media (min-width: 900px) {
  article.layout.with-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--space-7);
  }
  article.layout.with-aside > .page-body { min-width: 0; }
}

.breadcrumb {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: var(--space-4) 0 var(--space-5);
  padding: var(--space-2) 0;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap;
                 gap: var(--space-2); margin: 0; padding: 0; max-width: none; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin: 0 var(--space-2);
                              color: var(--color-border-hi); }
.breadcrumb a { text-decoration: none; color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-accent-dk); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--color-ink); font-weight: 600; }

/* Inline links inside article body get a friendly underline */
.page-body a { text-decoration-thickness: 1px; }

/* ==========================================================================
   Related sections
   ========================================================================== */
.related-section {
  margin: var(--space-7) 0;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-leaf);
  border-radius: var(--radius-md);
}
.related-section h2,
.related-section h3 {
  margin-top: 0; font-size: var(--text-lg);
}
.related-section ul {
  list-style: none; margin: 0; padding: 0; max-width: none;
  display: flex; flex-wrap: wrap; gap: var(--space-2);
}
.related-section li { margin: 0; }
.related-section a {
  display: inline-block;
  text-decoration: none;
  color: var(--color-accent-dk);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: 600;
}
.related-section a:hover {
  background: var(--color-accent);
  color: var(--color-accent-on);
  border-color: var(--color-accent);
}

/* ==========================================================================
   Quick-fix callout box (citrus accent for urgent items)
   ========================================================================== */
.callout-box {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: var(--space-6) 0;
  position: relative;
}
.callout-box.callout-citrus {
  border: 1px solid var(--color-citrus);
}
.callout-box::before {
  content: "";
  display: block;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-leaf));
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}
.callout-box.callout-citrus::before {
  background: linear-gradient(90deg, var(--color-citrus), var(--color-citrus-dk));
}
.callout-box .callout-label {
  font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--color-accent-dk);
  margin-bottom: var(--space-2); display: block;
}
.callout-box.callout-citrus .callout-label {
  color: var(--color-citrus-dk);
}
.callout-box > *:last-child { margin-bottom: 0; }
.callout-box h3 { margin-top: 0; }

/* ==========================================================================
   Sources
   ========================================================================== */
.sources {
  margin: var(--space-7) 0;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
}
.sources h2 { font-size: var(--text-md); text-transform: uppercase;
              letter-spacing: 0.08em; color: var(--color-muted); margin-top: 0; }
.sources ol { max-width: none; font-size: var(--text-sm); color: var(--color-muted); }
.sources li { margin-bottom: var(--space-1); }

/* ==========================================================================
   Symptom list (home page) — compact list of large tappable rows
   ========================================================================== */
.symptom-picker {
  padding: var(--space-7) var(--gutter);
}
.symptom-picker h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}
.symptom-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: var(--wrap);
  margin: 0 auto;
}
.symptom-row {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  text-decoration: none;
  color: var(--color-ink);
  transition: transform 0.08s ease, border-color 0.08s ease, box-shadow 0.08s ease;
}
.symptom-row:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}
.symptom-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
  color: var(--color-ink-head);
  text-decoration: none;
}
.symptom-row:hover .symptom-title {
  color: var(--color-accent-dk);
}

/* ==========================================================================
   Plant grid (home page) — denser grid with plant name + short line
   ========================================================================== */
.plants {
  padding: var(--space-7) var(--gutter);
  background: var(--color-bg);
}
.plants h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-5);
}
.plant-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  max-width: var(--wrap);
  margin: 0 auto;
}
@media (min-width: 480px) {
  .plant-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .plant-grid { grid-template-columns: repeat(3, 1fr); }
}

.plant-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-decoration: none;
  color: var(--color-ink);
  transition: transform 0.08s ease, border-color 0.08s ease, box-shadow 0.08s ease;
}
.plant-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}
.plant-title {
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--color-ink-head);
  text-decoration: none;
}
.plant-desc {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Article layout with container
   ========================================================================== */
main.main {
  padding-bottom: var(--space-8);
}
article.container.layout {
  max-width: 70ch;
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) 0;
}
article.container.layout > *:last-child {
  margin-bottom: 0;
}

/* Related sections */
.related-section {
  margin: var(--space-7) 0;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-leaf);
  border-radius: var(--radius-md);
}
.related-section h2,
.related-section h3 {
  margin-top: 0;
  font-size: var(--text-lg);
}
.related-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.related-section li { margin: 0; }
.related-section a {
  display: inline-block;
  text-decoration: none;
  color: var(--color-accent-dk);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
}
.related-section a:hover {
  background: var(--color-accent);
  color: var(--color-accent-on);
  border-color: var(--color-accent);
}

/* ==========================================================================
   Sources
   ========================================================================== */
.sources {
  margin: var(--space-7) 0;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
}
.sources h2 { font-size: var(--text-md); text-transform: uppercase;
              letter-spacing: 0.08em; color: var(--color-muted); margin-top: 0; }
.sources ol { max-width: none; font-size: var(--text-sm); color: var(--color-muted); }
.sources li { margin-bottom: var(--space-1); }

/* ==========================================================================
   Footer
   ========================================================================== */
footer.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--text-sm);
  padding: var(--space-6) var(--gutter) var(--space-7);
  text-align: center;
}
footer.site-footer .inner { max-width: var(--wrap); margin: 0 auto; }
footer.site-footer a { color: var(--color-muted); }
footer.site-footer a:hover { color: var(--color-accent-dk); }
footer.site-footer ul { list-style: none; display: flex; justify-content: center;
            flex-wrap: wrap; gap: var(--space-4); margin: 0 0 var(--space-3);
            padding: 0; max-width: none; }
footer.site-footer li { margin: 0; }
footer.site-footer p { margin: var(--space-2) 0 0; max-width: none; }
footer.site-footer .made-with { font-size: var(--text-xs); opacity: 0.8; }

/* ==========================================================================
   Motion — respect reduced preference
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
  .symptom-row:hover { transform: none; }
  .plant-card:hover { transform: none; }
}

/* ==========================================================================
   Dark mode — token overrides only
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:          #0e1412;
    --color-surface:     #161e1b;
    --color-surface-2:   #1e2824;
    --color-ink:         #e3ebe8;
    --color-ink-head:    #f2f8f5;
    --color-muted:       #a8b3af;
    --color-accent:      #5fb38a;
    --color-accent-dk:   #8cc5aa;
    --color-accent-on:   #0e1412;
    --color-citrus:      #f0b066;
    --color-citrus-dk:   #d4954a;
    --color-citrus-on:   #0e1412;
    --color-leaf:        #6ebca0;
    --color-gray:        #7f8e87;
    --color-border:      #2b3631;
    --color-border-hi:   #3b4842;
    --color-link:        #8cc5aa;
    --color-link-visit:  #a8d1b8;
    --color-focus:       #5fb38a;
    --color-shadow:      rgba(0, 0, 0, 0.35);
  }
}
