/* Lisa's Recipes — a warm, homey recipe box.
   Plain CSS, no framework. Mobile-first. */

:root {
    --bg: #faf6ef;
    --surface: #fffdf9;
    --text: #3d3229;
    --muted: #8c7d6e;
    --border: #e8e0d2;
    --accent: #b0563a;
    --accent-dark: #8f4229;
    --accent-soft: #f3e2d9;
    --danger: #a12622;
    --danger-dark: #7d1d1a;
    --success-bg: #e9f3e2;
    --success-border: #7ba05b;
    --success-text: #3f6212;
    --error-bg: #fbe9e4;
    --error-border: #c96a4f;
    --error-text: #8f3a22;
    --mark: #fff1b8;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(61, 50, 41, 0.08);
}

* {
    box-sizing: border-box;
}

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

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

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

@media (min-width: 600px) {
    .container {
        padding: 1.5rem 2rem;
    }
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-dark);
}

h1, h2, h3 {
    line-height: 1.25;
    color: var(--text);
}

/* Header */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.site-header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.site-title:hover {
    color: var(--accent);
}

/* Search */

.search-form {
    display: flex;
}

.search-form input[type="search"] {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    color: var(--text);
    background: var(--bg);
    min-width: 180px;
}

@media (min-width: 600px) {
    .search-form input[type="search"] {
        min-width: 240px;
    }
}

.search-form input[type="search"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
}

.search-result:hover {
    border-color: var(--accent);
}

.search-result-title {
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}

.search-result-title:hover {
    color: var(--accent);
}

.search-result-snippet {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

mark {
    background: var(--mark);
    color: var(--text);
    border-radius: 2px;
    padding: 0 2px;
}

/* Footer */

.site-footer {
    max-width: 900px;
    margin: 2.5rem auto 0;
    padding: 1rem;
    color: var(--muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* Buttons */

.button {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}

.button:focus-visible {
    outline: 2px solid var(--accent-dark);
    outline-offset: 2px;
}

.button-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.button-secondary:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.button-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.button-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}

/* Flash messages */

.flash-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.flash-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

/* Page header (title + action) */

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

.page-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

/* Empty states */

.empty-state {
    color: var(--muted);
    padding: 2.5rem 0;
    text-align: center;
    font-size: 1.05rem;
}

/* Login */

.login-form {
    max-width: 340px;
}

.login-form label {
    display: block;
    margin-top: 0.9rem;
    font-weight: 600;
}

.login-form input {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    color: var(--text);
    background: var(--surface);
}

.login-form input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.login-form button {
    margin-top: 1.25rem;
    width: 100%;
}

/* Recipe list */

.recipe-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 600px) {
    .recipe-list {
        grid-template-columns: 1fr 1fr;
    }
}

.recipe-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.recipe-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(61, 50, 41, 0.12);
}

.recipe-card-body {
    padding: 0.75rem 1rem;
}

.recipe-card-title {
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}

.recipe-card-title:hover {
    color: var(--accent);
}

.recipe-card-date {
    color: var(--muted);
    font-size: 0.85rem;
}

.recipe-card-thumb {
    display: block;
    height: 160px;
}

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

/* Recipe form */

.recipe-form {
    max-width: 560px;
}

.recipe-form label {
    display: block;
    margin-top: 1.1rem;
    font-weight: 600;
}

.recipe-form input[type="text"],
.recipe-form input[type="file"],
.recipe-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    color: var(--text);
    background: var(--surface);
}

.recipe-form textarea {
    resize: vertical;
    line-height: 1.5;
}

.recipe-form input:focus,
.recipe-form textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.hint {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.recipe-form button {
    margin-top: 1.5rem;
}

.current-image {
    margin-top: 0.6rem;
}

.current-image img {
    max-width: 240px;
    max-height: 180px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.current-image p {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0.4rem 0 0;
}

/* Recipe detail */

.recipe h1 {
    font-size: 1.9rem;
}

@media (min-width: 600px) {
    .recipe h1 {
        font-size: 2.2rem;
    }
}

.recipe-updated {
    color: var(--muted);
    font-size: 0.9rem;
}

.recipe-image {
    margin: 1.25rem 0;
}

.recipe-image img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: block;
}

.recipe-section {
    margin: 1.75rem 0;
}

.recipe-section h2 {
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    margin-bottom: 0.75rem;
}

.recipe-ingredients,
.recipe-instructions {
    padding-left: 1.4rem;
    margin: 0;
}

.recipe-ingredients li,
.recipe-instructions li {
    margin: 0.45rem 0;
}

.recipe-instructions li {
    padding-left: 0.25rem;
}

.recipe-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.delete-form {
    display: inline;
    margin: 0;
}

/* Error pages */

.error-page {
    text-align: center;
    padding: 3rem 0;
}

.error-page h1 {
    font-size: 3rem;
    margin: 0 0 0.5rem;
    color: var(--accent);
}

.error-page p {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0 0 1.5rem;
}
