:root {
    color-scheme: light;
    --bg: #f7f2ec;
    --surface: #ffffff;
    --surface-soft: #fcf8f4;
    --ink: #2f2926;
    --muted: #746a63;
    --accent: #8f4c36;
    --accent-strong: #743923;
    --green: #6e8b63;
    --line: #e4d8cf;
    --radius: 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

a { color: var(--accent-strong); }
img { max-width: 100%; display: block; }

.shell {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.92);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
}

.version,
.eyebrow,
.recipe-category,
.source-platform {
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.user-email { color: var(--muted); font-size: .88rem; }
.inline-form { margin: 0; }
.link-button {
    min-height: auto;
    background: transparent;
    color: var(--accent-strong);
    padding: 5px 0;
}
.link-button:hover { background: transparent; text-decoration: underline; }

.main-content { padding-block: 48px 72px; }

.hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 28px;
}

h1, h2, h3 {
    font-family: Georgia, "Times New Roman", serif;
    margin-top: 0;
}

h1 {
    font-size: clamp(2.2rem, 7vw, 4.4rem);
    line-height: .98;
    margin-bottom: 12px;
}

h2 { margin-bottom: 14px; }

.lead {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.6;
}

.panel,
.auth-card,
.empty-state,
.recipe-section,
.source-card,
.note-box,
.variant-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 36px rgba(67, 43, 31, .05);
}

.panel { padding: 24px; }

.search-form label,
.stack-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.search-form small { display: block; color: var(--muted); margin-top: 10px; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

input,
button {
    min-height: 48px;
    border-radius: 12px;
    font: inherit;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    padding: 0 14px;
    background: #fffdfa;
}

input:focus { outline: 2px solid rgba(143,76,54,.18); border-color: var(--accent); }

button {
    border: 0;
    padding: 0 18px;
    background: var(--accent);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

button:hover { background: var(--accent-strong); }
button:disabled { opacity: .5; cursor: not-allowed; }

.auth-wrap { min-height: 60vh; display: grid; place-items: center; }
.auth-card { width: min(460px, 100%); padding: 32px; }
.auth-card h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
.stack-form { display: grid; gap: 10px; margin-top: 28px; }
.stack-form button { margin-top: 8px; }

.alert { border-radius: 12px; padding: 12px 14px; margin-top: 20px; }
.alert-error { background: #fff0ed; border: 1px solid #e3b1a4; color: #7d2e20; }

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin: 38px 0 18px;
}
.section-heading h2 { margin-bottom: 0; }
.muted { color: var(--muted); }

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.recipe-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 12px 36px rgba(67, 43, 31, .05);
    transition: transform .18s ease, box-shadow .18s ease;
}
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(67,43,31,.1); }
.recipe-card img,
.recipe-image-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.recipe-image-placeholder { display: grid; place-items: center; background: linear-gradient(135deg,#eee0d5,#d8bda9); color: #765443; font-family: Georgia,serif; font-size: 1.5rem; }
.recipe-card-body { padding: 18px; }
.recipe-card h3 { margin: 6px 0 8px; font-size: 1.3rem; }
.recipe-card p { margin: 0; color: var(--muted); }

.empty-state { padding: 34px; text-align: center; }
.empty-state p { color: var(--muted); margin-bottom: 0; }

.back-link { display: inline-block; margin-bottom: 22px; text-decoration: none; }
.recipe-header { display: grid; grid-template-columns: 1.05fr .95fr; gap: 32px; align-items: center; margin-bottom: 26px; }
.recipe-header h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); }
.recipe-hero-image { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 24px; border: 1px solid var(--line); }

.meta-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.meta-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 4px; }
.meta-grid strong { font-size: 1.05rem; }
.meta-grid span { color: var(--muted); font-size: .8rem; }

.note-box { padding: 16px 18px; margin-bottom: 22px; background: #f4f7f1; }
.recipe-columns { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; align-items: start; }
.recipe-section { padding: 24px; }
.ingredient-list,
.step-list { margin: 0; padding-left: 22px; }
.ingredient-list li,
.step-list li { margin-bottom: 10px; line-height: 1.55; }

.variant-box { margin-top: 20px; padding: 22px; background: #fff3ef; }
.variant-box p { margin-bottom: 0; line-height: 1.6; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.tag { background: #eef3eb; border: 1px solid #d2dfcc; border-radius: 999px; padding: 7px 11px; font-size: .82rem; }

.sources-section { margin-top: 34px; }
.source-card { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 18px; margin-bottom: 10px; }
.source-card p { margin: 5px 0 0; color: var(--muted); }
.source-card a { white-space: nowrap; }

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 24px 0 36px;
    font-size: .9rem;
}

@media (max-width: 860px) {
    .recipe-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .recipe-header,
    .recipe-columns { grid-template-columns: 1fr; }
    .meta-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 640px) {
    .main-content { padding-block: 32px 52px; }
    .search-row,
    .recipe-grid,
    .meta-grid { grid-template-columns: 1fr; }
    .header-inner,
    .section-heading,
    .source-card { align-items: flex-start; }
    .header-actions { flex-wrap: wrap; justify-content: flex-end; }
    .user-email { display: none; }
    button:not(.link-button) { width: 100%; }
    .auth-card { padding: 24px; }
    .source-card { flex-direction: column; }
}


.menu-toggle {
    display: none;
    width: auto;
    min-height: 42px;
    padding: 0 12px;
    align-items: center;
    gap: 7px;
}

@media (max-width: 760px) {
    .header-inner {
        min-height: 62px;
        flex-wrap: wrap;
        gap: 10px;
        padding-block: 10px;
    }

    .js .menu-toggle {
        display: inline-flex;
        margin-left: auto;
        width: auto;
    }

    .js .header-actions {
        display: none;
        width: 100%;
        align-items: stretch;
        padding: 10px 0 6px;
        border-top: 1px solid var(--line);
    }

    .js .header-actions.is-open {
        display: flex;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .main-nav {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .main-nav .header-link {
        display: block;
        width: 100%;
        padding: 10px 4px;
    }

    .header-actions .inline-form {
        width: 100%;
    }

    .header-actions .link-button {
        text-align: left;
    }
}

.food-quantity-edit button[type="submit"] {
    font-size: 0;
}
.food-quantity-edit button[type="submit"]::after {
    content: "Módosítás";
    font-size: .95rem;
}
