/* A workspace pane (UI-12, design/runs/UI-12/): its layer, the scroll-edge fades under its top row and its
   format bar, and its file's name over it in the top row. The rest of the frame is workspace.css. */

.sheet {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  /* how far its name keeps in from each side: 12 clear of the top row's clusters where they're over it
     (shell.css's row variables), and the same at both sides, so the name stays centred over the pane */
  --name-l: 12px;
  --name-r: 12px;
  --name-in: max(var(--name-l), var(--name-r));
}
.sheet > * { transition: opacity 200ms var(--ease); }
/* each pane is its own layer, the one in use on top (UI-12): the format bar sliding into it from the other pane
   passes over that pane's name, tabs and fades, not under them; and what floats inside the note (the table
   and attachment bars) stays under its pane's top row, tabs and format bar */
.sheet { isolation: isolate; }
.panes > .sheet.pane-on { z-index: 1; }
.sheet-scroll { isolation: isolate; }
.sheet-left { --name-l: max(12px, calc(var(--tb-l) + var(--lead-w, 0px) + 12px - var(--main-l))); }
.sheet:last-child { --name-r: max(12px, calc(var(--tb-rx) + var(--tb-rw, 0px) + 12px - var(--main-r))); }
/* the scroll-edge fades, plain gradients (UI-12): under the top row and the tab bar, solid to 82% of 112;
   at the bottom, under the format bar, 84 tall. Per pane, so a dimmed pane's tabs stay over its fade */
.sheet::before,
.sheet::after {
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  content: "";
  pointer-events: none;
}
.sheet::before { top: 0; height: 112px; background: linear-gradient(to bottom, var(--bg) 0, var(--bg) 82%, var(--bg-0)); }
.sheet::after { bottom: 0; height: 84px; background: linear-gradient(to bottom, var(--bg-0), var(--bg) 60%); }

/* the file's name, over its pane in the top row (UI-12): it is the note's title, and renames in place
   (title-rename.js). 15/600, one line; its words 12 clear of the row's clusters, centred on the pane */
.sheet > .note-title,
.sheet > .note-title-in {
  position: absolute;
  z-index: 5;
  top: 14px;
  box-sizing: border-box;
  height: 28px;
  margin: 0;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--fg-strong);
  font: 600 15px/28px var(--font-ui);
  letter-spacing: normal;
  white-space: nowrap;
}
.sheet > .note-title {
  left: 50%;
  max-width: calc(100% - 2 * var(--name-in) + 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  transition: background-color 120ms var(--ease), opacity 200ms var(--ease);
}
/* the field: the name's room, its words centred where the name's were */
.sheet > .note-title-in {
  left: calc(var(--name-in) - 6px);
  width: calc(100% - 2 * var(--name-in) + 12px);
  border: 0;
  outline: none;
  background: var(--fill);
  box-shadow: 0 0 0 2px var(--accent);
  text-align: center;
}
.sheet > .note-title[hidden] { display: none; }
.sheet > .note-title.no-room { visibility: hidden; }
/* the name renames in place on a click (title-rename.js): a quiet fill on hover says it can; only a note
   that can be edited can be renamed */
.sheet:has(.editor[contenteditable="true"]) > .note-title { cursor: text; }
@media (hover: hover) { .sheet:has(.editor[contenteditable="true"]) > .note-title:hover { background-color: var(--fill); } }
