/*
 * layout.css — Steaz core layout chrome
 *
 * @purpose Generic status bar + bottom bar + sheet host. NO fd-specific
 *          selectors here — fd module injects its own styles.css.
 *
 * @scope Public-facing chrome: status bar (faux iOS clock + battery),
 *          bottom nav (Files + Profile), sheet hosts for drawers.
 *          fd overrides via .picker / .home / .reader / .feedback classes.
 *
 * @principles
 *   - Only var(--*) tokens; no hardcoded colors.
 *   - Mobile-first column (390-400px max), centered.
 *   - No animation until user interaction (per design handoff).
 */

:root {
    --surface:        #fbfcf7;
    --surface-2:      #f3f4ee;
    --ink:            #26302a;
    --ink-soft:       #586256;
    --faint:          #8c958a;
    --line:           #dde2d4;
    --line-2:         #c6cdbb;
    --accent:         #4f7d6e;
    --accent-soft:    #e4ede7;
    --glass:          rgba(247, 249, 244, 0.74);
    --glass-edge:     rgba(79, 125, 110, 0.32);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--surface-2);
}

body {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 4rem; /* room for bottom bar */
    position: relative;
}

a { color: inherit; }
button { font-family: inherit; }

/* ── Faux status bar (iOS-style 9:41 + battery) ───────────── */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem 0.25rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
    user-select: none;
}

/* ── Bottom navigation bar ──────────────────────────────── */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--glass-edge);
}
.bottom-tab {
    appearance: none;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 0.7rem;
}
.bottom-tab .icon { font-size: 1.25rem; }
.bottom-tab.active { color: var(--accent); }

/* ── Sheet hosts (drawers) — controlled by JS ──────────── */
.sheet-host {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}
.sheet-host[data-open="true"] { pointer-events: auto; }
.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sheet-host[data-open="true"] .sheet-backdrop { opacity: 1; }
.sheet-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}
.sheet-host[data-open="true"] .sheet-panel { transform: translateY(0); }