/* One figure for every way out of a page, so the link sits the same distance
   from the top of the window as from its side. The same clamp is in desk.css
   and printer.css, for the pages those dress. */
:root {
    --back-inset: clamp(18px, 2.4vw, 40px);
}

body {
    margin: 0;
    font-family: "Prompt";
}

/* Scoped to the app shell rather than set globally: the art-directed pages
   (home, dashboard, shop, the book and the shelves) do not use .page and each
   carries its own sizing model, so a bare `*` rule here would reach into them
   and shift artwork that is measured in content-box percentages. Inside the
   shell it is what stops `width: 400px` plus padding from measuring 434. */
.page,
.page *,
.page *::before,
.page *::after {
    box-sizing: border-box;
}

/* Long unbroken strings — Slack IDs, R2 URLs, pasted model links — otherwise
   set the width of whatever holds them. break-word, not anywhere: `anywhere`
   also drops the element's min-content to a single character, which lets
   table columns collapse and breaks ordinary words like "Pending" mid-word. */
.page :where(h1, h2, h3, h4, p, li, td, th, dd, dt) {
    overflow-wrap: break-word;
}

.page img,
.page video,
.page canvas {
    max-width: 100%;
}

.hidden {
    display: none;
}

/* Without this, any rule that sets `display` beats the UA stylesheet and the
   hidden attribute silently stops working. */
[hidden] {
    display: none !important;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #0066cc;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

.page {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
}

.sidebar a {
    color: inherit;
    text-decoration: none;
}

/* "log out" is a form post, so a button — dressed as the links beside it. */
.sidebar .sidebar-link {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.content {
    padding: 24px;
    min-width: 0;
}

.profile {
    padding: 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    color: black;
    text-decoration: none;
}

.profile:hover p {
    text-decoration: underline;
}

/* ---------- narrow screens ----------
   Same breakpoint as the /root theme in admin.css, so the two shells fold at
   the same width. Below it the 220px rail would eat over half a phone's
   viewport and push the content column off-screen. */
@media (max-width: 900px) {
    .page {
        grid-template-columns: minmax(0, 1fr);
        /* Stacked, the rows are auto-sized and min-height: 100vh gives them
           slack to share; stretched, that slack opens as a gap between the
           nav bar and the content. Let it fall to the bottom instead. */
        align-content: start;
    }

    .sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 16px;
        padding: 14px 18px;
        border-bottom: 1px solid #e5e5e5;
    }

    .sidebar form {
        margin: 0;
    }

    .content {
        padding: 18px;
    }

    /* Pinned to the corner it shares with the rail on desktop; once the rail
       is a top bar there is no corner left to sit in, and fixed it would
       float over whatever the page ends with. */
    .profile {
        position: static;
        padding: 18px;
        border-top: 1px solid #e5e5e5;
    }

    #pfp {
        width: 56px;
    }
}

#pfp {
    width: 96px;
    height: auto;
}

.user-pfp {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    object-fit: cover;
}

#loginButton,
#logoutButton {
    background-color: aqua;
    padding: 10px;
    border-radius: 5px;
}
