/* Contract: contracts/web/rules.md
 * Folders inside a project: the strip above the grid. web/project-folder-strip.js.
 *
 * Big targets, on purpose. These are dropped onto from a trackpad by somebody
 * who has lost work to a missed drop before, so a tile is a generous rectangle
 * and every crumb is a button with room around it.
 */

.ptree {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 20px; border-bottom: 1px solid var(--line);
}
.ptree[hidden] { display: none; }
.ptree.on { padding: 14px 20px; background: var(--panel-2); }

.ptree-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ptree-top .ghost { height: 34px; padding: 0 14px; font-size: 13px; }
/* Out of folder view the switch is the only thing here, so it sits at the end
   of the row rather than alone at the start of it. */
#ptree-toggle { margin-left: auto; }
.ptree.on #ptree-new { margin-left: auto; }
.ptree.on #ptree-toggle { margin-left: 0; }

.ptree-crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; }
.ptree-crumb {
  border: 1px solid transparent; border-radius: 8px; background: none;
  padding: 6px 10px; font: inherit; font-size: 14px; color: var(--ink-dim); cursor: pointer;
}
.ptree-crumb:hover { color: var(--ink); border-color: var(--line); }
.ptree-crumb.here { color: var(--ink); font-weight: 600; cursor: default; }
.ptree-crumb.here:hover { border-color: transparent; }
.ptree-sep { color: var(--ink-dim); padding: 0 2px; }
/* While pictures are being dragged, every crumb above you says it will take them. */
body.dragging-assets .ptree-crumb:not(.here) { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.ptree-tiles {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.ptree-tiles:empty { display: none; }
.ptree-tile {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.ptree-tile:hover { border-color: var(--ink-dim); }
.ptree-tile svg { width: 26px; height: 26px; flex: none; color: var(--accent); }
.ptree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ptree-n { flex: none; font-size: 12px; color: var(--ink-dim); }
body.dragging-assets .ptree-tile { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.ptree-hint { font-size: 12px; }

/* The tree, in the chooser the card menu opens. */
.pfolderpick-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; min-width: 320px; }
.pfolderpick-row {
  border: 1px solid transparent; border-radius: 8px; background: none; text-align: left;
  padding: 9px 12px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
}
.pfolderpick-row:hover:not(:disabled) { border-color: var(--line); background: var(--panel-2); }
.pfolderpick-row:disabled { color: var(--ink-dim); cursor: default; }

/* A file's folders in the inspector: the name opens it, the × takes the file out. */
.inplace { display: inline-flex; align-items: stretch; }
.inplace .tag.link { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.inplace-out {
  border: 1px solid var(--line); border-left: none; border-radius: 0 6px 6px 0;
  background: none; color: var(--ink-dim); font: inherit; font-size: 13px; padding: 0 9px; cursor: pointer;
}
.inplace-out:hover { color: var(--accent); border-color: var(--accent); }
