/* Recipe Writer: jump bar, recipe card and pin. Scoped to .rw-* to stay out of the theme's way. */

.rw-jump,
.rw-teaser,
.rw-card,
.rw-pin {
    --rw-accent: #E8572A;
    --rw-bg: #FFFFFF;
    --rw-text: #222222;
    --rw-radius: 12px;
    box-sizing: border-box;
}
.rw-jump *,
.rw-teaser *,
.rw-card *,
.rw-pin * {
    box-sizing: border-box;
}

/* Buttons */
.rw-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--rw-accent);
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    border: 2px solid var(--rw-accent);
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}
.rw-btn:hover { filter: brightness(.94); transform: translateY(-1px); }
.rw-btn--ghost {
    background: transparent;
    color: var(--rw-accent) !important;
}
.rw-btn--pin { background: #E60023; border-color: #E60023; }
.rw-icon { flex: none; }

/* Jump bar */
.rw-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 1.5em;
}

/* "Full recipe below" preview box */
.rw-teaser {
    position: relative;
    display: flex;
    gap: 18px;
    align-items: center;
    margin: 1.8em 0;
    padding: 18px 20px;
    background: color-mix(in srgb, var(--rw-accent) 7%, var(--rw-bg));
    color: var(--rw-text);
    border: 2px dashed color-mix(in srgb, var(--rw-accent) 55%, transparent);
    border-radius: var(--rw-radius);
    line-height: 1.5;
}
.rw-teaser__img { flex: 0 0 96px; }
.rw-teaser__img img {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0;
    object-fit: cover;
    border-radius: calc(var(--rw-radius) * .75);
}
.rw-teaser__body { min-width: 0; flex: 1; }
.rw-teaser .rw-teaser__kicker {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rw-accent);
}
.rw-teaser .rw-teaser__name { margin: 2px 0 2px; font-size: 1.25em; font-weight: 700; line-height: 1.25; }
.rw-teaser .rw-teaser__meta { margin: 0 0 6px; font-size: 14px; opacity: .75; }
.rw-teaser .rw-teaser__text { margin: 0 0 12px; font-size: 15px; }
.rw-teaser .rw-btn { flex-direction: row; }
.rw-teaser__arrow {
    position: absolute;
    right: 18px;
    bottom: 14px;
    display: flex;
    color: var(--rw-accent);
    animation: rw-bob 1.6s ease-in-out infinite;
}
.rw-teaser__arrow .rw-icon { width: 26px; height: 26px; }
@keyframes rw-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
    .rw-teaser__arrow { animation: none; }
}
@media (max-width: 640px) {
    .rw-teaser { align-items: flex-start; padding: 16px; }
    .rw-teaser__img { flex-basis: 72px; }
    .rw-teaser__img img { width: 72px; height: 72px; }
    .rw-teaser__arrow { display: none; }
}

/* Card */
.rw-card {
    margin: 2.5em 0;
    padding: 28px;
    background: var(--rw-bg);
    color: var(--rw-text);
    border: 2px solid var(--rw-accent);
    border-radius: var(--rw-radius);
    scroll-margin-top: 80px;
    font-size: 16px;
    line-height: 1.6;
}
.rw-card__head {
    display: flex;
    gap: 24px;
    align-items: center;
}
.rw-card__img {
    flex: 0 0 200px;
}
.rw-card__img img {
    display: block;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: calc(var(--rw-radius) * .75);
    margin: 0;
}
.rw-card__intro { min-width: 0; }
.rw-card__logo img { max-height: 48px; width: auto; margin: 0 0 8px; }
.rw-card .rw-card__title {
    margin: 0 0 8px;
    font-size: 1.6em;
    line-height: 1.2;
    color: var(--rw-text);
}
.rw-card__summary { margin: 0 0 14px; opacity: .85; }
.rw-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.rw-card ul.rw-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    margin: 22px 0 0 !important;
    padding: 14px 0 !important;
    border-top: 1px solid color-mix(in srgb, var(--rw-text) 15%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--rw-text) 15%, transparent);
}
.rw-card .rw-card__meta li {
    flex: 1 1 110px;
    margin: 0 !important;
    padding: 4px 12px;
    list-style: none !important;
    text-align: center;
}
.rw-card__meta li + li { border-left: 1px solid color-mix(in srgb, var(--rw-text) 12%, transparent); }
.rw-card__meta-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rw-accent);
}
.rw-card__meta-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.rw-scale {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid var(--rw-accent);
    background: transparent;
    color: var(--rw-accent);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.rw-scale:hover { background: var(--rw-accent); color: #fff; }

.rw-card__body {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 32px;
    margin-top: 22px;
}
.rw-card__notes { grid-column: 1 / -1; }
.rw-card h3 {
    margin: 0 0 12px;
    font-size: 1.2em;
    color: var(--rw-text);
}
.rw-card h3::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 6px;
    background: var(--rw-accent);
    border-radius: 2px;
}
.rw-card h4 { margin: 14px 0 6px; font-size: 1em; }
.rw-card ul,
.rw-card ol {
    margin: 0 !important;
    padding: 0 0 0 1.2em !important;
}
.rw-card li { margin: 0 0 8px; }
.rw-card__ingredients ul { list-style: none; padding-left: 0 !important; }
.rw-card__ingredients li { padding-left: 0; }
.rw-card__ingredients li:not(:has(label))::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--rw-accent);
    vertical-align: middle;
}
.rw-card__ingredients label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
}
.rw-card__ingredients input[type="checkbox"] {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 4px 0 0;
    accent-color: var(--rw-accent);
}
.rw-card__ingredients input:checked + span { text-decoration: line-through; opacity: .5; }
.rw-amount { font-weight: 700; }
.rw-note { opacity: .7; font-style: italic; }
.rw-card__steps li::marker { color: var(--rw-accent); font-weight: 700; }
.rw-card__footer {
    margin: 22px 0 0;
    font-size: 13px;
    text-align: center;
    opacity: .6;
}

/* Pin */
.rw-pin {
    max-width: 500px;
    margin: 2.5em auto;
    text-align: center;
}
.rw-pin img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--rw-radius);
    margin: 0 0 14px;
}
.rw-pin figcaption { margin: 0; }

@media (max-width: 640px) {
    .rw-card { padding: 20px; }
    .rw-card__head { flex-direction: column; align-items: stretch; }
    .rw-card__img { flex-basis: auto; }
    .rw-card__img img { width: 100%; height: 220px; }
    .rw-card__body { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .rw-card .rw-card__meta li { flex-basis: 45%; }
    .rw-card__meta li + li { border-left: 0; }
}

/* Print page and printing from the post */
.rw-card--print { border-width: 1px; }
.rw-card--print .rw-card__img { flex-basis: 140px; }
.rw-card--print .rw-card__img img { width: 140px; height: 140px; }
@media print {
    .rw-print-body { padding: 0 !important; }
    .rw-card { border: 1px solid #ccc; break-inside: auto; margin: 0; }
    .rw-card__actions, .rw-scale, .rw-jump, .rw-teaser, .rw-pin { display: none !important; }
    .rw-card__body { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}
