/* ──────────────────────────────────────────────────────────────────────────
   HxH PATCHES — 2026-05-12
   Включает: фикс аватарок (object-fit: contain + размытый фон),
             ссылки в описании, секция комментариев,
             кнопка "💬 Комментарии" в карточке.
   ──────────────────────────────────────────────────────────────────────── */

/* ── Card cover: full image visible, no cropping ─────────────────────────── */

.card-bg {
  height: 240px !important;                  /* было 155 */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0b0b15;
  background-image: linear-gradient(135deg, #1a1a2e, #0f0f1a);
}

.card-bg.card-bg--has-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.55) saturate(1.15);
  transform: scale(1.15);                    /* чтобы края blur не торчали */
  z-index: 0;
}

.card-bg-placeholder {
  font-size: 3.6rem;
  position: relative;
  z-index: 1;
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: contain !important;            /* было cover */
  position: relative;
  z-index: 1;
  transition: transform .4s ease;
}

.card:hover .card-photo {
  transform: scale(1.05) !important;
}

.card-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to bottom, transparent 55%, rgba(10,10,20,.92));
  pointer-events: none;
}

@media (min-width: 768px) {
  .card-bg { height: 280px !important; }
}

/* ── Detail page: same trick for hero photo ──────────────────────────────── */

.detail-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  overflow: hidden;
  background: #0b0b15;
}

.detail-photo-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: center;
  filter: blur(36px) brightness(0.5) saturate(1.2);
  transform: scale(1.2);
  z-index: 0;
}

.detail-photo-frame .detail-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Description: linkified URLs ─────────────────────────────────────────── */

.detail-desc .desc-link,
.card-desc .desc-link,
.comment-text .desc-link {
  color: var(--accent, #a3e635);
  text-decoration: underline;
  word-break: break-all;
}

.detail-desc .desc-link:hover {
  color: var(--primary, #84cc16);
  text-shadow: 0 0 8px rgba(132,204,22,.4);
}

/* ── Comments section ────────────────────────────────────────────────────── */

.comments-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border, rgba(255,255,255,.08));
}

.comments-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 1.2rem 0;
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--text, #fff);
}

.comments-count {
  font-size: .85rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(132,204,22,.15);
  color: var(--accent, #a3e635);
  border: 1px solid rgba(132,204,22,.3);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment {
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: var(--card, #1a1a2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  transition: border-color .2s;
}

.comment:hover {
  border-color: rgba(132,204,22,.3);
}

.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 700;
  color: var(--accent, #a3e635);
  font-size: .95rem;
}

.comment-author::before {
  content: '👤 ';
  opacity: .7;
  margin-right: 4px;
}

.comment-date {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}

.comment-text {
  margin: 0;
  color: rgba(255,255,255,.88);
  font-size: .95rem;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.comments-empty {
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px dashed var(--border, rgba(255,255,255,.1));
  color: rgba(255,255,255,.6);
  text-align: center;
}

.comments-empty a {
  color: var(--accent, #a3e635);
  text-decoration: underline;
}

/* ── Card comments link (small button in card footer) ────────────────────── */

.card-comments-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(132,204,22,.1);
  color: var(--accent, #a3e635);
  font-size: .85rem;
  text-decoration: none;
  border: 1px solid rgba(132,204,22,.25);
  transition: all .2s;
}

.card-comments-link:hover {
  background: rgba(132,204,22,.2);
  border-color: rgba(132,204,22,.5);
}

.card-comments-link span {
  font-weight: 700;
  min-width: 0.5em;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.card-footer > *:last-child {
  margin-left: auto;
}
