/* ========================================================================
   ROLAND'S DELI — TWO-COLUMN MENU v3.0 (COMPLETE REPLACEMENT)
   Load AFTER deli-menu.css v2. No JS or author-created spans required.

   CMS EDITING RULE: bold JUST the price in each top-level list item:
       <li>BLT <strong>10.75</strong><ul>...</ul></li>
   CSS cannot parse the last number from a plain text node.

   Supports both CMS nesting styles for add-ons:
   (A) description LI > nested UL of extras
   (B) second sibling UL directly under the sandwich LI (Turkey case)
   ======================================================================== */

.deli-menu.deli-menu-two-column {
    /* Typography — change independently as required */
    --deli-name-size: clamp(1.75rem, 2.6vw, 2.6rem);
    --deli-price-size: clamp(1.55rem, 2.2vw, 2.3rem);
    --deli-description-size: clamp(1rem, 1.45vw, 1.35rem);
    --deli-addon-font: 'Oswald', Impact, 'Arial Narrow', sans-serif;
    --deli-addon-size: clamp(.65rem, .88vw, .82rem);
    --deli-choice-font: 'Patrick Hand', cursive;;
    --deli-choice-size: clamp(.85rem, 1.07vw, 1.05rem);
    --deli-choice-color: #e8db67;

    /* Layout — the addon and price rails are part of the header */
    --deli-two-column-gap: clamp(2.6rem, 5vw, 5rem);
    --deli-two-column-row-gap: clamp(1rem, 1.7vw, 1.5rem);
    --deli-price-rail: clamp(4.8rem, 7vw, 6.25rem);
    --deli-addon-rail: clamp(6.2rem, 8.5vw, 8rem);
    --deli-addon-gap: .25rem;
    --deli-divider-square: 8px;
    --deli-divider-step: 25px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--deli-two-column-gap);
    row-gap: var(--deli-two-column-row-gap);
    align-items: start;
    position: relative;
    width: 100%;
    max-width: 1220px;
    margin: 1.5rem auto 0;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
}

/* A single red dotted divider from the top to the bottom of the menu */
.deli-menu.deli-menu-two-column::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: var(--deli-divider-square);
    transform: translateX(-50%);
    background: repeating-linear-gradient(
        to bottom,
        var(--deli-separator-red) 0 var(--deli-divider-square),
        transparent var(--deli-divider-square) var(--deli-divider-step)
    );
    pointer-events: none;
}

/* The top-level LI uses its plain name text as an anonymous grid item.
   The directly bolded price goes in the far-right column.
   Description list begins on row 2. */
.deli-menu.deli-menu-two-column > li {
    --deli-local-addon-rail: 0px;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--deli-local-addon-rail) var(--deli-price-rail);
    grid-template-rows: auto auto;
    column-gap: 0;
    align-items: start;
    align-content: start;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    min-width: 0;
    flex: initial;
    padding: 0;
    margin: 0;
    list-style: none;
    font-family: var(--deli-title-font, 'Arial Narrow', sans-serif);
    font-size: var(--deli-name-size);
    font-weight: 700;
    line-height: 1.08;
    text-transform: uppercase;
    color: var(--deli-text-white, #f8f7f1);
}

/* Set aside room for extras ONLY on items with them. The two allowed
   CMS structures are a third-level nested UL or a second sibling UL. */
.deli-menu.deli-menu-two-column > li:has(> ul > li > ul, > ul + ul) {
    --deli-local-addon-rail: var(--deli-addon-rail);
}

/* Suppress the original three-across menu's leaders and red separators */
.deli-menu.deli-menu-two-column > li::before,
.deli-menu.deli-menu-two-column > li::after {
    content: none !important;
    display: none !important;
}

/* Price: only a direct-child STRONG or B is treated as price.
   CMS bold button is the only extra formatting needed. */
.deli-menu.deli-menu-two-column > li > :is(strong, b) {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    display: block;
    position: static;
    width: auto;
    margin: 0;
    padding: 0;
    font-family: var(--deli-price-font, 'Oswald', sans-serif);
    font-size: var(--deli-price-size);
    /* font-weight: 700; */
    line-height: 1.08;
    text-align: right;
    white-space: nowrap;
    text-transform: none;
    font-variant-numeric: tabular-nums;
    color: var(--deli-text-white, #f8f7f1);
}

/* Normal description list is the FIRST directly nested UL. */
.deli-menu.deli-menu-two-column > li > ul:first-of-type {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: auto;
    padding: 0;
    margin: .12rem 0 0;
    list-style: none;
    font-family: var(--deli-description-font, Georgia, serif);
    font-size: var(--deli-description-size);
    font-weight: 400;
    line-height: 1.22;
    text-transform: none;
    color: var(--deli-description-color, #e4ded5);
}
.deli-menu.deli-menu-two-column > li > ul:first-of-type > li {
    display: block;
    position: static; /* extras position relative to top-level sandwich LI */
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font: inherit;
    line-height: inherit;
    text-transform: inherit;
    white-space: normal;
    overflow-wrap: break-word;
    color: inherit;
}
.deli-menu.deli-menu-two-column > li > ul:first-of-type > li + li {
    margin-top: .3rem;
}

/* Addons: BOTH supported nesting patterns share the same style.
   These are positioned relative to the top-level LI/header line. */
.deli-menu.deli-menu-two-column > li > ul > li > ul,
.deli-menu.deli-menu-two-column > li > ul + ul {
    position: absolute;
    /* Clear the base menu's grid-row: 2 on direct nested ULs.
       Otherwise absolute extras are anchored to the DESCRIPTION ROW,
       not the sandwich heading row (the Turkey bug). */
    grid-column: auto;
    grid-row: auto;
    top: .12rem;
    right: calc(var(--deli-price-rail) + var(--deli-addon-gap));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .15rem;
    width: var(--deli-addon-rail);
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--deli-addon-font);
    font-size: var(--deli-addon-size);
    font-weight: 300;
    line-height: 1.15;
    text-align: right;
    text-transform: uppercase;
    color: var(--deli-text-white, #f8f7f1);
}
.deli-menu.deli-menu-two-column > li > ul > li > ul > li,
.deli-menu.deli-menu-two-column > li > ul + ul > li {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    font: inherit;
    line-height: inherit;
    white-space: nowrap;
    text-transform: inherit;
    color: inherit;
}

/* For Chicken Salad and other entries with multiple first-level
   description LI elements, the first acts as the yellow choices line. */
.deli-menu.deli-menu-two-column > li > ul:first-of-type > li:first-child:not(:last-child) {
    font-family: var(--deli-choice-font);
    font-size: var(--deli-choice-size);
    font-weight: 500;
    line-height: 1.25;
    color: var(--deli-choice-color);
    text-transform: uppercase;
}
.deli-menu.deli-menu-two-column > li > ul:first-of-type > li:first-child:not(:last-child) > :is(strong,b) {
    font-weight: 700;
    color: var(--deli-text-white, #f8f7f1);
}

/* Bootstrap LG: one column, no red divider; extras return to normal
   flow beneath their description, regardless of nesting style. */
@media (max-width: 991.98px) {
    .deli-menu.deli-menu-two-column {
        grid-template-columns: minmax(0, 1fr);
        max-width: 680px;
        row-gap: 1.3rem;
        padding-inline: .5rem;
        --deli-name-size: clamp(1.75rem, 5.8vw, 2.75rem);
        --deli-price-size: clamp(1.45rem, 5vw, 2.25rem);
        --deli-description-size: clamp(1rem, 3.5vw, 1.32rem);
    }
    .deli-menu.deli-menu-two-column::after { display: none; }
    .deli-menu.deli-menu-two-column > li:has(> ul > li > ul, > ul + ul) {
        --deli-local-addon-rail: 0px;
    }
    .deli-menu.deli-menu-two-column > li > ul > li > ul,
    .deli-menu.deli-menu-two-column > li > ul + ul {
        position: static;
        display: flex;
        flex-flow: row wrap;
        justify-content: flex-start;
        align-items: baseline;
        gap: .2rem .9rem;
        width: auto;
        margin-top: .35rem;
        font-size: clamp(.7rem, 2vw, .88rem);
        text-align: left;
    }
    /* The sibling UL is a third grid row after the description UL. */
    .deli-menu.deli-menu-two-column > li > ul + ul {
        grid-column: 1 / -1;
        grid-row: 3;
        margin-top: .3rem;
    }
    .deli-menu.deli-menu-two-column > li > ul > li > ul > li,
    .deli-menu.deli-menu-two-column > li > ul + ul > li {
        white-space: normal;
    }
}

@media (max-width: 575.98px) {
    .deli-menu.deli-menu-two-column {
        --deli-name-size: clamp(1.45rem, 6.25vw, 2.3rem);
        --deli-price-size: clamp(1.3rem, 5.5vw, 1.8rem);
        --deli-price-rail: 4.8rem;
        --deli-description-size: clamp(.95rem, 4.2vw, 1.18rem);
    }
    .deli-menu.deli-menu-two-column > li > ul > li > ul,
    .deli-menu.deli-menu-two-column > li > ul + ul {
        font-size: clamp(.7rem, 3vw, .86rem);
    }
}


/* ==========================================
   SINGLE-ITEM MENU
   ========================================== */

/* Hide the red divider for one item */
.deli-menu.deli-menu-two-column:has(> li:only-child)::after {
    content: none;
    display: none;
}

/* Center one item at normal column width */
.deli-menu.deli-menu-two-column > li:only-child {
    grid-column: 1 / -1;
    justify-self: center;

    width: calc(
        (100% - var(--deli-two-column-gap)) / 2
    );
}

/* Mobile: use the available single-column width */
@media (max-width: 991.98px) {
    .deli-menu.deli-menu-two-column > li:only-child {
        width: 100%;
    }
}

