/* =========================================================
   HentaiNova — Comment component (Reddit / wpDiscuz style)
   NEW from scratch. Prefijo .hnc-* (no reutiliza CSS anterior)
   ========================================================= */

/* ---------- Container & list ---------- */
.hnc-wrap {
  margin-top: calc(1.2 * var(--size, 1rem));
}

.hnc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Note: subtle affordance on first message ---------- */
.hnc-intro {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  color: var(--light-3, rgba(255, 255, 255, 0.5));
}

/* ---------- Single comment item (flex row) ---------- */
.hnc-item {
  list-style: none;
}

.hnc-item > .hnc-flex {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--light-1, rgba(255, 255, 255, 0.05));
}

.hnc-item:first-child > .hnc-flex {
  padding-top: 0.25rem;
}

.hnc-item.hnc-admin > .hnc-flex {
  border-left: 3px solid #9b7bff;
  padding-left: 0.6rem;
  border-radius: 0.25rem;
  background: rgba(124, 92, 255, 0.06);
}

.hnc-item.hnc-mine:not(.hnc-admin) > .hnc-flex {
  background: rgba(255, 215, 0, 0.05);
  border-radius: 0.4rem;
}

/* ---------- Avatar column (fixed left, NO absolute) ---------- */
.hnc-av {
  flex-shrink: 0;
  width: 48px;
}

.hnc-av img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-light, #3c4143);
  border: 1px solid var(--light-2, rgba(255, 255, 255, 0.1));
}

.hnc-av .hnc-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-light, #3c4143);
  border: 1px solid var(--light-2, rgba(255, 255, 255, 0.1));
  color: var(--light-3, rgba(255, 255, 255, 0.5));
  font-size: 1.1rem;
}

/* ---------- Right content column (flex:1) ---------- */
.hnc-cell {
  flex: 1 1 100%;
  min-width: 0;
}

/* ---------- Meta: author + date + rank ---------- */
.hnc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.hnc-author {
  position: relative;
  color: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.hnc-author:hover {
  color: var(--primary, #ff5c8a);
}

.hnc-date {
  font-size: 0.78rem;
  color: var(--light-3, rgba(255, 255, 255, 0.5));
}

.hnc-tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.5;
}

.hnc-tag-admin {
  background: rgba(124, 92, 255, 0.18);
  border: 1px solid rgba(124, 92, 255, 0.5);
  color: #b9a2ff;
}

.hnc-tag-mine {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #ffd700;
}

.hnc-tag-rank {
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid currentColor;
}

/* ---------- Comment body text ---------- */
.hnc-txt {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text, #ddd);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hnc-txt p {
  margin: 0 0 0.6em;
}
.hnc-txt p:last-child {
  margin-bottom: 0;
}

/* Media inside comment: real width, capped height, left aligned */
.hnc-txt img,
.hnc-txt video,
.hnc-txt iframe,
.hnc-txt gif {
  display: block;
  margin: 0.5em 0;
  border-radius: 0.5rem;
}

.hnc-txt img {
  max-width: 100%;
  max-height: 27.3rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hnc-txt video,
.hnc-txt iframe,
.hnc-txt gif {
  max-width: 100%;
  max-height: 27.3rem;
  height: auto;
  width: auto;
  object-fit: contain;
}

.hnc-txt blockquote {
  margin: 0.4em 0;
  padding: 0.3em 0.8em;
  border-left: 3px solid #ff5c8a;
  opacity: 0.85;
}

.hnc-txt a {
  color: var(--link, #8ab4ff);
}

/* ---------- Spoiler: wraps ALL content (block, full width) ---------- */
.hnc-spo {
  display: block;
  width: 100%;
  position: relative;
  margin: 0.4em 0;
  border: 1px dashed var(--light-2, rgba(255, 255, 255, 0.15));
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
}

.hnc-spo-blur {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  filter: blur(24px) saturate(0.2);
  pointer-events: none;
  user-select: none;
  transition: filter 0.2s ease;
}

/* Everything inside a spoiler stays at full column width */
.hnc-spo-blur > * {
  max-width: 100%;
}

.hnc-spo.reveal .hnc-spo-blur {
  filter: none;
  pointer-events: auto;
  user-select: auto;
}

.hnc-spo-ov {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.5rem;
  background: rgba(7, 7, 11, 0.95);
  color: var(--light, #fff);
  font-size: 0.85rem;
  text-align: center;
  transition: opacity 0.15s ease;
}

.hnc-spo.reveal .hnc-spo-ov {
  opacity: 0;
  pointer-events: none;
}

.hnc-spo-ov i {
  color: #ffd700;
}

.hnc-spo-ov b {
  padding: 0.15rem 0.6rem;
  border-radius: 1rem;
  background: #ff5c8a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- Actions row (reply / like) ---------- */
.hnc-acts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.hnc-reply {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--light-3, rgba(255, 255, 255, 0.6));
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
  transition: color 0.15s, background 0.15s;
}

.hnc-reply:hover {
  color: #ff5c8a;
  background: rgba(255, 92, 138, 0.08);
}

.hnc-like {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--light-3, rgba(255, 255, 255, 0.6));
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 0.3rem;
  transition: color 0.15s, background 0.15s;
}

.hnc-like:hover {
  color: #ff5c8a;
  background: rgba(255, 92, 138, 0.08);
}

.hnc-like.liked {
  color: #ff5c8a;
}

.hnc-like-count {
  font-weight: 700;
}

/* ---------- Nested replies ---------- */
.hnc-level {
  list-style: none;
  margin: 0 0 0 3.4rem;
  padding: 0;
}

.hnc-level .hnc-item > .hnc-flex {
  border-bottom-color: transparent;
}

/* ---------- Author toolbar tooltip ---------- */
.hnc-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 9rem;
  padding: 0 0 0.75rem;
  background: var(--gray-dark, #151717);
  border: 1px solid var(--light-2, rgba(255, 255, 255, 0.1));
  border-radius: 0.7rem;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  text-align: center;
  font-size: 0.95rem;
  overflow: hidden;
}

.hnc-author:hover .hnc-tip,
.hnc-author:focus-within .hnc-tip {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hnc-tip-cover {
  width: 100%;
  height: 3.4rem;
  display: block;
  background-size: cover;
  background-position: center;
}

.hnc-tip-head {
  display: block;
}

.hnc-tip-head img {
  display: block;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  object-fit: cover;
  margin: -1.6rem auto 0;
  border: 3px solid var(--gray-dark, #151717);
  background: var(--gray-dark, #151717);
}

.hnc-tip:not(.hnc-tip-c) .hnc-tip-head img {
  margin-top: 0.6rem;
}

.hnc-tip b {
  display: block;
  margin-top: 0.3rem;
  font-weight: 700;
  font-size: 0.9em;
  line-height: 1.2;
  color: var(--light, #fff);
}

.hnc-tip em {
  display: block;
  font-style: normal;
  font-weight: 700;
  font-size: 0.72em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.15rem;
  padding: 0 0.5rem;
}

.hnc-tip .hnc-tip-age {
  display: block;
  font-style: normal;
  font-size: 0.72em;
  line-height: 1.4;
  color: var(--light-3, rgba(255, 255, 255, 0.5));
  margin-top: 0.25rem;
  padding: 0 0.75rem 0.4rem;
}

/* =========================================================
   Comment FORM (episode + content)
   ========================================================= */
.hnc-panel {
  margin-top: 1rem;
}

.hnc-form {
  width: 100%;
}

/* Flex row inside the form: fixed avatar left + full column right */
.hnc-form .hnc-flex {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* ---------- Editor ---------- */
.hnc-ed-wrap {
  flex: 1 1 100%;
  min-width: 0;
}

.hnc-ed-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.hnc-ed-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--light-2, rgba(255, 255, 255, 0.1));
  border-radius: 0.4rem;
  background: var(--gray-dark, #151717);
  color: var(--light, #fff);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hnc-ed-btn:hover {
  border-color: #ff5c8a;
  color: #ff5c8a;
}

.hnc-ed-btn:active {
  transform: scale(0.95);
}

.hnc-ed-spoil.active {
  border-color: #ffd700;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.45);
}

.hnc-ed-area {
  min-height: 4.5rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--light-2, rgba(255, 255, 255, 0.1));
  border-radius: 0.4rem;
  background: var(--gray-dark, #151717);
  color: var(--light, #fff);
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
}

.hnc-ed-area:focus {
  border-color: #ff5c8a;
}

.hnc-ed-area:empty::before {
  content: attr(data-placeholder);
  opacity: 0.5;
  pointer-events: none;
}

.hnc-ed-area img {
  display: block;
  max-width: 100%;
  max-height: 27.3rem;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.4rem;
  margin: 0.4rem 0;
}

.hnc-ed-area blockquote {
  margin: 0.4rem 0;
  padding: 0.2rem 0.7rem;
  border-left: 3px solid #ff5c8a;
  opacity: 0.85;
}

/* Spoiler shown to author in editor: just a marker, never blurred */
.hnc-ed-area .hnc-spo {
  border: 1px dashed #ff5c8a;
  border-radius: 0.35rem;
  padding: 0.05rem 0.3rem;
  filter: none;
}

.hnc-ed-src {
  display: none;
}

.hnc-ed-file {
  display: none;
}

/* ---------- Guest fallback textarea ---------- */
.hnc-guest-ico {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-light, #3c4143);
  border: 1px solid var(--light-2, rgba(255, 255, 255, 0.1));
  color: var(--light-3, rgba(255, 255, 255, 0.5));
  font-size: 1.1rem;
}

.hnc-form textarea {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.6rem 0.75rem;
  color: var(--text, #ddd);
  background: var(--gray-dark, #151717);
  border: 1px solid var(--light-2, rgba(255, 255, 255, 0.1));
  border-radius: 0.4rem;
  resize: vertical;
}

/* ---------- Submit ---------- */
.hnc-send {
  margin-top: 0.5rem;
}

.hnc-img-status {
  display: none;
  margin-left: 0.6rem;
  color: #ffd700;
  font-size: 0.82rem;
  font-style: italic;
}

/* ---------- AJAX feedback ---------- */
.hnc-ajax-msg {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--light, #fff);
  font-size: 0.85rem;
}

.hnc-ajax-msg.error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ffc7c7;
  font-weight: 600;
}

/* Guest form: submitting asks to login */
.hnc-form-guest .hnc-ed-wrap,
.hnc-form-guest .hnc-ed-tools {
  display: block;
}

/* ---------- Inline reply box ---------- */
.hnc-reply-box {
  margin: 0.8rem 0 0.4rem 3.4rem;
  padding: 0.75rem;
  background: var(--gray-dark, #151717);
  border: 1px solid var(--light-2, rgba(255, 255, 255, 0.1));
  border-radius: 0.5rem;
}

.hnc-reply-to {
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--light-3, rgba(255, 255, 255, 0.55));
}

.hnc-reply-to strong {
  color: #ff5c8a;
}

.hnc-reply-box .hnc-flex {
  align-items: flex-start;
}

.hnc-reply-box .hnc-ed-area {
  min-height: 3.2rem;
}

.hnc-reply-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.hnc-reply-actions .hnc-send {
  margin-top: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .hnc-av,
  .hnc-av img,
  .hnc-guest-ico {
    width: 40px;
    height: 40px;
  }

  .hnc-item > .hnc-flex,
  .hnc-form .hnc-flex {
    gap: 0.6rem;
  }

  .hnc-level {
    margin-left: 2.2rem;
  }

  .hnc-text {
    font-size: 0.95rem;
  }
}