/* =========================================================================
   Why Is My Plant — design system
   System font stack. Restrained, Apple-inspired. Server-rendered, JS-free.
   ========================================================================= */

:root {
    --green:        #1f8a4c;
    --green-deep:   #15663a;
    --green-tint:   #eaf3ec;
    --green-tint-2: #d7e9db;
    --ink:          #15231b;
    --body:         #2c3a32;
    --muted:        #5c6b62;
    --line:         #e4ebe5;
    --paper:        #f8faf7;
    --surface:      #ffffff;
    --dark:         #1c2a22;

    --r:            14px;
    --r-sm:         9px;
    --pill:         999px;

    --max:          1080px;
    --max-read:     64ch;

    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --shadow:       0 1px 2px rgba(21, 35, 27, 0.03), 0 6px 18px rgba(21, 35, 27, 0.04);
    --shadow-lift:  0 1px 3px rgba(21, 35, 27, 0.04), 0 10px 26px rgba(21, 35, 27, 0.07);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    color: var(--body);
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

main.wrap {
    padding-top: 3.5rem;
    padding-bottom: 5.5rem;
}

main.wrap > .article {
    max-width: var(--max-read);
    margin: 0 auto;
}

/* ---- Typography ---- */

h1, h2, h3 {
    color: var(--ink);
    font-family: var(--font-display);
    font-optical-sizing: auto;
}

h1 {
    font-size: clamp(1.7rem, 1.25rem + 1.7vw, 2.4rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.022em;
    color: var(--ink);
    margin: 0 0 1rem;
}

h2 {
    font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.5rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 2.5rem 0 0.9rem;
    letter-spacing: -0.012em;
}

h3 {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 1.4rem 0 0.4rem;
}

p { margin: 0 0 1.1rem; }

a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--green); }

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

.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--green-deep);
    margin: 0 0 0.9rem;
}

/* ---- Header ---- */

.site-header {
    background: rgba(248, 250, 247, 0.85);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.18rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--green);
    flex: 0 0 auto;
    position: relative;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        no-repeat center / 60% 60%
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 4c0 8-4.5 13-12 13.5C8 11 12.5 6 19 4Z' fill='%23fff'/%3E%3C/svg%3E");
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.site-nav a {
    font-family: var(--font-body);
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    border-radius: var(--pill);
    transition: background 0.15s, color 0.15s;
}

.site-nav a:hover { color: var(--ink); background: var(--green-tint); }

/* ---- Hero (home + hub) ---- */

.hero {
    padding: 3.5rem 1.5rem 4rem;
    margin-bottom: 3.5rem;
    text-align: center;
}

.hero .eyebrow { margin-bottom: 0.7rem; }
.hero h1 { margin: 0 0 0.9rem; }

.hero-lead {
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--muted);
    max-width: 34rem;
    margin: 0 auto;
}

.hero-compact { padding: 2.75rem 0 3rem; text-align: left; }
.hero-compact .hero-lead { margin: 0; }

/* ---- Card grid (home + hub) ---- */

.answers h2 { margin-top: 0; margin-bottom: 1.4rem; }

.article-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.article-card { display: flex; }

.article-card-link {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    min-height: 10.5rem;
}

.article-card-link:hover {
    transform: translateY(-2px);
    border-color: var(--green-tint-2);
    box-shadow: var(--shadow-lift);
}

.plant-tag {
    align-self: flex-start;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--green-deep);
    background: var(--green-tint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.65rem;
    border-radius: var(--pill);
}

.article-card-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.card-arrow {
    margin-top: auto;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    flex: 0 0 auto;
    transition: transform 0.18s ease;
}

.article-card-link:hover .card-arrow { transform: translateX(4px); }

/* ---- Article header (eyebrow + h1 + lead) ---- */

.article-header { animation: fade-up 0.5s ease-out both; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.article .lead {
    font-size: 1.1875rem;
    line-height: 1.5;
    font-weight: 400;
    color: var(--ink);
    border-left: 2px solid var(--green);
    padding-left: 1rem;
    margin: 0 0 2.5rem;
}

.article .lead p { margin: 0; }

/* ---- Article body ---- */

.article-body h2 {
    position: relative;
    padding-left: 1.4rem;
}

.article-body h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.52em;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50% 50% 50% 0;
    background: var(--green);
}

.article-body p { color: var(--body); }

.article-body ul,
.article-body ol {
    padding-left: 0;
    margin: 0 0 1.4rem;
    list-style: none;
}

.article-body ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.7rem;
}

.article-body ul li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.62em;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--green);
}

.article-body ul li strong { color: var(--green-deep); }

/* "How to fix it" ordered list with circular numbered badges */
.article-body ol { counter-reset: fix; }

.article-body ol li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1rem;
    min-height: 2rem;
}

.article-body ol li::before {
    counter-increment: fix;
    content: counter(fix);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Diagnostic table ---- */

.table-scroll {
    margin: 1.75rem 0;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow-x: auto;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 0.97rem;
}

.article-body th,
.article-body td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.article-body thead th {
    background: var(--green-tint);
    color: var(--ink);
    font-weight: 600;
    border-bottom: 1px solid var(--green-tint-2);
}

.article-body tbody tr:nth-child(even) { background: var(--paper); }
.article-body tbody tr:last-child td { border-bottom: none; }

/* ---- FAQ cards ---- */

.faq { margin-top: 3.5rem; }

.faq > h2 {
    border-top: 1px solid var(--line);
    padding-top: 2.25rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 1rem 1.15rem;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.faq-item:hover {
    border-color: var(--green-tint-2);
    box-shadow: var(--shadow);
}

.faq-item h3 {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
}

.faq-item p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }

/* ---- Author byline card (article footer) ---- */

.byline {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    margin-top: 3.5rem;
    padding: 1.35rem 1.5rem;
    background: var(--dark);
    border-radius: var(--r);
    color: #d7e0da;
}

.byline img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.byline .byline-body { font-size: 0.95rem; line-height: 1.6; }
.byline .byline-body p { margin: 0 0 0.85rem; }
.byline .byline-body strong { font-family: var(--font-display); font-weight: 600; color: #fff; font-size: 1.02rem; }
.byline .byline-body strong a { color: #fff; text-decoration: none; }
.byline .byline-body strong a:hover { text-decoration: underline; }

.byline-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 !important; }

.byline-links a {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    padding: 0.35rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--pill);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.byline-links a:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* ---- Author page ---- */

.author-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 2.5rem 2rem;
    margin: 0 auto 1.5rem;
    max-width: 36rem;
    box-shadow: var(--shadow);
}

.author-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 3px solid var(--green-tint);
}

.author-card-body h1 { margin: 0 0 0.6rem; }
.author-bio { margin: 0; color: var(--muted); }

.author-find { text-align: center; }

.link-pills {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
}

.link-pills a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    background: transparent;
    border: 1px solid var(--green);
    border-radius: var(--pill);
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    color: var(--green-deep);
    font-weight: 600;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.link-pills a:hover { background: var(--green); color: #fff; transform: translateY(-2px); }
.link-pills a:hover .card-arrow { background: #fff; color: var(--green); }

.link-pills .card-arrow {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.85rem;
    background: var(--green-tint);
    color: var(--green-deep);
}

/* ---- Footer ---- */

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem 3.5rem;
    padding-top: 2.75rem;
    padding-bottom: 1.75rem;
}

.footer-brand { flex: 1 1 17rem; min-width: 14rem; }

.footer-brand .brand { font-size: 1.15rem; }

.footer-tag {
    margin: 0.75rem 0 0;
    max-width: 22rem;
    line-height: 1.6;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.footer-head {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.footer-col a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-col a:hover { color: var(--green-deep); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 1.25rem;
    padding-bottom: 1.75rem;
}

.site-footer p { margin: 0; }

/* ---- Responsive ---- */

@media (min-width: 768px) {
    body { font-size: 1.0625rem; }
}

@media (max-width: 640px) {
    .hero { padding: 2.5rem 0.5rem 3rem; }
    .article-grid { grid-template-columns: 1fr; }
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; }
    .article-header { animation: none !important; }
    .article-card-link,
    .article-card-link:hover,
    .article-card-link:hover .card-arrow,
    .faq-item,
    .faq-item:hover,
    .link-pills a,
    .link-pills a:hover { transition: none !important; transform: none !important; }
}
