/* ==========================================================================
   Page frame: tower + pane.

   The app layout (`app.rs` → AppShell) renders the storefront tower and a
   pane (navbar · routed page · footer) on every public route:

     phones / tablet portrait      desktop / tablet landscape
     ─────────────────────────     ───────────────────────────────
     `/`   : tower only            tower (sticky, viewport-tall)
     other : pane only             | pane (scrolls)

   Everything below the breakpoint keeps the original behaviour; the split
   is added on top. Loaded after restaurant.css so its overrides win.
   ========================================================================== */

/* --- Phones and tablet portrait (default) ------------------------------- */

/* The tower is the home page: hide it everywhere else. */
.app-shell:not(.app-shell--home) .storefront-viewport {
    display: none;
}

/* The navbar wrapper contributes no box of its own, so the shared sticky
   `.navbar` keeps sticking against the pane, not against a wrapper that is
   exactly one navbar tall. */
.site-chrome {
    display: contents;
}

/* On `/` the tower is the whole page: no navbar, no footer, no welcome pane
   (its text opens as a modal from the roof's ℹ button). */
.app-shell--home .site-chrome--home,
.app-shell--home .footer--home,
.app-shell--home .home-welcome-pane {
    display: none;
}

/* --- Active floor = selected menu entry --------------------------------- */
.floor-target.active .floor-glow {
    opacity: 1;
}

.floor-target.active {
    box-shadow: inset 0 0 50px rgba(255, 215, 0, 0.18);
    border-top: 1px solid rgba(255, 215, 0, 0.35);
    border-bottom: 1px solid rgba(255, 215, 0, 0.35);
    background-color: rgba(10, 10, 15, 0.22);
}

.floor-target.active .floor-info-box {
    transform: translateY(0);
    opacity: 1;
}

/* --- Roof ℹ button (mirrors the login button, on the left) ------------- */
.roof-info-button {
    right: auto;
    left: 4%;
    font-family: var(--font-premium-serif);
    font-style: italic;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

/* --- Top-bar ℹ button ---------------------------------------------------- */
.demo-info-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-primary);
    font-family: var(--font-premium-serif);
    font-style: italic;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.demo-info-button:hover {
    border-color: var(--color-gold-primary);
    color: var(--color-gold-primary);
    transform: scale(1.05);
}

/* --- Welcome / demo-info content ---------------------------------------- */
.demo-welcome {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.demo-welcome__title {
    margin: 0;
}

.demo-welcome__lead {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.demo-welcome__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.9rem;
}

.demo-welcome__list li {
    line-height: 1.55;
    padding-left: 1.1rem;
    border-left: 2px solid rgba(var(--rs-gold-rgb), 0.35);
}

.demo-welcome__list strong {
    color: var(--color-gold-primary);
    font-family: var(--font-luxury-heading);
}

.demo-welcome__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.demo-welcome__foot {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.demo-welcome__close {
    align-self: flex-end;
}

/* The modal reuses the language modal's overlay + card, a bit wider. */
.demo-info-modal {
    max-width: 640px;
    width: min(92vw, 640px);
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}

/* The home pane (desktop only — hidden above on phones). */
.home-welcome-pane {
    background: var(--rs-bg);
    position: relative;
    min-height: 100vh;
    padding: 120px 20px 60px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    isolation: isolate;
}

.home-welcome-pane::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("/assets/ristogood_night_cut.png") top center / 100vw auto no-repeat;
    z-index: -2;
    pointer-events: none;
}

.home-welcome-pane::after {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--rs-veil);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: -1;
    pointer-events: none;
}

/* --- Desktop and tablet landscape: the split ---------------------------- */
@media (min-width: 1024px), (min-width: 900px) and (orientation: landscape) {
    :root {
        /* Poster aspect ratio 1 : 2.9155 → viewport-tall tower width. */
        --tower-w: calc(100vh / 2.9155);
    }

    /* The page scrolls normally again; restaurant.css forced the body to the
       poster's full-width height for the phone home. */
    body:has(.app-shell--home .storefront-viewport) {
        width: auto !important;
        height: auto !important;
        overflow-y: auto !important;
    }

    .app-shell {
        display: grid;
        grid-template-columns: var(--tower-w) minmax(0, 1fr);
        align-items: start;
        min-height: 100vh;
        background: var(--rs-bg-deep);
    }

    /* Tower: always present, sticky, one viewport tall. */
    .app-shell .storefront-viewport,
    .app-shell:not(.app-shell--home) .storefront-viewport {
        display: flex;
        position: sticky;
        top: 0;
        width: var(--tower-w);
        height: 100vh;
        overflow: hidden;
        box-shadow: 8px 0 40px rgba(var(--rs-shadow-rgb), 0.6);
        z-index: 1;
    }

    .app-shell .storefront-container {
        width: 100%;
        height: 100%;
    }

    /* Pane: navbar, page, footer. */
    .app-pane {
        min-width: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .app-pane__main {
        flex: 1 1 auto;
        min-width: 0;
    }

    .app-shell--home .site-chrome--home {
        display: contents;
    }

    .app-shell--home .footer--home {
        display: block;
    }

    .app-shell--home .home-welcome-pane {
        display: flex;
    }

    /* The fixed, blurred poster behind the subpages is now the tower's job:
       keep the veil, drop the second poster so the column reads as one. */
    .app-pane .menu-page-container::before,
    .app-pane .reservations-page-container::before,
    .app-pane .about-page-container::before,
    .app-pane .gallery-page-container::before,
    .app-pane .contacts-page-container::before,
    .app-pane .home-welcome-pane::before {
        background-image: none;
        background: radial-gradient(ellipse at 20% 0%, rgba(var(--rs-gold-rgb), 0.07), transparent 55%),
                    var(--rs-bg);
        left: var(--tower-w);
    }

    .app-pane .menu-page-container::after,
    .app-pane .reservations-page-container::after,
    .app-pane .about-page-container::after,
    .app-pane .gallery-page-container::after,
    .app-pane .contacts-page-container::after,
    .app-pane .home-welcome-pane::after {
        left: var(--tower-w);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: transparent;
    }

    /* The pane's pages already sit under a sticky navbar: less top padding. */
    .app-pane .menu-page-container,
    .app-pane .reservations-page-container,
    .app-pane .about-page-container,
    .app-pane .gallery-page-container,
    .app-pane .contacts-page-container,
    .app-pane .home-welcome-pane {
        padding-top: 48px;
        min-height: calc(100vh - var(--navbar-height, 70px));
    }

    /* The roof ℹ is for phones; the top bar has one here. */
    .roof-info-button {
        display: none;
    }

    /* The floating back button belongs to the phone flow. */
    .app-shell ~ .back-button,
    .app-shell ~ .floating-back-button {
        display: none;
    }
}

/* --- Phones: the subpages use the whole width ---------------------------- */
@media (max-width: 767px) {
    .menu-page-container,
    .reservations-page-container,
    .about-page-container,
    .gallery-page-container,
    .contacts-page-container,
    .home-welcome-pane {
        padding: 88px 8px 40px 8px;
    }

    .luxury-card {
        padding: 26px 14px;
        border-radius: 14px;
    }

    .menu-section {
        padding: 16px 12px;
    }
}
