/* wgf-titles.css - the /titles/ + /title/<slug>-<id>/ page family.
   Owner: title_app.py / title_render.py (linked through extra_css). Nothing else may use
   these classes: every selector is namespaced .wgf-ttl-*.

   Why this sheet exists (2026-09-03): the detail page's fact ledger used .wgf-facts-grid /
   .wgf-fact, which are declared ONLY in sheets this family never links (wgf-farming.css,
   wgf-housing-builder.css), so the Details block shipped as unstyled divs. Same defect the
   creature-family lane found; same fix - namespaced classes in the family's own sheet.

   Art: the icon ring is the client's own achievement frame
   (/assets/ui/achv/piece-iconframe.png), composited with the recipe proven in
   assets/wgf-achv-frame.css:352 (frame at 100% 100%, icon inset 5px).
   Colour: tokens from static/css/_tokens.css only. Slate panels, bronze rules, gold
   headings, parchment text. No green chrome, no gradients, no glows.
   Type: FrizQuadrata, the client's face, declared once in _tokens.css.
   -------------------------------------------------------------------------------------- */

/* --- identity header --------------------------------------------------------------- */

.wgf-ttl-hero {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.wgf-ttl-hero__text {
  min-width: 0;
  flex: 1 1 16rem;
}

.wgf-ttl-h1 {
  font-family: 'FrizQuadrata', var(--font-display, 'Cinzel', serif);
  margin: 0;
}

.wgf-ttl-form {
  margin: 0.35rem 0 0;
  color: var(--wgf-text, #f4ecd8);
}

/* The "<Name>" stand-in is not part of the earned title: the client greys placeholders,
   so it takes --q-poor (the poor-quality grey), never a chrome colour. */
.wgf-ttl-ph {
  color: var(--q-poor, #9d9d9d);
}

/* The client's raw CharTitles format string, quoted in the Details caption. Monospace so the
   "%s" placeholder reads as data rather than prose. Tokens only, no new colour. */
.wgf-ttl-fmt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
  color: var(--wgf-text, #f4ecd8);
  background: var(--wgf-well, #08090c);
  border: 1px solid var(--wgf-border, rgba(255, 209, 0, 0.20));
  border-radius: var(--radius-control, 4px);
  padding: 0.05rem 0.35rem;
  white-space: nowrap;
}

.wgf-ttl-chip {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--wgf-border, rgba(255, 209, 0, 0.20));
  border-radius: var(--radius-control, 4px);
  background: var(--wgf-well, #08090c);
  color: var(--wgf-gold-muted, #b5a06a);
  font-size: var(--text-sm, 0.875rem);
  vertical-align: 0.1em;
}

/* --- the client's achievement icon ring -------------------------------------------- */

.wgf-ttl-frame {
  flex: 0 0 auto;
  position: relative;
  display: inline-block;
  width: 58px;
  height: 58px;
  background: url(/assets/ui/achv/piece-iconframe.png) center / 100% 100% no-repeat;
}

.wgf-ttl-frame img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: cover;
}

/* --- fact ledger -------------------------------------------------------------------- */

.wgf-ttl-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.4rem;
  margin: 0;
}

.wgf-ttl-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  background: var(--wgf-well, #08090c);
  border: 1px solid var(--wgf-border-neutral, #2e313a);
  border-radius: var(--radius-card, 5px);
}

.wgf-ttl-fact__k {
  color: var(--wgf-neutral-text, #9b9384);
  font-size: var(--text-sm, 0.875rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wgf-ttl-fact__v {
  color: var(--wgf-text, #f4ecd8);
  text-align: right;
}

.wgf-ttl-fact__v a {
  color: var(--wgf-gold-link, #ffe375);
}

/* --- source rows (achievements / quests) -------------------------------------------- */

.wgf-ttl-srclist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.wgf-ttl-src {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.6rem;
  background: var(--wgf-panel-1, #14161c);
  border: 1px solid var(--wgf-border-neutral, #2e313a);
  border-radius: var(--radius-card, 5px);
}

.wgf-ttl-src .wgf-ttl-frame {
  width: 46px;
  height: 46px;
}

.wgf-ttl-src__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.wgf-ttl-src__name {
  color: var(--wgf-gold-link, #ffe375);
  font-family: 'FrizQuadrata', var(--font-display, 'Cinzel', serif);
}

.wgf-ttl-src__meta,
.wgf-ttl-src__items {
  color: var(--wgf-neutral-text, #9b9384);
  font-size: var(--text-sm, 0.875rem);
}

.wgf-ttl-src__items a {
  color: var(--wgf-gold-link, #ffe375);
}

/* --- hub header art ------------------------------------------------------------------ */

.wgf-ttl-art {
  margin: 0 0 0.9rem;
  border: 1px solid var(--wgf-metal, #6e5a2a);
  border-radius: var(--radius-card, 5px);
  overflow: hidden;
  line-height: 0;
}

.wgf-ttl-art img {
  display: block;
  width: 100%;
  height: clamp(110px, 20vw, 210px);
  object-fit: cover;
  object-position: center 35%;
}

/* --- hub source filter row (buttons themselves are .rd-type-btn, wgf-chrome.css) ------- */

.wgf-ttl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

/* --- hub counts strip ----------------------------------------------------------------- */

.wgf-ttl-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}

.wgf-ttl-counts li {
  padding: 0.3rem 0.65rem;
  background: var(--wgf-well, #08090c);
  border: 1px solid var(--wgf-border-neutral, #2e313a);
  border-radius: var(--radius-control, 4px);
  color: var(--wgf-text, #f4ecd8);
  font-size: var(--text-sm, 0.875rem);
}

.wgf-ttl-counts b {
  color: var(--wgf-gold-primary, #ffd100);
  font-weight: 700;
}
