/* Images → PDF page list (/tools/jpg-to-pdf). Loaded only on those pages, after tool.css. */

.pdf-list__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.pdf-list__count {
  margin: 0;
  font-weight: 600;
}

.pdf-list__header .is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.pdf-pages {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdf-page {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.pdf-page__thumb {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid var(--color-border); /* keeps white pages (receipts, documents) visible */
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--color-surface);
}

.pdf-page__info {
  display: grid;
  flex: 1;
  min-width: 0;
}

.pdf-page__number {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Long file names wrap to two lines instead of being cut to a few characters on phones. */
.pdf-page__name {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 600;
  overflow-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.pdf-page__meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.pdf-page__actions {
  display: flex;
  flex: none;
}

.pdf-page__button {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  padding: 0;
}

.pdf-page__button:disabled {
  opacity: 0.35;
}

/* Phones: the buttons move to their own row so the file name gets the full width. */
@media (max-width: 36rem) {
  .pdf-page {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: var(--space-1);
  }

  .pdf-page__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: calc(var(--space-1) * -1);
  }
}

/* The page list also accepts dropped files. */
.tool-stage.is-dragover {
  outline: 2px dashed var(--color-brand);
  outline-offset: var(--space-2);
  border-radius: var(--radius);
}
