/*
 * HumanUpgrade — клуб: лента, карточки постов, реакции, комментарии, сайдбар.
 */

.hu-club {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.hu-hero--compact {
  padding-block: var(--space-10);
}

/* Герой клуба для гостей: рыцарь за клавиатурой справа, смотрит на текст.
   Край картинки растворяется в фоне героя, текст остаётся на чистом поле. */
.hu-hero__art {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  width: auto;
  height: 100%;
  max-width: 55%;
  object-fit: cover;
  object-position: right center;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 45%),
                      linear-gradient(to bottom, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 45%),
              linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-composite: intersect;
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
}
.hu-hero--club .hu-hero__inner {
  max-width: 40rem;
}
@media (max-width: 767.98px) {
  .hu-hero__art {
    max-width: 75%;
    opacity: 0.28;
  }
}
.hu-club__layout {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}
@media (min-width: 1024px) {
  .hu-club__layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  /* Сайдбар слева: в DOM контент идёт первым (важнее для скринридеров), визуально — справа. */
  .hu-layout--sidebar-left {
    grid-template-columns: 320px minmax(0, 1fr);
  }
  .hu-layout--sidebar-left > .hu-club__sidebar {
    order: -1;
  }
  .hu-club__sidebar {
    position: sticky;
    top: 6rem;
  }
}
.hu-club__feed {
  min-width: 0;
}
.hu-feed {
  gap: var(--space-4);
}

/* Фильтры ленты: сегменты-ссылки и темы. */
.hu-feed-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.hu-feed-filters .jv-segmented {
  align-self: flex-start;
  max-width: 100%;
  overflow-x: auto;
}
.hu-feed-filters__topics a.jv-badge {
  text-decoration: none;
}

/* Карточка поста. */
.hu-post__head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.hu-post__byline {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.hu-post__byline-top {
  gap: var(--space-2);
  align-items: center;
}
.hu-post__author-name {
  color: var(--heading);
  font-weight: 600;
  text-decoration: none;
}
.hu-post__author-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hu-post__title {
  margin: 0;
  color: var(--heading);
  font-size: var(--text-xl);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.hu-post__title a {
  color: inherit;
  text-decoration: none;
}
.hu-post__title a:hover {
  color: var(--brand);
}
.hu-post__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.hu-post__comments {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
}
.hu-post__comments:hover {
  color: var(--brand);
}

.hu-arrow-link {
  align-self: flex-start;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.hu-arrow-link::after {
  content: " →";
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-hud);
}
.hu-arrow-link:hover::after {
  transform: translateX(2px);
}

/* Текст из Markdown. */
.hu-prose {
  color: var(--body);
  font-size: var(--text-base);
  line-height: 1.65;
  max-width: 68ch;
  overflow-wrap: anywhere;
}
.hu-prose > * + * {
  margin-top: var(--space-3);
}
.hu-prose p,
.hu-prose ul,
.hu-prose ol {
  margin-block: 0;
}
.hu-prose a {
  color: var(--brand);
}
.hu-prose code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.875em;
}
.hu-prose pre {
  overflow-x: auto;
  padding: var(--space-4);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.hu-prose pre code {
  padding: 0;
  background: none;
}
.hu-prose blockquote {
  margin-inline: 0;
  padding-left: var(--space-4);
  border-left: 2px solid var(--divider-strong);
  color: var(--muted);
}
.hu-prose--clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

/* Блок «Результат» в разборе. */
.hu-result {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-4);
  border-left: 2px solid var(--brand);
}

/* Видео-эмбед 16:9. */
.hu-video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.hu-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Закрытый контент. */
.hu-locked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px dashed var(--divider-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.hu-locked__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--divider);
  border-radius: var(--radius-full);
  color: var(--brand);
}
.hu-locked__text {
  flex: 1;
  min-width: 12rem;
  gap: var(--space-1);
}

/* Реакции. */
.hu-reactions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.hu-reactions__summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.hu-reactions__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}
.hu-reaction[aria-pressed="true"] {
  color: var(--brand);
  background: var(--brand-glow-soft);
}
.hu-reactions__views {
  margin-left: var(--space-2);
}
.hu-inline-form {
  display: inline;
}
.hu-avatar-stack {
  display: inline-flex;
}
.hu-avatar-stack .hu-avatar + .hu-avatar {
  margin-left: -0.4rem;
}
.hu-avatar-stack .hu-avatar {
  box-shadow: 0 0 0 2px var(--panel);
}

/* Комментарии. */
.hu-comments {
  gap: var(--space-4);
}
.hu-comments--replies {
  margin-top: var(--space-3);
}
.hu-comment {
  display: flex;
  gap: var(--space-3);
}
.hu-comment__body {
  flex: 1;
  min-width: 0;
}
.hu-comment__meta {
  gap: var(--space-2);
  align-items: center;
}
.hu-comment__text p {
  margin: var(--space-1) 0 0;
}
.hu-comment__actions {
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.hu-reply summary {
  cursor: pointer;
  color: var(--muted);
  list-style: none;
}
.hu-reply summary::-webkit-details-marker {
  display: none;
}
.hu-reply[open] summary {
  color: var(--brand);
}
.hu-reply .hu-comment-form {
  margin-top: var(--space-2);
}

/* Сайдбар. */
.hu-meeting-row,
.hu-program-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  color: var(--body);
  text-decoration: none;
}
.hu-program-row:hover .hu-meeting-row__title,
.hu-program-row:focus-visible .hu-meeting-row__title {
  color: var(--brand);
}
.hu-meeting-row__text,
.hu-program-row__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.hu-meeting-row__title {
  color: var(--heading);
  font-size: var(--text-sm);
  font-weight: 500;
}
.hu-program-row__price {
  color: var(--heading);
  font-size: var(--text-sm);
  white-space: nowrap;
}
.hu-date-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 2.75rem;
  padding-block: var(--space-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.hu-date-tile__month {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
}
.hu-date-tile__day {
  color: var(--heading);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.2;
}

.hu-breadcrumbs a {
  color: inherit;
}
.hu-more-link {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--divider-faint);
  color: var(--heading);
  text-decoration: none;
}
.hu-more-link:last-child {
  border-bottom: 0;
}
.hu-more-link:hover {
  color: var(--brand);
}
.hu-comment.is-hidden > .hu-avatar,
.hu-comment.is-hidden > .hu-comment__body > .hu-comment__meta {
  opacity: 0.5;
}
