/*
 * Quests: the catalogue of public ones, and the page one quest or one
 * invitation opens on. The cards are drawn by quests.js from the backend's
 * public catalogue. Read with base.css and pages.css.
 *
 * The quest and invitation pages are served at /q/ID and /i/CODE, so
 * nothing they need is asked for by a relative path.
 */

.eyebrow {
  margin: 0 0 0.9rem;
  font: 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink2);
}

/* ---------- The catalogue ---------- */

.quests-page {
  padding-block: clamp(3rem, 8vh, 5rem) clamp(2rem, 6vh, 4rem);
}

.quests-page .prose {
  max-width: 44rem;
}

.quests-page h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 0.92;
}

.quests-page .lead.small {
  font-size: 1rem;
  color: var(--ink2);
}

.quests-page .group-label {
  margin: 3.5rem 0 0;
  padding-top: 1rem;
  border-top: var(--rule) solid var(--ink);
  font: 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink2);
}

.quests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.quests-grid > .lead {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink2);
  font-size: 1.0625rem;
}

/* A quest is a thing to pick up, so it is the one framed object here. */
.quest-card {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 1.25rem;
  border: var(--rule) solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
}

.quest-card:focus-visible,
.quest-card:active {
  background: var(--paper2);
}

/* Only where there is a pointer: on a phone the tap left it lit. */
@media (hover: hover) {
  .quest-card:hover {
    background: var(--paper2);
  }
}

.quest-card .sym {
  margin-bottom: 0.5rem;
  font-size: 2rem;
  line-height: 1;
}

.quest-card .kind,
.quest-card .meta {
  font: 0.75rem/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink2);
}

.quest-card .name {
  font: 800 1.5rem/1.05 var(--display);
  letter-spacing: -0.02em;
}

.quest-card .rule {
  color: var(--ink2);
  font-size: 0.95rem;
  line-height: 1.45;
}

.quest-card .meta {
  margin-top: 0.4rem;
}

.quest-card .join {
  justify-self: start;
  margin-top: 0.9rem;
  padding: 0.55rem 0.9rem;
  border: 2px solid #17171a;
  border-radius: 6px;
  background: var(--lava);
  color: #17171a;
  font-size: 0.9rem;
  font-weight: 700;
}

/* The badge on offer, as an object: a mark in a ring, the name, who earns
   it. Drawn the same on a card and on a quest's own page, larger there. */
.quest-badge {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.85rem;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hair);
}

.quest-badge .mark {
  display: grid;
  grid-row: 1 / span 3;
  place-items: center;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper2);
  font-size: 1.5rem;
  line-height: 1;
}

.quest-badge .mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quest-badge .badge-eyebrow {
  font: 0.75rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink2);
}

.quest-badge .badge-name {
  font: 800 1.125rem/1.15 var(--display);
  letter-spacing: -0.02em;
}

.quest-badge .badge-who {
  color: var(--ink2);
  font-size: 0.9rem;
}

/* ---------- The way in ---------- */

.cta {
  display: grid;
  /* A track that cannot grow past the column, so a long button wraps
     instead of pushing everything under it off a 320 screen. */
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  justify-items: start;
  margin-top: 2.5rem;
}

.quests-cta {
  margin-top: 3.5rem;
}

/* ---------- One quest, one invitation ----------
 *
 * One screen, one thing to do.
 */

.invite .quest {
  margin: 1.75rem 0 0;
  padding: 1.25rem 1.4rem;
  border: var(--rule) solid var(--ink);
  border-radius: 8px;
}

.invite .quest .name {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font: 800 1.75rem/1.05 var(--display);
  letter-spacing: -0.02em;
}

.invite .quest p {
  margin: 0;
  color: var(--ink2);
}

.invite .quest #quest-about {
  margin-bottom: 0.5rem;
  font-style: italic;
}

.invite .quest .meta {
  margin-top: 0.75rem;
  font: 0.75rem/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink2);
}

.invite .quest-badge {
  max-width: 28rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
}

.invite .quest-badge .mark {
  width: 4rem;
  height: 4rem;
  font-size: 2rem;
}

.invite .quest-badge .badge-name {
  font-size: 1.5rem;
}

.invite .quest-badge .badge-who {
  font-size: 1rem;
}

.invite .open {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
}

.invite .code {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
}

.invite .code code {
  font-family: var(--mono);
  font-size: 1.125rem;
  letter-spacing: 0.12em;
}

.invite .how {
  margin-top: 1rem;
}

/* A long quest name breaks rather than running off a phone (AHO-636). */
.quests-page h1,
.quest-card .name,
.quest-badge .badge-name,
.invite .quest .name {
  overflow-wrap: break-word;
  hyphens: auto;
}
