/*
   Lore Engine - Beta Universe Systems app
   Copyright (c) 2026 Beta Universe Systems LLC / John Molt
   All rights reserved.

   2026-06-06 12:14 PM PT

   wwwroot/styles/app.css

   App-level chrome only — reset, shell, header, section dividers,
   main wrapper, footer, utility, and app-scoped print rules.
   Component-specific rules (assistant-block, question-panel,
   ask-btn, thinking dots, answer-panel, etc.) live inside their
   own component <style> blocks per BUS standards §7.

   Phase 6 additions: editor layout modifier classes (.app--editor,
   .app-main--editor, .editor-panel) for /edit.html. The base .app
   shell is reused; the editor only widens the page and turns the
   main wrapper into a two-column grid.
*/

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Base ──────────────────────────────────────────────────────── */
html, body {
    background: var(--bus-bg);
    color: var(--bus-white);
    font-family: var(--bus-font-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ── App Shell ─────────────────────────────────────────────────── */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 768px;
    margin: 0 auto;
}

/* Editor modifier — wider, no narrow column constraint. Desktop-only
   per the locked phase 6 decision; no responsive concession to phone. */
.app--editor {
    max-width: 1400px;
}

/* ── Header ────────────────────────────────────────────────────── */
.app-header {
    background: var(--bus-header);
    border-bottom: 3px solid var(--bus-orange);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--bus-shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 14px;
}

.header-logo {
    height: 56px;
    width: auto;
    flex-shrink: 0;
}

.header-text { flex: 1; }

.header-title {
    font-family: var(--bus-font-display);
    font-weight: 900;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    letter-spacing: 0.05em;
    color: var(--bus-white);
    line-height: 1;
    text-transform: uppercase;
}

.header-subtitle {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--bus-orange-warn);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 3px;
}

.font-toggle {
    background: var(--bus-orange);
    color: var(--bus-white);
    border: none;
    font-family: var(--bus-font-display);
    font-weight: 900;
    font-size: 1rem;
    padding: 7px 12px;
    cursor: pointer;
    border-radius: var(--bus-radius);
    box-shadow: var(--bus-shadow);
    letter-spacing: 0.05em;
    transition: background 0.15s;
    flex-shrink: 0;
}

.font-toggle:hover { background: var(--bus-orange-dark); }

/* ── Section Dividers ──────────────────────────────────────────── */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 16px 10px;
}

.section-divider__line {
    flex: 1;
    height: 2px;
    background: var(--bus-orange);
}

.section-divider__label {
    font-family: var(--bus-font-display);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bus-white);
    white-space: nowrap;
}

/* ── Main Wrapper ──────────────────────────────────────────────── */
.app-main {
    flex: 1;
    padding: 0 0 40px;
}

/* Editor main is a two-column grid: sidebar + edit panel.
   Sidebar gets a fixed comfortable width (~340px), edit panel takes
   the rest. Both columns stretch to fill available height. */
.app-main--editor {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0;
    padding: 0;
    align-items: stretch;
}

/* ── Editor: sidebar + panel ───────────────────────────────────── */
.editor-sidebar-slot {
    /* The chunkmap component (.chunkmap) is injected here and provides
       its own background, border, and padding. This slot just defines
       the grid cell. */
}

/* The editor panel is the anchor for the file editor (or, pre-7a, the
   placeholder card). Stretches to fill the right grid cell; file editor
   sizes itself via height: 100% on its own outer .file-editor div. No
   centering or padding here — the file-editor manages its own internal
   spacing. */
.editor-panel {
    display: flex;
    flex-direction: column;
    min-height: 60vh;
    background: var(--bus-bg);
}

/* ── Footer ────────────────────────────────────────────────────── */
.app-footer {
    border-top: 2px solid var(--bus-orange);
    padding: 10px 16px;
    background: var(--bus-header);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-family: var(--bus-font-display);
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bus-text-muted);
}

.footer-version { color: var(--bus-orange-warn); }

/* ── Utility ───────────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── Print (app-level only) ────────────────────────────────────── */
/*
   Hide app chrome on print. Component-scoped print rules for the
   assistant block live inside busAsker.js — that component owns
   its own visibility decisions for print.
*/
@media print {
    .app-header,
    .app-footer,
    .section-divider { display: none !important; }

    body { background: white !important; }

    /* The editor isn't designed to print; hide the sidebar slot to
       keep accidental Ctrl+P from looking broken. */
    .editor-sidebar-slot,
    .chunkmap { display: none !important; }
}