/* ============================================================
   Candidate profile (/candidates/:slug). Cover band (party-toned
   gradient + ray texture + radial glow), overlapping avatar,
   identity, sticky segmented tabs. Tokens only — never hard-code
   color (the party tint is passed inline as --c).
   ============================================================ */

/* ---- card chassis ---- */
.cand-card {
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ---- cover band ---- */
.cand-cover {
  position: relative;
  height: 124px;
  overflow: hidden;
  /* --c is the candidate's party color (or accent fallback), set inline */
  background:
    linear-gradient(118deg,
      color-mix(in srgb, var(--c, var(--accent)) 92%, #06121d) 0%,
      var(--c, var(--accent)) 54%,
      color-mix(in srgb, var(--c, var(--accent)) 66%, #0a1b2e) 100%);
}
@media (min-width: 640px) { .cand-cover { height: 156px; } }
.cand-cover.is-inactive { filter: saturate(.55); }
.cand-cover__tex {
  position: absolute; inset: 0; pointer-events: none; opacity: .15;
  background: repeating-linear-gradient(125deg, #fff 0 1px, transparent 1px 13px);
}
.cand-cover__glow {
  position: absolute; right: -44px; top: -68px; pointer-events: none;
  width: 230px; height: 230px; border-radius: 50%;
  opacity: .26; filter: blur(42px);
  background: radial-gradient(circle, #fff 0%, transparent 70%);
}
.cand-cover__chips {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
  max-width: calc(100% - 32px);
}
.cand-cover__loc {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 999px;
  background: rgba(0,0,0,.28); backdrop-filter: blur(6px);
  color: #fff; font-family: "Open Sans", monospace;
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
}

/* ---- status pill on the cover ---- */
.cand-status {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: rgba(0,0,0,.28); backdrop-filter: blur(6px); color: #fff;
}
.cand-status__dot { width: 7px; height: 7px; border-radius: 50%; }

/* ---- body / avatar ---- */
.cand-body { position: relative; padding: 0 20px 22px; }
@media (min-width: 640px) { .cand-body { padding: 0 24px 24px; } }

.cand-avatar {
  position: relative; z-index: 10; flex: none;
  width: 92px; height: 92px; margin-top: -46px;
  border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  color: #fff; font-family: "Poppins", sans-serif; font-weight: 600;
  font-size: 32px; letter-spacing: .01em;
  box-shadow: var(--shadow-lift);
  outline: 4px solid var(--surface);
}
@media (min-width: 640px) {
  .cand-avatar { width: 108px; height: 108px; margin-top: -56px; font-size: 38px; }
}
.cand-avatar.is-inactive { filter: grayscale(.35); }
/* Absolutely fill the circle so a non-square photo can't push past it. */
.cand-avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cand-avatar__win {
  position: absolute; bottom: 0; right: 0; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--mark); color: #fff;
  display: grid; place-items: center;
  border: 3px solid var(--surface);
}

/* ---- name / handle ---- */
.cand-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: "Poppins", sans-serif; font-weight: 700;
  font-size: 23px; letter-spacing: -.01em; color: var(--ink); line-height: 1.12;
}
@media (min-width: 640px) { .cand-name { font-size: 27px; } }
.cand-handle { margin-top: 3px; font-size: 14.5px; color: var(--faint); }

/* party badge */
.cand-party {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.cand-party__dot { width: 7px; height: 7px; border-radius: 50%; }

/* running-for line */
.cand-running {
  margin-top: 12px; font-size: 14.5px; line-height: 1.5; color: var(--ink);
}
.cand-running b { font-weight: 600; }
.cand-running .cand-inc { color: var(--faint); font-weight: 500; }

/* meta row */
.cand-meta { margin-top: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.cand-meta__item { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }

/* stat row */
.cand-stats { margin-top: 16px; display: flex; align-items: center; gap: 24px; }
.cand-stat { display: inline-flex; align-items: baseline; gap: 6px; }
.cand-stat__n { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 17px; color: var(--ink); }
.cand-stat__l { font-size: 13.5px; color: var(--muted); }

/* ---- claim banner ---- */
.cand-claim {
  margin-top: 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  background: var(--accent-soft);
}
.cand-claim__icon {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: var(--surface); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: var(--shadow-soft);
}
.cand-claim__txt { min-width: 0; flex: 1; }
.cand-claim__title { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.cand-claim__sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.cand-claim__btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  border: none; box-shadow: var(--shadow-soft);
  transition: background .15s ease;
}
.cand-claim__btn:hover { background: var(--accent-hover); }
.cand-claim.is-pending {
  border-color: var(--st-pending-dot);
  background: var(--st-pending-bg);
}
.cand-claim.is-pending .cand-claim__icon { color: var(--st-pending-fg); }

/* on narrow screens keep icon + text on the first row; the button drops
   to its own full-width row below (never crushed) */
@media (max-width: 540px) {
  .cand-claim__txt { flex: 1 1 calc(100% - 48px); }
  .cand-claim__btn { flex: 1 1 100%; width: 100%; justify-content: center; height: 40px; }
}

/* ---- external links ---- */
.cand-links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.cand-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--sunken); border: 1px solid var(--hairline);
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  max-width: 100%; transition: color .14s ease, border-color .14s ease;
}
.cand-link:hover { color: var(--accent-ink); border-color: var(--hairline-strong); }
.cand-link img { width: 15px; height: 15px; border-radius: 4px; flex: none; }
.cand-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- sticky segmented tab bar (Replies / Activity) ---- */
.cand-tabs {
  position: sticky; top: 0; z-index: 20;
  margin: 0 -16px; padding: 10px 16px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
}
@media (min-width: 640px) { .cand-tabs { margin: 0 -32px; padding: 10px 32px; } }
.cand-tabs__inner {
  display: flex; gap: 4px; padding: 4px;
  border-radius: 12px; background: var(--sunken); border: 1px solid var(--hairline);
}
.cand-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; border: none; background: transparent; cursor: pointer;
  border-radius: 8px; font-family: "Open Sans", sans-serif;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: color .15s ease;
}
.cand-tab:hover { color: var(--ink); }
.cand-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.cand-tab__count { font-family: "Open Sans", monospace; font-size: 11px; color: var(--faint); }
.cand-tab.is-on .cand-tab__count { color: var(--accent); }

/* ---- empty state ---- */
.cand-empty {
  border: 1px dashed var(--hairline-strong);
  background: var(--surface);
  border-radius: 18px;
  padding: 56px 24px; text-align: center;
}
.cand-empty__icon {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 16px;
  background: var(--sunken); border: 1px solid var(--hairline);
  display: grid; place-items: center; color: var(--faint);
}

/* ---- bio (clamped to 3 lines; expands via wevote--card--clamp .is-open) ---- */
.cand-bio {
  font-size: 14.5px; line-height: 1.6; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cand-bio.is-open { -webkit-line-clamp: unset; overflow: visible; }
.cand-bio p + p { margin-top: 12px; }
