/* Saved list — auto-loaded for the saved-list snippet (site/snippets/search/saved-list.php).
   Figma "Basket" 322:19377: the heading, the rows (handle · title, dot ·
   italic author · bookmark), the two pill buttons at the foot of the column.
   The list fills the scrolling right column at least to its foot, where the
   buttons stay. */

.saved-list {
  position: relative; /* the print panel (#18) slides up inside it */
  display: flex;
  flex-direction: column;
  min-height: 100%;
  --fa-serif: 0;
}

/* A row is taller than a plain list item: the item adds what it needs beyond
   the list item's own spacing, at the row's size (the em of the list item's
   optical shift). */
.saved-list__item {
  padding-block: calc(var(--space-xs) - var(--space-2xs) + var(--optical-shift) / 2);
  padding-inline: var(--space-s);
  font-size: var(--fs-subheading);
}
/* Lifted while dragged (Sortable's fallback clone): on the bar colour, with a
   shadow, opaque (Sortable sets 0.8 inline). */
.saved-list__item--lifted {
  background: var(--color-bar);
  box-shadow: var(--shadow-raised);
  opacity: 1 !important;
}

/* The handle sits in the middle of the row (list-item--mark-middle); the
   bookmark stays on the first line. The row positions the handle's touch
   zone (below). */
.saved-list__row {
  position: relative;
  gap: var(--space-s);
}

.saved-list__handle {
  display: flex;
  padding: var(--space-3xs);
  margin: calc(-1 * var(--space-3xs));
  color: var(--color-fg);
  opacity: var(--opacity-dimmed);
  cursor: grab;
  touch-action: none; /* a touch on the handle drags, it does not scroll */
}
.saved-list__handle:focus-visible {
  opacity: 1;
}
/* The grip is small; the part a touch can take is not: the row's whole
   height, from its left edge to halfway into the gap before the title (the
   link stays out of it). A pseudo-element of the handle, so a touch on it is
   a touch on the handle; nothing moves. */
.saved-list__handle::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: calc(var(--space-s) + var(--grip-size) + var(--space-s) / 2);
}
.saved-list__handle .icon {
  width: var(--grip-size);
  height: var(--grip-size);
}
body.sorting,
body.sorting .saved-list__handle {
  cursor: grabbing;
}

.saved-list__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  color: inherit;
}
.saved-list__link:hover {
  text-decoration: none;
}
.saved-list__link:hover .saved-list__title > span:first-child {
  text-decoration: underline;
}
.saved-list__title {
  line-height: var(--leading-none);
}
.saved-list__dot {
  --dot-size: var(--dot-size-small);
  display: inline-block;
  vertical-align: middle;
}
.saved-list__author {
  --fa-italic: 100;
}

.saved-list__empty {
  padding: var(--space-xs) var(--space-m);
  font-size: var(--fs-subtext);
  color: var(--color-muted);
}

.saved-list__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap; /* buttons that don't fit side by side stack */
  justify-content: space-between;
  gap: var(--space-s);
  margin-top: auto;
  padding: var(--space-s) var(--space-m) var(--space-m);
}
.saved-list__foot .button {
  white-space: nowrap; /* a label never breaks; the buttons stack instead */
}
