/* Gemensam formgivning för Mulliga Åsnan. */

html {
    scrollbar-gutter: stable;
}

:root {
    --ink: #263d30;
    --muted: #616a61;
    --paper: #f8f6f0;
    --green: #31583e;
    --line: #dedfd3;
    --accent: #ac632e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 17px/1.65 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

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

img {
    max-width: 100%;
    height: auto;
}

header {
    background: #fffdf8;
    border-bottom: 1px solid var(--line);
}

.top,nav,main,footer {
    max-width: 1200px;
    margin: auto;
    padding-left: 32px;
    padding-right: 32px;
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    padding-bottom: 24px;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    font: 700 27px/1.2 Georgia,serif;
}

.brand small {
    display: block;
    font: 10px/2 system-ui;
    letter-spacing: 2px;
    margin-top: 5px;
}

.mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid var(--green);
    border-radius: 50%;
    font: 19px Georgia;
}

.tag {
    font: italic 16px Georgia;
    color: var(--muted);
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 12px;
}

nav a {
    padding: 10px 15px;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
}

nav a:hover,nav a[aria-current] {
    background: #e9edde;
}

main {
    padding-top: 44px;
    padding-bottom: 64px;
    min-height: 65vh;
}

h1,h2,h3 {
    font-family: Georgia,serif;
    line-height: 1.16;
    font-weight: normal;
}

h1 {
    font-size: clamp(36px,5vw,58px);
    margin: 12px 0 20px;
}

h2 {
    font-size: 30px;
}

h3 {
    font-size: 25px;
    margin: 16px 0;
}

.eyebrow {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.lead {
    color: var(--muted);
    font-size: 18px;
    max-width: 620px;
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 56px;
    padding-bottom: 40px;
}

.hero img {
    width: 100%;
    height: 310px;
    object-fit: cover;
    border-radius: 12px;
}

.search {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
}

.search label {
    flex: 1;
    max-width: 520px;
}

label {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

input,select,textarea {
    font: inherit;
    color: var(--ink);
    border: 1px solid #aeb7a8;
    border-radius: 7px;
    background: white;
    padding: 12px;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
}

textarea {
    display: block;
    resize: vertical;
}

input[type=submit],button,.button {
    background: var(--green);
    color: white;
    border: 0;
    border-radius: 7px;
    padding: 13px 22px;
    font: 600 15px system-ui;
    min-height: 48px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    width: auto;
}

button:hover,.button:hover {
    background: #25432f;
}

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

.card {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.card>a {
    display: block;
    text-decoration: none;
    height: 100%;
}

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

.card-body {
    padding: 22px;
}

.card p {
    color: var(--muted);
    font-size: 15px;
    margin: 12px 0;
}

.card:hover {
    border-color: #8a9e84;
}

.meta {
    font-size: 13px;
    color: var(--muted);
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    font-size: 13px;
    color: var(--green);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 0;
}

.recipe-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 28px 0 40px;
    align-items: center;
}

.recipe-head img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 10px;
}

.recipe-body {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 48px;
}

.ingredients {
    padding: 26px;
    background: #e9edde;
    border-radius: 10px;
    align-self: start;
}

.ingredients h2 {
    margin-top: 0;
}

.ingredients ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ingredients li {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #cdd6c5;
}

.ingredients li:last-child {
    border: 0;
}

.instructions {
    max-width: 680px;
    overflow-wrap: anywhere;
}

.instructions p {
    margin-bottom: 20px;
}

.prose {
    max-width: 760px;
}

.prose p {
    margin: 0 0 22px;
}

.prose .subHeader {
    font: normal 26px Georgia;
    color: var(--green);
    margin-top: 30px;
}

.prose .pageName {
    font: normal 42px Georgia;
}

.notice {
    padding: 16px 20px;
    background: #e9edde;
    border-radius: 8px;
    margin: 16px 0 28px;
}

.empty {
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.skip {
    position: absolute;
    left: 16px;
    top: -100px;
    padding: 12px;
    background: white;
    z-index: 9;
}

.skip:focus {
    top: 10px;
}

:focus-visible {
    outline: 3px solid #b06c35;
    outline-offset: 4px;
}

footer {
    display: flex;
    justify-content: space-between;
    padding-top: 28px;
    padding-bottom: 28px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}

.editor {
    max-width: 900px;
}

.editor form {
    background: #fffdf8;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.editor form label {
    margin-top: 15px;
}

.editor table,.editor tbody,.editor tr,.editor td {
    display: block;
    width: 100%!important;
}

.editor table input,.editor table textarea {
    width: 100%;
}

.editor input[type=submit] {
    margin-top: 12px;
}

.editor select {
    margin: 8px 0;
}

.editor #recipeDetails img {
    border-radius: 8px;
}

.legacy table {
    width: 100%!important;
    max-width: 100%;
    border-collapse: collapse;
}

.legacy td,.legacy th {
    font-size: 16px;
    line-height: 1.65;
}

.legacy td {
    padding: 8px;
}

.legacy .pageName {
    font: 36px Georgia;
}

.legacy input[type=submit] {
    margin-top: 12px;
}

.legacy {
    overflow-wrap: anywhere;
}

.legacy>table>tbody>tr>td:has(>img[src*="spacer"]) {
    display: none;
}

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

    .hero {
        gap: 26px;
    }

    .recipe-body {
        grid-template-columns: 280px 1fr;
        gap: 26px;
    }

    .top,nav,main,footer {
        padding-left: 22px;
        padding-right: 22px;
    }

    .tag {
        display: none;
    }

}

@media (max-width:600px) {
    body {
        font-size: 17px;
    }

    .top {
        padding-top: 18px;
        padding-bottom: 16px;
    }

    .brand {
        font-size: 24px;
    }

    nav {
        gap: 2px;
    }

    nav a {
        padding: 10px 12px;
    }

    .hero,.recipe-head,.recipe-body {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero img {
        height: 225px;
    }

    .hero {
        padding-bottom: 28px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card img {
        height: 240px;
    }

    main {
        padding-top: 28px;
    }

    .search {
        align-items: stretch;
        flex-direction: column;
    }

    .search button {
        width: 100%;
    }

    .recipe-head {
        margin-bottom: 28px;
    }

    .section-head {
        align-items: baseline;
        gap: 10px;
    }

    .section-head h2 {
        font-size: 26px;
    }

    .section-head span {
        font-size: 13px;
    }

    footer {
        gap: 12px;
        flex-direction: column;
    }

    .legacy table,.legacy tbody,.legacy tr,.legacy td,.legacy th {
        display: block;
        width: 100%!important;
    }

    .editor form {
        padding: 18px;
    }

}

@media print {
    header,footer,.search,.print-button,.back {
        display: none;
    }

    body {
        background: white;
        font-size: 12pt;
    }

    main {
        padding: 0;
    }

    .recipe-head {
        grid-template-columns: 1fr;
    }

    .recipe-head img {
        max-height: 180px;
        width: auto;
    }

    .recipe-body {
        grid-template-columns: 1fr;
    }

    .ingredients {
        background: white;
        border: 1px solid #aaa;
    }

    .card {
        break-inside: avoid;
    }

}
