/* ═══════════════════════════════════════════════════════════════
   PaperView Concept Chips — shared styles

   Single source of truth for .fp-chip, .fp-bar, .fp-grid,
   weight classes (w0–w3), and supergroup color classes (sg-*).

   Load AFTER layout.css, BEFORE page-specific CSS.
   ═══════════════════════════════════════════════════════════════ */

/* ── Grid container ── */
.fp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
}

/* ── Chip wrapper (for chip + directions button) ── */
.fp-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.fp-chip-dir {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3, #999);
  padding: 3px 5px;
  cursor: pointer;
  border-radius: 0 4px 4px 0;
  transition: color 0.12s, background 0.12s;
  line-height: 1;
}

.fp-chip-dir:hover {
  color: var(--accent, #0056b3);
  background: rgba(0, 86, 179, 0.08);
}

.fp-chip-wrap .fp-chip {
  border-radius: 4px 0 0 4px;
}

/* ── Base chip ── */
.fp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s;
  white-space: nowrap;
}

.fp-chip:hover {
  filter: brightness(1.12);
}

.fp-chip {
  position: relative;
}

.fp-chip.active {
  font-weight: 500;
}

.fp-chip.active::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent #fff transparent transparent;
  opacity: 0.55;
}

/* ── Weight levels (heat map: heavier = more central) ── */
.fp-chip.w3 { background: #1565c0; color: #fff; }
.fp-chip.w2 { background: #64b5f6; color: #fff; }
.fp-chip.w1 { background: #e3f2fd; color: var(--text, #333); }
.fp-chip.w0 { background: #f5f7fa; color: var(--text-2, #666); }

/* ── Weight bar indicator ── */
.fp-bar {
  width: 3px;
  height: 10px;
  border-radius: 1px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.35);
}

.fp-chip.w3 .fp-bar { height: 12px; background: rgba(255, 255, 255, 0.5); }
.fp-chip.w2 .fp-bar { height: 9px; background: rgba(255, 255, 255, 0.5); }
.fp-chip.w1 .fp-bar { height: 6px; background: var(--accent, #2563eb); opacity: 0.3; }
.fp-chip.w0 .fp-bar { height: 4px; background: var(--text-3, #999); opacity: 0.3; }

/* ── Foundational badge ── */
.fp-foundational-badge {
  font-size: 13px;
  margin-left: 2px;
  flex-shrink: 0;
  line-height: 1;
  align-self: center;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Supergroup color classes ──
   Used by search results and roadmap detail panels.
   Root = darkest, mid = base, leaf = lightest.  */

/* Structure of QFT */
.fp-chip.sg-structure-of-qft      { background: #5B8DBE; color: #fff; }
.fp-chip.sg-structure-of-qft-root { background: #3A5A7F; color: #fff; }
.fp-chip.sg-structure-of-qft-mid  { background: #5B8DBE; color: #fff; }
.fp-chip.sg-structure-of-qft-leaf { background: #8BAFDB; color: #0e2d42; }

/* Observables & Scattering */
.fp-chip.sg-observables-scattering      { background: #C45B7C; color: #fff; }
.fp-chip.sg-observables-scattering-root { background: #7D3A4D; color: #fff; }
.fp-chip.sg-observables-scattering-mid  { background: #C45B7C; color: #fff; }
.fp-chip.sg-observables-scattering-leaf { background: #E59FB3; color: #3a1520; }

/* Quantum Gravity & Holography */
.fp-chip.sg-quantum-gravity-holography      { background: #E07850; color: #fff; }
.fp-chip.sg-quantum-gravity-holography-root { background: #8B4625; color: #fff; }
.fp-chip.sg-quantum-gravity-holography-mid  { background: #E07850; color: #fff; }
.fp-chip.sg-quantum-gravity-holography-leaf { background: #F5A97D; color: #3a1a0a; }

/* Cosmology */
.fp-chip.sg-cosmology      { background: #C4A835; color: #fff; }
.fp-chip.sg-cosmology-root { background: #7A6622; color: #fff; }
.fp-chip.sg-cosmology-mid  { background: #C4A835; color: #fff; }
.fp-chip.sg-cosmology-leaf { background: #DFC966; color: #3a3008; }

/* Strings & Mathematical Physics */
.fp-chip.sg-strings-math      { background: #8BB048; color: #fff; }
.fp-chip.sg-strings-math-root { background: #536B2A; color: #fff; }
.fp-chip.sg-strings-math-mid  { background: #8BB048; color: #fff; }
.fp-chip.sg-strings-math-leaf { background: #B8D87D; color: #1a2a0a; }

/* ── Chip icon (roadmap/detail panels) ── */
.fp-icon {
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1;
  align-self: center;
  color: rgba(255, 255, 255, 0.8);
}

.fp-icon-book {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.fp-icon-book svg {
  width: 10px;
  height: 10px;
  vertical-align: middle;
}
