/* Page-specific layout — home / menu / posts index / post detail. La Barra QR menu. */

/* ── /menu — sticky search + category-chip nav ─────────────────────────── */
.menu-toolbar {
    position: sticky;
    top: calc(var(--header-height) - 1px);
    
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: var(--sp3);
    padding: var(--sp5) var(--sp4) 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-subtle);
    transition: padding var(--dur-base) var(--ease-brand);
}

.search-bar--menu {
    margin: 0;
    height: 64px;
    font-size: 20px;
    transition: height var(--dur-base) var(--ease-brand), margin var(--dur-base) var(--ease-brand);
}

.search-bar--menu .search-bar__input { font-size: 20px; }

/* Big by default, shrinks + pins tighter once the user scrolls past it. */
.menu-toolbar.is-compact { padding: var(--sp2) var(--sp4) 0; }
.menu-toolbar.is-compact .search-bar--menu { height: 48px; }
.menu-toolbar.is-compact .search-bar--menu .search-bar__input { font-size: 16px; }

/*
 * overflow-x: auto implicitly forces overflow-y to auto too (per spec),
 * which clips the .is-active chip's box-shadow glow at the top/bottom edge
 * since box-shadow paints outside the border box. Vertical padding here
 * gives the glow room inside the clip region so it renders whole, same as
 * it does along the (unclipped) x axis.
 */
.category-chip-nav {
    display: flex;
    /* Groups stack their label above their chips (see .category-chip-group
       below) — aligning everything to the bottom keeps every group's chip
       row on one shared baseline, with labels floating above it as small
       subtitles instead of looking like an oversized, misaligned chip. */
    align-items: flex-end;
    gap: var(--sp2);
    overflow-x: auto;
    scrollbar-width: none;
    padding: var(--sp3) 0 calc(var(--sp3) + 2px);
}

.category-chip-nav::-webkit-scrollbar { display: none; }

.category-chip {
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: var(--sp2) var(--sp4);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface-1);
    color: var(--fg-secondary);
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-brand), border-color var(--dur-fast) var(--ease-brand), box-shadow var(--dur-fast) var(--ease-brand);
}

/* The DoorDash-style "you're here" cue — subtle glow instead of a hard
   background swap, reusing the same glow token as the hero progress bar. */
.category-chip.is-active {
    color: var(--fg-primary);
    border-color: var(--fg-primary);
    box-shadow: var(--shadow-glow);
}

/* ── Parent-grouped chip nav — a plain-text sticky label per top-level
   category (resto/drinks/etc.), stacked above that parent's own row of
   chips as a small subtitle (not a button, not the same height as a chip).
   The label sticks to the left edge of the scroll container for as long as
   any part of its own group is in view (position:sticky's containing block
   is the nearest block ancestor — here .category-chip-group — so it
   releases automatically once that group has fully scrolled past and the
   next group's label takes over). See MenuChromeService::categoryParents(). ── */
.category-chip-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex-shrink: 0;
}

.category-chip-group__label {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg);
    color: var(--fg-tertiary);
    font-family: var(--font-mono);
    font-size: 11px;
    background-color: unset !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    font-size: 1.2rem;
    font-weight: 900;
}

.category-chip-group__items {
    display: flex;
    align-items: center;
    gap: var(--sp2);
}

.category-chip--closed {
    flex-shrink: 0;
    padding: var(--sp2) var(--sp4);
    border: 1px dashed var(--line-subtle);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--fg-tertiary);
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
}

.category-listing { padding-bottom: var(--sp8); }

/* Desktop/tablet — the toolbar itself stays full-bleed (sticky band +
   border), only its contents get capped/centered so the search bar and
   chip nav don't stretch edge-to-edge on wide screens. Mobile is untouched. */
@media (min-width: 720px) {
    .search-bar--menu,
    .category-chip-nav {
        max-width: var(--container-max);
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── Parent-category section banner — sits above a parent's child-category
   panels in the /menu listing (both open and closed groups carry the same
   #parent-<slug> id, so split-cta's home banners can link straight to
   their own section instead of just /menu). Same photo/overlay treatment
   as split-cta, but taller and title-only — the subtitle/badges already
   live in the chip-nav and panels around it, so it doesn't need to repeat
   them. ── */
.parent-category-banner {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(200px, 30vw, 420px);
    overflow: hidden;
    background: var(--surface-1);
}

.parent-category-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--image-filter);
}

.parent-category-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .25) 55%, transparent 100%);
}

.parent-category-banner__title {
    position: relative;
    z-index: 1;
    padding: var(--sp6);
    font-size: clamp(30px, 5vw, 52px);
    line-height: 0.95;
    color: var(--fg-primary);
}

/* ── Home — search-to-menu form, dynamic per-parent-category split, CTA ──
   One panel per real top-level category (Front\HomeController::
   buildCategoryGroups()) — however many exist, not a hardcoded 2-up split —
   so it wraps instead of forcing exactly two columns. ── */
.search-form {
    margin: var(--sp7) var(--sp4) var(--sp6);
}

.search-form .search-bar { margin: 0; height: 64px; }
.search-form .search-bar__input { font-size: 19px; }

.split-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp4);
    margin: 0 var(--sp4) var(--sp6);
}

.split-cta__panel {
    display: flex;
    flex-direction: column;
    gap: var(--sp3);
    flex: 1 1 320px;
}

/* Desktop/tablet — cap the row itself so it doesn't stretch edge-to-edge on
   wide screens, and stop each panel from growing past a sensible width when
   there are only one or two parent categories. Mobile is untouched. */
@media (min-width: 720px) {
    .split-cta {
        max-width: var(--container-max);
        margin-left: auto;
        margin-right: auto;
    }

    .split-cta__panel { max-width: 640px; }
}

.split-cta__link {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 300px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface-1);
    transition: transform var(--dur-fast) var(--ease-brand);
}

.split-cta__link:hover { transform: translateY(-2px); }

.split-cta__link img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--image-filter);
}

.split-cta__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .25) 55%, transparent 100%);
}

.split-cta__content { position: relative; z-index: 1; padding: var(--sp6); }

.split-cta__categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp2);
}

.split-cta__closed {
    color: var(--fg-tertiary);
    font-style: italic;
    font-size: 14px;
}

.split-cta__title {
    display: flex;
    align-items: center;
    gap: var(--sp3);
    font-size: clamp(38px, 6vw, 58px);
    line-height: 0.95;
    color: var(--fg-primary);
}

.split-cta__icon { width: 0.55em; height: 0.55em; }

.split-cta__subtitle {
    margin-top: var(--sp3);
    max-width: 34ch;
    color: var(--fg-secondary);
    font-size: 14.5px;
}

.category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp3);
    margin: 0 var(--sp4) var(--sp7);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp2);
    padding: var(--sp3) var(--sp5);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--surface-1);
    color: var(--fg-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background-color var(--dur-fast) var(--ease-brand), border-color var(--dur-fast) var(--ease-brand);
}

.category-badge__icon { width: 14px; height: 14px; color: var(--fg-tertiary); }

.category-badge:hover { background: var(--surface-2); border-color: var(--fg-primary); }

/* Home's per-parent category badges (below each split-cta banner) fill the
   row evenly instead of hugging their own text width. */
.split-cta__categories .category-badge {
    flex-grow: 1;
    justify-content: center;
    border-radius: 5px;
}

.home-full-menu-cta { margin: 0 var(--sp4) var(--sp8); }

/* ── Posts index (/eventos) ────────────────────────────────────────────── */
.posts-index__head {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--sp7) var(--sp5) var(--sp5);
}

.posts-index__head h1 { font-size: clamp(30px, 5vw, 48px); }
.posts-index__head p { margin-top: var(--sp3); color: var(--fg-secondary); max-width: 60ch; }

.posts-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--sp5) var(--sp8);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp5);
}

@media (min-width: 560px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .posts-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Post detail (/eventos/:slug) ──────────────────────────────────────── */
.post-detail__hero {
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: 480px;
    overflow: hidden;
    background: var(--surface-1);
}

@media (min-width: 720px) { .post-detail__hero { aspect-ratio: 21 / 9; width: 100%; } }

.post-detail__hero img { width: 100%; height: 100%; object-fit: cover; filter: var(--image-filter); }

.post-detail__content {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--sp7) var(--sp5) var(--sp8);
}

.post-detail__back-link { margin-bottom: var(--sp5); }

.post-detail__eyebrow { color: var(--fg-tertiary); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }

.post-detail__content h1 { font-size: clamp(28px, 5vw, 44px); margin-top: var(--sp3); }

.post-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp4);
    margin-top: var(--sp4);
    color: var(--fg-secondary);
    font-size: 14px;
}

.post-detail__meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-detail__meta .icon { width: 16px; height: 16px; color: var(--fg-tertiary); }

.post-detail__body {
    margin-top: var(--sp6);
    color: var(--fg-secondary);
    font-size: 15px;
    line-height: 1.75;
}

.post-detail__body p { margin-bottom: var(--sp4); }
.post-detail__body h2, .post-detail__body h3 { margin: var(--sp6) 0 var(--sp3); text-transform: none; font-family: var(--font-body); font-weight: 700; color: var(--fg-primary); }
.post-detail__body ul, .post-detail__body ol { margin: 0 0 var(--sp4) var(--sp5); list-style: revert; }
.post-detail__body a { color: var(--fg-primary); text-decoration: underline; }
.post-detail__body img { margin: var(--sp5) 0; }

.post-detail__location {
    margin-top: var(--sp6);
    padding: var(--sp4);
    background: var(--surface-1);
    display: flex;
    align-items: center;
    gap: var(--sp3);
    color: var(--fg-secondary);
    font-size: 14px;
}

.post-detail__share { display: flex; flex-wrap: wrap; gap: var(--sp3); margin-top: var(--sp7); }

/* ── Event gallery + lightbox ──────────────────────────────────────────── */
.post-gallery {
    margin-top: var(--sp6);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp2);
}

.post-gallery__item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--surface-1);
    padding: 0;
    border: none;
    cursor: pointer;
}

.post-gallery__item img { width: 100%; height: 100%; object-fit: cover; filter: var(--image-filter); transition: transform var(--dur-fast) var(--ease-brand); }
.post-gallery__item:hover img { transform: scale(1.04); }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox__stage { display: flex; flex-direction: column; align-items: center; gap: var(--sp3); max-width: min(92vw, 900px); max-height: 88vh; }
.lightbox__image { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: var(--radius-md); }
.lightbox__counter { color: var(--fg-tertiary-on-dark, rgba(255, 255, 255, .6)); font-size: 12px; }

.lightbox__close {
    position: absolute;
    top: var(--sp4);
    right: var(--sp4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-radius: 50%;
    border: none;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-radius: 50%;
    border: none;
}

.lightbox__nav .icon { width: 22px; height: 22px; }
.lightbox__nav--prev { left: var(--sp4); }
.lightbox__nav--prev .icon { transform: rotate(90deg); }
.lightbox__nav--next { right: var(--sp4); }
.lightbox__nav--next .icon { transform: rotate(-90deg); }

.post-detail__related { border-top: 1px solid var(--line-subtle); }
