/* public/assets/reactions.css
   tokens: --surface, --border, --text, --muted, --theme-color
*/

/* =========================
   Reactions widget (safe)
   ========================= */

.reactions{
  --rx-accent: var(--theme-color, #0088cc);

  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.reaction-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(15,23,42,.12);
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  cursor:pointer;
  user-select:none;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.reaction-btn:hover{
  border-color: rgba(15,23,42,.18);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.reaction-btn:active{ transform: translateY(1px); }

.reaction-btn.active{
  border-color: rgba(0,136,204,.35);
  background: rgba(0,136,204,.06);
}

.reaction-count{
  min-width: 18px;
  text-align:center;
  font-variant-numeric: tabular-nums;
}

.reaction-label{
  font-weight: 800;
  color: rgba(15,23,42,.7);
}

/* ==========================================
   Favorites page — SCOPED to .favorites-ui
   (и совместимость с .favorites-page)
   ========================================== */

.favorites-ui{
  --fav-surface: var(--surface, #fff);
  --fav-text: var(--text, #0f172a);
  --fav-muted: rgba(15,23,42,.55);
  --fav-border: rgba(15,23,42,.10);
  --fav-accent: var(--theme-color, #0088cc);

  color: var(--fav-text);
}

/* базовая “страница-карточка” */
.favorites-ui .favorites-page,
.favorites-page.favorites-ui{
  background: var(--fav-surface);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* header */
.favorites-ui .favorites-header,
.favorites-header.favorites-ui{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 14px;
}

.favorites-ui .favorites-title,
.favorites-title.favorites-ui{
  margin:0;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--fav-accent);
}

.favorites-ui .favorites-sub,
.favorites-sub.favorites-ui{
  color: var(--fav-muted);
  font-weight: 700;
  font-size: 13px;
}

.favorites-ui .favorites-empty,
.favorites-empty.favorites-ui{
  padding: 14px;
  border: 1px dashed rgba(15,23,42,.18);
  border-radius: 12px;
  color: rgba(15,23,42,.7);
  background: rgba(15,23,42,.02);
  font-weight: 700;
}

/* grid */
.favorites-ui .favorites-grid,
.favorites-grid.favorites-ui{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 980px){
  .favorites-ui .favorites-grid,
  .favorites-grid.favorites-ui{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px){
  .favorites-ui .favorites-grid,
  .favorites-grid.favorites-ui{
    grid-template-columns: 1fr;
  }
}

/* cards */
.favorites-ui .fav-card,
.fav-card.favorites-ui{
  display:grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  border: 1px solid var(--fav-border);
  border-radius: 14px;
  overflow:hidden;
  background: var(--fav-surface);
  text-decoration:none;
  color: inherit;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}

.favorites-ui .fav-card:hover,
.fav-card.favorites-ui:hover{
  transform: translateY(-1px);
  border-color: rgba(15,23,42,.16);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.favorites-ui .fav-card-media,
.fav-card-media.favorites-ui{
  background: rgba(15,23,42,.04);
  display:flex;
  align-items:center;
  justify-content:center;
}

.favorites-ui .fav-card-media img,
.fav-card-media.favorites-ui img{
  width: 110px;
  height: 110px;
  object-fit: cover;
  display:block;
}

.favorites-ui .fav-card-placeholder,
.fav-card-placeholder.favorites-ui{
  width: 110px;
  height: 110px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 28px;
  opacity: .7;
}

.favorites-ui .fav-card-body,
.fav-card-body.favorites-ui{
  padding: 10px 12px 12px;
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-width: 0;
}

.favorites-ui .fav-card-title,
.fav-card-title.favorites-ui{
  font-weight: 900;
  line-height: 1.2;
  color: rgba(15,23,42,.92);
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorites-ui .fav-card-text,
.fav-card-text.favorites-ui{
  color: rgba(15,23,42,.65);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.favorites-ui .fav-card-actions,
.fav-card-actions.favorites-ui{
  margin-top: 6px;
}

/* =========================================================
   ✅ Overlay favorite buttons (⭐) — scoped to favorites
   Чтобы active был виден, но не лез в другие модули
   ========================================================= */

.favorites-ui :where(.fav-btn, [data-favorite-button]){
  transition: filter .15s ease, transform .08s ease, background .15s ease, border-color .15s ease;
}

.favorites-ui :where(.fav-btn, [data-favorite-button]):active{
  transform: translateY(1px);
}

.favorites-ui :where(.fav-btn.active, [data-favorite-button].active, .fav-btn.is-active, [data-favorite-button].is-active){
  background: rgba(255, 245, 200, .95) !important;
  border-color: rgba(245, 158, 11, .65) !important;
}

