/* ================================================================
   FriendsByChance — pane-layout.css
   Three-pane page shell shared across all full-screen pages
   ================================================================ */

/* ── Page shell ─────────────────────────────────────────────────
   Absolute inside .fbc-shell-main (components/shell.css), which
   already provides the top-bar offset and the centred max-width. */
.fbc-page {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: row;
    background: var(--color-bg);
    overflow: hidden;
}
.fbc-page.visible,
.fbc-page.open { display: flex; }

/* ── Left pane ──────────────────────────────────────────────────── */
.fbc-pane-left {
    width: var(--fbc-left-w);
    min-width: var(--fbc-left-w);
    border-right: 1px solid var(--color-divider);
    background: var(--color-bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* ── Main pane ──────────────────────────────────────────────────
   Capped so a very wide window does not stretch content into an
   unreadable line length; the cap is lifted for full-width pages. */
.fbc-pane-main {
    flex: 1;
    min-width: 0;
    max-width: var(--fbc-main-max-w);
    overflow-y: auto;
    position: relative;
}
.fbc-page--full .fbc-pane-main { max-width: none; }

/* Inner wrapper (omitted when mainFill: true): the main pane's whole width
   but its padding — no band either side, however wide the pane grows (the
   user, 2026-11-01: the side padding "too wide when the page is very wide").
   The main pane's own cap (--fbc-main-max-w) still holds. */
.fbc-pane-main-inner {
    margin: 0 auto;
    padding: 24px 24px 48px;
}

/* ── Right pane ─────────────────────────────────────────────────────
   Closed until the user opens it (pane-layout.js).  In the flow it is
   either a real column (.open) or simply absent; narrower, it becomes an
   overlay (.collapsed, below). */
.fbc-pane-right {
    width: var(--fbc-right-w);
    min-width: var(--fbc-right-w);
    border-left: 1px solid var(--color-divider);
    background: var(--color-bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.fbc-pane-right:not(.collapsed):not(.open) { display: none; }

/* The right pane's GRIP: a narrow handle at the top of its left edge
   (the user, 2026-11-01: "at the top, rather than the middle"), dragged
   to make the pane wider or narrower (pane-layout.js) — there only while
   the pane is a column beside the main pane.  A flex item of no width
   between the two, so it straddles their border; what the finger takes
   is wider than what is drawn. */
.fbc-pane-grip {
    position:   relative;
    flex:       none;
    width:      0;
    z-index:    5;
}
.fbc-pane-grip[hidden] { display: none; }
.fbc-pane-grip-handle {
    position:      absolute;
    top:           4px;
    left:          -12px;
    width:         24px;
    height:        64px;
    display:       flex;
    align-items:   center;
    justify-content: center;
    cursor:        col-resize;
    touch-action:  none;
    background:    none;
    border:        0;
    padding:       0;
}
.fbc-pane-grip-handle::before {
    content:       '';
    width:         6px;
    height:        44px;
    border-radius: 3px;
    background:    var(--color-divider);
    box-shadow:    0 0 0 1px var(--color-bg);
}
.fbc-pane-grip-handle:hover::before,
.fbc-pane-grip-handle:focus-visible::before,
.fbc-pane-grip--dragging .fbc-pane-grip-handle::before { background: var(--color-primary-light); }
/* While dragged, nothing under the pointer is selected or hovered. */
.fbc-pane-resizing, .fbc-pane-resizing * { user-select: none; cursor: col-resize !important; }

/* One container per view (the page's own, the chat, …); the pane shows
   exactly one. */
.fbc-pane-right-view {
    display:        flex;
    flex-direction: column;
    flex:           1;
    min-height:     0;
}

/* THE HISTORY's row (pane-layout.js): back at its start, clear and the
   list in its middle, forward at its end — the app's square buttons. */
.fbc-pane-nav {
    flex:            none;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             6px;
    padding:         6px 10px;
    border-bottom:   1px solid var(--color-divider);
}
/* HISTORY: one button, as wide as the two square ones it replaced. */
.fbc-pane-nav-history {
    min-width:   66px;
    gap:         6px;
    display:     inline-flex;
    align-items: center;
}
.fbc-pane-nav-history svg { flex: none; }

/* THE HISTORY, in the pane: its title with "Clear history", the entries as
   cards (.fbc-pick-card), room all round. */
.fbc-pane-history {
    padding:    14px 16px;
    gap:        8px;
    overflow-y: auto;
}
.fbc-pane-history-head {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             8px;
    min-height:      30px;
}
.fbc-pane-history-title { font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary); }
.fbc-pane-history-list  { display: flex; flex-direction: column; gap: 6px; }
.fbc-pane-history-empty { font-size: 0.8rem; color: var(--color-text-muted); }
/* Nothing to show: a line saying what can be. */
.fbc-pane-empty {
    padding:    24px 18px;
    color:      var(--color-text-muted);
    font-size:  0.9rem;
    line-height: 1.45;
}

/* A closed pane leaves its room empty: nothing moves, the main pane keeps
   its most (the user, 2026-11-01 — D9 settled; the two designs tried, the
   main pane widening and the column re-centring, are gone) — but on a page
   that GROWS INTO IT (PaneLayout growsIntoRight: The Map, 2026-11-02), the
   main pane takes that room: its most and the pane's width.  Only while
   the pane is a closed column: as an overlay it never held room. */
.fbc-page--grows-right:not(:has(> .fbc-pane-right.open)) > .fbc-pane-main {
    max-width: calc(var(--fbc-main-max-w) + var(--fbc-right-w));
}

/* ── Backdrop ───────────────────────────────────────────────────── */
.fbc-pane-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition, 0.25s ease);
}
.fbc-pane-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Right pane: JS-managed overlay (added via .collapsed class) ─ */
.fbc-pane-right.collapsed {
    position:   absolute;
    top: 0; right: 0; bottom: 0;
    min-width:  0;
    width:      85%;
    max-width:  var(--fbc-right-default-w);
    z-index:    20;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.18);
    transform:  translateX(100%);
    transition: transform var(--transition, 0.25s ease);
}
.fbc-pane-right.collapsed.open { transform: translateX(0); }

/* A phone held upright: a sliver of page beside the chat is no use to
   anyone, so the overlay takes the whole page. */
@media (orientation: portrait) {
    .fbc-pane-right.collapsed {
        width:     100%;
        max-width: none;
    }
}

/* ── Left pane: JS-managed overlay (added via .collapsed class) ── */
.fbc-pane-left.collapsed {
    position:   absolute;
    top: 0; left: 0; bottom: 0;
    min-width:  0;
    width:      85%;
    max-width:  var(--fbc-left-w);
    z-index:    20;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.18);
    transform:  translateX(-100%);
    transition: transform var(--transition, 0.25s ease);
}
.fbc-pane-left.collapsed.open { transform: translateX(0); }

/* ── TILES (pane-layout.js setTiles; components/tile-view.js) ───────
   The grid in the main pane's place (the main pane hidden): it fills
   what the main pane and, closed, the right pane leave.  The left pane
   keeps its head alone (the page's own .fbc-tiled-hide elements go) and
   lies OVER the grid's top-left corner — the grid scrolls under it. */
.fbc-page--tiled .fbc-pane-left:not(.collapsed) {
    position:      absolute;
    top:           0;
    left:          0;
    z-index:       4;
    max-height:    100%;
    border-bottom: 1px solid var(--color-divider);
    box-shadow:    0 2px 6px rgba(0, 0, 0, 0.08);
}
.fbc-page--tiled .fbc-tiled-hide { display: none !important; }
