﻿/* Novela.Web/wwwroot/css/immersive.css
   ───────────────────────────────────────────────
   Immersive mode (immersive.js): the bars slide away and the page takes the whole window.
   A bar slides back while the mouse is at its edge (body.reveal-top / body.reveal-bottom).
   Kept in its own file rather than in reader.css.
   ─────────────────────────────────────────────── */

/* The page area no longer leaves room for the bars */
body.immersive {
    --reader-header-h: 0px;
    --reader-nav-h: 0px;
}

/* Top bar: lies over the page, hidden above the window until the mouse comes to the top */
body.immersive .reader-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 22;
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
    transform: translateY(-105%);
    transition: transform .2s ease;
}

body.immersive.reveal-top .reader-header { transform: none; }

/* Bottom bar: the same, from below (it keeps its own height) */
body.immersive .reader-nav-bar {
    height: 50px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .15);
    transform: translateY(105%);
    transition: transform .2s ease;
}

body.immersive.reveal-bottom .reader-nav-bar { transform: none; }

/* (Toasts, the "Back to…" button and the Read aloud player sit above the bottom bar's
   height, which is now 0 — so they move down near the edge by themselves.) */

/* The button at the top right */
.reader-header .immersive-button { font-size: 1.1rem; position: relative; }

/* Their tooltips, under the button — the same look as the bookmark's (reader.css).
   (The tooltip rule in reader.css covers only the bottom bar's buttons.) */
.reader-header .immersive-button[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    white-space: nowrap;
    background: #333;
    color: #fff;
    font: .8rem system-ui, "Segoe UI", sans-serif;
    padding: .3rem .6rem;
    border-radius: 4px;
    pointer-events: none;
    z-index: 50;
}

/* Touch screens: no tooltips. They show while the mouse is over a button; a finger "stays over" the last
   button it tapped, so the eye's "Show the bars again (I or Esc)" stuck on the screen in Immersive. */
@media (hover: none) {
    [data-tooltip]:hover::after {
        display: none !important;
    }
}
