/* /explore in the Édito design (pages.ExplorePage): the title in Newsreader,
   the six topics whose star activity grew most against last week, then every
   topic by category (chips filter them) as cards: name and Follow, what it
   covers, how many repos it ranks this week, its #1. A search (?q=) lists the
   matching topics and repos (their rows come from list.css). */

.x-main { display: block; padding-bottom: 72px; }
.x-main:focus { outline: none; }
.x-main a:focus-visible, .x-main button:focus-visible, .x-main input:focus-visible { outline: 2px solid var(--rise); outline-offset: 2px; }

/* Head */
.x-head { max-width: 680px; padding: clamp(32px, 5vw, 56px) 0 32px; }
.x-title {
  margin: 0 0 10px; font-family: var(--font-display); font-weight: var(--display-weight); line-height: 1.08;
  font-size: calc(clamp(32px, 4.6vw, 52px) * var(--display-scale)); letter-spacing: var(--display-tracking); text-wrap: balance;
}
.x-lead { margin: 0; font-size: 17px; line-height: 1.5; }
.x-search { position: relative; max-width: 560px; margin: 20px 0 0; }
.x-search__icon { position: absolute; left: 15px; top: 15px; line-height: 0; color: var(--muted); pointer-events: none; }
.x-search__input { width: 100%; min-height: 48px; padding-left: 42px; font-size: 16px; }
.x-status { min-height: 1.5em; margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Sections */
.x-sec { padding-bottom: 40px; min-width: 0; }
.x-sec[hidden] { display: none; }
.x-sec__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.x-sec__title {
  margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); line-height: 1.2;
  font-size: calc(20px * var(--display-scale-sm)); letter-spacing: var(--display-tracking-sm);
}
.x-sec__title--solo { margin-bottom: 12px; }
.x-sec__sub { font-size: 13px; color: var(--muted); }

/* The topics growing fastest */
.x-hot { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 32px; }
.x-hot__row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 56px; padding: 8px 0;
  color: var(--text); text-decoration: none; background: linear-gradient(var(--border), var(--border)) no-repeat bottom / 100% 1px;
}
.x-hot__row:hover { color: var(--text); background-color: var(--hover); }
.x-hot__rank { font-size: 14px; color: var(--muted); }
.x-hot__body { display: flex; flex-direction: column; min-width: 0; }
.x-hot__name { font-size: 15px; font-weight: 500; }
.x-hot__meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.x-hot__delta { font-size: 15px; font-weight: 500; color: var(--muted); }
.x-hot__delta--up { color: var(--rise-text); }

/* Category chips */
.x-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.x-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--border-strong);
}
.x-chip:hover { color: var(--text); background: var(--hover); }
.x-chip[aria-current] { color: var(--rise-text); background: var(--rise-soft); box-shadow: inset 0 0 0 1px var(--rise-line); }
.x-chip__count { font-size: 11px; opacity: .75; }

/* A category */
#topic-results { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.x-cat { display: flex; flex-direction: column; gap: 14px; }
.x-cat__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.x-cat__title {
  margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); line-height: 1.2;
  font-size: calc(18px * var(--display-scale-sm)); letter-spacing: var(--display-tracking-sm);
}
.x-cat__sub { font-size: 13px; color: var(--muted); }
.x-niches { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 13px; color: var(--muted); }
.x-niches a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.x-niches a:hover { text-decoration-color: currentColor; }

/* Topic cards: the name links the topic page, and the whole card with it */
.x-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.x-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px; box-sizing: border-box;
  border-radius: 8px; background: var(--surface); box-shadow: 0 0 0 1px var(--border);
}
@media (hover: hover) { .x-card:hover { background: var(--hover); box-shadow: 0 0 0 1px var(--border-strong); } }
.x-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.x-card__names { display: flex; flex-direction: column; min-width: 0; }
.x-card__name { font-size: 16px; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.x-card__name:hover { color: var(--text); }
.x-card__name::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.x-main .x-card__name:focus-visible { outline: none; }
.x-card__name:focus-visible::after { outline: 2px solid var(--rise); outline-offset: -2px; }
.x-card__slug { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.x-follow {
  position: relative; z-index: 1; flex: none; min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  box-shadow: inset 0 0 0 1px var(--border-strong); font: inherit; font-size: 12px; color: var(--text); cursor: pointer;
}
.x-follow:hover { background: var(--raised); }
.x-follow.is-subscribed, .x-follow[aria-pressed="true"] { color: var(--rise-text); box-shadow: inset 0 0 0 1px var(--rise-line); }
.x-card__desc { flex: 1; margin: 0; font-size: 13px; color: var(--muted); }
.x-card__stats { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 12px; color: var(--muted); }
.x-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; margin: 0; padding-top: 10px; box-shadow: inset 0 1px 0 var(--border); font-size: 12px; }
.x-card__topname { display: flex; flex-direction: column; min-width: 0; }
.x-card__kicker { font-size: 11px; color: var(--muted); }
.x-card__repo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-card__gain { flex: none; font-size: 14px; font-weight: 500; color: var(--rise-text); }
.x-more { margin: 16px 0 0; font-size: 13px; color: var(--muted); }

/* A search without a topic: what to try, popular topics, clear the search */
.x-empty { display: flex; flex-direction: column; gap: 16px; max-width: 640px; padding: 4px 0 24px; }
.x-empty__body { margin: 0; font-size: 15px; color: var(--muted); }
.x-empty__chips { margin: 0; }
.x-empty__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0; font-size: 14px; }
.x-empty__clear { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 719.98px) {
  .x-chip { min-height: 44px; }
  .x-follow { min-height: 44px; }
}
