/* ============================================================================
   shared-candidatos.css
   Candidato art cards (horizontal strip) — visually matched to
   shared-products-dimona.css (#f4f3ef surface, deep rounding, Figtree,
   #151219 text, #712bf5 accent).

   The card background comes from Firestore: shared-candidatos.js sets
   --card-bg (and --card-fg for readable text) on each card from the art's
   color field. #f4f3ef is only the fallback when no color is saved.

   NOTE: shared-candidatos.js writes inline styles on the card and also
   injects its own <style> with a hover lift. Bootstrap utilities (.p-2,
   .rounded-circle) use !important, so !important is required in several
   rules below to override them.
   ========================================================================== */

/* ─── Horizontal strip ────────────────────────────────────────────────────── */

#candidatoArtsContainer {
  gap: 20px !important;
}

#candidatoArtsContainer::-webkit-scrollbar { height: 4px; }
#candidatoArtsContainer::-webkit-scrollbar-track { background: transparent; }
#candidatoArtsContainer::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* ─── Card ────────────────────────────────────────────────────────────────── */

.candidato-art-card {
  display: flex;
  flex: 0 0 200px;
  flex-direction: column;
  width: 200px;
  min-width: 200px;
  padding: 10px;
  overflow: hidden;
  background: var(--card-bg, #f4f3ef) !important;
  border: none !important;
  border-radius: 28px !important;
  box-shadow: none !important;
  font-family: 'Figtree', sans-serif;
  font-weight: 400;
  color: var(--card-fg, #151219);
}

/* Cancel the hover lift injected by shared-candidatos.js (_addStyles).
   The Dimona card has no lift; the image zoom below replaces it. */
.candidato-art-card:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ─── Image ───────────────────────────────────────────────────────────────── */

.candidato-art-card > div:has(> img[data-fullscreen]) {
  position: relative;
  width: 100%;
  height: auto !important;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--card-bg, #e2e2e2);
  border-radius: 22px;
  cursor: pointer;
}

.candidato-art-card img[data-fullscreen] {
  display: block;
  max-width: 100%;
  transform: scale(1);
  transition: transform 0.4s ease;
  will-change: transform;
}

.candidato-art-card > div:has(> img[data-fullscreen]):hover img[data-fullscreen] {
  transform: scale(1.05);
}

/* ─── Artist row ──────────────────────────────────────────────────────────── */

.candidato-art-card > .p-2 {
  gap: 10px !important;
  padding: 12px 4px 4px !important;
}

.candidato-art-card img.user-profile-link {
  flex-shrink: 0;
  width: 32px !important;
  height: 32px !important;
  object-fit: cover;
  background: #1c1c1f;
  border-radius: 10px !important;
  cursor: pointer;
}

.candidato-art-card span.user-profile-link {
  min-width: 0;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: var(--card-fg, #000);
  cursor: pointer;
}

.candidato-art-card .user-profile-link:hover {
  opacity: 0.75;
}

/* ─── Footer / actions ────────────────────────────────────────────────────── */

.candidato-art-card .card-footer {
  gap: 6px !important;
  padding: 6px 4px 4px !important;
  background: transparent !important;
  border: none !important;
}

.candidato-art-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 14px !important;
  font-family: inherit;
  font-size: 0.8rem !important;
  font-weight: 600;
  line-height: 1;
  color: #151219;
  background: #fff;
  border: 1.5px solid #e2e2e2;
  border-radius: 12px;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.15s ease;
}

.candidato-art-card .btn:hover {
  color: #712bf5;
  background: #fff;
  border-color: #712bf5;
}

.candidato-art-card .btn:active {
  transform: scale(0.96);
}

.candidato-art-card .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(113, 43, 245, 0.25);
}

/* Liked state — the JS toggles btn-primary / btn-outline-primary */
.candidato-art-card .like-button.btn-primary {
  color: #fff;
  background: #712bf5;
  border-color: #712bf5;
}

.candidato-art-card .like-button.btn-primary:hover {
  color: #fff;
  background: #5f22d6;
  border-color: #5f22d6;
}

/* ─── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .candidato-art-card {
    flex-basis: 170px !important;
    width: 170px !important;
    min-width: 170px !important;
    padding: 4px;
    border-radius: 14px !important;
  }

  .candidato-art-card > div:has(> img[data-fullscreen]) { aspect-ratio: 3 / 4; border-radius: 12px; }
  .candidato-art-card > .p-2 { gap: 7px !important; padding: 8px 2px 4px !important; }
  .candidato-art-card img.user-profile-link { width: 30px !important; height: 30px !important; }
  .candidato-art-card span.user-profile-link { font-size: 14px !important; }
  .candidato-art-card .card-footer { gap: 4px !important; padding: 4px 2px 2px !important; }
  .candidato-art-card .btn { min-height: 34px; padding: 5px 9px !important; }
}

/* ─── Debug-only dark mode (mirrors shared-products-dimona.css) ───────────── */

html.kv-dbg-dark .candidato-art-card,
html.kv-dbg-dark .candidato-art-card > div:has(> img[data-fullscreen]),
html.kv-dbg-dark .candidato-art-card .btn {
  background: #222124 !important;
  border-color: #e1dfe6 !important;
}

html.kv-dbg-dark .candidato-art-card .like-button.btn-primary {
  background: #712bf5 !important;
}

/* ─── Profile pages only: hide artist avatar + name ───────────────────────────
   (profile.html / public-profile.html use <body class="profile-page-shell">).
   The row is left empty, so its padding is removed to take no space. */

body.profile-page-shell .candidato-art-card img.user-profile-link,
body.profile-page-shell .candidato-art-card span.user-profile-link {
  display: none !important;
}

body.profile-page-shell .candidato-art-card > .p-2 {
  padding: 0 !important;
  gap: 0 !important;
}