/* A REFERENCE'S TAGS, ON THE TILE, ON HOVER (js/panel/15g-reference-tag-edit.js).

   Simon: "as we scroll over shots in the reference panel, we can see each of
   the applied tags in a subtle way." Not there until the pointer is: the
   gallery is pictures, and a tag line on every tile is what the redesign took
   away. Small, dark, translucent chips over a shade at the foot of the frame;
   a category with nothing in it is a fainter dashed "+ Shot type". */
.rl-chips {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-content: flex-end; gap: 3px;
  max-height: 62%; overflow: hidden;
  padding: 22px 6px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .5) 55%, rgba(0, 0, 0, 0));
  opacity: 0; transition: opacity .12s;
  pointer-events: none;   /* the gaps between chips are still the tile: a click there picks */
}
.reflib-item:hover .rl-chips, .reflib-item.rl-editing .rl-chips { opacity: 1; }
#reflib.tagging .rl-chips { display: none; }

.rl-chip {
  pointer-events: auto;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 6px; margin: 0;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius-sm, 3px);
  background: rgba(8, 8, 10, .66); color: rgba(255, 255, 255, .84);
  font: inherit; font-size: 10px; line-height: 13px; letter-spacing: .01em;
  cursor: pointer;
}
.rl-chip.rl-add {
  border-style: dashed; border-color: rgba(255, 255, 255, .16);
  background: rgba(8, 8, 10, .38); color: rgba(255, 255, 255, .42);
}
.rl-chip:hover, .rl-chip:focus-visible {
  outline: none; color: #fff;
  border-color: var(--accent); background: rgba(var(--accent-rgb), .28);
}
.reflib-item.rl-editing { border-color: var(--accent); }

/* ---- the list a chip opens ---- */
.rl-pop {
  position: fixed; z-index: 20; width: 210px;
  display: flex; flex-direction: column;
  border: 1px solid var(--border-dash, #28282c); border-radius: 6px;
  background: var(--card, #111113); color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(var(--accent-rgb), .12);
  font-size: 11.5px;
}
.rl-pop-h {
  padding: 8px 10px 6px; color: var(--text-dim); font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
}
.rl-pop-list { max-height: 248px; overflow-y: auto; padding: 0 4px 4px; }
.rl-pop-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 5px 8px; border: 0; border-radius: 3px;
  background: transparent; color: var(--text-dim);
  font: inherit; text-align: left; cursor: pointer;
}
.rl-pop-opt::before {
  content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%;
  border: 1px solid var(--text-faint);
}
.rl-pop-opt:hover { background: var(--card-hover); color: var(--text); }
.rl-pop-opt[aria-pressed="true"] { color: #fff; background: var(--accent-soft); }
.rl-pop-opt[aria-pressed="true"]::before { background: var(--accent); border-color: var(--accent); }
.rl-pop-foot {
  display: flex; gap: 6px; align-items: center;
  padding: 6px; border-top: 1px solid var(--border);
}
.rl-pop-new {
  flex: 1 1 auto; min-width: 0; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: 3px;
  background: var(--surface-sunk, #0d0d0f); color: var(--text); font: inherit; font-size: 11px;
}
.rl-pop-new:focus { outline: none; border-color: var(--accent); }
.rl-pop-clear {
  flex: none; padding: 4px 8px; border: 0; border-radius: 3px;
  background: transparent; color: var(--text-faint); font: inherit; font-size: 11px; cursor: pointer;
}
.rl-pop-clear:hover { color: var(--text); background: var(--card-hover); }
