/**
 * Profile avatar catalog search — result layouts (list / grid / lanes / bricks).
 */

.pav-results-scroll {
  max-height: min(24rem, 55vh);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pav-results-scroll.pav-results-scroll--lanes {
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  padding-bottom: 0.25rem;
}

.pav-results-scroll.pav-results--message {
  max-height: none;
  overflow: visible;
}

.pav-results-inner {
  width: 100%;
}

.pav-result-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pav-result-card:hover,
.pav-result-card:focus-visible {
  background: hsl(var(--accent) / 0.45);
  border-color: hsl(var(--border));
  outline: none;
}

.pav-result-card:disabled {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
}

.pav-results-scroll.pav-results--picking {
  pointer-events: none;
}

.pav-results-wrap--picking {
  cursor: wait;
}

.pav-result-card__thumb {
  display: block;
  object-fit: cover;
  border-radius: 0.375rem;
  background: hsl(var(--muted));
  flex-shrink: 0;
}

.pav-result-card__thumb--poster {
  width: 3.5rem;
  height: 5.25rem;
}

.pav-result-card__thumb--square {
  width: 4rem;
  height: 4rem;
}

.pav-result-card__thumb--empty {
  display: block;
}

.pav-result-card__title {
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 500;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* List */
.pav-results-inner.pav-results--list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.pav-results-inner.pav-results--list .pav-result-card__thumb--poster {
  width: 4rem;
  height: 6rem;
}

.pav-results-inner.pav-results--list .pav-result-card__thumb--square {
  width: 4.5rem;
  height: 4.5rem;
}

/* Grid */
.pav-results-inner.pav-results--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  container-type: inline-size;
  container-name: pav-results;
}

@container pav-results (min-width: 420px) {
  .pav-results-inner.pav-results--grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pav-results-inner.pav-results--grid .pav-result-card {
  flex-direction: column;
  align-items: stretch;
  padding: 0.5rem;
  gap: 0.5rem;
}

.pav-results-inner.pav-results--grid .pav-result-card__thumb--poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
}

.pav-results-inner.pav-results--grid .pav-result-card__thumb--square {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.pav-results-inner.pav-results--grid .pav-result-card__title {
  -webkit-line-clamp: 2;
  font-size: 0.8125rem;
}

/* Lanes — horizontal scroll, larger tiles */
.pav-results-inner.pav-results--lanes {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.75rem;
  scroll-snap-type: x mandatory;
}

.pav-results-inner.pav-results--lanes .pav-result-card {
  flex: 0 0 auto;
  width: 7.5rem;
  flex-direction: column;
  align-items: stretch;
  scroll-snap-align: start;
  padding: 0.375rem;
}

.pav-results-inner.pav-results--lanes .pav-result-card__thumb--poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
}

.pav-results-inner.pav-results--lanes .pav-result-card__thumb--square {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.pav-results-inner.pav-results--lanes .pav-result-card__title {
  -webkit-line-clamp: 2;
  font-size: 0.75rem;
}

/* Bricks — masonry columns (layout on inner wrapper so outer scroll works) */
.pav-results-inner.pav-results--bricks {
  column-count: 2;
  column-gap: 0.75rem;
  container-type: inline-size;
  container-name: pav-results;
}

@container pav-results (min-width: 420px) {
  .pav-results-inner.pav-results--bricks {
    column-count: 3;
  }
}

.pav-results-inner.pav-results--bricks .pav-result-card {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin-bottom: 0.75rem;
  break-inside: avoid;
  padding: 0.375rem;
  gap: 0.5rem;
}

.pav-results-inner.pav-results--bricks .pav-result-card__thumb--poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
}

.pav-results-inner.pav-results--bricks .pav-result-card__thumb--square {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.pav-results-inner.pav-results--bricks .pav-result-card__title {
  -webkit-line-clamp: 2;
  font-size: 0.8125rem;
}

#profile-avatar-search-results-toolbar .pls-view-toggle {
  margin-left: auto;
}

#profile-avatar-search-results-footer {
  min-height: 1.25rem;
}

.pav-results-scroll-sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
  visibility: hidden;
}
