body.recipe-page {
    background: #262929;
    color: #f2f2f2;
}

.recipe-shell {
    --page-background: #262929;
    --page-foreground: #f2f2f2;
    --link-color: #f2f2f2;
    --rule-color: #424242;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--page-background);
    color: var(--page-foreground);
}

#light-mode:checked ~ .recipe-shell {
    --page-background: #fff;
    --page-foreground: #222;
    --link-color: #222;
    --rule-color: #bbb;
}

.theme-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.theme-toggle {
    display: inline-block;
    margin: 12px 20px 0;
    font-family: "Helvetica Neue", sans-serif;
    font-size: 16px;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: #00ffff8f;
}

#light-mode:focus-visible ~ .recipe-shell .theme-toggle {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.recipe-shell header,
.recipe-shell footer {
    background: var(--page-background);
}

.recipe-shell a,
.recipe-shell a:visited,
.recipe-shell #content h1,
.recipe-shell #content h2 {
    color: var(--page-foreground);
}

.recipe-shell a:hover {
    color: var(--page-foreground);
}

.recipe-shell #content {
    box-sizing: border-box;
    width: min(60rem, 100%);
    max-width: 100%;
    min-width: 0;
}

.recipe-shell #content p {
    margin: 1rem 0;
}

.recipe-shell .recipe-summary {
    color: var(--page-foreground);
    font-style: italic;
}

.recipe-shell .recipe-ingredients {
    list-style: disc;
    padding-left: 1.5rem;
}

.recipe-shell .recipe-ingredients li,
.recipe-shell .recipe-method li {
    margin: 0 0 0.6rem;
    padding: 0;
}

.recipe-shell .recipe-method {
    padding-left: 2rem;
}

.recipe-shell td,
.recipe-shell th,
.recipe-shell .footer-line {
    border-color: var(--rule-color);
    background-color: var(--rule-color);
}

.recipe-shell footer p {
    color: var(--page-foreground);
}

@media print {
    @page {
        margin: 18mm;
    }

    body.recipe-page,
    .recipe-shell {
        min-height: 0;
        background: #fff !important;
        color: #000 !important;
    }

    .recipe-shell header,
    .recipe-shell footer,
    .theme-toggle {
        display: none;
    }

    .recipe-shell #content {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .recipe-shell #content h1,
    .recipe-shell #content h2,
    .recipe-shell #content p,
    .recipe-shell #content li,
    .recipe-shell a {
        color: #000 !important;
    }

    .recipe-shell h1,
    .recipe-shell h2,
    .recipe-shell li {
        break-inside: avoid;
    }
}
