/* Higher specificity than the theme's generic ".entry-content > *" module margin */
.entry-content > .ahx-recipe,
.ahx-recipe {
    --recipe-ink: #24332f;
    --recipe-muted: #65736c;
    --recipe-line: #d9e0d9;
    --recipe-accent: #b4482d;
    color: var(--recipe-ink);
    margin: 2rem auto;
    max-width: 980px;
}

body.ahx-recipe-page-background {
    background: #fff;
    isolation: isolate;
}

body.ahx-recipe-page-background .ahx-recipe {
    --recipe-muted: #5f6d66;
    background: transparent;
}

body.ahx-recipe-page-background::before {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    content: "";
    inset: 0;
    opacity: .07;
    pointer-events: none;
    position: fixed;
    z-index: -1;
}

body.ahx-recipe-page-background .ahx-recipe__servings {
    flex-wrap: wrap;
}

@media print {
    body.ahx-recipe-page-background::before {
        display: none;
    }
}

.ahx-recipe__gallery {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.ahx-recipe__image-link {
    border-radius: 4px;
    cursor: zoom-in;
    display: block;
    flex: 0 0 140px;
    max-width: 100%;
    overflow: hidden;
}

.ahx-recipe__image-link:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 3px;
}

.ahx-recipe__gallery-image {
    aspect-ratio: 4 / 3;
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

.ahx-recipe-image-dialog {
    background: #fff;
    border: 0;
    border-radius: 6px;
    box-sizing: border-box;
    margin: auto;
    max-height: calc(100dvh - 2rem);
    max-width: calc(100vw - 2rem);
    padding: 3rem 1rem 1rem;
}

.ahx-recipe-image-dialog::backdrop {
    background: rgb(0 0 0 / 75%);
}

.ahx-recipe-image-dialog .ahx-recipe-image-dialog__image {
    display: block;
    height: auto;
    margin: 0;
    max-height: calc(100dvh - 6rem);
    max-width: 100%;
    object-fit: contain;
    width: auto;
}

.ahx-recipe-image-dialog [hidden] {
    display: none;
}

.ahx-recipe-image-dialog .ahx-recipe-image-dialog__close {
    align-items: center;
    background: #fff;
    border: 1px solid #d9e0d9;
    border-radius: 4px;
    color: #24332f;
    cursor: pointer;
    display: flex;
    font-size: 1.75rem;
    height: 36px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: .5rem;
    top: .5rem;
    width: 36px;
}

body.ahx-recipe-image-open {
    overflow: hidden;
}

.ahx-recipe__source {
    color: var(--recipe-muted);
    font-size: .9em;
}

.ahx-recipe__servings {
    align-items: center;
    border-block: 1px solid var(--recipe-line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: 1.25rem 0;
    padding: .8rem 0;
}

.ahx-recipe__servings > label {
    align-items: center;
    display: flex;
    gap: .5rem;
}

.ahx-recipe__servings input[type="number"] {
    margin-inline-start: .5rem;
    width: 5rem;
}

.ahx-recipe__layout-control {
    justify-content: flex-end;
    margin-inline-start: auto;
}

.ahx-recipe__layout-control select {
    max-width: min(11rem, 48vw);
}

.ahx-recipe__body {
    display: grid;
    gap: 2.5rem;
}

.ahx-recipe__body h2 {
    margin-top: 0;
}

.ahx-recipe__ingredients ul,
.ahx-recipe__instructions ol {
    margin: 0;
    padding-inline-start: 1.4rem;
}

.ahx-recipe__ingredients ul {
    list-style: none;
    padding-inline-start: 0;
}

.ahx-recipe__ingredient {
    align-items: center;
    border-bottom: 1px solid var(--recipe-line);
    column-gap: .75rem;
    display: grid;
    grid-template-columns: minmax(4.5rem, max-content) minmax(0, 1fr);
    list-style: none;
    margin: 0;
    padding-block: .65rem;
}

.ahx-recipe__ingredient:last-child {
    border-bottom: 0;
}

.ahx-recipe__ingredient-amount {
    text-align: end;
    white-space: nowrap;
}

.ahx-recipe__ingredient-copy {
    display: block;
    min-width: 0;
    text-align: start;
}

.ahx-recipe__ingredient-copy.has-addition {
    display: grid;
    gap: .1rem;
}

.ahx-recipe__ingredient-copy:not(.has-addition) [data-ahx-item] {
    display: inline;
}

.ahx-recipe__ingredient-addition {
    color: var(--recipe-muted);
}

.ahx-recipe__instructions li {
    margin-block: 0 1rem;
    padding-inline-start: .35rem;
}

.ahx-recipe__bring {
    background: var(--recipe-accent);
    border: 0;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    margin-top: 1rem;
    padding: .7rem 1rem;
}

.ahx-recipe__bring:hover,
.ahx-recipe__bring:focus-visible {
    background: #87331f;
}

.ahx-recipe__bring-form {
    margin-top: 1rem;
}

.ahx-recipe__bring-status {
    color: var(--recipe-muted);
    margin-block: .5rem 0;
}

.ahx-recipe__notice {
    border-inline-start: 4px solid var(--recipe-accent);
    padding: .6rem 1rem;
}

.ahx-recipe--split .ahx-recipe__body {
    grid-template-columns: minmax(220px, .8fr) minmax(0, 1.7fr);
}

.ahx-recipe-collection [hidden] {
    display: none;
}

.ahx-recipe-pantry {
    border-bottom: 1px solid var(--recipe-line);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
}

.ahx-recipe-collection .ahx-recipe-pantry h2 {
    font-size: 1.5rem;
    letter-spacing: 0;
    margin: 0 0 1rem;
}

.ahx-recipe-pantry fieldset {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.ahx-recipe-pantry legend {
    margin-bottom: .5rem;
}

.ahx-recipe-pantry__row {
    align-items: end;
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 40px;
    margin-bottom: .75rem;
}

.ahx-recipe-pantry label {
    display: grid;
    font-size: .9rem;
    gap: .3rem;
    min-width: 0;
}

.ahx-recipe-pantry input:not([type="checkbox"]),
.ahx-recipe-pantry select {
    background: #fff;
    border: 1px solid #9aa79f;
    border-radius: 4px;
    box-sizing: border-box;
    color: var(--recipe-ink);
    font: inherit;
    height: 40px;
    min-width: 0;
    padding: .4rem .55rem;
    width: 100%;
}

.ahx-recipe-pantry button {
    align-items: center;
    background: #fff;
    border: 1px solid #9aa79f;
    border-radius: 4px;
    color: var(--recipe-ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    gap: .4rem;
    justify-content: center;
    min-height: 40px;
    padding: .4rem .75rem;
}

.ahx-recipe-pantry button:disabled {
    cursor: default;
    opacity: .5;
}

.ahx-recipe-pantry button[type="submit"] {
    background: #246342;
    border-color: #246342;
    color: #fff;
}

.ahx-recipe-pantry .ahx-recipe-pantry__remove {
    padding: 0;
    width: 40px;
}

.ahx-recipe-pantry__controls,
.ahx-recipe-pantry__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
    margin-top: .75rem;
}

.ahx-recipe-pantry__controls > label:not(.ahx-recipe-pantry__complete) {
    align-items: center;
    grid-template-columns: auto 5rem;
}

.ahx-recipe-pantry label.ahx-recipe-pantry__complete {
    align-items: center;
    display: flex;
    gap: .5rem;
}

.ahx-recipe-pantry__status {
    margin: 1rem 0 0;
}

.ahx-recipe-list__match {
    border-top: 1px solid var(--recipe-line);
    font-size: .85rem;
    line-height: 1.5;
    margin-top: .85rem;
    overflow-wrap: anywhere;
    padding-top: .5rem;
}

.ahx-recipe-collection .ahx-recipe-list__match p {
    margin: .35rem 0 0;
}

.ahx-recipe-list__coverage {
    color: #246342;
    font-weight: 600;
}

.entry-content > .ahx-recipe-submissions {
    margin-inline: 0;
}

.ahx-recipe-submissions {
    --recipe-ink: #24332f;
    --recipe-line: #d9e0d9;
    color: var(--recipe-ink);
    margin: 1rem 0 2rem;
}

.ahx-recipe-submissions [hidden] {
    display: none;
}

.ahx-recipe-submission {
    border-block-end: 1px solid var(--recipe-line);
    padding: .75rem 0;
}

.ahx-recipe-submission h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0;
    margin: 0;
}

.ahx-recipe-submission form {
    margin-top: 1.25rem;
}

.ahx-recipe-submission__fields {
    display: grid;
    gap: 1rem;
}

.ahx-recipe-submission label {
    display: grid;
    font-size: .9rem;
    gap: .3rem;
    min-width: 0;
}

.ahx-recipe-submission input:not([type="checkbox"]),
.ahx-recipe-submission textarea {
    background: #fff;
    border: 1px solid #9aa79f;
    border-radius: 4px;
    box-sizing: border-box;
    color: var(--recipe-ink);
    font: inherit;
    min-height: 40px;
    min-width: 0;
    padding: .4rem .55rem;
    width: 100%;
}

.ahx-recipe-submission textarea {
    resize: vertical;
}

.ahx-recipe-submission fieldset {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.ahx-recipe-submission legend {
    margin-bottom: .5rem;
}

.ahx-recipe-submission__servings {
    max-width: 8rem;
}

.ahx-recipe-submission__ingredient {
    align-items: end;
    display: grid;
    gap: .6rem;
    grid-template-columns: minmax(0, .7fr) minmax(0, .7fr) minmax(0, 2fr) minmax(0, 1.5fr) 40px;
    margin-bottom: .75rem;
}

.ahx-recipe-submission button {
    align-items: center;
    background: #fff;
    border: 1px solid #9aa79f;
    border-radius: 4px;
    color: var(--recipe-ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    gap: .4rem;
    justify-content: center;
    min-height: 40px;
    padding: .4rem .75rem;
}

.ahx-recipe-submission button[type="submit"] {
    background: #246342;
    border-color: #246342;
    color: #fff;
}

.ahx-recipe-submission button:disabled {
    cursor: default;
    opacity: .5;
}

.ahx-recipe-submission [data-ahx-submission-remove],
.ahx-recipe-submission [data-ahx-submission-remove-image] {
    padding: 0;
    width: 40px;
}

.ahx-recipe-submission__types label {
    align-items: center;
    display: inline-flex;
    gap: .4rem;
    margin: .3rem 1rem .3rem 0;
}

.ahx-recipe-submission__image,
.ahx-recipe-submission__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

.ahx-recipe-submission__image img {
    height: 90px;
    object-fit: cover;
    width: 120px;
}

.ahx-recipe-submission__image span {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.ahx-recipe-submission__trap {
    left: -10000px;
    position: absolute;
}

.ahx-recipe-submission .has-error {
    color: #a12622;
}

@media (max-width: 680px) {
    .ahx-recipe-submission__ingredient {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
    }

    .ahx-recipe-submission__ingredient > label:nth-child(3),
    .ahx-recipe-submission__ingredient > label:nth-child(4) {
        grid-column: 1 / 3;
    }

    .ahx-recipe-submission__ingredient > button {
        grid-column: 3;
        grid-row: 1;
    }
}

.ahx-recipe-archive {
    box-sizing: border-box;
    margin: 2rem auto 4rem;
    max-width: 980px;
    padding-inline: 20px;
}

.ahx-recipe-collection {
    --recipe-ink: #24332f;
    --recipe-muted: #65736c;
    --recipe-line: #d9e0d9;
    color: var(--recipe-ink);
}

.entry-content > .ahx-recipe-collection {
    margin-inline: 0;
}

.ahx-recipe-collection__group + .ahx-recipe-collection__group {
    margin-top: 2.5rem;
}

.ahx-recipe-collection .ahx-recipe-collection__heading {
    border-bottom: 1px solid var(--recipe-line);
    font-size: 1.5rem;
    margin: 0 0 1.25rem;
    padding-bottom: .65rem;
}

.ahx-recipe-collection__count {
    color: var(--recipe-muted);
    font-size: .8em;
    font-weight: normal;
}

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

.ahx-recipe-collection .ahx-recipe-list__item {
    background: #fff;
    border: 1px solid var(--recipe-line);
    border-radius: 6px;
    margin: 0;
    min-width: 0;
    overflow: hidden;
}

.ahx-recipe-collection .ahx-recipe-list__link {
    color: inherit;
    display: block;
    height: 100%;
    text-decoration: none;
}

.ahx-recipe-list__link:hover,
.ahx-recipe-list__link:focus-visible {
    box-shadow: inset 0 0 0 2px #2271b1;
}

.ahx-recipe-collection .ahx-recipe-list__item img,
.ahx-recipe-list__placeholder {
    aspect-ratio: 4 / 3;
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

.ahx-recipe-list__placeholder {
    align-items: center;
    background: repeating-linear-gradient(135deg, #edf1ee, #edf1ee 12px, #f5f7f5 12px, #f5f7f5 24px);
    color: var(--recipe-muted);
    display: flex;
    justify-content: center;
}

.ahx-recipe-list__copy {
    padding: 1rem;
}

.ahx-recipe-collection .ahx-recipe-list__item h3 {
    font-size: 1.2rem;
    letter-spacing: 0;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
}

.ahx-recipe-collection .ahx-recipe-list__types,
.ahx-recipe-collection .ahx-recipe-list__excerpt {
    color: var(--recipe-muted);
    font-size: .9rem;
    margin: .65rem 0 0;
    overflow-wrap: anywhere;
}

@media (max-width: 680px) {
    .ahx-recipe-pantry__row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
        gap: .5rem;
    }

    .ahx-recipe-pantry__row > label:first-child {
        grid-column: 1 / -1;
    }

    .ahx-recipe--split .ahx-recipe__body {
        grid-template-columns: 1fr;
    }
}