/* ============================================================
   Keokuk Forum — Profile & Member Directory CSS v1.1
   ============================================================ */

/* --- Profile Header --------------------------------------- */
.kf-profile-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 36px 28px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.kf-profile-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--pur-400), var(--pur-600), var(--pur-400));
  background-size: 200% auto;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer { 0% { background-position: 0 0; } 100% { background-position: 200% 0; } }

.kf-profile-header__layout {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}

.kf-profile-header__avatar {
  position: relative;
  flex-shrink: 0;
}

.kf-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.kf-profile-avatar--initials {
  background: linear-gradient(135deg, var(--pur-400), var(--pur-600));
  color: #fff;
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  width: 96px;
  height: 96px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.kf-avatar-edit-btn {
  position: absolute;
  bottom: -6px; right: -6px;
  width: 28px; height: 28px;
  background: var(--accent); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s;
  border: 2px solid var(--bg-card);
}
.kf-avatar-edit-btn:hover { background: var(--accent-hover); text-decoration: none; }

.kf-profile-header__info {
  flex: 1;
  min-width: 200px;
}

.kf-profile-header__name {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.kf-profile-header__username {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-3);
  font-family: var(--font-sans);
}

.kf-profile-header__badges {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.kf-profile-header__bio {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 20px;
  max-width: 540px;
}

.kf-profile-stats-row {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
}
.kf-profile-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
  border-right: 1px solid var(--border);
  line-height: 1.25;
  min-width: 80px;
}
.kf-profile-stat-box:last-child { border-right: none; }
.kf-profile-stat-box strong {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.kf-profile-stat-box span {
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kf-profile-header__actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* --- Profile Grid ----------------------------------------- */
.kf-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 760px) {
  .kf-profile-grid { grid-template-columns: 1fr; }
  .kf-profile-header__layout { flex-direction: column; align-items: center; text-align: center; }
  .kf-profile-header__name { justify-content: center; }
  .kf-profile-header__badges { justify-content: center; }
  .kf-profile-stats-row { margin: 0 auto; }
  .kf-profile-header__actions { justify-content: center; }
  .kf-profile-header__bio { text-align: center; }
}

.kf-section-heading {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Post snippet */
.kf-post-snippet {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.kf-post-snippet:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); text-decoration: none; }
.kf-post-snippet__thread { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.kf-post-snippet__body { font-size: 0.83rem; color: var(--text-2); line-height: 1.45; }
.kf-post-snippet__time { font-size: 0.74rem; color: var(--text-3); }

/* --- Edit Profile Form ------------------------------------ */
.kf-edit-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.kf-edit-section__title { font-family: var(--font-serif); font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.kf-form-field { margin-bottom: 16px; }

.kf-avatar-upload { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.kf-avatar-upload__controls { display: flex; flex-direction: column; gap: 8px; }
.kf-avatar-upload__hint { font-size: 0.76rem; color: var(--text-3); line-height: 1.4; }
.kf-avatar-remove { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-3); cursor: pointer; }
.kf-avatar-remove:hover { color: #dc2626; }

/* --- Member Directory ------------------------------------- */
.kf-members-bar { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.kf-members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 28px; }

.kf-member-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; text-decoration: none;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.kf-member-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px var(--accent-glow); transform: translateY(-2px); text-decoration: none; }

.kf-member-card__avatar { position: relative; width: 56px; flex-shrink: 0; }
.kf-member-avatar-img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; display: block; }
.kf-member-avatar-initials { width: 56px; height: 56px; border-radius: 12px; background: linear-gradient(135deg, var(--pur-400), var(--pur-600)); color: #fff; font-family: var(--font-serif); font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.kf-member-online-dot { position: absolute; bottom: 2px; right: 2px; width: 10px; height: 10px; background: #22c55e; border-radius: 50%; border: 2px solid var(--bg-card); }

.kf-member-card__info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.kf-member-card__name { font-size: 0.92rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kf-member-card__uname { font-size: 0.75rem; color: var(--text-3); }
.kf-member-card__role { font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 100px; display: inline-block; width: fit-content; text-transform: capitalize; margin-top: 2px; }
.kf-member-card__bio { font-size: 0.78rem; color: var(--text-3); line-height: 1.4; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kf-member-card__stats { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.kf-member-card__stats strong { color: var(--text-2); }
