/* v0.7 — detail polish */
.brand { gap: 0; }
.brand-mark { display: none !important; }

/* Project artwork is intentionally present, not washed into the card background. */
.card-art img { opacity: .96; filter: saturate(1.08) contrast(1.035) brightness(1.025); }
.card-art span {
  background:
    linear-gradient(90deg,
      var(--card-base) 0%,
      color-mix(in srgb, var(--card-base) 78%, transparent) 17%,
      color-mix(in srgb, var(--card-base) 10%, transparent) 72%,
      transparent 100%),
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--card-base) 9%, transparent));
}
html[data-theme="light"] .card-art img { opacity: .99; filter: saturate(1.10) contrast(1.055) brightness(.99); }
html[data-theme="light"] .card-art span {
  background:
    linear-gradient(90deg, #fff 0%, rgba(255,255,255,.58) 17%, rgba(255,255,255,.07) 72%, rgba(255,255,255,0) 100%),
    linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.03));
}

.card-type-corner {
  position: absolute;
  z-index: 5;
  top: 13px;
  right: 13px;
  margin: 0;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--card-base) 35%, transparent);
  backdrop-filter: blur(8px);
}
.card-title-row { padding-right: 30px; }
.card-platforms { margin-top: 8px; }
.card-author { margin-top: 7px; }

.gallery { overscroll-behavior-x: contain; overscroll-behavior-y: auto; }

/* Expanded-description collapse is deliberately just a quiet text action. */
.description-collapse-row { margin-top: 6px; }
.description-collapse,
.description-collapse:hover,
.description-collapse:focus-visible {
  min-height: 0;
  padding: 3px 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}
.description-collapse:hover { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; }

/* Rich Modrinth descriptions: HTML banners, linked images and tables. */
.markdown img.markdown-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 10px auto 14px;
  border: 0;
  border-radius: 10px;
  object-fit: contain;
  cursor: zoom-in;
}
.markdown a:has(> img.markdown-image) { display: block; text-decoration: none; }
.markdown table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 11px; }
.markdown th, .markdown td { padding: 7px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown th { color: var(--text); background: var(--surface-2); }
.markdown details { margin: 10px 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.markdown summary { cursor: pointer; color: var(--text); font-weight: 700; }

/* Quick jump appears only after the full long description was opened. */
.detail-jump-downloads {
  position: fixed;
  z-index: 78;
  left: calc(100vw - min(430px, 50vw));
  bottom: 17px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text-soft);
  box-shadow: 0 8px 28px color-mix(in srgb, #000 18%, transparent);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 10px;
  font-weight: 720;
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease;
}
.detail-jump-downloads .chevron-icon { width: 13px; height: 13px; }
.detail-jump-downloads:hover { border-color: color-mix(in srgb, var(--accent) 58%, var(--line)); color: var(--text); }
.detail-jump-downloads.used { opacity: 0; pointer-events: none; transform: translate(-50%, 5px); }

/* Actual source artwork sits between the version name and its status. */
.source-avatar {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
}
.source-avatar img { display: block; width: 20px; height: 20px; object-fit: contain; }
.source-avatar > span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); }
html[data-theme="light"] .source-avatar { background: transparent; }
.version-name-line { gap: 7px; }
.version-name-line .release-badge { margin-left: 0; }

/* Version channel filter: three independent checkboxes, release only by default. */
.version-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.version-channel-filter { grid-column: 1 / -1; }
.version-channel-filter > span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 700;
}
.version-channel-checks { display: flex; gap: 6px; flex-wrap: wrap; }
.version-channel {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-faint);
  cursor: pointer;
  user-select: none;
  font-size: 9px;
}
.version-channel input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.version-channel .check-box {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--field);
  box-shadow: inset 0 0 0 2px var(--field);
}
.version-channel input:checked + .check-box { background: #61d286; border-color: #61d286; }
.version-channel-beta input:checked + .check-box { background: #e7bb60; border-color: #e7bb60; }
.version-channel-alpha input:checked + .check-box { background: #df6d76; border-color: #df6d76; }
.version-channel input:checked ~ b { color: var(--text); }
.version-channel b { font-weight: 680; }

/* Click feedback for a download: a green sweep runs underneath the row content. */
.version-row > * { position: relative; z-index: 2; }
.version-row::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, #5ed786 22%, transparent) 35%, color-mix(in srgb, #5ed786 34%, transparent) 55%, transparent 100%);
  transform: translateX(-115%);
  opacity: 0;
}
.version-row.download-flash::after { animation: versionDownloadSweep .9s ease-out; }
@keyframes versionDownloadSweep {
  0% { transform: translateX(-115%); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateX(115%); opacity: 0; }
}

@media (max-width: 900px) {
  .detail-jump-downloads { left: 50vw; }
}
@media (max-width: 760px) {
  .card-type-corner { top: 10px; right: 10px; }
  .version-filters { grid-template-columns: 1fr; }
  .version-channel-filter { grid-column: auto; }
}


/* v0.8 — card corner, compact downloads, visible quick-jump */

/* The project type belongs to the whole card, not the left text column. */
.project-card { position: relative; }
.card-type-corner {
  top: 11px;
  right: 11px;
  max-width: 158px;
}
.card-title-row { padding-right: 0; }

/* Quick jump is centered inside the drawer and stays visible until files enter view. */
.detail-jump-downloads {
  left: 50%;
  right: auto;
  bottom: 14px;
  transform: translateX(-50%);
  min-height: 36px;
  padding: 0 13px;
  gap: 6px;
  opacity: 1;
  pointer-events: auto;
}
.detail-jump-downloads:hover { transform: translateX(-50%) translateY(-1px); }
.detail-jump-downloads.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(7px);
}
.detail-jump-downloads.used { opacity: 1; pointer-events: auto; transform: translateX(-50%); }

/* Version status filters sit beside the heading, not as a third form row. */
.versions-head {
  align-items: center;
  margin-bottom: 12px;
}
.versions-title { min-width: 0; }
.versions-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.version-channel-checks {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.version-channel {
  min-height: 28px;
  padding: 0 8px;
  gap: 5px;
  border-radius: 8px;
  font-size: 9px;
}
.version-channel .check-box { width: 11px; height: 11px; }
.versions-reset {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 8px;
  font-size: 9px;
}
.version-filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  margin: 0 0 10px;
}
.version-channel-filter { display: none; }

/* Restore the compact three-column download row; generic z-index rules must not move the status strip. */
.version-row {
  display: grid;
  grid-template-columns: minmax(245px, 1.35fr) minmax(155px, .72fr) 86px;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 8px 10px 8px 14px;
}
.version-row > *:not(.version-status-strip) { position: relative; z-index: 2; }
.version-status-strip {
  position: absolute !important;
  z-index: 3 !important;
  inset: 0 auto 0 0;
  width: 3px;
}
.version-primary { min-width: 0; }
.version-name-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}
.version-name-line strong {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.source-avatar {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}
.source-avatar img,
.source-avatar > span { width: 20px; height: 20px; }
.release-badge { flex: 0 0 auto; }
.version-meta-inline { margin-top: 3px; }
.version-tags-inline {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  overflow: visible;
}
.version-download {
  width: 86px;
  min-height: 32px;
  padding: 0 10px;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .card-type-corner { top: 9px; right: 9px; }
  .versions-head { align-items: flex-start; flex-direction: column; }
  .versions-head-actions { width: 100%; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; }
  .version-channel-checks { justify-content: flex-start; flex-wrap: wrap; }
  .version-filters { grid-template-columns: 1fr; }
  .version-row { grid-template-columns: minmax(0,1fr) auto; }
  .version-tags-inline { grid-column: 1 / -1; padding-left: 0; }
  .version-download { width: auto; min-width: 82px; }
}

@media (max-width: 520px) {
  .version-row { grid-template-columns: 1fr; }
  .version-tags-inline { grid-column: auto; }
  .version-download { width: 100%; }
}


/* CraftScope v0.8.2 — filter geometry, description affordance and file jump polish */

/* Keep the footer physically inside the filter card at every supported zoom. */
.filters {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.filter-heading { flex: 0 0 auto; }
.filters-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
.filter-footer {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.reset-filters-button { box-sizing: border-box; }

/* A collapsed description itself is also an expand target. */
.description-wrap.collapsed { cursor: pointer; }
.description-wrap.collapsed:hover::after {
  background: linear-gradient(transparent, color-mix(in srgb, var(--drawer-base) 97%, var(--accent) 3%) 88%);
}

/* No reset action beside Release / Beta / Alpha. */
.versions-reset { display: none !important; }

/* Empty file state uses theme variables instead of old dark-only colors. */
.versions-empty {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}
html[data-theme="light"] .versions-empty {
  border-color: var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--page));
  color: var(--muted);
}

/* A small bottom-centred suggestion inside the project drawer, not the viewport. */
.detail-jump-downloads {
  left: calc(100vw - min(430px, 50vw));
  right: auto;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  min-height: 48px;
  padding: 7px 13px 7px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text);
  box-shadow: 0 12px 36px color-mix(in srgb, #000 17%, transparent);
  backdrop-filter: blur(15px);
  text-align: left;
}
.jump-downloads-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.jump-downloads-icon .chevron-icon { width: 15px; height: 15px; }
.jump-downloads-copy { display: grid; gap: 1px; line-height: 1.15; }
.jump-downloads-copy b { font-size: 10px; font-weight: 800; color: var(--text); }
.jump-downloads-copy small { font-size: 8px; color: var(--text-faint); font-weight: 600; }
.detail-jump-downloads:hover {
  transform: translateX(-50%) translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 95%, transparent);
}
.detail-jump-downloads.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}
.detail-jump-downloads.used { transform: translateX(-50%); }
html[data-theme="light"] .detail-jump-downloads {
  box-shadow: 0 12px 34px rgba(51,66,76,.15);
}

@media (max-width: 760px) {
  .detail-jump-downloads {
    left: 50vw;
    bottom: 12px;
    min-width: 196px;
  }
}
/* The drawer transform is the containing block for this fixed control. */
.detail-jump-downloads { left: 50%; }

html[data-theme="light"] .versions-empty { background: #ffffff; }


/* Keep drawer controls outside the scroll surface so the file suggestion truly stays at the bottom. */
.drawer { overflow: hidden; }
#drawerContent {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.drawer-jump-host {
  position: absolute;
  z-index: 79;
  inset: 0;
  pointer-events: none;
}
.drawer-jump-host .detail-jump-downloads {
  position: absolute;
  left: 50%;
  bottom: 18px;
  pointer-events: auto;
}
@media (max-width: 760px) {
  .drawer-jump-host .detail-jump-downloads { left: 50%; bottom: 12px; }
}




.version-source-note {
  margin: 8px 0 10px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, #d7a94b 28%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, #d7a94b 7%, var(--surface));
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.45;
}
.compatibility-unknown-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-faint);
  background: var(--surface-2);
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}
