/* ===== This site's own adjustments to the desktop it copies (voyeur/app/styles.css is never edited) =====
   The film box, the ticket, is drawn by home/ticket.css, which the other pages load too. */

/* The header every page has: archive (this page), about, film, performance, four words at the top left of the landing, drawn as
   the sound switch opposite them is drawn (landing.css draws the same header on the other pages). Inside a folder the
   crumb has that corner, and they are put away. */
.site-nav { position: fixed; top: 8px; left: 14px; z-index: 60; display: flex; gap: 4px; font-family: var(--font-ui); font-size: 13px; letter-spacing: var(--ls-ui); text-transform: lowercase; white-space: nowrap; }
.site-nav a { display: inline-flex; align-items: center; height: 40px; padding: 0 10px; border-radius: 8px; color: rgba(249, 247, 247, 0.5); text-decoration: none; transition: color 0.2s ease; -webkit-tap-highlight-color: transparent; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }
body.in-chapter .site-nav, .capture-mode .site-nav { display: none; }
@media (max-width: 768px) { .site-nav { top: 6px; left: 6px; gap: 2px; font-size: 14px; } .site-nav a { height: 44px; padding: 0 8px; } }
@media (max-width: 360px) { .site-nav { font-size: 13px; } .site-nav a { padding: 0 6px; } }
/* on a phone the four words take the top edge: the sound switch is its speaker alone */
@media (max-width: 768px) { .sound-toggle .sound-toggle-label { display: none; } }

/* The film box, trailer and all, stays at the bottom right on every page. On the landing the four folders keep clear
   of it; inside a folder the desk is laid out exactly as on desktop-voyeur and its icons scroll past under the box. */
@media (min-width: 1024px) {
    body.landing .split-container { padding-right: 372px; box-sizing: border-box; }
}

/* Phones. The film box is pinned to the bottom of the landing, so the four folders are laid out in the room above
   it (home.js measures the box into --film-box-h); inside a folder the box is gone and the icons have the screen. */
@media (max-width: 768px) {
    body.landing .chapter-folders { bottom: var(--film-box-h, 400px); }
    body.landing .chapter-folders .desktop-icon:nth-child(1) { top: 30%; }
    body.landing .chapter-folders .desktop-icon:nth-child(2) { top: 36%; }
    body.landing .chapter-folders .desktop-icon:nth-child(3) { top: 72%; }
    body.landing .chapter-folders .desktop-icon:nth-child(4) { top: 78%; }
    /* a long file name wraps inside its icon's width and no icon reaches past the right edge */
    .desktop-canvas .desktop-icon { translate: -10px 0; }
    .desktop-canvas .desktop-icon .label { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}

/* The sound switch: one control for everything the page plays. It is drawn as the crumb at the top left is drawn, a
   line of the page's own small type with a speaker beside it, and stands opposite it at the top right: grey with a
   crossed speaker when off (the default), the text's colour with sound waves when on. */
.sound-toggle {
    position: fixed;
    top: 8px;
    right: 14px;
    z-index: 2147483000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 10px;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(249, 247, 247, 0.5);
    font-family: var(--font-ui);
    font-size: 13px;
    letter-spacing: var(--ls-ui);
    text-transform: lowercase;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease, right 0.18s ease, opacity 0.15s ease;
}
.sound-toggle svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle .sound-toggle-speaker { fill: currentColor; }
.sound-toggle .sound-toggle-waves { display: none; }
.sound-toggle.on .sound-toggle-waves { display: inline; }
.sound-toggle.on .sound-toggle-cross { display: none; }
.sound-toggle.on { color: var(--text); }
.sound-toggle:hover { color: var(--accent); }
.sound-toggle:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }
/* something meant to be heard is playing while the sound is off: the switch blinks to the text's colour twice */
.sound-toggle.nudge { animation: sound-toggle-nudge 0.9s ease 2; }
@keyframes sound-toggle-nudge { 40% { color: var(--text); } }
@media (prefers-reduced-motion: reduce) { .sound-toggle.nudge { animation: none; } }
/* a reader or window that closes at the top right keeps its cross: home.js sees the two meet and the switch stands
   to the left of the cross (.aside) for as long as it is there */
.sound-toggle.aside { right: 60px; }

/* Phones. One row along the top: inside a folder the crumb on the left (a back arrow and "desktop" to tap, then the
   folder's name) and the switch on the right, as a speaker alone there so the crumb has the room; everywhere else the
   switch keeps its word. */
@media (max-width: 768px) {
    .sound-toggle { top: 6px; right: 6px; height: 44px; min-width: 44px; justify-content: center; font-size: 14px; }
    .sound-toggle svg { width: 22px; height: 22px; }
    .sound-toggle.aside { right: 54px; }
    body.in-chapter .sound-toggle .sound-toggle-label { display: none; }
    body.in-chapter .chapter-bar {
        top: 0; left: 0; right: 0; height: 56px; box-sizing: border-box;
        padding: 0 58px 0 16px; align-items: center; gap: 10px;
        font-size: 16px; letter-spacing: 0.5px;
        background: #000; border-bottom: 1px solid var(--border);
    }
    .chapter-crumb-home { display: inline-flex; align-items: center; gap: 8px; height: 56px; flex: none; color: rgba(249, 247, 247, 0.62); }
    .chapter-crumb-home::before { content: "\2039"; font-size: 26px; line-height: 1; margin-top: -3px; }
    .chapter-crumb-sep { flex: none; color: rgba(249, 247, 247, 0.35); }
    .chapter-crumb-name { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}

/* The diary entries are hidden for now (the four diary notepads and the two "My diary" recordings). Their places on
   the desks are kept: delete this rule and they are back where they were. */
.desktop-icon[data-key^="diary-notepad"],
.desktop-icon[data-key="nadia"],
.desktop-icon[data-key="the-end"] { display: none !important; }

/* Also hidden for now, their places kept the same way: any PDF guide (Delta's character creation guide is the one
   there is), the reddit DM thread, the maker chat channel and the inbox. */
.desktop-icon[onclick*="openPdfWindow"],
.desktop-icon[data-key="delta-guide-pdf"],
.desktop-icon[data-key="msg-reddit-dm-intro"],
.desktop-icon[data-key="maker-chat"],
.desktop-icon[data-key="inbox"] { display: none !important; }

/* Phones, inside a folder: the desk's scattered places are drawn for a wide screen and do not fit a narrow one (and
   the copied page throws every icon at random into one screen on load), so here the folder's things stand in two
   columns in the order the desk lists them, and the page scrolls down through them. These rules outrank the places
   the script writes on each icon. */
@media (max-width: 768px) {
    body.in-chapter .desktop-canvas {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 58px 16px;
        align-items: start;
        margin-top: 0 !important;
        min-height: 0 !important;
        padding: 88px 10px 160px;
        box-sizing: border-box;
    }
    body.in-chapter .desktop-canvas .band-banner { display: none !important; }
    body.in-chapter .desktop-canvas .desktop-icon {
        position: relative !important;
        top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
        translate: none;
        transform: none !important;
        width: auto !important;
        max-width: 100%;
        min-width: 0;
        justify-self: center;
        margin: 0 !important;
    }
    body.in-chapter .desktop-canvas .desktop-icon.chapter-hidden { display: none !important; }
    body.in-chapter .desktop-canvas .desktop-icon .label { max-width: 100%; }
}

/* Phones: what the desk's windows need to be used with a thumb. */
@media (max-width: 768px) {
    /* every cross is a 44px target; the strokes stay the size they were */
    .window-traffic-lights { right: 4px; }
    .traffic-close { width: 44px; height: 44px; }
    .traffic-close::before, .traffic-close::after { width: 19px; }
    .chat-float-close { top: 8px; right: 8px; width: 44px; height: 44px; padding: 0; font-size: 22px; }
    .capture-picture .bar .close { box-sizing: content-box; padding: 13px; margin: -13px -13px -13px 3px; }
    .vm-close { min-width: 44px; min-height: 44px; margin: -8px -10px -8px 0; font-size: 20px; }
    .vm-play { width: 36px; height: 36px; }

    /* a recording's player sits along the bottom of the screen, clear of the icons, not over the next row of them */
    .voice-memo-player:not(.in-card) {
        left: 12px !important; right: 12px; top: auto !important;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        width: auto; box-sizing: border-box;
        z-index: 95;
    }

    /* the inbox: the list of people above, the open conversation below, each the window's full width */
    .inbox-body { flex-direction: column; }
    .inbox-list { width: auto !important; max-width: none !important; flex: none; max-height: 42%; overflow-y: auto; border-right: none !important; border-bottom: 1px solid var(--border); }
    .inbox-thread { flex: 1; min-height: 0; width: auto !important; overflow-y: auto; }

    /* a document: the page as wide as the screen allows, its comments across the bottom */
    .iframe-window { width: calc(100% - 16px); height: 80vh; height: 80dvh; }
    .iframe-comments-panel { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-height: 45vh; }
}

/* Delta's and Chris's recordings (home.js adds the name and the role): the face, the name in bold, who they are in
   grey, the clip's title in the accent between quotation marks, then play. */
.desktop-icon.speaker-card .speaker-name { font-family: var(--font-ui); font-size: 15px; font-weight: 700; letter-spacing: 0.5px; color: var(--text); margin-top: 10px; text-align: center; }
.desktop-icon.speaker-card .speaker-role { font-family: var(--font-meta); font-size: 12px; letter-spacing: var(--ls-ui); color: rgba(226, 225, 225, 0.34); margin-top: 3px; text-align: center; white-space: nowrap; }
.desktop-icon.speaker-card .label { color: var(--accent); margin-top: 8px; max-width: 170px; line-height: 1.45; }
.desktop-icon.speaker-card .label::before { content: "\201C"; }
.desktop-icon.speaker-card .label::after { content: "\201D"; }
.desktop-icon.speaker-card .meta-group { display: none; }
.desktop-icon.speaker-card .play-pill { margin-top: 10px; }


/* Phones: a found picture's window fills the screen, its bar with the name and the cross kept along the top, the
   picture whole in the room under it. (The script writes the window's size and place for a wide screen.) */
@media (max-width: 768px) {
    .capture-picture.found-picture {
        left: 0 !important; top: 0 !important; right: 0; bottom: 0;
        width: 100% !important; height: 100%; height: 100dvh; max-width: none; box-sizing: border-box;
        border: none; border-radius: 0;
        background: #000;
        z-index: 400;
    }
    .capture-picture.found-picture .bar { min-height: 56px; box-sizing: border-box; padding: 6px 6px 6px 18px; font-size: 16px; gap: 12px; }
    /* the bar is the picture's alone (the sound button is put away while it is open): the name has its full width */
    .capture-picture.found-picture .bar .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .capture-picture.found-picture .bar .close { margin: 0; }
    .capture-picture.found-picture img { flex: 1; min-height: 0; width: 100%; height: auto; object-fit: contain; }

}

/* put away (home.js): a full-screen window's title bar has the top of a phone's screen to itself */
.sound-toggle.tucked { opacity: 0; pointer-events: none; }
