/* Quiet's catalog: the title and its line, the search, filters, tag and
   sort, the tag being filtered, then the games and More. */

/* The page's own column, in place of the frame's padding, so its edge is
   the navbar's at every width. */
.q-main > div:has(.q-catalog) {
  padding: 0;
}

.q-wrap.q-catalog {
  padding-top: 48px;
  padding-bottom: 72px;
}

.q-catalog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.q-catalog-intro {
  min-width: 0;
  max-width: 640px;
}

.q-catalog [data-part="page-title"] {
  margin: 0 0 8px;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: rgb(var(--c-heading));
}

.q-catalog-text {
  margin: 0;
  font-size: 18px;
  color: rgb(var(--c-secondary));
}

.q-catalog [data-part="card-grid"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 20px;
}

.q-catalog [data-part="card"] {
  padding: 16px;
}

.q-catalog [data-part="card-title"] {
  font-size: 17px;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

.q-catalog [data-part="card-text"] {
  margin-top: 4px;
  font-size: 14px;
  color: rgb(var(--c-secondary));
}

.q-catalog [data-part="card-meta"] {
  margin-top: 8px;
  font-size: 13px;
  color: rgb(var(--c-muted));
}

.q-catalog [data-part="empty"] {
  color: rgb(var(--c-muted));
}

/* The search, the player count, the tag and the sort: one row, the search
   growing; on a phone the search takes its own row and the three selects
   share one. */
.q-catalog [data-part="filters"] {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin: 0 0 28px;
}

.q-catalog [data-part="catalog-search"],
.q-catalog [data-part="catalog-filters"],
.q-catalog [data-part="catalog-tags"],
.q-catalog [data-part="catalog-sort"] {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.q-catalog [data-part="catalog-search"] {
  flex: 1 1 320px;
}

.q-catalog [data-part="catalog-filters"],
.q-catalog [data-part="catalog-tags"],
.q-catalog [data-part="catalog-sort"] {
  position: relative;
  flex: 0 0 160px;
}

.q-catalog [data-part="filters"] label {
  font-size: 14px;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

.q-catalog [data-part="filters"] input,
.q-catalog [data-part="filters"] select {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgb(var(--q-input-edge, var(--c-edge)));
  border-radius: 6px;
  background-color: rgb(var(--c-surface));
  color: rgb(var(--c-primary));
  font: inherit;
  font-size: 15px;
  box-shadow: none;
}

.q-catalog [data-part="filters"] input::placeholder {
  color: rgb(var(--c-placeholder));
  opacity: 1;
}

/* The selects' own arrow gives way to Quiet's chevron, drawn by the field
   in the muted ink, with room kept so it never covers the value. */
.q-catalog [data-part="filters"] select {
  padding-right: 40px;
  background-image: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.q-catalog [data-part="catalog-filters"]::after,
.q-catalog [data-part="catalog-tags"]::after,
.q-catalog [data-part="catalog-sort"]::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 14px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  background: rgb(var(--c-muted));
  -webkit-mask: url("assets/icon-chevron-down.svg") center / contain no-repeat;
  mask: url("assets/icon-chevron-down.svg") center / contain no-repeat;
}

.q-catalog [data-part="filters"] input:hover,
.q-catalog [data-part="filters"] select:hover {
  border-color: rgb(var(--c-muted));
}

.q-catalog [data-part="filters"] input:focus,
.q-catalog [data-part="filters"] select:focus {
  outline: none;
  border-color: rgb(var(--c-focus));
  box-shadow: 0 0 0 1px rgb(var(--c-focus));
}

/* Tagged x · Clear: a muted caption above the games, Clear in the accent. */
.q-catalog [data-part="tag-filter"] {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-size: 14px;
  color: rgb(var(--c-muted));
}

.q-catalog [data-part="tag-filter"] a {
  color: rgb(var(--c-accent));
  text-decoration: none;
}

.q-catalog [data-part="tag-filter"] a:hover {
  color: rgb(var(--c-accent-hover));
  text-decoration: underline;
}

/* A card's tags, below its line. */
.q-catalog [data-part="card-tags"] {
  margin-top: 10px;
}

/* More: Quiet's secondary button. */
.q-catalog [data-part="more"] {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 6px;
  border: 1px solid rgb(var(--c-edge));
  background: rgb(var(--c-surface));
  color: rgb(var(--c-primary));
  font-size: 15px;
  font-weight: 600;
}

.q-catalog [data-part="more"]:hover {
  background: rgb(var(--c-surface-muted));
}

@media (max-width: 639px) {
  .q-catalog [data-part="page-title"] {
    font-size: 36px;
  }

  .q-catalog [data-part="catalog-search"] {
    flex-basis: 100%;
  }

  .q-catalog [data-part="catalog-filters"],
  .q-catalog [data-part="catalog-tags"],
  .q-catalog [data-part="catalog-sort"] {
    flex: 1 1 0;
  }
}

/* The layout's own column and button: its CSS stands alone, since it can be
   picked under another theme, whose theme.css this page loads instead. */
.q-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.q-button {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid rgb(var(--c-edge));
  background: rgb(var(--c-surface));
  color: rgb(var(--c-primary));
  font-size: 15px;
  font-weight: 600;
}

.q-button:hover {
  background: rgb(var(--c-surface-muted));
}

.q-button-quiet {
  border-color: transparent;
  background: transparent;
}

.q-button-code::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 8px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("assets/icon-code.svg") center / contain no-repeat;
  mask: url("assets/icon-code.svg") center / contain no-repeat;
}

@media (max-width: 639px) {
  .q-wrap {
    padding: 0 16px;
  }
}
