/* ─────────────────────────────────────────────
   Restaurant Menu Block — Frontend Styles
   ───────────────────────────────────────────── */

.rmb-restaurant-menu {
    --rmb-accent: var(--global-palette4);
    --rmb-text: #2c2c2c;
    --rmb-muted: #6b6b6b;
    --rmb-border: #e2d9cf;
    --rmb-bg-nav: #faf7f4;
    --rmb-tag-bg: #f0ebe5;
    margin: 0 auto;
    padding: 0;
    font-family: var(--global-body-font-family);
    color: var(--global-palette4);
}

/* ── Title ─────────────────────────────────── */
.rmb-menu-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 1.5rem;
    color: var(--rmb-accent);
}

/* ── Jump Links ────────────────────────────── */
.rmb-jump-links {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--rmb-bg-nav);
    border-top: 1px solid var(--rmb-border);
    border-bottom: 1px solid var(--rmb-border);
    margin-bottom: 2rem;
    padding: 0.6rem 1rem;
}
.rmb-jump-links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 0;
}
.rmb-jump-links li {
    margin: 0;
    padding: 0;
}
.rmb-jump-links li:not(:last-child)::after {
    content: '·';
    color: var(--rmb-border);
    font-weight: 700;
    font-size: 1rem;
    vertical-align: middle;
}
.rmb-jump-links a {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rmb-muted);
    white-space: nowrap;
    transition: color 0.2s;
}
.rmb-jump-links a:hover,
.rmb-jump-links a:focus,
.rmb-jump-links a.is-active {
    color: var(--rmb-accent);
}
.rmb-jump-links a.is-active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* ── Jump select (mobile dropdown) ─────────── */
.rmb-jump-select-wrap {
    display: none; /* shown on mobile via media query */
    align-items: center;
    gap: 0.6rem;
    max-width: 100%;
}
.rmb-jump-select-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rmb-muted);
    flex-shrink: 0;
}
.rmb-jump-select {
    flex: 1;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%236b6b6b' stroke-width='2' d='M1 1l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    border: 1px solid var(--rmb-border);
    border-radius: 6px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--rmb-accent);
    font-family: inherit;
    cursor: pointer;
}
.rmb-jump-select:focus {
    outline: 2px solid var(--rmb-accent);
    outline-offset: 2px;
}

/* ── Sections ──────────────────────────────── */
.rmb-menu-section {
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.rmb-section-title {
    font-size: 1.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rmb-accent);
    border-bottom: 2px solid var(--rmb-accent);
    padding-bottom: 0.5rem;
    margin: 0 0 0.5rem;
}
.rmb-section-description {
    color: var(--rmb-muted);
    font-size: 0.95rem;
    margin: 0 0 1.25rem;
}
.single-content .rmb-section-description {
    margin-bottom: 0;
}
.rmb-section-title + .rmb-section-description {
    margin-top: -0.25rem;
    margin-bottom: 1rem;
}

/* ── Subsections ──────────────────────────────── */
.rmb-subsection-title {
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rmb-muted);
    margin: 1.5rem 0 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--rmb-border);
}
.rmb-subsection-title:first-of-type {
    margin-top: 0.5rem;
}

/* ── Items ─────────────────────────────────── */
.rmb-items-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.rmb-menu-item {
    padding: 1rem 0;
}
.rmb-menu-item:last-child {
    border-bottom: none;
}

/* Item header: name ... price */
.rmb-item-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.rmb-item-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--rmb-text);
    flex-shrink: 0;
}
.rmb-item-dots {
    flex: 1;
    border-bottom: 1px dotted var(--rmb-border);
    margin-bottom: 0.25em;
    min-width: 20px;
}
.rmb-item-price {
    font-size: 0.9rem;
    color: var(--rmb-accent);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Description */
.rmb-item-description {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--rmb-muted);
    line-height: 1.5;
}
.single-content .rmb-item-description {
    margin-bottom: 0;
}

/* ── Dietary Tags (inline in header) ──────── */
.rmb-dietary-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 0.4rem;
}
.rmb-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--rmb-tag-bg);
    color: var(--rmb-muted);
    line-height: 1.4;
}

.single-content .rmb-jump-links ul {
   padding-left: 0;
}

/* Tag color variants */
.rmb-tag--vegetarian   { background: #e8f5e9; color: #2e7d32; }
.rmb-tag--vegan        { background: #e0f2f1; color: #00695c; }
.rmb-tag--gluten-free  { background: #fff3e0; color: #e65100; }
.rmb-tag--halal        { background: #e3f2fd; color: #1565c0; }
.rmb-tag--kosher       { background: #ede7f6; color: #4527a0; }
.rmb-tag--dairy-free   { background: #fce4ec; color: #c62828; }
.rmb-tag--nut-free     { background: #fff8e1; color: #f57f17; }
.rmb-tag--spicy        { background: #fbe9e7; color: #d84315; }

/* ── Gluten Free Section ──────────────────── */
.rmb-gf-list {
    list-style: disc;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 2rem;
}
.rmb-gf-list li {
    font-size: 1.05rem;
    color: var(--rmb-text);
    padding: 0.4rem 0;
    break-inside: avoid;
}

@media ( max-width: 600px ) {
    .rmb-gf-list {
        columns: 1;
    }
}

/* ── Smooth scrolling ──────────────────────── */
html {
    scroll-behavior: smooth;
    /* Reserve space for the sticky jump-link nav so anchor/hash scrolls land below it.
       --rmb-nav-h is set by JS; fallback covers the pre-JS first-paint case. */
    scroll-padding-top: calc(var(--rmb-nav-h, 160px) + 16px);
}

/* ── Responsive ────────────────────────────── */
@media ( max-width: 600px ) {
    .rmb-menu-title {
        font-size: 1.5rem;
    }
    .rmb-jump-links {
        padding: 0.5rem 0.75rem;
    }
    .rmb-jump-links ul {
        display: none;
    }
    .rmb-jump-select-wrap {
        display: flex;
    }
    .rmb-item-name,
    .rmb-item-price {
        font-size: 0.95rem;
    }
}

/* ── Item Photo Thumbnail ─────────────────── */
.rmb-menu-item--has-photo {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.rmb-item-photo {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}
.rmb-item-photo:hover {
    opacity: 0.8;
}
.rmb-item-content {
    flex: 1;
    min-width: 0;
}

/* ── Variants (sub-items) ─────────────────── */
.rmb-item-variants {
    margin-top: 0.35rem;
}
.rmb-item-variant {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.15rem 0;
}
.rmb-variant-name {
    font-size: 0.9rem;
    color: var(--rmb-muted);
    flex-shrink: 0;
}

/* ── Price Note (Market Price, size variants) ─ */
.rmb-price-note {
    font-size: 0.9rem;
    color: var(--rmb-muted);
}
.rmb-item-price-note {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--rmb-muted);
    font-style: italic;
}

/* ── Lightbox ──────────────────────────────── */
.rmb-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rmb-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}
.rmb-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}
.rmb-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}
.rmb-lightbox-caption {
    color: #fff;
    font-size: 1rem;
    margin-top: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.rmb-lightbox-close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}
.rmb-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
}
