/* ============================================================
   KARMAFLEX ARTISTS — FRONTEND CSS
   Uses var(--kf-*, fallback) so it looks right with the
   KarmaFlex theme AND degrades gracefully on any other theme.
   ============================================================ */

/* ==========================================
   GENERIC GRID — used by [kf_artist_grid] and the archive
   ========================================== */
.kfa-grid {
  display: grid;
  grid-template-columns: repeat(var(--kfa-grid-cols, 5), 1fr);
  gap: 24px 16px;
  margin: 16px 0 32px;
}
@media (max-width: 900px) { .kfa-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .kfa-grid { grid-template-columns: repeat(3, 1fr); gap: 18px 10px; } }
@media (max-width: 420px) { .kfa-grid { grid-template-columns: repeat(2, 1fr); } }

/* ==========================================
   ARTIST CARD — circular avatar, verified badge, name, genre
   (mirrors KarmaFlex's .kf-artist-card so the homepage slider
   and this plugin's grids look identical)
   ========================================== */
.kfa-artist-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; cursor: pointer; transition: transform .2s ease;
}
.kfa-artist-card:hover { transform: translateY(-4px); }

.kfa-artist-card__avatar {
  position: relative; width: 88px; height: 88px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--kf-border, #e2e8f0);
  background: linear-gradient(135deg, var(--kf-accent-glow, rgba(22,163,74,.12)), var(--kf-bg-3, #f1f5f9));
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.kfa-artist-card:hover .kfa-artist-card__avatar {
  border-color: var(--kf-accent, #16a34a);
  box-shadow: 0 0 0 4px var(--kf-accent-glow, rgba(22,163,74,.12));
}
.kfa-artist-card__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.kfa-initials {
  font-size: 28px; font-weight: 800; color: var(--kf-accent, #16a34a);
  font-family: var(--kf-font-head, inherit);
}

.kfa-artist-card__name {
  font-size: 13px; font-weight: 700; color: var(--kf-text, #0f172a);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100px; line-height: 1.3; transition: color .2s ease;
}
.kfa-artist-card:hover .kfa-artist-card__name { color: var(--kf-accent, #16a34a); }

.kfa-artist-card__genre {
  font-size: 10px; font-weight: 600; color: var(--kf-text-3, #64748b);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100px; text-transform: uppercase; letter-spacing: .5px;
}

/* Verified badge — blue checkmark on the avatar */
.kfa-verified {
  position: absolute; bottom: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #2563eb; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--kf-bg, #fff);
  box-shadow: 0 1px 4px rgba(37,99,235,.4);
}

/* ==========================================
   BADGE — small genre pill (used on profile page)
   ========================================== */
.kfa-badge,
.kf-badge.kfa-badge {
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: var(--kf-r-full, 999px);
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  background: var(--kf-green-pale, rgba(22,163,74,.12)); color: var(--kf-accent, #16a34a);
  border: 1px solid rgba(22,163,74,.2);
}

/* ==========================================
   PROFILE PAGE — banner + header
   ========================================== */
.kfa-profile-page { padding-bottom: 20px; }

.kfa-banner {
  height: 200px; border-radius: var(--kf-r-lg, 16px); margin: 16px 0 0;
  background: linear-gradient(135deg, var(--kf-accent, #16a34a), var(--kf-header-bg, #0f172a));
  background-size: cover; background-position: center;
  position: relative; overflow: hidden;
}
.kfa-banner__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 100%);
}
@media (max-width: 640px) { .kfa-banner { height: 130px; } }

.kfa-profile-header {
  display: flex; gap: 24px; align-items: flex-end;
  margin: -56px 0 24px; padding: 0 8px; position: relative; z-index: 2;
  flex-wrap: wrap;
}
@media (max-width: 640px) { .kfa-profile-header { margin-top: -44px; flex-direction: column; align-items: center; text-align: center; } }

.kfa-profile-header__avatar--lg {
  position: relative; width: 128px; height: 128px; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--kf-bg, #fff);
  background: linear-gradient(135deg, var(--kf-accent-glow, rgba(22,163,74,.12)), var(--kf-bg-3, #f1f5f9));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: var(--kf-shadow-md, 0 4px 16px rgba(0,0,0,.08));
}
.kfa-profile-header__avatar--lg img { width: 100%; height: 100%; object-fit: cover; }
.kfa-profile-header__avatar--lg .kfa-initials { font-size: 44px; }
.kfa-profile-header__avatar--lg .kfa-verified { width: 32px; height: 32px; bottom: 4px; right: 4px; border-width: 3px; }
.kfa-profile-header__avatar--lg .kfa-verified svg { width: 16px; height: 16px; }

.kfa-profile-header__info { flex: 1; min-width: 0; padding-bottom: 6px; }
.kfa-profile-header__name {
  font-size: clamp(24px, 4vw, 36px); font-weight: 800; letter-spacing: -.5px;
  color: var(--kf-text, #0f172a); margin: 0 0 2px; font-family: var(--kf-font-head, inherit);
  line-height: 1.2;
}
.kfa-profile-header__realname { font-size: 14px; color: var(--kf-text-3, #64748b); margin-bottom: 10px; }

.kfa-profile-header__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.kfa-country {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--kf-text-3, #64748b); font-weight: 600;
}
.kfa-country svg { opacity: .7; }

.kfa-profile-stats { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.kfa-stat { display: flex; flex-direction: column; }
.kfa-stat strong {
  font-size: 20px; font-weight: 800; color: var(--kf-text, #0f172a);
  font-family: var(--kf-font-mono, ui-monospace, monospace); line-height: 1.2;
}
.kfa-stat span { font-size: 11px; color: var(--kf-text-3, #64748b); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }

.kfa-profile-header__social { display: flex; gap: 8px; }

/* ==========================================
   SOCIAL ICONS — shared by profile header, mini cards
   ========================================== */
.kfa-social-icon {
  width: 36px; height: 36px; border-radius: var(--kf-r-md, 10px);
  display: flex; align-items: center; justify-content: center;
  background: var(--kf-bg-3, #f1f5f9); color: var(--kf-text-2, #334155);
  border: 1px solid var(--kf-border, #e2e8f0); transition: all .2s ease;
}
.kfa-social-icon:hover { background: var(--kfa-social-color, var(--kf-accent, #16a34a)); color: #fff; border-color: transparent; transform: translateY(-2px); }

/* ==========================================
   BIO — fallback typography if theme has no .kf-entry-content
   ========================================== */
.kfa-bio.kf-entry-content {
  font-size: 16px; line-height: 1.85; color: var(--kf-text-2, #334155); margin: 8px 0 28px;
}
.kfa-bio.kf-entry-content > * + * { margin-top: 1.1em; }

/* ==========================================
   TRACK LIST FALLBACK (no theme song-card)
   ========================================== */
.kfa-track-list { display: flex; flex-direction: column; border: 1px solid var(--kf-border, #e2e8f0); border-radius: var(--kf-r-lg, 16px); overflow: hidden; margin-bottom: 24px; }
.kfa-track-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--kf-border, #e2e8f0); text-decoration: none;
  background: var(--kf-bg-card, #fff); transition: background .2s ease;
}
.kfa-track-row:last-child { border-bottom: none; }
.kfa-track-row:hover { background: var(--kf-bg-el, #f0fdf4); }
.kfa-track-row__art {
  width: 40px; height: 40px; border-radius: var(--kf-r-sm, 6px); overflow: hidden; flex-shrink: 0;
  background: var(--kf-bg-3, #f1f5f9); display: flex; align-items: center; justify-content: center;
  color: var(--kf-text-muted, #94a3b8);
}
.kfa-track-row__art img { width: 100%; height: 100%; object-fit: cover; }
.kfa-track-row__title { flex: 1; font-size: 14px; font-weight: 700; color: var(--kf-text, #0f172a); }
.kfa-track-row__arrow { color: var(--kf-text-muted, #94a3b8); }
.kfa-track-row:hover .kfa-track-row__title { color: var(--kf-accent, #16a34a); }

/* ==========================================
   ALBUM GRID FALLBACK (no theme album-card)
   ========================================== */
.kfa-album-fallback-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 768px) { .kfa-album-fallback-grid { grid-template-columns: repeat(2,1fr); } }
.kfa-album-fallback-card {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none;
  border: 1px solid var(--kf-border, #e2e8f0); border-radius: var(--kf-r-lg, 16px); overflow: hidden;
  background: var(--kf-bg-card, #fff); transition: all .2s ease;
}
.kfa-album-fallback-card:hover { border-color: var(--kf-accent, #16a34a); transform: translateY(-3px); }
.kfa-album-fallback-card__art {
  aspect-ratio: 1; background: var(--kf-bg-3, #f1f5f9); display: flex; align-items: center; justify-content: center;
  color: var(--kf-text-muted, #94a3b8);
}
.kfa-album-fallback-card__art img { width: 100%; height: 100%; object-fit: cover; }
.kfa-album-fallback-card__title { font-size: 13px; font-weight: 700; padding: 0 12px 12px; color: var(--kf-text, #0f172a); }

/* ==========================================
   [kf_artist_profile] MINI PROFILE CARD
   ========================================== */
.kfa-profile-mini {
  display: flex; gap: 16px; padding: 18px; margin: 20px 0;
  border: 1px solid var(--kf-border, #e2e8f0); border-radius: var(--kf-r-lg, 16px);
  background: var(--kf-bg-card, #fff);
}
.kfa-profile-mini__avatar {
  position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--kf-accent-glow, rgba(22,163,74,.12)), var(--kf-bg-3, #f1f5f9));
  display: flex; align-items: center; justify-content: center;
}
.kfa-profile-mini__avatar img { width: 100%; height: 100%; object-fit: cover; }
.kfa-profile-mini__avatar .kfa-initials { font-size: 22px; }
.kfa-profile-mini__avatar .kfa-verified { width: 18px; height: 18px; }
.kfa-profile-mini__avatar .kfa-verified svg { width: 9px; height: 9px; }

.kfa-profile-mini__body { flex: 1; min-width: 0; }
.kfa-profile-mini__name { font-size: 16px; font-weight: 800; color: var(--kf-text, #0f172a); text-decoration: none; }
.kfa-profile-mini__meta { display: flex; gap: 8px; align-items: center; margin: 4px 0 6px; flex-wrap: wrap; }
.kfa-profile-mini__country { font-size: 12px; color: var(--kf-text-3, #64748b); }
.kfa-profile-mini__bio { font-size: 13px; color: var(--kf-text-3, #64748b); line-height: 1.6; margin: 0 0 10px; }
.kfa-profile-mini__stats { display: flex; gap: 16px; font-size: 12px; color: var(--kf-text-3, #64748b); margin-bottom: 10px; }
.kfa-profile-mini__stats strong { color: var(--kf-text, #0f172a); font-family: var(--kf-font-mono, monospace); }
.kfa-profile-mini__social { display: flex; gap: 6px; }
.kfa-profile-mini__social .kfa-social-icon { width: 30px; height: 30px; }

/* ==========================================
   WIDGET — Featured Artists
   ========================================== */
.kfa-widget-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.kfa-widget-artist { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; width: 64px; }
.kfa-widget-artist__avatar {
  position: relative; width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--kf-border, #e2e8f0);
  background: linear-gradient(135deg, var(--kf-accent-glow, rgba(22,163,74,.12)), var(--kf-bg-3, #f1f5f9));
  display: flex; align-items: center; justify-content: center;
}
.kfa-widget-artist__avatar img { width: 100%; height: 100%; object-fit: cover; }
.kfa-widget-artist__avatar .kfa-initials { font-size: 18px; }
.kfa-widget-artist__avatar .kfa-verified { width: 16px; height: 16px; }
.kfa-widget-artist__avatar .kfa-verified svg { width: 8px; height: 8px; }
.kfa-widget-artist__name {
  font-size: 11px; font-weight: 700; color: var(--kf-text, #0f172a); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 64px;
}
.kfa-widget-artist:hover .kfa-widget-artist__name { color: var(--kf-accent, #16a34a); }

/* ==========================================
   GENRE FILTER BAR — artist archive
   ========================================== */
.kfa-genre-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.kfa-genre-filter__pill {
  padding: 7px 16px; border-radius: var(--kf-r-full, 999px);
  border: 1px solid var(--kf-border, #e2e8f0); background: var(--kf-bg-card, #fff);
  color: var(--kf-text-2, #334155); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .2s ease; font-family: var(--kf-font-body, inherit);
}
.kfa-genre-filter__pill:hover { border-color: var(--kf-accent, #16a34a); color: var(--kf-accent, #16a34a); }
.kfa-genre-filter__pill.is-active { background: var(--kf-accent, #16a34a); color: #fff; border-color: var(--kf-accent, #16a34a); }

.kfa-artist-card.kfa-hide { display: none; }

/* ==========================================
   BASELINE FALLBACKS — only matter without KarmaFlex's main.css
   ========================================== */
.kf-container { width: 100%; max-width: var(--kf-container-width, 1200px); margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

.kf-section-header { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 16px; gap: 12px; }
.kf-section-title {
  display: flex; align-items: center; gap: 10px; font-family: var(--kf-font-head, inherit);
  font-size: 18px; font-weight: 800; color: var(--kf-text, #0f172a); text-transform: uppercase; letter-spacing: .5px;
}
.kf-section-title::before { content: ''; width: 4px; height: 22px; background: var(--kf-accent, #16a34a); border-radius: 4px; flex-shrink: 0; }
.kfa-title-icon { width: 28px; height: 28px; background: var(--kf-accent, #16a34a); color: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.kf-archive-header { margin: 20px 0 28px; padding: 24px; background: linear-gradient(135deg, var(--kf-accent-glow, rgba(22,163,74,.12)), transparent); border: 1px solid var(--kf-border, #e2e8f0); border-radius: var(--kf-r-lg, 16px); }
.kf-archive-header__title { font-size: 26px; font-weight: 800; margin: 0 0 6px; color: var(--kf-text, #0f172a); }
.kf-archive-header__desc { font-size: 14px; color: var(--kf-text-3, #64748b); }

.kf-pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 32px 0; justify-content: center; }
.kf-pagination .page-numbers {
  min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--kf-r-sm, 6px); border: 1px solid var(--kf-border, #e2e8f0);
  background: var(--kf-bg-card, #fff); color: var(--kf-text-2, #334155); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .2s ease;
}
.kf-pagination .page-numbers:hover { border-color: var(--kf-accent, #16a34a); color: var(--kf-accent, #16a34a); }
.kf-pagination .current { background: var(--kf-accent, #16a34a); color: #fff; border-color: var(--kf-accent, #16a34a); }
