/* Building a tutorial from Platform's videos (js/learn-tutorial-drag.js).
   Simon, 21 Oct 2026: "drag and drop videos from the platform tutorial space
   into the tutorials tutorial space and then rearrange in there."

   With Tutorials open on a developer account, "Platform videos" sits under
   the player in the left column and the tutorials stay on the right, so both
   are on screen to drag between. The player is a little smaller while it
   does, to leave the library room. Narrower than 960px it is stacked: the
   player, the library, then the tutorials. */
@media (min-width: 960px) {
  /* The player takes what it needs, but never more than leaves the library
     260px; it scrolls inside its own row past that (.ln-player overflow). */
  #learn-page .ln-col.ltd-on { grid-template-rows: minmax(0, max-content) minmax(260px, 1fr); }
  #learn-page .ln-col.ltd-on > .ln-player { grid-column: 1; grid-row: 1; }
  #learn-page .ln-col.ltd-on > .ltd-lib { grid-column: 1; grid-row: 2; min-height: 0; }
  #learn-page .ln-col.ltd-on > .ln-side { grid-column: 2; grid-row: 1 / span 2; }
  #learn-page .ln-col.ltd-on .ln-video { width: min(100%, calc((100vh - 330px) * 16 / 9 * .5)); }
}
.ltd-lib { display: flex; flex-direction: column; min-height: 0; border: 1px solid #2a2a31; border-radius: 6px; background: rgba(255, 255, 255, .015); }
.ltd-lib.ltd-src { border-color: rgba(var(--accent-rgb), .5); }
.ltd-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #23232a; font-size: 12.5px; flex: none; }
.ltd-lib.ltd-shut .ltd-h { border-bottom: 0; }
.ltd-tt { font-weight: 600; color: var(--text); }
.ltd-n { color: var(--text-faint); font-size: 11.5px; }
.ltd-sp { flex: 1; }
.ltd-clear[hidden], .ltd-undo[hidden] { display: none; }
.ltd-lib.ltd-shut .ltd-body { display: none; }
.ltd-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; min-height: 0; overflow-y: auto; }
.ltd-hint { font-size: 11.5px; color: var(--text-dim); line-height: 1.45; }
.ltd-q { background: var(--bg); color: var(--text); border: 1px solid #2a2a31; border-radius: 4px; padding: 6px 9px; font: inherit; font-size: 12px; }
.ltd-q:focus { outline: none; border-color: var(--accent); }
.ltd-grp + .ltd-grp { margin-top: 6px; }
.ltd-gh { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); margin: 2px 0 6px; }
.ltd-drafts .ltd-gh { color: var(--accent); }
.ltd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px 8px; }
.ltd-tile { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 3px; margin: -3px; border: 1px solid transparent; border-radius: 5px;
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.ltd-tile:hover { border-color: #33333b; }
.ltd-tile:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.ltd-tile.ltd-sel { border-color: var(--accent); background: rgba(var(--accent-rgb), .12); }
.ltd-tick { position: absolute; top: 5px; left: 5px; z-index: 2; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); border: 1.5px solid rgba(255, 255, 255, .7); color: transparent; font-size: 11px; font-weight: 700; }
.ltd-tile.ltd-sel .ltd-tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.ltd-used { position: absolute; left: 5px; bottom: 5px; z-index: 2; font-size: 10px; background: rgba(0, 0, 0, .72); color: #fff; padding: 1px 5px; border-radius: 2px; }
.ltd-t { font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltd-none { font-size: 12px; color: var(--text-faint); padding: 8px 0; }

/* the drag */
.ln-lesson.ltd-card { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.ltd-lifted { opacity: .35; }
html.ltd-dragging, html.ltd-dragging * { cursor: grabbing !important; }
.ltd-ghost { position: fixed; left: 0; top: 0; z-index: 10000; pointer-events: none; max-width: 260px; padding: 7px 11px; border-radius: 5px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 8px 26px rgba(0, 0, 0, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltd-ghost.ltd-no { background: #3a3a42; }
.ltd-mark { position: fixed; z-index: 9999; width: 3px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); pointer-events: none; }
.ltd-mark[hidden] { display: none; }
#learn-page .ln-mod.ltd-over { outline: 1px solid rgba(var(--accent-rgb), .7); outline-offset: 6px; border-radius: 4px; background: rgba(var(--accent-rgb), .05); }
#learn-page .ln-mod.ltd-over .ln-emptydrop { border-color: var(--accent); color: var(--text); }
#learn-page .ln-cat.ltd-navover { outline: 2px solid var(--accent); outline-offset: -2px; }
