/*
 * TapBios simplified menu presentation.
 *
 * Loaded AFTER menu-layouts.css on purpose: that sheet carries the
 * per-menu layout variants ([data-layout], [data-header]) and would
 * otherwise win on source order. Keeping this as its own layer avoids
 * a specificity arms race inside menu.css.
 *
 * Header, tabs and page chrome below are global improvements that apply
 * to every menu regardless of style. The "flat item rows" block is scoped
 * to [data-layout="list"] (the default) only — grid, compact and magazine
 * layouts, and non-default card/image shapes, keep their own presentation
 * from menu-layouts.css so a business can pick a distinct template style.
 */

/* ==================================================================== *
 * Header: logo + name, then hours / address / cuisine as one line.
 * ==================================================================== */

.menu-hero--centered {
    text-align: left;
}

.menu-hero--centered .menu-hero-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
}

.menu-hero-identity {
    min-width: 0;
}

.menu-hero--centered .menu-logo,
.menu-hero--centered .menu-logo-placeholder {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    flex-shrink: 0;
    border-radius: 0.75rem;
}

.menu-kicker {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--page-text-subtle, var(--text-subtle));
    margin: 0 0 0.15rem;
}

.menu-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
}

/* Hours / address / cuisine, one line where it fits */
.menu-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.75rem;
    margin: 1rem 0 0;
    padding: 0.9rem 0 0;
    border-top: 1px solid var(--page-border, var(--color-border));
}

.menu-fact {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.menu-fact dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--page-text-subtle, var(--text-subtle));
}

.menu-fact dd {
    margin: 0;
    font-size: 0.875rem;
    color: var(--page-text, var(--text-default));
}

.menu-fact dd a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.menu-hero--centered .menu-description {
    margin: 0.85rem 0 0;
    text-align: left;
    font-size: 0.9375rem;
    color: var(--page-text-subtle, var(--text-subtle));
    max-width: 44rem;
}

.menu-contact {
    margin-top: 1.1rem;
}

/* ==================================================================== *
 * Category tabs
 * ==================================================================== */

.menu-tabs {
    display: flex;
    gap: 0.4rem;
    margin: 1.35rem 0 1rem;
    padding-bottom: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.menu-tabs::-webkit-scrollbar {
    display: none;
}

.menu-tab {
    flex-shrink: 0;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--page-border, var(--color-border));
    background: var(--page-surface, transparent);
    color: var(--page-text-secondary, var(--text-secondary));
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.menu-tab:hover {
    color: var(--page-text, var(--text-default));
    border-color: var(--page-border-strong, var(--border-strong));
}

.menu-tab.is-active {
    background: var(--page-primary, var(--color-primary));
    border-color: transparent;
    color: var(--page-button-text, #fff);
}

.menu-tab:focus-visible {
    outline: 2px solid var(--page-primary, var(--color-primary));
    outline-offset: 2px;
}

/* With tabs the section heading just repeats the active tab. */
.menu-page.has-menu-tabs .menu-section-toggle {
    display: none;
}

.menu-page.has-menu-tabs .menu-section {
    margin: 0;
}

.menu-section-desc {
    margin: 0 0 0.75rem;
    color: var(--page-text-subtle, var(--text-subtle));
    font-size: 0.875rem;
}

/* ==================================================================== *
 * Page chrome: no boxed card, the background colour is the page itself.
 * ==================================================================== */

.menu-shell {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.menu-page {
    padding: clamp(2rem, 7vw, 4rem) 1.25rem 3rem;
}

/* ==================================================================== *
 * Minor item typography + badge tidiness — applies to every layout.
 * ==================================================================== */

.menu-item-badges:empty {
    display: none;
}

.menu-item-badges {
    margin-top: 0.4rem;
}

/* ==================================================================== *
 * Flat item rows — [data-layout="list"] (the default) only. Grid,
 * compact and magazine layouts keep their own card/image presentation
 * from menu-layouts.css.
 * ==================================================================== */

[data-layout="list"] .menu-sections,
[data-layout="list"] .menu-section,
[data-layout="list"] .menu-section-body {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

[data-layout="list"] .menu-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

[data-layout="list"] .menu-item {
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 0;
    border: 0;
    border-bottom: 1px solid var(--page-border, var(--color-border));
    background: transparent;
    box-shadow: none;
}

[data-layout="list"] .menu-item:last-child {
    border-bottom: 0;
}

/* Sizing only — border-radius is left to the [data-image-shape] rules in
   menu-layouts.css so circle/square/pill shapes still work on list layout. */
[data-layout="list"] .menu-item-img-wrap {
    width: 3.5rem;
    height: 3.5rem;
    aspect-ratio: auto;
    flex: 0 0 auto;
    overflow: hidden;
    background: var(--page-surface, rgba(127, 127, 127, 0.08));
    border: 1px solid var(--page-border, var(--color-border));
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-layout="list"] .menu-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

[data-layout="list"] .menu-item-content {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

/* Thumbnail | (dish name over ingredients) | price.
   Centred rather than baseline-aligned so the price sits against the whole
   two-line block, not just the name. */
[data-layout="list"] .menu-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    column-gap: 1rem;
}

[data-layout="list"] .menu-item-price {
    justify-self: end;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
    /* A menu is a list of short rows; two columns stop it running long. */
    [data-layout="list"].menu-page.has-menu-tabs .menu-items {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 2rem;
    }

    [data-layout="list"].menu-page.has-menu-tabs .menu-items .menu-item:nth-last-child(2):nth-child(odd) {
        border-bottom: 0;
    }
}

@media (max-width: 767.98px) {
    /* menu-layouts.css turns the list thumbnail into a full-width 16:9 banner
       on mobile, which makes every row enormous. Keep the compact square. */
    [data-layout="list"] .menu-item-img-wrap {
        width: 3.25rem;
        height: 3.25rem;
        aspect-ratio: auto;
    }

    /* menu-layouts.css stacks the list row into a column on mobile
       (thumbnail above the text). Keep the thumbnail on the leading edge. */
    [data-layout="list"] .menu-item {
        flex-direction: row;
        text-align: left;
    }

    [data-layout="list"] .menu-item-content {
        align-items: flex-start;
        text-align: left;
    }

    [data-layout="list"] .menu-item-row {
        column-gap: 0.75rem;
    }
}

/* ==================================================================== *
 * Live open/closed status and address (partials/menu-status.php)
 * ==================================================================== */

.menu-status,
.menu-address-line {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.2rem 0 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--page-text-secondary, var(--text-secondary));
}

.menu-status[hidden] {
    display: none;
}

.menu-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--page-text-subtle, #8F8F86);
}

.menu-status.is-open .menu-status-dot {
    background: #2FB457;
}

.menu-status.is-soon .menu-status-dot {
    background: #E5A00D;
}

.menu-address-line svg {
    flex-shrink: 0;
}

.layout-menu .menu-page .menu-address-line a:not(.btn):not(.menu-tab):not(.menu-contact-btn) {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--page-border-strong, currentColor);
    text-underline-offset: 0.2em;
}

.menu-hero--hero .menu-status,
.menu-hero--hero .menu-address-line,
.menu-hero--banner:not(.menu-hero--no-image) .menu-status,
.menu-hero--banner:not(.menu-hero--no-image) .menu-address-line {
    color: rgba(255, 255, 255, 0.92);
}

/* ==================================================================== *
 * List layout: the rows sit in one raised panel, the same shape in dark and
 * light. The panel uses the page's own surface tokens, so it reads as a
 * step above the page background in both modes.
 * ==================================================================== */

[data-layout="list"] .menu-items {
    padding: 0 1rem;
    border: 1px solid var(--page-border, var(--color-border));
    border-radius: 14px;
    background: var(--page-surface-strong, rgba(127, 127, 127, 0.08));
}

[data-layout="list"][data-card-shape="sharp"] .menu-items {
    border-radius: 4px;
}

[data-layout="list"][data-card-shape="pill"] .menu-items {
    border-radius: 24px;
}

[data-layout="list"] .menu-items .menu-item {
    border-radius: 0;
}
