/* ── Comments Section ── */
/* Custom comment system — clean, inviting, brand-aligned */

.nv-comments-section {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 0 1rem 4rem;
  box-sizing: border-box;
}

.nv-comments-section__inner {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 2rem;
}

.nv-comments-section__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.nv-comments-section__title {
  font-family: var(--typography-fontFamily-display);
  font-size: 1.6rem;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  font-weight: var(--typography-fontWeight-display);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nv-comments-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-neutral-gray400);
  font-family: var(--typography-fontFamily-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ── Comment form ── */
.nv-comment-form {
  margin-bottom: 2.5rem;
}

.nv-comment-form__card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.nv-comment-form__field {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nv-comment-form__field:last-of-type {
  border-bottom: none;
}

/* Accessible labels (WCAG 2.1 AA 3.3.2/4.1.2). Visually hidden but present in
   the accessibility tree and programmatically associated via `for`/`id`, so
   screen readers get a persistent name while sighted users rely on the
   placeholder-driven design. */
.nv-comment-form__label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Re-establish the focus ring on the submit/reply controls that have no
   default browser focus indication, for visible keyboard navigation. */
.nv-comment-form__submit:focus-visible,
.nv-comment-form__cancel-reply:focus-visible,
.nv-comment__reply-btn:focus-visible {
  outline: 2px solid var(--color-brand-neonCyan);
  outline-offset: 2px;
}

.nv-comment-form__name {
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-family: var(--typography-fontFamily-sans);
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
}

.nv-comment-form__name::placeholder {
  color: var(--color-neutral-gray500);
}

.nv-comment-form__textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-family: var(--typography-fontFamily-sans);
  font-size: 0.9rem;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
}

.nv-comment-form__textarea::placeholder {
  color: var(--color-neutral-gray400);
}

.nv-comment-form__replying {
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  color: var(--color-brand-neonCyan);
  font-family: var(--typography-fontFamily-mono);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 229, 255, 0.04);
  border-top: 1px solid rgba(0, 229, 255, 0.08);
}

.nv-comment-form__cancel-reply {
  background: none;
  border: none;
  color: var(--color-neutral-gray500);
  cursor: pointer;
  font-size: 0.72rem;
  font-family: var(--typography-fontFamily-mono);
  text-decoration: underline;
}

.nv-comment-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 1rem;
}

.nv-comment-form__hint {
  margin: 0;
  font-size: 0.7rem;
  color: var(--color-neutral-gray500);
  line-height: 1.4;
  font-family: var(--typography-fontFamily-sans);
}

.nv-comment-form__submit {
  min-height: var(--size-touch-target);
  padding: 0.55rem 1.5rem;
  border-radius: 9999px;
  background: var(--color-brand-neonPink);
  color: #FFFFFF;
  border: none;
  font-family: var(--typography-fontFamily-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.nv-comment-form__submit:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(255, 20, 147, 0.35);
  transform: scale(1.03);
}

.nv-comment-form__submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nv-comment-form__success {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: rgba(0, 200, 83, 0.1);
  color: #00C853;
  font-size: 0.82rem;
  font-family: var(--typography-fontFamily-mono);
}

.nv-comment-form__error {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: rgba(255, 23, 68, 0.1);
  color: #FF1744;
  font-size: 0.82rem;
  font-family: var(--typography-fontFamily-mono);
}

/* ── Comments List ── */
.nv-comments-list__count {
  font-size: 0.82rem;
  color: var(--color-neutral-gray400);
  font-family: var(--typography-fontFamily-mono);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nv-comments-list__empty {
  text-align: center;
  padding: 2.5rem 1rem;
}

.nv-comments-list__empty-text {
  color: var(--color-neutral-gray500);
  font-size: 0.9rem;
  margin: 0;
  font-family: var(--typography-fontFamily-sans);
}

.nv-comments-list__threads {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Individual Comment ── */
.nv-comment {
  display: flex;
  gap: 0.75rem;
}

.nv-comment--reply {
  margin-left: 2.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.nv-comment__avatar {
  flex-shrink: 0;
}

.nv-comment__avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-brand-neonPink), var(--color-brand-neonPurple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--typography-fontFamily-mono);
}

.nv-comment__content {
  flex: 1;
  min-width: 0;
}

.nv-comment__header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.nv-comment__author {
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFFFFF;
  font-family: var(--typography-fontFamily-sans);
}

.nv-comment__dot {
  color: var(--color-neutral-gray600);
  font-size: 0.72rem;
}

.nv-comment__time {
  font-size: 0.72rem;
  color: var(--color-neutral-gray500);
  font-family: var(--typography-fontFamily-mono);
}

.nv-comment__body {
  font-size: 0.88rem;
  color: var(--color-neutral-gray200);
  line-height: 1.6;
  margin-bottom: 0.35rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.nv-comment__reply-btn {
  background: none;
  border: none;
  color: var(--color-neutral-gray500);
  min-width: var(--size-touch-target);
  min-height: var(--size-touch-target);
  font-family: var(--typography-fontFamily-mono);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.nv-comment__reply-btn:hover {
  color: var(--color-brand-neonCyan);
}

@media (max-width: 600px) {
  .nv-comments-section {
    padding: 0 0.75rem 3rem;
  }
  .nv-comment-form__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .nv-comment-form__hint {
    font-size: 0.65rem;
  }
  .nv-comment-form__submit {
    width: 100%;
    text-align: center;
  }
  .nv-comment--reply {
    margin-left: 1.5rem;
  }
}

/* ── Related Articles Section ──
   Full-screen (edge-to-edge) horizontal scroll-snap carousel on desktop,
   compact mini-card horizontal strip on mobile. */
.related-section {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}
.related-section__inner {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 2rem;
  padding-bottom: 2rem;
  max-width: 100%;
}
.related-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  width: 100%;
  margin-bottom: 1.25rem;
  box-sizing: border-box;
}
.related-section__title {
  font-family: var(--typography-fontFamily-display);
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1;
  font-weight: var(--typography-fontWeight-display);
  color: #FFFFFF;
  text-transform: uppercase;
}
.related-section__nav {
  display: flex;
  gap: 0.5rem;
}
.related-section__arrow {
  width: var(--size-touch-target); /* 44px — WCAG 2.5.8/2.5.5 minimum via site token */
  height: var(--size-touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.related-section__arrow:hover {
  background: rgba(255,20,147,0.2);
  border-color: rgba(255,20,147,0.5);
}
/* Horizontal carousel rail: full-bleed scroll-snap track */
.related-section__rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 1rem 1rem;
  scrollbar-width: none;
}
.related-section__rail::-webkit-scrollbar { display: none; }
/* The rail is keyboard-focusable (tabindex=0) so AT/keyboard users can scroll it with
   arrow keys — give it a visible focus ring (#87, WCAG 2.4.7). */
.related-section__rail:focus-visible {
  outline: 2px solid var(--color-brand-neonCyan);
  outline-offset: 2px;
  border-radius: 0.5rem;
}
/* #87: the right-edge fade is a persistent "more content this way" cue that does not
   depend on the scrollbar or the arrows, so it survives every viewport. Defined here
   (not via the Base.astro .nv-rail-fade utility) because that utility is Astro-scoped
   to Base's own elements and never matches this client-rendered React rail. */
.related-section__rail.nv-rail-fade { position: relative; }
.related-section__rail.nv-rail-fade::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1.5rem;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(270deg, var(--color-neutral-black), transparent);
}
.related-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 0.75rem;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.related-card:hover {
  border-color: rgba(255,20,147,0.25);
  transform: translateY(-2px);
}
.related-card__image-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.related-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.related-card__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.4));
}
.related-card__body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.related-card__badge {
  font-size: 0.6rem;
  font-family: var(--typography-fontFamily-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-content-confirmed);
}
.related-card__title {
  font-size: 0.92rem;
  color: #FFFFFF;
  line-height: 1.3;
  margin: 0;
  font-weight: 600;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.related-card__meta {
  font-size: var(--typography-fontSize-overline);
  color: var(--color-neutral-gray500);
  font-family: var(--typography-fontFamily-mono);
  margin-top: auto;
}

@media (max-width: 767px) {
  /* Mobile: compact horizontal scroll-snap mini cards (no vertical pile-up) */
  .related-section__rail {
    gap: 0.75rem;
    scroll-snap-type: x mandatory;
    padding: 0.25rem 1rem 1rem;
  }
  .related-card {
    flex: 0 0 232px;
  }
  .related-card__title {
    font-size: 0.84rem;
    -webkit-line-clamp: 2;
  }
  /* #87: the arrows used to be hidden here, which removed the ONLY scroll affordance
     on mobile (scrollbar is also hidden) — keep them. They are already 44px touch
     targets via --size-touch-target, and the .nv-rail-fade edge cue adds a second. */
  .related-section__arrow {
    display: inline-flex;
  }
}
