/* The Footage Board (the owner's page, views/edit/fboard.js). The brand doors are the home page's own (.brandgrid,
   .branddoor, .logoplate in edit.css); only the board's tabs, its grid of clips and its player are added here.
   Tokens only, so the light and the dark look both come for free. */
.fbpage .asleep { margin-bottom: var(--s4); }
.fb-off { align-items: center; flex-wrap: wrap; }
.fb-off > div { flex: 1 1 240px; }
.fb-off .btn { flex: none; min-height: var(--tap); }

.fbpage .tabs { margin-bottom: var(--s4); }
.fbpage .tabs button { min-height: var(--tap); }

/* Thumbnails (2026-11-17, his second word on it: "way too large now ... it needs to look like a vertical video"; the
   BIG picture he asked for is the opened viewer, not the grid). A tab of tall clips shows phone-shaped 9:16 cards about
   300 px wide; a tab of wide pictures shows 16:9 cards about 420 px wide; as many to a row as fit. One to a row on a phone. */
main:has(.fbpage) { max-width: 1560px; }
.fbgrid { display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); align-items: start; }
.fbclip { position: relative; display: flex; flex-direction: column; gap: var(--s3); min-width: 0; padding: var(--s2); }
.fbclip .cover {
  display: grid; place-items: center; flex: none; align-self: stretch; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0;
  border-radius: var(--r-md); cursor: pointer;
}
.fbgrid.wide .fbclip .cover { aspect-ratio: 16 / 9; }
.fbclip .cover img, .fbclip .cover video.peek { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* A wide clip in a tab of tall ones (or the other way round) is shown whole, not cut. */
.fbclip.odd .cover img, .fbclip.odd .cover video.peek { object-fit: contain; }
.fbclip .cover:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.fb-text { display: flex; flex: 1; flex-direction: column; gap: var(--s1); min-width: 0; padding: 0 var(--s1); }
.fb-text h3 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  font-size: 1.0625rem; line-height: 1.25; overflow-wrap: anywhere;
}
.fb-meta { color: var(--muted); font-size: var(--t-small); line-height: 1.4; overflow-wrap: anywhere; }
/* Next to every picture (2026-11-17): Delete, Auto sort, Talking, then a box for his own words. Big enough to tap. */
.fb-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.fb-acts .btn, .fb-say .btn { min-height: var(--tap); justify-content: center; }
.fb-acts .btn { width: 100%; padding-inline: var(--s2); }
.fb-acts .fb-del { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.fb-acts .fb-del:hover:not(:disabled) { background: var(--bad); color: #fff; }
.fbclip .btn:disabled { opacity: .5; cursor: default; }
.fb-say { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); align-items: stretch; }
.fb-say textarea {
  width: 100%; min-height: var(--tap); padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--paper); color: var(--ink); font: inherit; font-size: var(--t-small); line-height: 1.4; resize: vertical;
}
.fb-say textarea:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.fb-saved { color: var(--muted); font-size: var(--t-small); line-height: 1.4; overflow-wrap: anywhere; padding: 0 var(--s1); }
.fbpage.stale .fbclip { opacity: .55; filter: grayscale(1); }
.fb-foot { display: grid; justify-items: center; gap: var(--s3); margin-top: var(--s5); text-align: center; }
.fb-foot .btn { min-height: var(--tap); }

/* The player: the clip as large as the panel allows, never taller than the screen. */
.fb-player { display: grid; gap: var(--s3); }
.fb-player h2 { margin: 0; overflow-wrap: anywhere; }
/* The viewer fills the window (2026-11-17: "when I click on a video, it needs to be bigger. Especially the photos").
   The clip keeps its own shape (no bars beside a tall one), centred, as large as the window allows. */
.sheet:has(.fb-player) { max-width: min(98vw, 2400px); max-height: 97dvh; }
.fb-video { display: block; max-width: 100%; max-height: 80dvh; margin: 0 auto; border-radius: var(--r-md); }
video.fb-video { width: auto; height: 80dvh; }
/* A click on the picture (or anywhere that is not a button) closes the viewer, the way it always did. */
.fb-player .fb-video { cursor: zoom-out; }
.fb-said { font-size: var(--t-small); line-height: 1.5; max-height: 9em; overflow: auto; }
.fb-vrow { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }
.fb-vrow .btn { min-height: var(--tap); }
.fb-vrow .fb-del { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.fb-vrow .fb-del:hover:not(:disabled) { background: var(--bad); color: #fff; }
.fb-vrow .btn:disabled { opacity: .45; cursor: default; }
.fb-vrow kbd {
  margin-left: var(--s2); padding: 0 6px; border: 1px solid currentColor; border-radius: 4px; font: inherit; font-size: .75em; opacity: .7;
}
.fb-vtitle { font-weight: 600; overflow-wrap: anywhere; }
.fb-player .fb-meta, .fb-vtitle { text-align: center; }
.fb-player .actions { margin-top: var(--s2); }
.fb-player .actions .btn { min-height: var(--tap); }

@media (min-width: 700px) {
  .fbpage .tabs { flex-wrap: wrap; overflow: visible; }
  .fbgrid { gap: var(--s5) var(--s4); }
  .fbclip { padding: var(--s3) var(--s3) var(--s4); }
  .fbclip .cover { width: 100%; aspect-ratio: 9 / 16; }
  .fbgrid.wide .fbclip .cover { aspect-ratio: 16 / 9; }
  .fb-text h3 { font-size: 1.125rem; }
}
@media (min-width: 700px) {
  .fbgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fbgrid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Select (2026-11-17): a Select button beside the tabs; in Select mode a click ticks a picture, and a bar at the
   bottom of the window acts on all the ticked ones at once. */
.fb-tabrow { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s4); }
.fb-tabrow .tabs { flex: 1; min-width: 0; margin-bottom: 0; }
.fb-picktoggle { flex: none; min-height: var(--tap); }
.fb-picktoggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.fbpage.picking .fbclip { cursor: pointer; }
.fbpage.picking .fbclip .cover { cursor: pointer; position: relative; }
.fbpage.picking .fbclip .fb-acts, .fbpage.picking .fbclip .fb-say { opacity: .35; pointer-events: none; }
.fbclip.picked { outline: 3px solid var(--brass); outline-offset: -3px; }
.fbclip.picked .cover::after {
  content: "✓"; position: absolute; top: 10px; left: 10px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--brass); color: #111; font-weight: 800; font-size: 20px;
}
.fbpage.picking .fbclip:not(.picked) .cover::after {
  content: ""; position: absolute; top: 10px; left: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .35);
}
.fb-pickbar {
  position: sticky; top: 72px; z-index: 20; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center;
  margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--paper); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .6);
}
.fb-pickbar .btn { min-height: var(--tap); }
.fb-pickcount { font-weight: 600; }
.fb-gap { flex: 1; }
.fb-pickbar .fb-del { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.fb-pickbar .fb-del.armed, .fb-pickbar .fb-del:hover:not(:disabled) { background: var(--bad); color: #fff; }
.fb-pickbar .btn:disabled { opacity: .45; cursor: default; }

/* The thumbnail timeline (2026-11-17): a strip over the bottom of every video thumbnail. Slide along it to see that
   moment; click to jump there and play on. It is tall enough to hit easily and shows the time under the mouse. */
.fb-coverwrap { position: relative; }
.fb-scrub {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 34px; cursor: pointer; touch-action: none;
  border-radius: 0 0 var(--r-md) var(--r-md); background: linear-gradient(to top, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0));
}
.fb-scrub::before {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 9px; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .35);
}
.fb-scrubfill {
  position: absolute; left: 10px; bottom: 9px; height: 4px; max-width: calc(100% - 20px); width: 0; border-radius: 2px;
  background: var(--brass);
}
.fb-scrubhover {
  position: absolute; bottom: 4px; width: 2px; height: 14px; margin-left: -1px; background: #fff; opacity: 0; pointer-events: none;
}
.fb-scrubtime {
  position: absolute; right: 10px; bottom: 16px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .7); color: #fff;
  font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none;
}
.fb-scrub:hover .fb-scrubhover, .fb-scrub:hover .fb-scrubtime { opacity: 1; }
.fb-scrub:hover::before { height: 6px; bottom: 8px; }
.fb-scrub:hover .fb-scrubfill { height: 6px; bottom: 8px; }
.fbpage.picking .fb-scrub { z-index: 3; }

/* 4 videos across on a computer (his ask 2026-11-17: "I want 4 videos across instead of 5"); wide pictures 3 across. */
@media (min-width: 1100px) {
  .fbgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fbgrid.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* A hover preview shows only once it has a picture; until then the thumbnail stays, with a small "loading" ring. */
.fbclip .cover video.peek { opacity: 0; transition: opacity .15s; }
.fbclip .cover video.peek.ready { opacity: 1; }
.fbclip.peekwait .fb-coverwrap::after {
  content: ""; position: absolute; top: 12px; right: 12px; z-index: 4; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: fbspin .8s linear infinite;
}
@keyframes fbspin { to { transform: rotate(360deg); } }

