:root {
    --green-900: #14532d;
    --green-700: #1f7a4c;
    --green-600: #2f9e5e;
    --green-100: #e7f4ec;
    --green-50: #f3faf5;
    --text: #1f2a24;
    --muted: #5f7469;
    --border: #d9e6dd;
    --bg: #fbfdfb;
    --card-bg: #ffffff;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--green-900);
    color: #fff;
    padding: 1rem 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.brand-icon { font-size: 1.5rem; }

.search-form {
    display: flex;
    flex: 1;
    max-width: 420px;
    min-width: 220px;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 0.55rem 0.8rem;
    border: none;
    border-radius: 6px 0 0 6px;
    font-size: 0.95rem;
}
.search-form button {
    padding: 0.55rem 1rem;
    border: none;
    background: var(--green-600);
    color: #fff;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-weight: 600;
}
.search-form button:hover { background: var(--green-700); }

/* Page titles */
.page-title {
    margin: 1.75rem 0 0.25rem;
    font-size: 1.9rem;
    color: var(--green-900);
}
.page-subtitle {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

/* Filters */
.filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.alpha-link {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    background: var(--green-100);
    color: var(--green-700);
    font-weight: 600;
    font-size: 0.9rem;
}
.alpha-link:hover { background: var(--green-600); color: #fff; text-decoration: none; }
.alpha-link.active { background: var(--green-700); color: #fff; }

.family-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.family-filter select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    max-width: 280px;
}

/* Plant grid */
.plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.1rem;
    margin-bottom: 2rem;
}
.plant-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.plant-card:hover {
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(20, 83, 45, 0.12);
    transform: translateY(-2px);
}
.plant-thumb {
    aspect-ratio: 4 / 3;
    background: var(--green-50);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.plant-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.plant-thumb-placeholder { font-size: 2.5rem; }
.plant-card-body { padding: 0.75rem 0.9rem 1rem; }
.plant-card-latin { margin: 0 0 0.2rem; font-style: italic; font-weight: 700; font-size: 1.05rem; line-height: 1.25; color: var(--green-900); }
.plant-card-common { margin: 0; color: var(--muted); font-size: 0.88rem; }
.plant-card-family { margin: 0.2rem 0 0; font-size: 0.8rem; color: var(--green-700); font-weight: 600; }

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted);
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin: 2rem 0;
}
.page-link {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--green-700);
    font-size: 0.9rem;
}
.page-link:hover { background: var(--green-100); text-decoration: none; }
.page-link.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.page-ellipsis { padding: 0.4rem 0.25rem; color: var(--muted); }

/* Breadcrumb */
.breadcrumb {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.88rem;
    color: var(--muted);
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

/* Detail page */
.plant-detail-header h1 {
    margin: 0.25rem 0 0.75rem;
    font-size: 2.1rem;
    color: var(--green-900);
}
.plant-meta-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    background: var(--card-bg);
}
.plant-meta-box .common-name { margin: 0; font-size: 1.05rem; }
.plant-meta-box .family { margin: 0.2rem 0 0; font-weight: 600; color: var(--green-700); }
.garden-location { text-align: right; font-size: 0.9rem; color: var(--muted); }
.garden-location strong { display: block; color: var(--green-900); font-size: 1rem; }

.plant-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.gallery-item {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--green-50);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.plant-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.75rem;
    align-items: start;
}
@media (max-width: 820px) {
    .plant-body { grid-template-columns: 1fr; }
}

.plant-sidebar { display: flex; flex-direction: column; gap: 0.9rem; }
.side-box {
    background: var(--green-100);
    border-radius: 8px;
    padding: 0.9rem 1rem;
}
.side-box h2 {
    margin: -0.9rem -1rem 0.75rem;
    background: #d2eadb;
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
    border-radius: 8px 8px 0 0;
}
.side-box p { margin: 0; font-size: 0.92rem; }
.side-icon { text-align: center; margin-bottom: 0.5rem; }
.side-icon img { width: 3rem; height: 3rem; }

.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.tag-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; }
.tag-list img { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.plant-main { min-width: 0; }
.content-section { margin-bottom: 1.75rem; }
.content-section h2 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--green-900);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
    margin-bottom: 0.75rem;
}
.rich-content p { margin: 0 0 0.75rem; }
.rich-content ul, .rich-content ol { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.rich-content li { margin-bottom: 0.3rem; }
.rich-content em { color: var(--green-700); }

.disclaimer {
    font-size: 0.82rem;
    color: var(--muted);
    background: var(--green-50);
    border-left: 3px solid var(--green-600);
    padding: 0.6rem 0.9rem;
    margin: 0 0 1rem;
}

.recipe-list { display: flex; flex-direction: column; gap: 1rem; }
.recipe-card {
    display: flex;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--card-bg);
    flex-wrap: wrap;
}
.recipe-thumb {
    width: 220px;
    max-width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.recipe-body { flex: 1; min-width: 200px; }
.recipe-body h3 { margin: 0 0 0.4rem; color: var(--green-900); }

.references ol { padding-left: 1.25rem; font-size: 0.88rem; color: var(--muted); }
.references li { margin-bottom: 0.5rem; }

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}
