/* (SHOTS PANEL DOCK) THE SHOTS AS A PANEL OF THEIR OWN -- js/panel/38b-shots-panel-dock.js.

   Simon, 16 Nov 2026: "Can we make it so the shots section, where you choose
   the shots, is an independent panel? I want to try putting it next to the
   gallery or next to the gallery viewer."

   Three places: beside Create (where it always was, and the default), beside
   the gallery, beside the viewer. Away from Create the column stands in
   #spd-host, a fixed layer seated on the LEFT strip of that panel, and the
   panel gives it the room with its own padding -- the way the viewer already
   gives the Edit room's strip its room (50-edit-view.css) -- so the panel's
   box, its seams and its name tab stay exactly where they were. */

/* SHOTS PANEL DOCK: the layer the column stands in when it is away from Create. */
#spd-host { display: none; }
html.spd-away #spd-host {
  display: flex; position: fixed; box-sizing: border-box;
  z-index: var(--z-sticky, 40);
  background: var(--bg);
}
/* SHOTS PANEL DOCK: the column fills it, and keeps every look it had beside Create (the rules on #sm-shots
   are not scoped to Create's pane). The width is the layer's, so Create's --sm-shots-w is not asked. */
html.spd-away #spd-host > #sm-shots { width: auto !important; flex: 1 1 auto; min-width: 0; height: 100%; }
/* SHOTS PANEL DOCK: the seam goes with it, on the same side it had beside Create -- the right, against the
   panel's own content. */
html.spd-away #spd-host > #sm-shots-rz {
  position: absolute; top: 0; bottom: 0; right: -4px; margin: 0; z-index: 3;
}

/* SHOTS PANEL DOCK: the panel it stands beside makes room for it. */
html.spd-gallery #gallery-pane { padding-left: calc(var(--spd-w, 225px) + 14px) !important; }
html.spd-viewer #nle-viewer { padding-left: var(--spd-w, 225px) !important; }

/* SHOTS PANEL DOCK: the header is the handle -- the six dots the panel tabs wear say so -- and the button on
   its right is the same move from a menu. Only where there are panels to stand beside (the desktop shell);
   in After Effects' single column the shots stay with Create and neither is drawn. */
.spd-btn {
  /* Negative margins so the button does not make the header any taller than its title made it. */
  flex: none; width: 20px; height: 18px; padding: 0; margin: -4px 0 -4px auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 3px; background: var(--card);
  color: var(--text-dim); cursor: pointer; opacity: .7;
}
.spd-btn svg { width: 12px; height: 12px; display: block; }
.spd-btn:hover, .spd-btn.on { border-color: var(--accent); color: var(--accent); opacity: 1; }
html:not(.nle-on) .spd-btn { display: none; }
html.nle-on #sm-shots > .sm-shots-head:first-child { cursor: grab; gap: 6px; }
html.nle-on #sm-shots > .sm-shots-head:first-child > .sec-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
html.nle-on #sm-shots > .sm-shots-head:first-child > .sec-title::before {
  content: ''; flex: none; width: 5px; height: 9px; opacity: .45;
  background-image: radial-gradient(currentColor 42%, transparent 46%);
  background-size: 2.5px 3px;
}
html.nle-on #sm-shots > .sm-shots-head:first-child:hover > .sec-title::before { opacity: .9; }
html.spd-lift #sm-shots > .sm-shots-head:first-child { cursor: grabbing; }

/* SHOTS PANEL DOCK: the menu -- the gallery's own context-menu look (.gal-ctx), a heading, a tick on the
   place it is set to, and a quiet note on a place that is not on screen right now. */
.spd-menu { min-width: 190px; }
.spd-menu .spd-mh {
  padding: 5px 9px 4px; font-size: 9.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-faint);
}
.gal-ctx.spd-menu button { display: flex; align-items: center; gap: 8px; }
.spd-menu .spd-tick { flex: none; width: 12px; text-align: center; color: var(--accent); }
.spd-menu button:hover .spd-tick { color: #fff; }
.spd-menu .spd-note { margin-left: auto; padding-left: 10px; font-size: 10px; color: var(--text-faint); }
.spd-menu button:hover .spd-note { color: rgba(255, 255, 255, .8); }

/* SHOTS PANEL DOCK: dragging the header -- each place it can go, outlined, and the strip it would take lit. */
.spd-zone {
  position: fixed; pointer-events: none; box-sizing: border-box;
  z-index: calc(var(--z-menu, 300) + 1);
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-radius: 3px;
}
.spd-zone .spd-zl {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--spd-zw, 225px); max-width: 100%;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 28px; box-sizing: border-box;
}
/* SHOTS PANEL DOCK: the name of the place, on a chip so it reads over whatever the panel has in that corner. */
.spd-zone .spd-zl > span {
  padding: 5px 9px; border-radius: 3px; white-space: nowrap;
  background: rgba(10, 10, 12, .92); border: 1px solid var(--border);
  font-size: 9.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-dim);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}
.spd-zone.hot { border-style: solid; border-color: var(--accent); }
.spd-zone.hot .spd-zl {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: inset -2px 0 0 var(--accent);
}
.spd-zone.hot .spd-zl > span { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==================== SHOTS LAYOUT DEFAULT ====================
   Simon, 17 Nov 2026 09:53: the Shots panel beside the Gallery by default, the gallery's tabs hidden, the shot
   chosen in the Shots panel; 09:54: "an All shots section, that's the equivalent of when you pick All in the
   gallery tabs." The rules for when each of these applies live in js/panel/38b-shots-panel-dock.js. */

/* SHOTS LAYOUT DEFAULT: the gallery's folder strip is hidden while the Shots panel is on screen anywhere. */
html.sld-tabs-off #shot-tabs { display: none !important; }

/* SHOTS LAYOUT DEFAULT: All shots -- the first entry, drawn as the tiles under it are (simple.js's .sm-shot),
   with the first four shots' pictures in its frame, or a grid mark while there are none. */
#sm-shots > .sld-all {
  position: relative; display: block; flex: none; box-sizing: border-box;
  width: calc(100% - 16px); margin: 0 8px 4px; padding: 5px;
  border: 1px solid transparent; border-radius: 3px; cursor: pointer; color: var(--text); text-align: left;
}
#sm-shots > .sld-all:hover { background: var(--bg-2, rgba(255, 255, 255, .04)); }
#sm-shots > .sld-all.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .10); }
#sm-shots > .sld-all.dragover { border-color: var(--accent); background: rgba(var(--accent-rgb), .16); }
#sm-shots > .sld-all:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
#sm-shots > .sld-all .th {
  display: block; position: relative; width: 100%; aspect-ratio: 21 / 9; box-sizing: border-box;
  border-radius: 3px; background: #0a0a0c; border: 1px solid var(--border); overflow: hidden;
}
#sm-shots > .sld-all .sld-mos { position: absolute; inset: 0; display: grid; gap: 1px; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
#sm-shots > .sld-all .sld-mos[data-n="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
#sm-shots > .sld-all .sld-mos[data-n="2"] { grid-template-rows: 1fr; }
#sm-shots > .sld-all .sld-mos img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; opacity: .8; }
#sm-shots > .sld-all .sld-ico {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-faint);
}
#sm-shots > .sld-all .sld-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; }
#sm-shots > .sld-all.sld-has-mos .sld-ico { display: none; }
#sm-shots > .sld-all.on .sld-ico { color: var(--accent); }
#sm-shots > .sld-all .nm {
  display: block; margin-top: 4px; font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* SHOTS LAYOUT DEFAULT: with All showing, the shot you are working in (where the next generation files) is
   marked, not lit -- one lit entry in the panel, as in the strip. */
#sm-shots.sld-all-on #sm-shotlist .sm-shot.on {
  border-color: rgba(var(--accent-rgb), .45); border-style: dashed; background: none;
}
/* SHOTS LAYOUT DEFAULT: Add shot takes dropped generations now (a new shot with them in it). */
#sm-shots .sm-addtile.dragover { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), .10); }

/* SHOTS LAYOUT DEFAULT: COMPACT ROWS, when the panel is short (beside the 260px gallery): a small 21:9
   thumbnail and the name on one line, All shots on top and Add shot at the end, and the column scrolls. */
#sm-shots.sld-compact > .sm-shots-head:first-child {
  padding: 7px 8px 5px; position: sticky; top: 0; z-index: 2; background: var(--bg);   /* the header (and its place button) stays as the rows scroll */
}
#sm-shots.sld-compact #sm-shotlist { padding: 0 6px; }
#sm-shots.sld-compact > .sld-all { width: calc(100% - 12px); margin: 0 6px 2px; }
#sm-shots.sld-compact #sm-shotlist .sm-shot { margin-bottom: 2px; }
#sm-shots.sld-compact #sm-shotlist .sm-shot,
#sm-shots.sld-compact > .sld-all,
#sm-shots.sld-compact > #sm-shot-add {
  display: flex; align-items: center; gap: 8px; padding: 3px 4px; min-height: 30px; box-sizing: border-box;
}
#sm-shots.sld-compact #sm-shotlist .sm-shot .th,
#sm-shots.sld-compact > .sld-all .th {
  flex: none; width: 50px; height: auto; aspect-ratio: 21 / 9;
}
#sm-shots.sld-compact #sm-shotlist .sm-shot .th .n { display: none; }
#sm-shots.sld-compact #sm-shotlist .sm-shot .nm,
#sm-shots.sld-compact > .sld-all .nm,
#sm-shots.sld-compact > #sm-shot-add .nm { flex: 1 1 auto; min-width: 0; margin-top: 0; }
#sm-shots.sld-compact > .sld-all .sld-ico svg { width: 12px; height: 12px; }
/* SHOTS LAYOUT DEFAULT: the delete x, centred on the row and still big enough to hit (Simon asked for a bigger
   one in this column: 24px is the floor tests/simple-shots.mjs holds it to). */
#sm-shots.sld-compact #sm-shotlist .sm-shot .x {
  top: 50%; right: 3px; transform: translateY(-50%);
  width: 24px; height: 24px; font-size: 16px; line-height: 22px;
}
#sm-shots.sld-compact #sm-shotlist .sm-shot:hover .nm { padding-right: 26px; }
#sm-shots.sld-compact > #sm-shot-add { width: calc(100% - 12px); margin: 2px 6px 8px; }
#sm-shots.sld-compact > #sm-shot-add .th { flex: none; width: 50px; height: 0; padding-bottom: 21px; }
#sm-shots.sld-compact > #sm-shot-add .sm-addplus { font-size: 15px; }
/* SHOTS LAYOUT DEFAULT: a reference slot being dragged (18f-slot-to-gallery.js) marks All shots as a place it
   can go, as it marks the strip's All tab. */
html.stg-drag #sld-all { outline: 1px dashed rgba(var(--accent-rgb, 99, 102, 241), .55); outline-offset: -2px; }
