/* feat-profile.css — isolated stylesheet for the "profile" redesign feature (loads after forum.css
   so same-specificity rules here override it). Owned by one subagent. */

/* ---- Member profile (t=usrinfo) bespoke card ------------------------------
   Wraps the stock profile table in an on-brand hero card. All colors come from
   the shared theme tokens (--surface / --line / --ink / --accent ...) so this
   tracks the per-team accent and light/dark mode automatically. */

.swh-profile { margin: 18px auto 28px; max-width: 860px; }

/* Hero header ------------------------------------------------------------- */
.swh-pf-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px 26px 24px;
  margin: 0 0 18px;
  background:
    linear-gradient(180deg, var(--brand-tint) 0%, transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  position: relative;
  overflow: hidden;
}
.swh-pf-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-fill), var(--brand));
}

/* Avatar ------------------------------------------------------------------ */
.swh-pf-avatar {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface-2);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--ring), var(--sh-1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.swh-pf-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}
.swh-pf-avatar-mono {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--accent-fill), var(--brand-strong));
  letter-spacing: .01em;
}

/* Identity column --------------------------------------------------------- */
.swh-pf-id { min-width: 0; flex: 1 1 auto; }
.swh-pf-name {
  margin: 0 0 8px;
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--ink);
  word-break: break-word;
}

.swh-pf-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.swh-pf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.swh-pf-pill--level {
  color: var(--brand-strong);
  background: var(--brand-tint);
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
.swh-pf-pill--status { color: var(--text); background: var(--surface-2); }
.swh-pf-pill--online {
  color: #0f7b3d;
  background: rgba(26, 152, 74, .12);
  border-color: rgba(26, 152, 74, .35);
}
.swh-pf-pill--online::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: #1a984a;
  box-shadow: 0 0 0 2px rgba(26, 152, 74, .25);
}
.swh-pf-pill--offline::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  opacity: .55;
}

/* Stats row --------------------------------------------------------------- */
.swh-pf-stats { display: flex; flex-wrap: wrap; gap: 26px; margin: 0 0 16px; }
.swh-pf-stat { display: flex; flex-direction: column; gap: 1px; }
.swh-pf-stat-num {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.swh-pf-stat-lbl {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Action buttons ---------------------------------------------------------- */
.swh-pf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.swh-pf-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--accent-fill);
  color: #fff !important;
  border: 1px solid transparent;
  transition: background .15s ease, transform .05s ease;
}
.swh-pf-btn:hover { background: var(--accent-fill-strong); }
.swh-pf-btn:active { transform: translateY(1px); }
.swh-pf-btn--ghost {
  background: transparent;
  color: var(--brand-strong) !important;
  border-color: var(--line);
}
.swh-pf-btn--ghost:hover { background: var(--surface-2); }

/* Detail table below the hero: forum.css already renders .ContentTable as a
   card. Soften the redundant caption header into a quiet "details" bar. */
.swh-profile .ContentTable { margin-top: 0; }
.swh-profile .ContentTable > tbody > tr:first-child th,
.swh-profile .ContentTable > tr:first-child th {
  font-size: 11px !important;
  letter-spacing: .06em;
}

/* Responsive: stack + center on narrow viewports -------------------------- */
@media (max-width: 560px) {
  .swh-pf-hero { flex-direction: column; text-align: center; padding: 24px 18px; }
  .swh-pf-badges, .swh-pf-stats, .swh-pf-actions { justify-content: center; }
  .swh-pf-stats { gap: 20px; }
}

/* Dark mode: brighten the online pill for contrast on dark surfaces. */
@media (prefers-color-scheme: dark) {
  .swh-pf-pill--online {
    color: #4ade80;
    background: rgba(74, 222, 128, .14);
    border-color: rgba(74, 222, 128, .34);
  }
}
:root[data-theme="dark"] .swh-pf-pill--online {
  color: #4ade80;
  background: rgba(74, 222, 128, .14);
  border-color: rgba(74, 222, 128, .34);
}
