/* =============================================
   KingshotPro — Wiki layer  (pivot 2026-06-13)
   Reusable components for the verified wiki + community hub.
   Builds on css/style.css tokens (--bg, --gold, --surface, etc.).
   ============================================= */

:root {
  --gold-2:     #ffd970;
  --parchment:  #f0c040;
  --verified:   #4caf82;
  --community:  #5c8ce0;
  --unconfirmed:#c8923a;
  --shadow-lg:  0 18px 50px rgba(0,0,0,0.55);
  --ring:       0 0 0 1px var(--border);
}

/* ---------- HERO ---------- */
.wiki-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 64px 20px 56px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 50% -10%, rgba(240,192,64,0.16), transparent 55%),
    linear-gradient(180deg, var(--surface-2), var(--surface) 70%);
  border: 1px solid var(--border);
  margin-bottom: 28px;
}
.wiki-hero::after {
  /* faint hex grid texture */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(transparent 0, transparent 31px, rgba(240,192,64,0.04) 32px),
    linear-gradient(90deg, transparent 0, transparent 31px, rgba(240,192,64,0.04) 32px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: radial-gradient(80% 80% at 50% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 80% at 50% 30%, #000, transparent 75%);
}
.wiki-hero > * { position: relative; z-index: 1; }

.wiki-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold); opacity: 0.9; margin-bottom: 18px;
  padding: 6px 14px; border: 1px solid var(--gold-dim); border-radius: 999px;
  background: rgba(240,192,64,0.06);
}
.wiki-h1 {
  font-size: clamp(30px, 5.4vw, 50px);
  line-height: 1.05; font-weight: 800; letter-spacing: -1px;
  margin: 0 auto 16px; max-width: 16ch;
}
.wiki-h1 .grad {
  background: linear-gradient(120deg, var(--gold-2), var(--gold) 45%, var(--gold-dim));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wiki-sub {
  font-size: clamp(15px, 2.2vw, 18px); color: var(--text-muted);
  max-width: 60ch; margin: 0 auto 28px; line-height: 1.6;
}

/* ---------- SEARCH ---------- */
.wiki-search { position: relative; max-width: 560px; margin: 0 auto; text-align: left; }
.wiki-search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px 6px 4px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wiki-search-box:focus-within {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.wiki-search-icon { font-size: 18px; opacity: 0.7; }
.wiki-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 16px; padding: 12px 0;
}
.wiki-search-input::placeholder { color: var(--text-dim); }
.wiki-search-go {
  background: var(--gold); color: #1a1505; border: none;
  font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 9px;
  cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.wiki-search-go:hover { background: var(--gold-2); }
.wiki-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: 360px; overflow-y: auto; z-index: 50; padding: 6px;
  display: none;
}
.wiki-search-results.open { display: block; }
.wiki-search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  text-decoration: none; color: var(--text);
}
.wiki-search-item:hover, .wiki-search-item.sel { background: var(--surface); }
.wiki-search-item .si-icon { font-size: 18px; width: 22px; text-align: center; }
.wiki-search-item .si-title { font-weight: 600; font-size: 14px; }
.wiki-search-item .si-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wiki-search-item .si-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.wiki-search-item .si-cat { font-size: 11px; color: var(--text-muted); margin-left: auto; padding-left: 8px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px; }
.wiki-search-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ---------- STAGE BAND ---------- */
.stage-band {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 26px;
}
.stage-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: all 0.15s;
}
.stage-chip:hover { border-color: var(--gold-dim); color: var(--gold); text-decoration: none; transform: translateY(-1px); }
.stage-chip .sc-emoji { font-size: 15px; }

/* ---------- TRUST PILLARS ---------- */
.trust-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0;
}
.trust-pillar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 20px; text-align: center;
}
.trust-icon {
  font-size: 26px; width: 54px; height: 54px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--gold-glow); border: 1px solid var(--gold-dim);
}
.trust-pillar h3 { font-size: 15px; margin-bottom: 6px; color: var(--text); }
.trust-pillar p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ---------- HUB CARDS ---------- */
.hub-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.hub-card {
  display: block; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; text-decoration: none; color: var(--text);
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.hub-card:hover {
  transform: translateY(-3px); border-color: var(--gold-dim);
  box-shadow: var(--shadow-lg); text-decoration: none;
}
.hub-card-icon {
  font-size: 30px; width: 58px; height: 58px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--gold-glow); border: 1px solid var(--gold-dim);
}
.hub-card-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.hub-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 14px; }
.hub-card-count {
  font-size: 12px; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.hub-card-arrow { position: absolute; top: 22px; right: 22px; color: var(--text-dim); font-size: 18px; transition: color 0.16s, transform 0.16s; }
.hub-card:hover .hub-card-arrow { color: var(--gold); transform: translateX(3px); }

/* ---------- PROVENANCE BADGES (the Canon standard) ---------- */
/* Every verifiable fact in the wiki carries one of these. */
.prov-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  vertical-align: middle;
}
.prov-verified   { color: var(--verified);    background: rgba(76,175,130,0.12);  border: 1px solid rgba(76,175,130,0.45); }
.prov-community  { color: var(--community);    background: rgba(92,140,224,0.12);  border: 1px solid rgba(92,140,224,0.45); }
.prov-unconfirmed{ color: var(--unconfirmed);  background: rgba(200,146,58,0.12);  border: 1px solid rgba(200,146,58,0.45); }
.prov-badge .pb-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.prov-date { font-size: 11px; color: var(--text-dim); margin-left: 6px; }

/* Inline source citation */
.cite {
  font-size: 11px; color: var(--text-muted); text-decoration: none;
  border-bottom: 1px dotted var(--text-dim);
}
.cite:hover { color: var(--gold); border-color: var(--gold); text-decoration: none; }
.cite-sup { font-size: 10px; vertical-align: super; color: var(--community); cursor: help; }

/* A small legend block explaining the badges (drop into any canon page) */
.prov-legend {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  font-size: 12px; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; margin: 16px 0;
}

/* ---------- COMMUNITY CTA ---------- */
.community-cta {
  background:
    radial-gradient(100% 120% at 0% 0%, rgba(92,140,224,0.12), transparent 60%),
    var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px; text-align: center;
}
.community-cta h2 { font-size: 22px; margin-bottom: 8px; }
.community-cta p { color: var(--text-muted); max-width: 56ch; margin: 0 auto 18px; }
.community-pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.community-pill {
  font-size: 13px; padding: 8px 15px; border-radius: 999px;
  border: 1px dashed var(--border); color: var(--text-muted);
}
.community-pill .cp-soon { color: var(--gold); font-weight: 700; margin-left: 6px; font-size: 11px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
  .trust-row { grid-template-columns: 1fr; }
  .wiki-hero { padding: 44px 16px 40px; }
}
