/* Tessera Pane-Layout — 3-column app chrome.
 *
 * Markup contract the host SHOULD render under <main id="root">:
 *
 *   <div class="map-page">
 *     <aside class="left-pane"> ... LHS ... </aside>
 *     <div class="splitter splitter-left" data-side="left"></div>
 *     <section class="center-pane"> ... center (graph) ... </section>
 *     <div class="splitter splitter-right" data-side="right"></div>
 *     <aside class="right-pane"> ... RHS detail ... </aside>
 *   </div>
 *
 * Behaviour layered on top by pane-layout.js:
 *   - Splitter handles drag to resize LHS/RHS, persisted to
 *     localStorage under a host-specified key prefix.
 *   - At ≤1180px, LHS becomes an off-canvas drawer; host renders
 *     <button class="map-hamburger" data-act="toggle-left">≡</button>
 *     somewhere in the center-pane; the JS wires it.
 *   - At ≤800px, the grid stacks: graph 60vh on top, RHS below
 *     getting the rest of the viewport (scrollable).
 *
 * Visual tokens (--accent, --rule, --ink-soft, etc.) are inherited
 * from the host's family stylesheet (sc-family or equivalent).
 * Defaults live here so the layout works without a family loaded.
 */

[hidden] { display: none !important; }

.map-page {
  --left-w: 14rem;
  --right-w: 22rem;
  position: fixed;
  top: var(--nav-height, 56px);
  left: 0; right: 0; bottom: var(--footer-height, 32px);
  display: grid;
  grid-template-columns: var(--left-w) 4px 1fr 4px var(--right-w);
  overflow: hidden;
  background: var(--page-bg, #fbfaf6);
}

.map-page > .left-pane,
.map-page > .right-pane,
.map-page > .center-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.left-pane  {
  background: #fafaf7;
  border-right: 1px solid var(--rule, #e5e7eb);
}
.right-pane {
  background: #fff;
  border-left: 1px solid var(--rule, #e5e7eb);
}
.center-pane { background: var(--page-bg, #fbfaf6); }

.splitter {
  cursor: col-resize;
  background: transparent;
  transition: background 100ms;
  touch-action: none;
}
.splitter:hover, .splitter:active { background: var(--splitter-hover, #c5d4b8); }

/* Hamburger — visible only when LHS is off-canvas. Position it
 * with absolute inside the center-pane so it floats over the
 * graph. */
.map-hamburger {
  display: none;
  position: absolute;
  top: 8px; left: 10px;
  z-index: 6;
  width: 34px; height: 34px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--rule, #d6dccd);
  border-radius: 6px;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.map-hamburger:hover { background: #f3f7ee; }

/* Tablet (≤1180px): LHS becomes off-canvas; center+RHS share grid. */
@media (max-width: 1180px) {
  .map-page {
    grid-template-columns: 1fr 4px var(--right-w);
  }
  .splitter-left { display: none; }
  .left-pane {
    position: fixed;
    top: var(--nav-height, 56px);
    left: 0; bottom: 0;
    width: 18rem;
    z-index: 10;
    transform: translateX(-101%);
    transition: transform 200ms ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.12);
  }
  .left-pane.open { transform: translateX(0); }
  .map-hamburger { display: inline-flex; }
}

/* Phone (≤800px): stack — graph 60vh on top, RHS fills the rest. */
@media (max-width: 800px) {
  .map-page {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh 1fr;
  }
  .splitter-right { display: none; }
  .right-pane {
    border-left: none;
    border-top: 1px solid var(--rule, #e5e7eb);
  }
}
