:root {
    --bg: #f5f8f1;
    --card: #ffffff;
    --text: #20311a;
    --muted: #577447;
    --primary: #6f8f3a;
    --line: #d9e5cb;
    --accent: #d86f1a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.site-header {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    color: var(--text);
}

.logo img {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
}

.main-nav {
    display: flex;
    gap: 18px;
}

.main-nav a {
    color: var(--muted);
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 8px;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--text);
    background: #edf4e4;
    text-decoration: none;
}

.hero {
    padding: 60px 0 40px;
    text-align: center;
    background: linear-gradient(135deg, #f5f8f1 0%, #e8f4e0 100%);
    border-radius: 16px;
    margin: 20px 0;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: 2.8rem;
    line-height: 1.2;
    color: var(--text);
}

.hero p {
    font-size: 1.2rem;
    color: var(--muted);
    margin-bottom: 20px;
}

.hero-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.compact-hero {
    padding-bottom: 6px;
}

.featured-card,
.post-card,
.auth-card,
.editor-form,
.single-post,
table,
.info-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(41, 67, 24, 0.05);
}

.featured-card {
    padding: 22px;
    margin: 12px 0 28px;
}

.featured-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.badge {
    background: #ebf4df;
    color: #5a7b27;
    font-size: .75rem;
    font-weight: 700;
    display: inline-block;
    border-radius: 99px;
    padding: 4px 10px;
}

.post-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    margin-bottom: 30px;
}

.post-card {
    padding: 16px;
}

.post-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.post-card h3 {
    margin-top: 0;
}

.post-card small {
    color: #5f7553;
}

.section-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#postSearch {
    width: min(290px, 100%);
    margin: 0;
    border: 1px solid #c7d8b2;
    background: #fff;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
    margin-top: 40px;
}

.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links {
    text-align: right;
}

.social-links {
    margin-top: 8px;
}

.stats-section {
    margin-bottom: 30px;
}

.stats-section h2 {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(41, 67, 24, 0.1);
}

.stat-card h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--muted);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.subscribe-section {
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: 40px 0;
    margin: 40px 0;
    border-radius: 16px;
}

.subscribe-section h2 {
    margin: 0 0 10px;
    font-size: 2rem;
}

.subscribe-section p {
    margin: 0 0 20px;
    font-size: 1.1rem;
}

.subscribe-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.subscribe-form input {
    padding: 12px;
    border: none;
    border-radius: 8px;
    width: min(300px, 100%);
}

.subscribe-form .btn {
    background: #fff;
    color: var(--primary);
}

.subscribe-form .btn:hover {
    background: #f0f0f0;
}

.single-post {
    padding: 26px;
    margin-top: 24px;
}

.post-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 16px;
}

.category-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    border-radius: 4px;
    padding: 4px 8px;
    margin-bottom: 8px;
}

.category-badge-small {
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    border-radius: 4px;
    padding: 2px 6px;
    margin-bottom: 8px;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(420px, 100%);
    padding: 24px;
}

input,
textarea,
button {
    width: 100%;
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

button,
.btn {
    background: var(--primary);
    border: 0;
    color: #fff;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: 8px;
    display: inline-block;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #5a7b27;
}

.btn-light {
    background: var(--accent);
}

.btn-light:hover {
    background: #b85a15;
}

.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 14px;
}

.admin-top h1 {
    margin: 0;
    color: var(--text);
}

.editor-form {
    padding: 24px;
    max-width: 800px;
}

.editor-form label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text);
}

.editor-form input,
.editor-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
}

.editor-form textarea {
    resize: vertical;
    min-height: 200px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(41, 67, 24, 0.1);
}

th {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    text-align: left;
    padding: 14px 12px;
}

td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
}

tr:last-child td {
    border-bottom: none;
}

.error {
    color: #b91c1c;
    font-weight: 700;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.info-card {
    padding: 18px;
}

.info-card h2 {
    margin-top: 0;
}

.info-card ul {
    margin: 0;
    padding-left: 18px;
}

.categories-section {
    margin: 40px 0;
    text-align: center;
}

.categories-section h2 {
    margin-bottom: 20px;
    color: var(--text);
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.category-link {
    background: var(--line);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.category-link:hover,
.category-link.active {
    background: var(--primary);
    color: #fff;
}

.care-table-wrap {
    margin-bottom: 24px;
}

.care-table {
    width: 100%;
}

@media (max-width: 720px) {
    .nav-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .logo img {
        max-width: 190px;
    }

    .main-nav {
        gap: 8px;
        font-size: .95rem;
        flex-wrap: wrap;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
}
