/* Layout and interactions only. Editable colors/fonts/spacing come from WP presets.
   Low-specificity defaults let Site Editor styles take precedence. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
:where(a, button, input):focus-visible { outline: 3px solid var(--wp--preset--color--primary); outline-offset: 4px; }
:where(.wp-site-blocks > *) { margin-block-start: 0; }
:where(.rtb-header-shell) { position: sticky; top: 0; z-index: 50; }
:where(.rtb-header) { backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--wp--preset--color--line); }
.admin-bar :where(.rtb-header-shell) { top: 32px; }
:where(.rtb-header .rtb-header-row) { min-height: 88px; }
:where(.rtb-header .wp-block-site-title)::after { content: '.'; color: var(--wp--preset--color--primary); }
.rtb-header .wp-block-navigation__container > .wp-block-navigation-submenu { border: 1px solid var(--wp--preset--color--line); border-radius: 999px; padding: 10px 18px; min-height: 44px; gap: 8px; }
:where(.rtb-header .wp-block-navigation__submenu-container) { border-radius: 16px; padding: 12px; box-shadow: 0 16px 50px #253b301a; }
:where(.rtb-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content) { padding: 8px 12px; }
:where(.rtb-eyebrow) { font-family: var(--wp--preset--font-family--body); font-size: 10px; letter-spacing: .17em; text-transform: uppercase; }
:where(.rtb-hero) { overflow: hidden; }
:where(.rtb-hero > .wp-block-column) { min-width: 0; }
:where(.rtb-hero-copy) { padding: clamp(30px, 4.1vw, 54px); }
:where(.rtb-hero-copy h1) { overflow-wrap: break-word; hyphens: auto; }
:where(.rtb-hero-copy .wp-block-post-excerpt) { max-width: 460px; }
:where(.rtb-photo-column) { position: relative; }
:where(.wp-block-recepten-gallery) { position: relative; height: 100%; min-height: var(--rtb-photo-height, 560px); overflow: hidden; background: var(--wp--preset--color--surface); }
.rtb-main-photo { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--rtb-photo-position, center); }
:where(.rtb-photo-placeholder) { display: grid; min-height: var(--rtb-photo-height, 560px); place-items: center; padding: 32px; text-align: center; }
:where(.rtb-photo-strip) { position: absolute; left: 20px; bottom: 20px; z-index: 2; display: flex; gap: 10px; max-width: calc(100% - 40px); overflow-x: auto; padding: 10px; border: 1px solid #ffffffaa; border-radius: 18px; background: var(--wp--preset--color--base); background: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent); backdrop-filter: blur(14px) saturate(130%); box-shadow: 0 12px 32px #14291d30; }
:where(.rtb-photo-thumb) { display: block; flex: 0 0 72px; width: 72px; height: 62px; overflow: hidden; border: 2px solid transparent; border-radius: 10px; opacity: .75; }
:where(.rtb-photo-thumb[aria-current], .rtb-photo-thumb:hover) { opacity: 1; }
:where(.rtb-photo-thumb[aria-current]) { border-color: var(--wp--preset--color--primary); }
.rtb-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
:where(.rtb-photo-column .wp-block-recepten-latest-link) { position: absolute; right: 22px; bottom: 22px; width: min(330px, calc(100% - 44px)); box-shadow: 0 8px 32px #18251920; }
:where(.wp-block-recepten-latest-link a) { display: grid; gap: 5px; }
:where(.wp-block-recepten-latest-link small) { font-size: 9px; text-transform: uppercase; letter-spacing: .16em; }
:where(.wp-block-recepten-latest-link strong) { font-size: 15px; font-weight: 600; line-height: 1.4; }
:where(.wp-block-recepten-meta) { display: flex; flex-wrap: wrap; gap: 7px; }
:where(.rtb-pill) { display: inline-block; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; padding: 5px 9px; }
:where(.wp-block-recepten-category-grid) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
:where(.rtb-category) { height: 250px; position: relative; border-radius: 18px; overflow: hidden; background: var(--wp--preset--color--contrast); display: flex; align-items: end; padding: 24px; isolation: isolate; }
:where(.rtb-category)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #162a20eb, transparent 85%); z-index: -1; }
.rtb-category img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
:where(.rtb-category h3) { margin: 0; color: inherit; font-family: var(--wp--preset--font-family--heading); font-size: var(--wp--preset--font-size--card); font-weight: 400; text-transform: capitalize; letter-spacing: -.035em; }
:where(.rtb-category small) { font-size: 12px; }
:where(.rtb-category > span) { margin-left: auto; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid #ffffff66; display: grid; place-items: center; }
.rtb-recipe-query .wp-block-post-template.is-layout-grid { gap: 56px 26px; }
:where(.rtb-recipe-query .wp-block-post-template > li) { min-width: 0; }
:where(.rtb-card) { display: flex; flex-direction: column; height: 100%; }
:where(.rtb-card > *) { width: 100%; }
.rtb-card .wp-block-post-featured-image { overflow: hidden; border-radius: 18px; }
.rtb-card .wp-block-post-featured-image a { display: block; border-radius: inherit; overflow: hidden; }
:where(.rtb-card .wp-block-post-title) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; min-height: 0; }
:where(.rtb-card .wp-block-post-excerpt__excerpt) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; min-height: 4.35em; margin: 0; }
:where(.rtb-card .wp-block-recepten-meta) { min-height: 33px; }
:where(.rtb-card .wp-block-recepten-recipe-link) { margin-top: auto; padding-top: 20px; }
:where(.wp-block-recepten-recipe-link a) { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--wp--preset--color--line); padding-top: 15px; }
:where(.wp-block-recepten-recipe-link span) { display: grid; place-items: center; border-radius: 50%; background: var(--wp--preset--color--hero); width: 30px; height: 30px; }
:where(.wp-block-recepten-category-filter) { display: flex; flex-wrap: wrap; gap: 10px; }
:where(.wp-block-recepten-category-filter a) { padding: 8px 12px; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; background: var(--wp--preset--color--surface); }
.wp-block-recepten-category-filter a:is([aria-current], :hover) { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--white); }
:where(.wp-block-recepten-category-filter span) { opacity: .7; }
:where(.rtb-checklist) { padding: 0; margin: 18px 0 0; list-style: none; }
:where(.rtb-checklist li) { border-top: 1px solid var(--wp--preset--color--line); }
:where(.rtb-checklist label) { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 14px 0; cursor: pointer; }
:where(.rtb-checklist input) { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--wp--preset--color--primary); }
:where(.rtb-checklist input:checked + span) { text-decoration: line-through; opacity: .6; }
:where(.rtb-copy) { font: inherit; font-size: 11px; min-height: 44px; padding: 8px 12px; color: inherit; background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--line); border-radius: 999px; cursor: pointer; }
:where(.rtb-steps) { list-style: none; counter-reset: steps; padding: 0; margin: 0; }
:where(.rtb-steps li) { position: relative; counter-increment: steps; padding: 24px 24px 24px 78px; margin-bottom: 14px; min-height: 90px; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 16px; }
:where(.rtb-steps li)::before { content: counter(steps, decimal-leading-zero); position: absolute; left: 20px; top: 23px; border-radius: 50%; background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); width: 36px; height: 36px; display: grid; place-items: center; font-family: var(--wp--preset--font-family--body); font-size: 13px; font-weight: 800; }
:where(.wp-block-recepten-notes p:first-child) { margin-top: 0; }
:where(.wp-block-recepten-notes p:last-child) { margin-bottom: 0; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    :where(.rtb-card img, .rtb-category img) { transition: transform .35s ease; }
    :where(.rtb-card:hover img, .rtb-category:hover img) { transform: scale(1.035); }
    :where(.wp-block-button__link) { transition: transform .2s ease, background .2s ease; }
    :where(.wp-block-button__link:hover) { transform: translateY(-2px); }
}
@media (max-width: 960px) {
    :where(.wp-block-recepten-category-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rtb-recipe-query .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 781px) {
    :where(.rtb-hero .wp-block-recepten-gallery) { min-height: 360px; height: 360px; }
    :where(.home .rtb-hero .wp-block-recepten-gallery) { min-height: 300px; height: 300px; }
    :where(.rtb-hero-copy) { padding: 34px 27px 32px; }
    :where(.rtb-header .rtb-header-row) { min-height: 72px; }
    .admin-bar :where(.rtb-header-shell) { top: 46px; }
    :where(.rtb-photo-strip) { left: 12px; bottom: 12px; padding: 7px; gap: 7px; max-width: calc(100% - 24px); }
    :where(.rtb-photo-thumb) { width: 55px; height: 51px; flex-basis: 55px; }
}
@media (max-width: 600px) {
    .rtb-recipe-query .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr; }
    :where(.rtb-category) { height: 190px; padding: 16px; }
    :where(.wp-block-recepten-category-grid) { gap: 12px; }
    .rtb-category h3 { font-size: clamp(16px, 4.4vw, 22px); white-space: nowrap; overflow-wrap: normal; }
    :where(.rtb-category > span) { position: absolute; right: 12px; top: 12px; width: 27px; height: 27px; }
    :where(.rtb-footer-row) { flex-direction: column; align-items: flex-start; }
    :where(.rtb-card .wp-block-post-title, .rtb-card .wp-block-post-excerpt__excerpt) { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Keep the copy action beside the heading, including existing editor templates. */
.wp-block-group:has(> .wp-block-recepten-ingredients) { position: relative; }
.wp-block-group:has(> .wp-block-recepten-ingredients) > :is(h2, p) { padding-right: 112px; }
.wp-block-group:has(> .wp-block-recepten-ingredients) .rtb-copy { position: absolute; top: 28px; right: 28px; max-width: 105px; }
/* WP's default link hover must not add underlines to these controls. */
.wp-site-blocks a:hover { text-decoration: none; }

/* Recipe cards: one clear surface and equal rows, including a single column. */
.rtb-recipe-query .wp-block-post-template.is-layout-grid { grid-auto-rows: 1fr; }
.rtb-card {
    background: #fff;
    border: 1px solid var(--wp--preset--color--line);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 4px 16px #253b3008;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.rtb-card > * { flex-shrink: 0; }
.rtb-card .wp-block-post-featured-image { margin-top: 0; border-radius: 14px; }
.rtb-card .wp-block-recepten-recipe-link { margin-top: auto; padding-top: 20px; }

/* Keep recipe metadata and the action together at the foot of all recipe cards. */
.rtb-card .wp-block-recepten-meta { margin-top: auto; padding-top: 16px; }
.rtb-card .wp-block-recepten-recipe-link { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--wp--preset--color--line); }
.rtb-card .wp-block-recepten-recipe-link a {
    border-top: 0;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 999px;
    background: var(--wp--preset--color--hero);
    color: var(--wp--preset--color--contrast);
    justify-content: center;
    gap: 10px;
}
.rtb-card .wp-block-recepten-recipe-link span { background: transparent; width: auto; height: auto; }
.rtb-card .wp-block-recepten-recipe-link a:hover { background: var(--wp--preset--color--accent); }
@media (max-width: 600px) {
    .rtb-recipe-query .wp-block-post-template.is-layout-grid { row-gap: 24px; }
}

/* Natural title wrapping without automatic hyphenation. */
:is(h1,h2,h3,h4,h5,h6), .rtb-hero-copy h1 { hyphens: none; word-break: normal; overflow-wrap: normal; }
.rtb-recipe-tags { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .625rem; margin-top: 4px; }
.rtb-recipe-tags a { color: var(--wp--preset--color--muted); }
.wp-block-recepten-notes { padding: 20px 24px; background: var(--wp--preset--color--hero); border: 1px solid var(--wp--preset--color--line); border-left: 4px solid var(--wp--preset--color--primary); border-radius: 14px; font-size: .875rem; }
.wp-block-recepten-notes strong { color: var(--wp--preset--color--contrast); }
.wp-block-recepten-notes p { margin: 8px 0 0; }
.rtb-header-search { max-width: 330px; margin-left: auto; }
.rtb-header-search .wp-block-search__inside-wrapper { gap: 6px; }
.rtb-header-search input { min-width: 0; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 16px; background: white; }
.rtb-header-search button { margin-left: 0; padding: 9px 16px; }
@media(max-width:781px) {
 .rtb-header .rtb-header-row { flex-wrap: wrap; gap: 12px; padding-block: 12px; }
 .rtb-header-search { order: 3; flex-basis: 100%; max-width: none; width: 100%; margin: 0; }
 .rtb-header .wp-block-navigation { margin-left: auto; }
 .rtb-header .wp-block-navigation__submenu-container { max-height: 60vh; overflow-y: auto; }
 html { scroll-padding-top: 165px; }
}

/* Header identity, compact card tags and responsive note placement. */
.rtb-brand { display: block; width: 240px; flex: 0 0 auto; line-height: 0; }
.rtb-brand img { display: block; width: 100%; height: auto; }
.rtb-recipe-tags { gap: 6px; margin-top: 5px; }
.rtb-recipe-tags .rtb-tag-pill { display: inline-block; padding: 4px 9px; border-radius: 999px; background: var(--wp--preset--color--hero); color: var(--wp--preset--color--contrast); font-size: 11px; line-height: 1.45; }
.rtb-recipe-tags .rtb-tag-pill:hover { background: var(--wp--preset--color--accent); }
.rtb-notes-mobile { display: none; }
.rtb-header .wp-block-navigation .wp-block-navigation__submenu-container { top: calc(100% + 14px); max-height: calc(100svh - 180px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; }
@media(max-width:781px) {
 .rtb-brand { width: 180px; }
 .rtb-notes-desktop { display: none; }
 .rtb-notes-mobile { display: block; margin-bottom: 28px; }
 .rtb-header .wp-block-navigation .wp-block-navigation__submenu-container { max-height: calc(100svh - 210px - env(safe-area-inset-bottom, 0px)); }
}

/* Tag pills must remain distinct against the recipe hero's green surface. */
.rtb-hero .rtb-recipe-tags .rtb-tag-pill {
    background-color: #d1d9c4;
    background-color: color-mix(in srgb, var(--wp--preset--color--hero) 85%, var(--wp--preset--color--contrast) 15%);
    color: var(--wp--preset--color--contrast);
}
.rtb-hero .rtb-recipe-tags .rtb-tag-pill:hover {
    background-color: var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--white, #fff);
}

/* Ingredient section headings share the existing list and copy order. */
.rtb-checklist .rtb-ingredient-group { border-top: 0; padding: 24px 0 8px; }
.rtb-checklist .rtb-ingredient-group:first-child { padding-top: 6px; }
.rtb-ingredient-group h3 { margin: 0; font-family: var(--wp--preset--font-family--body); font-size: .875rem; font-weight: 700; color: var(--wp--preset--color--primary); }

.rtb-load-on-scroll .wp-block-query-pagination { margin-top: 32px; flex-direction: column; align-items: center; gap: 10px; }
.rtb-load-more { font: inherit; font-size: 13px; color: var(--wp--preset--color--contrast); background: var(--wp--preset--color--hero); border: 1px solid var(--wp--preset--color--line); border-radius: 999px; padding: 12px 22px; cursor: pointer; }
.rtb-load-more:disabled { opacity: .6; cursor: wait; }
.rtb-load-status { color: var(--wp--preset--color--muted); font-size: 12px; margin: 0; }
