/* --- RECIPE CONTENT (extended) — on top of recipe-content.css ---
   Every rule is scoped to .recipe-content--extended (only recipe-content-extended.html.twig
   renders it), so recipe bodies built from recipe-content.html.twig are not affected. Each
   value it restates from recipe-content.css goes through a --recipe-content-ext-* token whose
   fallback is recipe-content.css's own value, so a brand that sets nothing renders the same. */

/* Section: its own width cap, text colour and line-height on top of recipe-content's. */
.recipe-content--extended {
    max-width: var(--recipe-content-ext-max-width, var(--content-max-width, 1440px));
    color: var(--recipe-content-ext-color, var(--color-primary, #000));
    line-height: var(--recipe-content-ext-line-height, inherit);
}

/* Columns: the space between a heading and its list. */
.recipe-content--extended .recipe-content-ingredients,
.recipe-content--extended .recipe-content-instructions {
    gap: var(--recipe-content-ext-column-gap, 20px);
}

.recipe-content--extended .recipe-content-ingredients {
    min-width: var(--recipe-content-ext-ingredients-min-width, 260px);
}

/* Headings: font, colour, line-height, transform and an optional rule under them. */
.recipe-content--extended .recipe-content-heading {
    font-family: var(--recipe-content-ext-heading-font, var(--font-family-body, var(--font-family)));
    line-height: var(--recipe-content-ext-heading-line-height, inherit);
    text-transform: var(--recipe-content-ext-heading-transform, uppercase);
    color: var(--recipe-content-ext-heading-color, inherit);
    padding-bottom: var(--recipe-content-ext-heading-rule-gap, 0);
    border-bottom: var(--recipe-content-ext-heading-rule, none);
}

/* Ingredient lines: the gap between quantity, name and checkbox; the quantity's transform. */
.recipe-content--extended .recipe-ingredient {
    gap: var(--recipe-content-ext-inline-gap, 10px);
}

.recipe-content--extended .recipe-ingredient-measurement {
    text-transform: var(--recipe-content-ext-measurement-transform, uppercase);
}

.recipe-content--extended .recipe-ingredient-link {
    color: var(--recipe-content-ext-link-color, inherit);
}

/* Checklist (data.checklist): the label wraps the line and takes over its flex layout; the
   native checkbox is hidden and drawn as .recipe-ingredient-box. */
.recipe-content--extended .recipe-ingredient-label {
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    gap: var(--recipe-content-ext-inline-gap, 10px);
    cursor: pointer;
}

.recipe-content--extended .recipe-ingredient-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.recipe-content--extended .recipe-ingredient-box {
    flex: 0 0 auto;
    width: var(--recipe-checkbox-size, 20px);
    height: var(--recipe-checkbox-size, 20px);
    margin-right: var(--recipe-checkbox-gap, 0);
    border: var(--recipe-checkbox-border, 1px solid currentColor);
    background: var(--recipe-checkbox-bg, transparent);
    position: relative;
}

.recipe-content--extended .recipe-ingredient-check:checked + .recipe-ingredient-box::after {
    content: '';
    position: absolute;
    left: 30%;
    top: 10%;
    width: 30%;
    height: 60%;
    border: solid var(--recipe-checkbox-mark-color, currentColor);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.recipe-content--extended .recipe-ingredient-check:focus-visible + .recipe-ingredient-box {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Instructions: space between a number and its text. */
.recipe-content--extended .recipe-instruction {
    padding-left: var(--recipe-content-ext-instruction-padding-left, 0);
}

/* Tips (data.tips), under the instructions. */
.recipe-content--extended .recipe-tips {
    margin-top: var(--recipe-tips-margin-top, 0);
    font-family: var(--font-family-body, var(--font-family));
    font-size: var(--recipe-tips-size, var(--recipe-instruction-size, 24px));
    font-weight: var(--recipe-instruction-weight, 500);
}

.recipe-content--extended .recipe-tips .recipe-content-heading {
    margin-bottom: var(--recipe-content-ext-column-gap, 20px);
}

.recipe-content--extended .recipe-tips-body ul {
    padding-left: 1.2em;
    list-style: disc;
}

.recipe-content--extended .recipe-tips-body li + li,
.recipe-content--extended .recipe-tips-body p + p {
    margin-top: 0.6em;
}

.recipe-content--extended .recipe-tips-body img {
    display: block;
    width: 100%;
    height: auto;
}

.recipe-content--extended .recipe-tips-body figcaption {
    margin-top: 10px;
    font-size: var(--recipe-tips-caption-size, 12px);
}

/* Copy list (data.copyList): a button under the ingredients and its status line. The button takes the primary
   button colours; every value has a token. */
.recipe-content--extended .recipe-copy {
    margin-top: var(--recipe-copy-margin-top, 30px);
}

.recipe-content--extended .recipe-copy-button {
    padding: var(--recipe-copy-padding, 14px 45px);
    border: var(--color-button-primary-border, 0);
    border-radius: var(--recipe-copy-radius, 0);
    background-color: var(--color-button-primary-bg, var(--color-primary, #14A518));
    color: var(--color-button-primary-text, #FFFFFF);
    font-family: var(--recipe-copy-font, inherit);
    font-size: var(--recipe-copy-size, 16px);
    font-weight: var(--recipe-copy-weight, 700);
    line-height: var(--recipe-copy-line-height, 1.5);
    text-transform: var(--recipe-copy-transform, uppercase);
    cursor: pointer;
    transition: background-color 0.2s;
}

.recipe-content--extended .recipe-copy-button:hover {
    background-color: var(--color-button-primary-hover-bg, var(--color-button-primary-bg, var(--color-primary, #14A518)));
}

.recipe-content--extended .recipe-copy-status {
    margin: var(--recipe-copy-status-margin, 12px 0 0);
    font-size: var(--recipe-copy-status-size, 16px);
    color: var(--recipe-copy-status-color, inherit);
}

.recipe-content--extended .recipe-copy-status--error {
    color: var(--recipe-copy-status-error-color, #B00020);
}

/* --- opt-in stepToggle: a round button at the start of each step marks it done --- */
.recipe-content--extended .recipe-instructions-list--toggle .recipe-instruction {
    position: relative;
    padding-left: calc(var(--recipe-step-toggle-size, 28px) + var(--recipe-step-toggle-gap, 12px));
    transition: opacity 0.2s;
}

.recipe-content--extended .recipe-step-toggle {
    position: absolute;
    top: var(--recipe-step-toggle-top, 0);
    left: 0;
    width: var(--recipe-step-toggle-size, 28px);
    height: var(--recipe-step-toggle-size, 28px);
    padding: 0;
    border: var(--recipe-step-toggle-border, 2px solid currentColor);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.recipe-content--extended .recipe-step-toggle[aria-pressed="true"] {
    border-color: var(--recipe-step-toggle-done-bg, var(--color-primary, #1a1a1a));
    background: var(--recipe-step-toggle-done-bg, var(--color-primary, #1a1a1a)) no-repeat center / 60%
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}

.recipe-content--extended .recipe-instruction--done {
    opacity: var(--recipe-step-done-opacity, 0.5);
}

.recipe-content--extended .recipe-instruction--done > :not(.recipe-step-toggle) {
    text-decoration: var(--recipe-step-done-decoration, none);
}
