/* ==========================================================================
   Recipe Filters and Posts Display  v2.0
   Everything is scoped under .jcrf so it can't leak into (or be broken by) the theme.
   Re-brand it by overriding the variables below, e.g. in Customizer > Additional CSS:
       .jcrf { --rf-primary:#06311a; --rf-accent:#e8590c; }
   ========================================================================== */

.jcrf {
    --rf-primary: #06311a;
    --rf-primary-soft: #e7efe9;
    --rf-accent: #e8590c;
    --rf-text: #1b2a21;
    --rf-muted: #68736c;
    --rf-line: #e5e1d8;
    --rf-bg: #ffffff;
    --rf-soft: #f7f5f0;
    --rf-star: #f5a623;
    --rf-radius: 14px;
    --rf-top: 100px;          /* set live by JS to sit under your sticky header */
    --rf-cols: 3;
    --rf-ratio: 4 / 5;        /* card image shape: width / height. Try 1 / 1 (square) or 3 / 4 (less tall) */

    display: grid;
    grid-template-columns: clamp(230px, 26%, 290px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;       /* required: lets the sidebar be shorter than the grid so it can stick */
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
    color: var(--rf-text);
    font-size: 16px;
    line-height: 1.45;
}
.jcrf *, .jcrf *::before, .jcrf *::after { box-sizing: border-box; }
.jcrf [hidden] { display: none !important; }
.jcrf a { text-decoration: none; box-shadow: none; }
.jcrf button { font-family: inherit; }
.jcrf :focus-visible { outline: 2px solid var(--rf-primary); outline-offset: 2px; }
.jcrf-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jcrf .jcrf-icon { flex: none; display: block; }

/* ---------- Sidebar (sticky on desktop) ---------- */

.jcrf .jcrf-sidebar {
    position: sticky;
    top: var(--rf-top);
    max-height: calc(100vh - var(--rf-top) - 16px);
    display: flex;
    flex-direction: column;
    background: var(--rf-bg);
    border: 1px solid var(--rf-line);
    border-radius: var(--rf-radius);
    box-shadow: 0 6px 24px rgba(20, 40, 28, .06);
    overflow: hidden;
    z-index: 5;
}
.jcrf .jcrf-sidebar__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--rf-line);
}
.jcrf .jcrf-sidebar__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 0 0;
    padding: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    color: var(--rf-text);
}
.jcrf .jcrf-sidebar__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cfd6d1 transparent;
}
.jcrf .jcrf-sidebar__scroll::-webkit-scrollbar { width: 6px; }
.jcrf .jcrf-sidebar__scroll::-webkit-scrollbar-thumb { background: #cfd6d1; border-radius: 6px; }
.jcrf .jcrf-sidebar__foot { display: none; }
.jcrf .jcrf-drawer-close { display: none; }

.jcrf .jcrf-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
    margin: 0;
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--rf-primary);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.jcrf .jcrf-link .jcrf-icon { width: 15px; height: 15px; }
.jcrf .jcrf-link:hover { color: var(--rf-accent); }

/* Filter groups */
.jcrf .jcrf-group { border-bottom: 1px solid var(--rf-line); }
.jcrf .jcrf-group:last-child { border-bottom: 0; }
.jcrf .jcrf-group > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-weight: 700;
    font-size: .95rem;
}
.jcrf .jcrf-group > summary::-webkit-details-marker { display: none; }
.jcrf .jcrf-group > summary::marker { content: ''; }
.jcrf .jcrf-group > summary:hover { background: var(--rf-soft); }
.jcrf .jcrf-group__title { margin-right: auto; }
.jcrf .jcrf-group__n {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--rf-primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.jcrf .jcrf-group__n[data-n="0"] { display: none; }
.jcrf .jcrf-group > summary .jcrf-icon { width: 18px; height: 18px; color: var(--rf-muted); transition: transform .2s ease; }
.jcrf .jcrf-group[open] > summary .jcrf-icon { transform: rotate(180deg); }
.jcrf .jcrf-group__body { padding: 0 18px 16px; }

/* Checkbox rows */
.jcrf .jcrf-checks { display: flex; flex-direction: column; }
.jcrf .jcrf-check {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 7px 0 7px calc(var(--d, 0) * 18px);
    cursor: pointer;
    font-size: .93rem;
    font-weight: 400;
    line-height: 1.3;
    color: var(--rf-text);
    text-transform: none;
}
.jcrf .jcrf-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
.jcrf .jcrf-check__box {
    flex: none;
    position: relative;
    width: 20px;
    height: 20px;
    border: 1.5px solid #b9c2bc;
    border-radius: 6px;
    background: #fff;
    transition: background .15s, border-color .15s;
}
.jcrf .jcrf-check__box::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .15s ease;
}
.jcrf .jcrf-check:hover .jcrf-check__box { border-color: var(--rf-primary); }
.jcrf .jcrf-check input:checked + .jcrf-check__box { background: var(--rf-primary); border-color: var(--rf-primary); }
.jcrf .jcrf-check input:checked + .jcrf-check__box::after { transform: rotate(45deg) scale(1); }
.jcrf .jcrf-check input:focus-visible + .jcrf-check__box { outline: 2px solid var(--rf-primary); outline-offset: 2px; }
.jcrf .jcrf-check__label { flex: 1; min-width: 0; }
.jcrf .jcrf-check input:checked ~ .jcrf-check__label { font-weight: 600; }
.jcrf .jcrf-check__count { font-size: .78rem; color: var(--rf-muted); font-variant-numeric: tabular-nums; }

/* In-group search + show more */
.jcrf .jcrf-group-search[type="search"] {
    display: block;
    width: 100%;
    height: 38px;
    margin: 0 0 8px;
    padding: 0 12px;
    border: 1px solid var(--rf-line);
    border-radius: 10px;
    background: var(--rf-soft);
    font-size: .9rem;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
.jcrf .jcrf-group-search[type="search"]:focus { background: #fff; border-color: var(--rf-primary); outline: 0; }
.jcrf .jcrf-more-toggle { margin-top: 6px; }

/* Pills (time / rating) */
.jcrf .jcrf-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.jcrf .jcrf-pill { position: relative; margin: 0; cursor: pointer; }
.jcrf .jcrf-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.jcrf .jcrf-pill span {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--rf-line);
    border-radius: 999px;
    background: #fff;
    font-size: .86rem;
    line-height: 1.2;
    transition: all .15s ease;
}
.jcrf .jcrf-pill:hover span { border-color: var(--rf-primary); }
.jcrf .jcrf-pill input:checked + span { background: var(--rf-primary); border-color: var(--rf-primary); color: #fff; font-weight: 600; }
.jcrf .jcrf-pill input:focus-visible + span { outline: 2px solid var(--rf-primary); outline-offset: 2px; }

/* Any / All segmented control */
.jcrf .jcrf-match { display: flex; margin: 0 0 10px; padding: 3px; background: var(--rf-soft); border-radius: 10px; }
.jcrf .jcrf-match label { flex: 1; margin: 0; cursor: pointer; }
.jcrf .jcrf-match input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.jcrf .jcrf-match span { display: block; padding: 6px 8px; border-radius: 8px; text-align: center; font-size: .82rem; font-weight: 600; color: var(--rf-muted); }
.jcrf .jcrf-match input:checked + span { background: #fff; color: var(--rf-primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.jcrf .jcrf-match input:focus-visible + span { outline: 2px solid var(--rf-primary); }

/* ---------- Main column ---------- */

.jcrf .jcrf-main { min-width: 0; }

.jcrf .jcrf-search { position: relative; margin: 0 0 16px; }
.jcrf .jcrf-search > .jcrf-icon { position: absolute; left: 18px; top: 50%; margin-top: -10px; color: var(--rf-muted); pointer-events: none; }
.jcrf .jcrf-search .jcrf-search__input[type="search"] {
    display: block;
    width: 100%;
    height: 54px;
    margin: 0;
    padding: 0 48px 0 50px;
    border: 1.5px solid var(--rf-line);
    border-radius: 999px;
    background: #fff;
    color: var(--rf-text);
    font-size: 1rem;
    box-shadow: 0 4px 18px rgba(20, 40, 28, .05);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}
.jcrf .jcrf-search .jcrf-search__input[type="search"]::-webkit-search-cancel-button { display: none; }
.jcrf .jcrf-search .jcrf-search__input[type="search"]:focus { outline: 0; border-color: var(--rf-primary); box-shadow: 0 0 0 4px var(--rf-primary-soft); }
.jcrf .jcrf-search__clear {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 34px;
    height: 34px;
    margin-top: -17px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--rf-soft);
    color: var(--rf-muted);
    cursor: pointer;
}
.jcrf .jcrf-search__clear .jcrf-icon { width: 16px; height: 16px; }
.jcrf .jcrf-search__clear:hover { background: var(--rf-primary-soft); color: var(--rf-primary); }

.jcrf .jcrf-toolbar { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.jcrf .jcrf-count { flex: 1; margin: 0; padding: 0; font-size: .95rem; font-weight: 600; color: var(--rf-text); }
.jcrf .jcrf-filter-btn { display: none; }
.jcrf .jcrf-count--m { display: none; }

.jcrf .jcrf-sort { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; color: var(--rf-muted); }
.jcrf .jcrf-sort select {
    height: 42px;
    min-width: 150px;
    margin: 0;
    padding: 0 38px 0 14px;
    border: 1px solid var(--rf-line);
    border-radius: 10px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2368736c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--rf-text);
    font-size: .92rem;
    font-weight: 600;
    box-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.jcrf .jcrf-sort select:focus { outline: 0; border-color: var(--rf-primary); box-shadow: 0 0 0 3px var(--rf-primary-soft); }

/* Active filter chips */
.jcrf .jcrf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.jcrf .jcrf-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--rf-primary-soft);
    color: var(--rf-primary);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.jcrf .jcrf-chip:hover { background: var(--rf-primary); color: #fff; }

/* ---------- Recipe grid ---------- */

.jcrf ul.jcrf-grid {
    display: grid;
    /* Up to --rf-cols columns, but never narrower than 190px, so it adapts to narrow page-builder columns. */
    grid-template-columns: repeat(auto-fill, minmax(max(190px, calc((100% - (var(--rf-cols) - 1) * 24px) / var(--rf-cols))), 1fr));
    gap: 30px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.jcrf ul.jcrf-grid > li { margin: 0; padding: 0; list-style: none; min-width: 0; }
.jcrf ul.jcrf-grid > li::before, .jcrf ul.jcrf-grid > li::marker { content: none; }

.jcrf .jcrf-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.jcrf .jcrf-card__link:hover, .jcrf .jcrf-card__link:focus { color: inherit; }
.jcrf .jcrf-card__media {
    position: relative;
    aspect-ratio: var(--rf-ratio);
    overflow: hidden;
    border-radius: var(--rf-radius);
    background: var(--rf-soft);
    box-shadow: 0 2px 10px rgba(20, 40, 28, .08);
    transform: translateZ(0);
}
.jcrf .jcrf-card__img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.jcrf .jcrf-card__link:hover .jcrf-card__img { transform: scale(1.06); }
.jcrf .jcrf-card__placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b7beb9; }
.jcrf .jcrf-card__placeholder .jcrf-icon { width: 44px; height: 44px; }

.jcrf .jcrf-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--rf-accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.3;
}
.jcrf .jcrf-time {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--rf-text);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.3;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
}
.jcrf .jcrf-time .jcrf-icon { width: 14px; height: 14px; }

.jcrf .jcrf-card__body { display: flex; flex-direction: column; gap: 5px; padding: 12px 2px 0; flex: 1; }
.jcrf .jcrf-card__cat {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rf-accent);
    line-height: 1.2;
}
.jcrf .jcrf-card__title {
    margin: 0;
    padding: 0;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: var(--rf-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.jcrf .jcrf-card__link, .jcrf .jcrf-card__link:hover, .jcrf .jcrf-card__link:focus, .jcrf .jcrf-card__link:hover * { text-decoration: none !important; }
.jcrf .jcrf-card__link:hover .jcrf-card__title { color: var(--rf-primary); }

.jcrf .jcrf-rating { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 2px; }
.jcrf .jcrf-stars { position: relative; display: inline-block; font-size: 15px; line-height: 1; letter-spacing: 1px; color: #d9d9d4; white-space: nowrap; }
.jcrf .jcrf-stars::before { content: '\2605\2605\2605\2605\2605'; }
.jcrf .jcrf-stars > i {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(var(--r, 0) / 5 * 100%);
    overflow: hidden;
    color: var(--rf-star);
    font-style: normal;
    white-space: nowrap;
}
.jcrf .jcrf-stars > i::before { content: '\2605\2605\2605\2605\2605'; }
.jcrf .jcrf-rating__count { font-size: .8rem; font-weight: 600; color: var(--rf-muted); }

/* ---------- Entrance animations (only active once JS adds .jcrf-js; no JS = everything visible) ---------- */

/* Cards: rise + fade in as they scroll into view, image settles from a slight zoom */
.jcrf-js .jcrf-card {
    transition: opacity .7s cubic-bezier(.22, .8, .24, 1), transform .7s cubic-bezier(.22, .8, .24, 1);
    will-change: opacity, transform;
}
.jcrf-js .jcrf-card:not(.is-in) { opacity: 0; transform: translateY(28px) scale(.97); }
.jcrf-js .jcrf-card:not(.is-in) .jcrf-card__img { transform: scale(1.14); }
.jcrf-js .jcrf-card.is-in .jcrf-card__img { transition: transform 1.1s cubic-bezier(.22, .8, .24, 1); }
.jcrf-js .jcrf-card.is-in.is-settled .jcrf-card__img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.jcrf-js .jcrf-card.is-in.is-settled { will-change: auto; }
/* Time pill + badge slide in a beat after the card */
.jcrf-js .jcrf-card:not(.is-in) .jcrf-time, .jcrf-js .jcrf-card:not(.is-in) .jcrf-badge { opacity: 0; transform: translateY(8px); }
.jcrf-js .jcrf-card .jcrf-time, .jcrf-js .jcrf-card .jcrf-badge { transition: opacity .5s ease .35s, transform .5s ease .35s; }

/* Page load: search drops in, sidebar glides in, filter groups cascade (desktop only) */
@keyframes jcrf-drop  { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes jcrf-glide { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes jcrf-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes jcrf-pop   { 0% { opacity: 0; transform: scale(.7); } 70% { transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
.jcrf-js .jcrf-search  { animation: jcrf-drop .6s cubic-bezier(.22, .8, .24, 1) both; }
.jcrf-js .jcrf-toolbar { animation: jcrf-fade-up .6s ease .12s both; }
@media (min-width: 991px) {
    .jcrf-js .jcrf-sidebar { animation: jcrf-glide .7s cubic-bezier(.22, .8, .24, 1) both; }
    .jcrf-js .jcrf-group   { animation: jcrf-fade-up .55s ease both; }
    .jcrf-js .jcrf-group:nth-child(1) { animation-delay: .15s; }
    .jcrf-js .jcrf-group:nth-child(2) { animation-delay: .23s; }
    .jcrf-js .jcrf-group:nth-child(3) { animation-delay: .31s; }
    .jcrf-js .jcrf-group:nth-child(4) { animation-delay: .39s; }
    .jcrf-js .jcrf-group:nth-child(5) { animation-delay: .47s; }
    .jcrf-js .jcrf-group:nth-child(6) { animation-delay: .55s; }
}
/* Chips pop in, counts and badges ping when they change */
.jcrf .jcrf-chip { animation: jcrf-pop .35s cubic-bezier(.3, 1.4, .5, 1) both; }
.jcrf .jcrf-count.is-ping { animation: jcrf-fade-up .35s ease both; }
.jcrf .jcrf-group__n, .jcrf .jcrf-filter-btn__n { animation: jcrf-pop .3s ease both; }
/* Press feedback */
.jcrf .jcrf-btn:active, .jcrf .jcrf-apply:active, .jcrf .jcrf-pill:active span, .jcrf .jcrf-filter-btn:active { transform: scale(.97); }
.jcrf .jcrf-check input:checked + .jcrf-check__box { animation: jcrf-pop .25s ease both; }
/* Subtle lift on hover for the whole card */
.jcrf .jcrf-card__media { transition: box-shadow .35s ease, transform .35s ease; }
.jcrf .jcrf-card__link:hover .jcrf-card__media { box-shadow: 0 14px 30px rgba(20, 40, 28, .18); transform: translateY(-3px); }

/* Skeletons */
@keyframes jcrf-shimmer { to { background-position: -200% 0; } }
.jcrf .jcrf-skel__img, .jcrf .jcrf-skel__l1, .jcrf .jcrf-skel__l2 {
    background: linear-gradient(90deg, #eeebe4 25%, #f8f6f1 45%, #eeebe4 65%);
    background-size: 200% 100%;
    animation: jcrf-shimmer 1.3s linear infinite;
    border-radius: 10px;
}
.jcrf .jcrf-skel__img { aspect-ratio: var(--rf-ratio); border-radius: var(--rf-radius); }
.jcrf .jcrf-skel__l1 { height: 14px; width: 40%; margin-top: 14px; }
.jcrf .jcrf-skel__l2 { height: 18px; width: 85%; margin-top: 10px; }

.jcrf .jcrf-error { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--rf-muted); }

/* Empty state */
.jcrf .jcrf-empty { padding: 56px 20px; text-align: center; background: var(--rf-soft); border-radius: var(--rf-radius); color: var(--rf-muted); }
.jcrf .jcrf-empty .jcrf-icon { width: 44px; height: 44px; margin: 0 auto 10px; color: #aab3ad; }
.jcrf .jcrf-empty h3 { margin: 0 0 6px; padding: 0; font-size: 1.2rem; color: var(--rf-text); }
.jcrf .jcrf-empty p { margin: 0 0 18px; }

/* Buttons + load more */
.jcrf .jcrf-btn, .jcrf .jcrf-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 30px;
    border: 0;
    border-radius: 999px;
    background: var(--rf-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(6, 49, 26, .22);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
}
.jcrf .jcrf-btn:hover, .jcrf .jcrf-apply:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(6, 49, 26, .28); color: #fff; }
.jcrf .jcrf-btn[disabled], .jcrf .jcrf-apply[disabled] { opacity: .55; cursor: default; transform: none; }
.jcrf .jcrf-load-more.is-busy::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: jcrf-spin .7s linear infinite;
}
@keyframes jcrf-spin { to { transform: rotate(360deg); } }

.jcrf .jcrf-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 40px; }
.jcrf .jcrf-progress-text { margin: 0; font-size: .9rem; color: var(--rf-muted); }
.jcrf .jcrf-progress { width: 220px; height: 5px; border-radius: 5px; background: var(--rf-line); overflow: hidden; }
.jcrf .jcrf-progress span { display: block; height: 100%; border-radius: 5px; background: var(--rf-primary); transition: width .4s ease; }

/* Dim the old results slightly while new ones load (search keeps focus) */
.jcrf.is-loading .jcrf-count { opacity: .5; }

/* ---------- Tablet ---------- */

@media (max-width: 1200px) and (min-width: 991px) {
    .jcrf { gap: 24px; }
    .jcrf ul.jcrf-grid { --rf-cols: 2; }
}

/* ---------- Mobile / tablet: filters become a bottom sheet ---------- */

@media (max-width: 990px) {
    .jcrf { display: block; }
    .jcrf ul.jcrf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }

    .jcrf .jcrf-search { margin-bottom: 12px; }
    .jcrf .jcrf-search .jcrf-search__input[type="search"] { height: 50px; }

    /* Sticky action bar */
    .jcrf .jcrf-toolbar {
        position: sticky;
        top: calc(var(--rf-top) - 16px);
        z-index: 20;
        margin: 0 0 10px;
        padding: 10px 0;
        gap: 10px;
        background: var(--rf-bg);
        border-bottom: 1px solid var(--rf-line);
    }
    .jcrf .jcrf-filter-btn {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 42px;
        margin: 0;
        padding: 0 16px;
        border: 1.5px solid var(--rf-primary);
        border-radius: 999px;
        background: #fff;
        color: var(--rf-primary);
        font-size: .92rem;
        font-weight: 700;
        cursor: pointer;
    }
    .jcrf .jcrf-filter-btn .jcrf-icon { width: 18px; height: 18px; }
    .jcrf .jcrf-filter-btn__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--rf-primary); color: #fff; font-size: .72rem; line-height: 20px; text-align: center; }
    .jcrf .jcrf-toolbar .jcrf-count { display: none; }
    .jcrf .jcrf-count--m { display: block; margin: 0 0 12px; font-size: .85rem; color: var(--rf-muted); }
    .jcrf .jcrf-sort { flex: 1; }
    .jcrf .jcrf-sort__label { display: none; }
    .jcrf .jcrf-sort select { width: 100%; min-width: 0; height: 42px; border-radius: 999px; padding-left: 14px; }

    .jcrf .jcrf-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
    .jcrf .jcrf-chips::-webkit-scrollbar { display: none; }
    .jcrf .jcrf-chip, .jcrf .jcrf-chips__clear { flex: none; white-space: nowrap; }

    /* Bottom sheet */
    .jcrf .jcrf-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        max-height: 88vh;
        max-height: 88dvh;
        border: 0;
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
        transform: translateY(105%);
        visibility: hidden;
        transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .3s;
        z-index: 100001;
    }
    .jcrf.is-drawer-open .jcrf-sidebar { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
    .jcrf .jcrf-sidebar__head { padding: 18px 18px 14px; }
    .jcrf .jcrf-drawer-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--rf-soft);
        color: var(--rf-text);
        cursor: pointer;
    }
    .jcrf .jcrf-sidebar__foot { display: block; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rf-line); background: #fff; }
    .jcrf .jcrf-apply { width: 100%; }
    .jcrf .jcrf-check { padding-top: 10px; padding-bottom: 10px; }

    .jcrf .jcrf-overlay { position: fixed; inset: 0; background: rgba(10, 20, 14, .55); z-index: 100000; animation: jcrf-fade .25s ease; }
    @keyframes jcrf-fade { from { opacity: 0; } to { opacity: 1; } }
}
html.jcrf-lock, html.jcrf-lock body { overflow: hidden !important; }

@media (max-width: 380px) {
    .jcrf .jcrf-card__title { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
    .jcrf *, .jcrf *::before, .jcrf *::after { animation: none !important; transition: none !important; }
}


/* ==========================================================================
   JOYFUL COOK — visual refresh
   Presentation-only overrides. Existing markup, filters, AJAX and behavior
   are intentionally untouched.
   ========================================================================== */
.jcrf {
    --rf-primary: #174b2b;
    --rf-primary-soft: #eaf3e9;
    --rf-accent: #df8a19;
    --rf-text: #202b22;
    --rf-muted: #748075;
    --rf-line: #e8e9df;
    --rf-bg: #fff;
    --rf-soft: #f7f8f2;
    --rf-star: #efa928;
    --rf-radius: 20px;
    --rf-card-shadow: 0 8px 26px rgba(25, 52, 31, .075);
    font-family: inherit;
    gap: 28px;
    max-width: 1500px;
    color: var(--rf-text);
    line-height: 1.55;
}

/* Filter panel */
.jcrf .jcrf-sidebar {
    border: 1px solid rgba(28, 73, 40, .10);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff 0%, #fcfdf9 100%);
    box-shadow: 0 12px 34px rgba(31, 59, 36, .075);
}
.jcrf .jcrf-sidebar__head {
    padding: 20px 20px 17px;
    border-bottom: 1px solid #edf0e8;
    background: linear-gradient(135deg, #f4f8ef, #fff);
}
.jcrf .jcrf-sidebar__title {
    gap: 10px;
    font-size: 1.08rem;
    letter-spacing: -.025em;
}
.jcrf .jcrf-sidebar__title .jcrf-icon {
    width: 19px;
    height: 19px;
    color: var(--rf-accent);
}
.jcrf .jcrf-link {
    padding: 7px 11px;
    border-radius: 999px;
    background: #fff4e5;
    color: #a65d08;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}
.jcrf .jcrf-link:hover { background: #ffe8c7; color: #814400; }
.jcrf .jcrf-group { border-bottom-color: #eef0e9; }
.jcrf .jcrf-group > summary {
    padding: 16px 19px;
    font-size: .94rem;
    letter-spacing: -.01em;
    transition: background .2s ease, color .2s ease;
}
.jcrf .jcrf-group > summary:hover { background: #f7f9f3; color: var(--rf-primary); }
.jcrf .jcrf-group__n {
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #eaf3e9;
    color: var(--rf-primary);
    font-size: .72rem;
    line-height: 22px;
}
.jcrf .jcrf-group__body { padding: 0 19px 18px; }
.jcrf .jcrf-check {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: .9rem;
    transition: color .18s ease;
}
.jcrf .jcrf-check:hover { color: var(--rf-primary); }
.jcrf .jcrf-check__box {
    width: 19px;
    height: 19px;
    border-radius: 6px;
    border-color: #cbd4c9;
}
.jcrf .jcrf-check__count { font-size: .76rem; }
.jcrf .jcrf-pill span {
    padding: 8px 13px;
    border-color: #e5e9df;
    background: #fbfcf8;
    font-size: .83rem;
}
.jcrf .jcrf-pill input:checked + span {
    background: var(--rf-primary);
    border-color: var(--rf-primary);
    box-shadow: 0 4px 10px rgba(23, 75, 43, .16);
}
.jcrf .jcrf-match { background: #f0f3eb; border-radius: 12px; }

/* Search + controls */
.jcrf .jcrf-search { margin-bottom: 20px; }
.jcrf .jcrf-search > .jcrf-icon { left: 20px; color: #718071; }
.jcrf .jcrf-search .jcrf-search__input[type="search"] {
    height: 58px;
    padding-left: 54px;
    border: 1px solid #e5e9df;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 55, 34, .055);
    font-size: .98rem;
}
.jcrf .jcrf-search .jcrf-search__input[type="search"]::placeholder { color: #9aa398; }
.jcrf .jcrf-search .jcrf-search__input[type="search"]:focus {
    border-color: #7da887;
    box-shadow: 0 0 0 4px rgba(23, 75, 43, .09), 0 8px 24px rgba(28, 55, 34, .055);
}
.jcrf .jcrf-search__clear { background: #f1f4ed; }
.jcrf .jcrf-toolbar { gap: 16px; margin-bottom: 18px; }
.jcrf .jcrf-count { font-size: .9rem; font-weight: 600; color: #657266; }
.jcrf .jcrf-sort { gap: 10px; font-size: .84rem; font-weight: 600; }
.jcrf .jcrf-sort select {
    height: 44px;
    min-width: 158px;
    border: 1px solid #e5e9df;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 3px 12px rgba(28, 55, 34, .035);
}
.jcrf .jcrf-sort select:focus { border-color: #7da887; }

/* Active filter tags */
.jcrf .jcrf-chips { gap: 9px; margin-bottom: 20px; }
.jcrf .jcrf-chip {
    padding: 8px 12px 8px 14px;
    background: #edf5e9;
    color: #245a32;
    font-size: .8rem;
    box-shadow: inset 0 0 0 1px rgba(23, 75, 43, .07);
}
.jcrf .jcrf-chip:hover { background: var(--rf-primary); color: #fff; }

/* Recipe cards */
.jcrf ul.jcrf-grid {
    gap: 34px 24px;
}
.jcrf .jcrf-card {
    min-width: 0;
}
.jcrf .jcrf-card__link {
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 5px 22px rgba(25, 52, 31, .055);
    transition: transform .3s ease, box-shadow .3s ease;
}
.jcrf .jcrf-card__link:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 34px rgba(25, 52, 31, .13);
}
.jcrf .jcrf-card__media {
    border-radius: 18px;
    box-shadow: none;
    background: #f0f2e9;
}
.jcrf .jcrf-card__link:hover .jcrf-card__media {
    transform: none;
    box-shadow: none;
}
.jcrf .jcrf-card__img { transition: transform .65s cubic-bezier(.2, .7, .2, 1); }
.jcrf .jcrf-card__link:hover .jcrf-card__img { transform: scale(1.055); }
.jcrf .jcrf-badge {
    top: 13px;
    left: 13px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #e99a25;
    box-shadow: 0 4px 12px rgba(74, 46, 7, .16);
    font-size: .66rem;
    letter-spacing: .055em;
}
.jcrf .jcrf-time {
    left: 13px;
    bottom: 13px;
    gap: 6px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 999px;
    background: rgba(255,255,255,.95);
    color: #344237;
    font-size: .75rem;
    box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.jcrf .jcrf-card__body {
    gap: 7px;
    padding: 15px 16px 17px;
}
.jcrf .jcrf-card__cat {
    color: #b66a12;
    font-size: .68rem;
    letter-spacing: .095em;
}
.jcrf .jcrf-card__title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.38;
    letter-spacing: -.018em;
}
.jcrf .jcrf-card__link:hover .jcrf-card__title { color: #28613a; }
.jcrf .jcrf-rating { padding-top: 5px; }
.jcrf .jcrf-stars { font-size: 14px; }
.jcrf .jcrf-rating__count { font-size: .76rem; }

/* Empty state and pagination */
.jcrf .jcrf-empty {
    padding: 64px 24px;
    border: 1px dashed #dce5d8;
    border-radius: 20px;
    background: linear-gradient(135deg, #f7faf3, #fff);
}
.jcrf .jcrf-empty .jcrf-icon { color: #8da88e; }
.jcrf .jcrf-empty h3 { font-size: 1.3rem; letter-spacing: -.025em; }
.jcrf .jcrf-btn, .jcrf .jcrf-apply {
    min-height: 48px;
    padding: 0 26px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1c5a32, #123f25);
    box-shadow: 0 7px 17px rgba(23, 75, 43, .18);
    font-size: .92rem;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.jcrf .jcrf-btn:hover, .jcrf .jcrf-apply:hover {
    background: linear-gradient(135deg, #26703f, #174b2b);
    box-shadow: 0 10px 22px rgba(23, 75, 43, .24);
}
.jcrf .jcrf-more { gap: 14px; margin-top: 48px; }
.jcrf .jcrf-progress { width: 230px; height: 6px; background: #e9eee5; }
.jcrf .jcrf-progress span { background: linear-gradient(90deg, #174b2b, #82a85f); }

/* Mobile refinement */
@media (max-width: 990px) {
    .jcrf { gap: 0; }
    .jcrf ul.jcrf-grid { gap: 22px 14px; }
    .jcrf .jcrf-search { margin-bottom: 14px; }
    .jcrf .jcrf-search .jcrf-search__input[type="search"] {
        height: 53px;
        border-radius: 14px;
    }
    .jcrf .jcrf-toolbar {
        padding: 10px 0 12px;
        border-bottom: 1px solid #edf0e8;
        background: var(--rf-bg);
    }
    .jcrf .jcrf-filter-btn {
        height: 43px;
        padding: 0 15px;
        border: 1px solid #dce8da;
        border-radius: 12px;
        background: #f5f8f1;
        color: var(--rf-primary);
        font-size: .86rem;
    }
    .jcrf .jcrf-filter-btn__n { background: var(--rf-accent); }
    .jcrf .jcrf-sort select {
        height: 43px;
        border-radius: 12px;
        background-color: #fff;
    }
    .jcrf .jcrf-count--m { margin: 2px 0 14px; font-size: .82rem; }
    .jcrf .jcrf-sidebar {
        border-radius: 22px 22px 0 0;
        background: #fff;
    }
    .jcrf .jcrf-sidebar__head {
        padding: 19px 20px 15px;
        background: #f6f9f2;
    }
    .jcrf .jcrf-sidebar__foot { background: #fff; }
    .jcrf .jcrf-apply { min-height: 50px; }
    .jcrf .jcrf-card__body { padding: 12px 11px 14px; }
    .jcrf .jcrf-card__title { font-size: .94rem; }
}
@media (max-width: 480px) {
    .jcrf ul.jcrf-grid { gap: 19px 11px; }
    .jcrf .jcrf-card__link { border-radius: 14px; }
    .jcrf .jcrf-card__media { border-radius: 14px; }
    .jcrf .jcrf-card__body { padding: 11px 10px 13px; gap: 6px; }
    .jcrf .jcrf-card__cat { font-size: .62rem; }
    .jcrf .jcrf-card__title { font-size: .88rem; line-height: 1.35; }
    .jcrf .jcrf-time { left: 8px; bottom: 8px; padding: 5px 8px; font-size: .68rem; }
    .jcrf .jcrf-badge { top: 8px; left: 8px; padding: 4px 8px; font-size: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .jcrf .jcrf-card__link { transition: none; }
}


/* ==========================================================================
   MOBILE EDGE FIX (v2.0.4)
   Phones/tablets only (max-width: 990px). Desktop rules above are untouched.
   Problem: inside zero-padding page-builder columns the filter ran edge to edge,
   could be wider than the screen (right side cropped), and the theme's list
   margin pushed the card grid ~8px in from the left.
   Fix: keep the filter inside the screen, restore even side gutters, and make
   the card grid ignore theme list margins/padding.
   ========================================================================== */
@media (max-width: 990px) {
    .jcrf {
        width: 100%;
        max-width: 100vw;        /* never wider than the phone screen */
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
    }
    .jcrf .jcrf-main,
    .jcrf .jcrf-search,
    .jcrf .jcrf-chips { max-width: 100%; min-width: 0; }
    .jcrf .jcrf-toolbar { min-width: 0; }
    .jcrf .jcrf-sort { min-width: 0; }
    .jcrf .jcrf-sort select { max-width: 100%; }

    /* Theme list styles (margin-left / padding-left on ul) must not shift the grid */
    .jcrf ul.jcrf-grid {
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }
    .jcrf ul.jcrf-grid > li { margin: 0 !important; }
}

/* Phones: even left/right gutters */
@media (max-width: 690px) {
    .jcrf { --rf-gutter: 14px; padding-left: var(--rf-gutter); padding-right: var(--rf-gutter); }
    /* Sticky filter bar stays full-bleed so cards never peek out beside it while scrolling */
    .jcrf .jcrf-toolbar {
        margin-left: calc(-1 * var(--rf-gutter));
        margin-right: calc(-1 * var(--rf-gutter));
        padding-left: var(--rf-gutter);
        padding-right: var(--rf-gutter);
    }
}
