/* ============================================================
   Roundups Recipe Builder — Frontend CSS
   Premium food-blog aesthetic · Warm palette · Playfair Display
   ============================================================ */

/* ── Google Fonts ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Lato:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ── Design Tokens ───────────────────────────────────────── */
:root {
    /* Accent is overridden per-roundup via inline <style> */
    --rrb-accent      : #e67e22;
    --rrb-accent-dark : #d35400;
    --rrb-cream       : #fffdf9;
    --rrb-sand        : #f9f4ed;
    --rrb-border      : #ede8e0;
    --rrb-text        : #2c2c2c;
    --rrb-muted       : #7a7a7a;
    --rrb-green       : #527a54;
    --rrb-r           : 18px;          /* card border-radius */
    --rrb-shadow      : 0 4px 24px rgba(0,0,0,.08),0 1px 6px rgba(0,0,0,.04);
    --rrb-shadow-hover: 0 18px 52px rgba(0,0,0,.13),0 4px 16px rgba(0,0,0,.07);
    --rrb-ease        : .28s cubic-bezier(.4,0,.2,1);
    --rrb-font-h      : 'Playfair Display', Georgia, serif;
    --rrb-font-b      : 'Lato', 'Helvetica Neue', Arial, sans-serif;
}

/* ── Box model reset ─────────────────────────────────────── */
.rrb-roundup *, .rrb-roundup *::before, .rrb-roundup *::after,
.rrb-toc    *, .rrb-toc    *::before, .rrb-toc    *::after {
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════
   TABLE OF CONTENTS
══════════════════════════════════════════════════════════ */
.rrb-toc {
    background: var(--rrb-sand);
    border: 1px solid var(--rrb-border);
    border-left: 4px solid var(--rrb-accent);
    border-radius: var(--rrb-r);
    padding: 22px 28px;
    margin-bottom: 46px;
    font-family: var(--rrb-font-b);
    max-width: 620px;
}
.rrb-toc-h {
    font-family: var(--rrb-font-h);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rrb-text);
    margin: 0 0 13px;
}
.rrb-toc-list {
    margin: 0;
    padding-left: 22px;
}
.rrb-toc-list li { margin-bottom: 7px; font-size: .92rem; }
.rrb-toc-list a {
    color: var(--rrb-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--rrb-ease);
}
.rrb-toc-list a:hover {
    color: var(--rrb-accent-dark);
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════
   ROUNDUP WRAPPER
══════════════════════════════════════════════════════════ */
.rrb-roundup {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    font-family: var(--rrb-font-b);
}
.rrb-grid-2 {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 32px;
}
@media (max-width: 680px) {
    .rrb-grid-2 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   RECIPE CARD
══════════════════════════════════════════════════════════ */
.rrb-card {
    position: relative;
    background: #fff;
    border-radius: var(--rrb-r);
    border: 1px solid var(--rrb-border);
    overflow: hidden;
    box-shadow: var(--rrb-shadow);
    transition: box-shadow var(--rrb-ease), transform var(--rrb-ease);
    scroll-margin-top: 80px;
}
.rrb-card:hover {
    box-shadow: var(--rrb-shadow-hover);
    transform: translateY(-5px);
}

/* ── Number badge ────────────────────────────────────────── */
.rrb-num-badge {
    position: absolute; top: 16px; left: 16px; z-index: 10;
    background: var(--rrb-accent); color: #fff;
    font-family: var(--rrb-font-h);
    font-size: .95rem; font-weight: 700;
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,.22);
    letter-spacing: -.02em;
}

/* ── Image ───────────────────────────────────────────────── */
.rrb-img-link { display: block; text-decoration: none; }
.rrb-img-wrap {
    position: relative; width: 100%; padding-top: 57%; overflow: hidden;
    background: var(--rrb-sand);
}
.rrb-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    transition: transform .55s cubic-bezier(.25,.46,.45,.94);
    display: block;
}
.rrb-card:hover .rrb-img { transform: scale(1.07); }
.rrb-img-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 48%, rgba(16,8,0,.3) 100%);
    pointer-events: none;
}
.rrb-img-wrap.rrb-no-img {
    display: flex; align-items: center; justify-content: center;
    font-size: 60px; color: #d5c5b0;
    padding-top: 0; height: 210px;
}

/* ── Card body ───────────────────────────────────────────── */
.rrb-body {
    padding: 26px 28px 30px;
    display: flex; flex-direction: column; gap: 13px;
}

/* ── Badges ──────────────────────────────────────────────── */
.rrb-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.rrb-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    padding: 5px 13px; border-radius: 999px; line-height: 1;
    white-space: nowrap;
}

/* ─── Category badge — warm pill, shows actual post category ── */
/* This is a <span> or <a>. When it's a link it's also clickable. */
.rrb-badge-cat,
a.rrb-badge-cat:link,
a.rrb-badge-cat:visited {
    background: #fff7ee;
    color: #c05a00;
    border: 1.5px solid #f5c890;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
}
a.rrb-badge-cat:hover {
    background: #ffe8c6;
    border-color: #e67e22;
    color: #9a3e00;
}

.rrb-badge-time {
    background: #edf7ee; color: var(--rrb-green);
    border: 1.5px solid rgba(82,122,84,.22);
}

/* ── Title ───────────────────────────────────────────────── */
.rrb-card-title {
    font-family: var(--rrb-font-h);
    font-size: 1.48rem; font-weight: 700;
    line-height: 1.24; margin: 0; color: var(--rrb-text);
}
.rrb-card-title a {
    color: inherit; text-decoration: none;
    background-image: linear-gradient(var(--rrb-accent),var(--rrb-accent));
    background-size: 0 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size var(--rrb-ease), color var(--rrb-ease);
}
.rrb-card-title a:hover {
    color: var(--rrb-accent-dark);
    background-size: 100% 2px;
}

/* ── Excerpt ─────────────────────────────────────────────── */
.rrb-excerpt {
    font-size: .94rem; line-height: 1.72; color: var(--rrb-muted); margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Stars (frontend) ────────────────────────────────────── */
.rrb-rating-wrap { display: flex; flex-direction: column; gap: 7px; }
.rrb-stars { display: flex; gap: 3px; line-height: 1; }
.rrb-s { font-size: 1.28rem; line-height: 1; }
.rrb-s-on  { color: #f0a500; filter: drop-shadow(0 0 3px rgba(240,165,0,.38)); }
.rrb-s-off { color: #e0e0e0; }
.rrb-review {
    font-size: .87rem; font-style: italic;
    color: var(--rrb-muted); margin: 0;
    padding-left: 11px;
    border-left: 3px solid var(--rrb-accent);
}

/* ── CTA Button ──────────────────────────────────────────── */
.rrb-cta {
    display: inline-block;
    background: linear-gradient(135deg, var(--rrb-accent), var(--rrb-accent-dark));
    color: #fff !important;
    text-decoration: none !important;
    font-family: var(--rrb-font-b);
    font-size: .88rem; font-weight: 700; letter-spacing: .02em;
    padding: 14px 26px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(230,126,34,.34);
    transition:
        transform var(--rrb-ease),
        box-shadow var(--rrb-ease),
        background var(--rrb-ease);
    align-self: flex-start;
    line-height: 1.35;
    margin-top: 5px;
}
.rrb-cta:hover {
    transform: translateY(-2px) scale(1.025);
    box-shadow: 0 8px 28px rgba(230,126,34,.52);
    background: linear-gradient(135deg,#f08030,#c04400);
    color: #fff !important;
}
.rrb-cta:focus-visible {
    outline: 3px solid var(--rrb-accent);
    outline-offset: 3px;
}

/* ── Info / Error messages ───────────────────────────────── */
.rrb-fe-error,
.rrb-fe-empty {
    background: var(--rrb-sand);
    border: 1px solid var(--rrb-border);
    border-radius: 12px;
    padding: 20px 24px;
    color: var(--rrb-muted);
    font-family: var(--rrb-font-b);
    font-size: .95rem;
    text-align: center;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 580px) {
    .rrb-body { padding: 18px 18px 22px; }
    .rrb-card-title { font-size: 1.22rem; }
    .rrb-cta { width: 100%; text-align: center; }
    .rrb-toc { padding: 16px 18px; }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .rrb-card, .rrb-img, .rrb-cta, .rrb-card-title a { transition: none; }
    .rrb-card:hover { transform: none; }
    .rrb-card:hover .rrb-img { transform: none; }
}
