:root {
    --primary: #2f7a4f;
    --primary-dark: #235c3b;
    --bg: #f6f7f5;
    --card-bg: #ffffff;
    --text: #222;
    --muted: #666;
    --border: #e0e0e0;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0 0 3rem 0;
}

header {
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
    font-weight: 500;
}

header a:hover { text-decoration: underline; }

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

.filter-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-form label {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.25rem;
}

.filter-form input, .filter-form select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.filter-form .full-width { grid-column: 1 / -1; }

button, .btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn:hover { background: var(--primary-dark); }

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.recipe-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.recipe-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.recipe-card .body {
    padding: 0.9rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-card h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
}

.macros {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.macros span {
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}

.card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

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

.detail-header {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.detail-header img {
    width: 320px;
    max-width: 100%;
    border-radius: 10px;
}

.detail-macros {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.detail-macros div {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 90px;
}

.detail-macros .value { font-size: 1.3rem; font-weight: 600; color: var(--primary); }
.detail-macros .label { font-size: 0.75rem; color: var(--muted); }

ol.instructions li { margin-bottom: 0.6rem; }

.flash {
    background: #e7f5ec;
    border: 1px solid var(--primary);
    color: var(--primary-dark);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}
