/* The gallery's typography, colour and light.
 *
 * EVERYTHING VISUAL OUTSIDE THE CANVAS IS HERE, and the one thing
 * inside it that a stylesheet can still reach: the title, which is a
 * host element AP6 positions and CSS dresses.
 *
 * THE INFORMATION CARD AND THE CREDITS ARE NO LONGER HERE. The card is
 * an AP6Form drawn by AP6. The credits have gone further still: they
 * are a picture hung on the wall of the room itself, in perspective,
 * turning with it -- so the only text this stylesheet still dresses is
 * the gallery's name and the one line that must always be legible.
 *
 * The room's own six surfaces are not styled here -- they are palette
 * entries in ap6/colors.json, because they are painted on the canvas.
 */

:root {
    --ap6-ink: #2a2320;
    --ap6-muted: #7d7168;
    --ap6-rule: #e0d6c8;
    --ap6-panel: #fffdf9;
    --ap6-page: #f3ece1;
    --ap6-accent: #8a6a4f;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--ap6-page);
    color: var(--ap6-ink);
    font: 15px/1.6 "Segoe UI", system-ui, Arial, sans-serif;
}

/* --- the title ------------------------------------------------------ */

.ap6-title {
    max-width: 1000px;
    margin: 0 auto 18px;
    text-align: center;
}

.ap6-title h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ap6-title p {
    margin: 6px 0 0;
    color: var(--ap6-accent);
    font-size: 12px;
    letter-spacing: 0.34em;
    text-transform: uppercase;
}

/* A hairline under the title, the way a gallery card is set. */
.ap6-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 1px;
    margin: 14px auto 0;
    background: var(--ap6-accent);
    opacity: 0.5;
}

/* A LOADING LINE, NOT A HEADER. It floats over the room while the
 * pictures arrive and takes no layout space at all -- nothing is
 * allowed to push the gallery down the page any more. */
#ap6-status {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 14px;
    z-index: 4;
    margin: 0;
    text-align: center;
    color: var(--ap6-muted);
    font-size: 12px;
    letter-spacing: 0.1em;
    pointer-events: none;
}

/* A SLIM, PERMANENT DISCLAIMER. Fixed to the viewport rather than hung
 * in the room, because it has to be legible wherever the viewer is
 * looking -- which is the one thing a wall cannot promise. Takes no
 * pointer events, so it never interrupts a drag. */
#ap6-disclaimer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    margin: 0;
    padding: 6px 0 8px;
    text-align: center;

    /* READABLE OVER WHATEVER IT LANDS ON. The room turns, so the
     * surface behind this line is sometimes a pale wall and sometimes
     * the dark floor -- a single flat colour cannot be legible against
     * both. A hairline of the page's own ground, fading upward, gives
     * it something constant to sit on without reading as a bar. */
    background: linear-gradient(
        to bottom,
        rgba(243, 236, 225, 0) 0%,
        rgba(243, 236, 225, 0.72) 45%,
        rgba(243, 236, 225, 0.92) 100%);

    color: var(--ap6-ink);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    pointer-events: none;
}

/* --- the room ------------------------------------------------------- */

/* The canvas host. AP6 attaches its wrapper here and every panel
 * element becomes a child of it, positioned absolutely by C++. */
/* FULL SCREEN. The application IS the page: the session is created at
 * this element's own size, so the canvas is the viewport and the room
 * is the background rather than a picture sitting inside a document. */
#ap6-host {
    position: relative;
    width: 100%;
    height: 100%;
    background: #efe7db;
    overflow: hidden;
}

/* THE LIGHT.
 *
 * There is no lighting model in the room and there is not one here
 * either -- this is a sheet of glass over the canvas carrying a warm
 * pool where a gallery's ceiling spots would fall, and a soft darkening
 * at the corners. It costs nothing, it cannot be wrong, and it is
 * removed by deleting one rule.
 *
 * pointer-events: none is what keeps it purely visual: every click,
 * drag and wheel passes straight through to the canvas underneath, so
 * the 360 look, the focus and the zoom are untouched by it.
 *
 * THE STACKING IS EXPLICIT because the order in the document is not
 * what is wanted: this element is written into the page, and AP6
 * APPENDS its canvas afterwards, so by document order the canvas would
 * cover the light entirely. One above the canvas, and the panels one
 * above that -- an information panel must not be dimmed by the room's
 * own lighting.
 */
#ap6-light {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    background:
        radial-gradient(
            62% 46% at 50% 30%,
            rgba(255, 246, 226, 0.30) 0%,
            rgba(255, 246, 226, 0.12) 42%,
            rgba(255, 246, 226, 0) 68%),
        radial-gradient(
            120% 92% at 50% 42%,
            rgba(52, 38, 24, 0) 52%,
            rgba(52, 38, 24, 0.16) 84%,
            rgba(52, 38, 24, 0.30) 100%);
}

/* --- the title, which is a panel in the scene -----------------------
 *
 * An AP6HtmlComp like the other two. C++ gives it a box across the top
 * of the canvas; this decides what it looks like. It takes no clicks,
 * so the room can be dragged straight through it.
 */
.ap6-title-panel {
    z-index: 3;
    pointer-events: none;
    box-sizing: border-box;
    padding-top: 26px;
    text-align: center;
    background: none;
}

.ap6-title-panel h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ap6-ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.ap6-title-panel p {
    margin: 7px 0 0;
    color: var(--ap6-accent);
    font-size: 11px;
    letter-spacing: 0.36em;
    text-transform: uppercase;
}

/* --- the title, laid out for a viewport of any size ------------------
 *
 * WHY CSS OVERRIDES THE PAYLOAD'S GEOMETRY HERE, and only here.
 *
 * A box in room.ap6 is absolute pixels, and that is the right thing
 * when the canvas is a known size. This deployment is full screen, so
 * the canvas is whatever the window is -- and no fixed number is right
 * for both a phone and a 4K monitor.
 *
 * The room needs nothing: it fills its parent and derives its field of
 * view from the canvas width. The credits need nothing either any more:
 * they are canvas-painted, and their boxes are fractions of the canvas
 * in the payload itself, which is how a component with no element gets
 * to be responsive at all. The title is the only host element left, so
 * it is the only thing anchored here.
 */
.ap6-title-panel {
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: auto !important;
    height: 116px !important;
}
