/*
 * Additive stylesheet.
 *
 * The recovered original stylesheets (/_astro/about.BEPzA-OU.css and
 * /_astro/about.D4vrQl3h.css) are served verbatim and define the entire visual
 * system. This file only fills in classes used by markup that the archive did
 * not expose, such as the favourite button, the metadata sections inside an
 * opened card and the autocomplete rows. Every value is expressed with the
 * original custom properties so all four themes keep working.
 */

/* ---------------------------------------------------------------- brand */
.cardQualityNote {
  font-size: 0.6875rem;
  color: var(--muted);
  padding: 0.375rem 0.625rem;
  border-top: 1px solid var(--border);
}

.cardQualityNote a {
  color: var(--accent-text);
}

.creditPanel h2 {
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------- cards */
.cardImg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.cardMediaLink {
  display: block;
  width: 100%;
  height: 100%;
}

.cardPrice {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  z-index: 1;
  white-space: nowrap;
}

.cardFav {
  position: absolute;
  top: 0.375rem;
  left: 0.375rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}

.card:hover .cardFav,
.cardFav:focus-visible,
.cardFav.active {
  opacity: 1;
}

.cardFav:hover {
  color: var(--accent);
}

.cardFav.active {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent), transparent 55%);
}

.cardBadgeRow {
  position: absolute;
  left: 0.375rem;
  bottom: 0.375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: calc(100% - 0.75rem);
  pointer-events: none;
}

.cardMeta {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cardMeta .badgeNew {
  color: var(--danger);
  font-weight: 600;
}

.cardBio {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.cardAuthorAvatar {
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.cardAuthorName {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cardLikes {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cardExploreBtn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 3px;
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  cursor: pointer;
  white-space: nowrap;
}

.cardExploreBtn:hover {
  background: var(--item-hover);
}

/* ------------------------------------------------- opened metadata panel */
.cardMetaSection {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--border);
}

.cardMetaSection:last-child {
  border-bottom: 0;
}

.cardMetaLabel {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.cardMetaBio {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.cardMetaGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem 0.5rem;
  font-size: 0.75rem;
}

.cardMetaGrid > div {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  min-width: 0;
}

.cardMetaKey {
  color: var(--muted);
  font-size: 0.6875rem;
}

.cardMetaVal {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cardCategoryList {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cardCategoryItem {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  font-size: 0.75rem;
}

.cardCategoryItemName {
  color: var(--text);
}

.cardCategoryItemSub {
  color: var(--muted);
  font-size: 0.6875rem;
}

.cardCategoryBadge {
  margin-left: auto;
  font-size: 0.625rem;
  color: var(--accent-text);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.25rem;
}

.cardTagList {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.cardVarList {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cardVarItem {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.cardVarItem > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cardVarItem > span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex: 0 0 auto;
}

.cardLinked {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.cardLinkedItemBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-size: 0.6875rem;
  padding: 0.125rem 0.25rem;
  cursor: pointer;
}

.cardLinkedItemBtn:hover {
  background: var(--item-hover);
}

.cardLinkedImg {
  border-radius: 2px;
  object-fit: cover;
}

.cardLinkedName {
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cardLinkedEmpty {
  font-size: 0.75rem;
  color: var(--muted);
}

.cardBadgeMore {
  cursor: pointer;
  pointer-events: auto;
}

/* ---------------------------------------------------------------- popups */
.popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 15rem;
  max-width: 20rem;
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
}

.popup[hidden] {
  display: none;
}

.popup .fieldRow {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
}

.popup .subhead {
  margin: 0 0 0.25rem 1.375rem;
  font-size: 0.6875rem;
  color: var(--muted);
}

.tracePopup {
  right: auto;
  left: 0;
  min-width: 17rem;
}

.traceTitle {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.traceRow {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.traceLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.traceMs {
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  color: var(--text);
}

.traceTotal {
  border-top: 1px solid var(--border);
  padding-top: 0.25rem;
  font-weight: 600;
  color: var(--text);
}

/* ------------------------------------------------- multi select rows */
.msRow {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.1875rem 0.375rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.msRow:hover {
  background: var(--item-hover);
}

.msBox {
  flex: 0 0 auto;
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
}

.msBox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.msIcon {
  border-radius: 2px;
  object-fit: cover;
  flex: 0 0 auto;
}

.msLabel {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msCount {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.6875rem;
}

.msSelected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.125rem 0 0.375rem;
}

.chip.chipActive {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-color: color-mix(in oklab, var(--accent), var(--border) 40%);
  color: var(--text);
  cursor: pointer;
}

.chipX {
  color: var(--muted);
}

/* ---------------------------------------------------------------- tree */
.catTreeChildren {
  padding-left: 1.125rem;
}

.catTreeChildren[hidden] {
  display: none;
}

.catTreeCount {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-left: 0.375rem;
}

.catTreeExpand.open svg {
  transform: rotate(0deg);
}

.catTreeExpand svg {
  transform: rotate(-90deg);
  transition: transform 0.12s ease;
}

.catTreeCheck.checked .catTreeBox {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------------------------------------------------------------- misc */
.inputClearBtn {
  position: absolute;
  right: 0.375rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.inputClearBtn:hover {
  color: var(--text);
}

.searchNavBtn {
  padding: 0.25rem 0.375rem;
}

.searchNavBtn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.searchRow {
  align-items: center;
  gap: 0.25rem;
}

.emptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 3rem 1rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
}

.emptyState[hidden] {
  display: none;
}

.emptyHint {
  font-size: 0.8125rem;
  color: var(--muted);
}

.linkBtn {
  border: 0;
  background: transparent;
  color: var(--accent-text);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.filtersClearBtn {
  margin-left: auto;
}

.filtersInfoBarActive .filtersClearBtn {
  color: var(--accent-text);
}

.rateLimitMsg {
  color: var(--danger);
  font-size: 0.75rem;
}

.pagerNum.active {
  color: var(--accent-text);
  border-color: color-mix(in oklab, var(--accent), var(--border) 50%);
  font-weight: 600;
}

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 0.5rem);
  z-index: 100;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.8125rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------ skeleton */
.card.skel {
  pointer-events: none;
}

/* the topbar settings cluster needs a minimum width for the three selects */
.topbarSettings .settingsInline {
  gap: 0.5rem;
}

/* keep the sidebar scrollable on short viewports, as the original did */
.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
}


/* category rows are filtered per view; keep the hidden attribute authoritative */
.catTreeRow[hidden],
.catTreeChildren[hidden] {
  display: none !important;
}

/* the price row carries three labels plus the free-only checkbox; let it wrap */
.rsHead {
  flex-wrap: wrap;
  row-gap: 0.25rem;
}

.rsValues {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}



/* ------------------------------------------------------------ mobile filter overlay */
/*
 * The recovered sheet turns the rail into `display: contents` below 1020px and
 * hides .desktopFilters, showing only the floating trigger. The overlay half of
 * that mechanism was never in the recovered CSS, so it is added here, scoped to
 * the open state only: when closed, nothing is rendered and the sheet's own rules
 * stay in charge.
 */
@media (max-width: 1020px) {
  .sidebar.filters-open {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 98;
    width: min(92vw, 360px);
    overflow-y: auto;
    padding: 0.625rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5), 0 6px 28px rgba(0, 0, 0, 0.45);
  }

  .sidebar.filters-open .desktopFilters {
    display: block;
  }
}

/* the toggle strips put the label left and the count right */
.cardToggle > span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cardToggle[aria-expanded="true"] > span:last-child {
  color: var(--accent);
}
/* ------------------------------------------------------------ brand lockup */
/*
 * The brand is now two lines: the wordmark, and beneath it a quiet memoriam for
 * the site this archive preserves. The topbar sizes to its content, so this costs
 * about eleven pixels of height and nothing else.
 */
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  height: 100%;
  white-space: nowrap;
}

.brand > a {
  line-height: 0;
}

.brandRip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.55;
  transition: opacity 0.12s ease;
}

.brandRip:hover,
.brandRip:focus-visible {
  opacity: 1;
}

.brandRipText {
  font-family: var(--font-mono, ui-monospace, Consolas, monospace);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brandRipLogo {
  height: 8px;
  width: auto;
  display: block;
}

/* theme toggling mirrors the recovered rule for .brandLogo */
.brandRipLogoLight {
  display: none;
}

:root[data-theme="linen"] .brandRipLogoDark,
:root[data-theme="cloud"] .brandRipLogoDark {
  display: none;
}

:root[data-theme="linen"] .brandRipLogoLight,
:root[data-theme="cloud"] .brandRipLogoLight {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .brandRip {
    transition: none;
  }
}
/* ------------------------------------------------------------ infinite scroll */
/* the sentinel sits under the grid and holds the loading dots or the end marker */
.scrollSentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 0;
  min-height: 2.5rem;
  color: var(--muted);
  font-family: var(--font-mono, ui-monospace, Consolas, monospace);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scrollSentinel[hidden] {
  display: none;
}

.scrollSentinel[data-state="end"] {
  border-top: 1px solid var(--border);
  margin-top: 0.875rem;
}

/* with infinite scroll on, the pager is redundant */
body.isInfinite .pager {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .barInfiniteKnob,
  .barInfiniteTrack {
    transition: none;
  }
}
