/* ============================================================
   Страница материала /news/:id — «Тактический минимум»
   Референс: design/tactical-style/mockups/NewsPost.dc.html,
   ТЗ: design/tactical-style/STYLE-GUIDE.md.
   Подключается ПОСЛЕ articleStyle.css и news.css и переопределяет
   их «старые» правила только в рамках этой страницы; сами файлы
   не трогаем — их используют другие страницы.
   Контракты public/js/article.js (классы/id/data-атрибуты) сохранены.
   ============================================================ */

/* --- Иконки: article.js вставляет текстовые глифы «♥» и «↩» при живом
   добавлении комментариев (менять js нельзя). Поэтому иконка рисуется
   CSS-маской поверх currentColor: серверный inline-SVG прячется, глиф
   гасится font-size:0 — серверная и js-разметка выглядят одинаково. --- */

.article-likes__icon,
.comment__like-icon,
.comment__reply-label {
  display: inline-block;
  flex-shrink: 0;
  font-size: 0;
  line-height: 0;
  background-color: currentColor;
  -webkit-mask: var(--np-icon) center / contain no-repeat;
  mask: var(--np-icon) center / contain no-repeat;
}

.article-likes__icon svg,
.comment__like-icon svg,
.comment__reply-label svg {
  display: none;
}

.article-likes__icon,
.comment__like-icon {
  --np-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.6l-1-1a5.5 5.5 0 0 0-7.8 7.8l1 1L12 21.2l7.8-7.8 1-1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E");
}

/* Активный лайк — залитое сердце */
.article-likes__btn--active .article-likes__icon,
.comment__like-btn--active .comment__like-icon {
  --np-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.6l-1-1a5.5 5.5 0 0 0-7.8 7.8l1 1L12 21.2l7.8-7.8 1-1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E");
}

.comment__reply-label {
  --np-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpolyline points='15 10 20 15 15 20'/%3E%3Cpath d='M4 4v7a4 4 0 0 0 4 4h12'/%3E%3C/svg%3E");
}

/* ============================================================
   Каркас страницы
   ============================================================ */

.article-page.news-post {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--t-text);
  border-radius: 0;
  box-shadow: none;
}

/* --- Хлебные крошки: HUD-строка вместо старой панели --- */

.news-post-breadcrumb {
  max-width: 980px;
  margin: 36px auto 24px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.news-post-bc-list {
  gap: 4px 12px;
  font-family: var(--t-font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--t-text-faint);
}

.news-post-bc-item {
  color: var(--t-text-faint);
}

.news-post-bc-item + .news-post-bc-item::before {
  content: '/';
  margin-right: 12px;
  color: var(--t-text-faint);
  font-size: 10px;
  font-weight: 400;
}

.news-post-bc-item a {
  color: var(--t-text-muted);
  font-weight: 400;
  padding: 0;
  margin: 0;
  border-radius: 0;
  transition: color 0.18s ease;
}

.news-post-bc-item a:hover {
  color: var(--t-red-bright);
  background: none;
  box-shadow: none;
}

.news-post-bc-item a:focus-visible {
  color: var(--t-red-bright);
  background: none;
  box-shadow: none;
  outline: 1px solid var(--t-red-bright);
  outline-offset: 3px;
}

.news-post-bc-item--current {
  color: var(--t-red-bright);
  font-weight: 400;
}

/* ============================================================
   Шапка материала
   ============================================================ */

.news-post-header {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-post-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.news-post .news-kind--large {
  margin-bottom: 0;
}

.news-post-title {
  margin: 0;
  font-family: var(--t-font-display);
  font-weight: 400;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: left;
  color: #ffffff;
}

.news-post-title::after {
  display: none;
}

.news-post-title .t-brand {
  letter-spacing: 2px;
}

.news-post-byline {
  display: flex;
  gap: 18px;
}

.news-post-byline .t-brand {
  font-size: 11px;
}

/* ============================================================
   Тело статьи — панель с кронштейнами
   ============================================================ */

.news-post-content {
  margin-top: 0;
  padding: 36px 40px;
  font-family: var(--t-font-body);
  font-size: 16px;
  line-height: 1.7;
  color: #c9ced8;
}

/* news.css красит патчноут в левую кромку — возвращаем ровную панель */
.news-post--patch .news-post-content {
  border-left: 1px solid var(--t-panel-border);
  padding-left: 40px;
}

/* --- Типографика контента (Quill HTML) в палитре стиля --- */

.news-post-content h1,
.news-post-content h2,
.news-post-content h3,
.news-post-content h4,
.news-post-content h5,
.news-post-content h6 {
  font-family: var(--t-font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.news-post-content h2 {
  border-bottom: 1px solid var(--t-line);
}

.news-post-content h4 { color: var(--t-text); }
.news-post-content h5 { color: var(--t-text); }
.news-post-content h6 { color: var(--t-text-muted); }

.news-post-content strong,
.news-post-content b {
  color: var(--t-text);
}

.news-post-content em,
.news-post-content i {
  color: var(--t-text-muted);
}

.news-post-content a {
  color: var(--t-red-bright);
  border-bottom: 1px solid rgba(255, 77, 77, 0.35);
}

.news-post-content a:hover {
  color: var(--t-red-bright);
  border-bottom-color: var(--t-red-bright);
}

.news-post-content blockquote {
  border-left: 2px solid var(--t-red);
  background: rgba(12, 14, 16, 0.6);
  border-radius: 0;
  font-style: normal;
  color: var(--t-text-muted);
}

.news-post-content code {
  font-family: var(--t-font-mono);
  background-color: #17181d;
  color: var(--t-red-bright);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
}

.news-post-content pre,
.news-post-content pre.ql-syntax {
  font-family: var(--t-font-mono);
  background-color: #101114;
  color: #c9ced8;
  border: 1px solid var(--t-panel-border);
  border-radius: 0;
}

.news-post-content img {
  border-radius: 0;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.news-post-content iframe,
.news-post-content video,
.news-post-content .ql-video {
  border-radius: 0;
  box-shadow: none;
}

.news-post-content hr {
  border-top: 1px solid var(--t-line);
}

/* Таблицы: шапка mono-HUD, без «зебры» */
.news-post-content table {
  border-radius: 0;
  box-shadow: none;
  border: 1px solid var(--t-panel-border);
}

.news-post-content th {
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--t-panel-border);
  font-family: var(--t-font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--t-text-muted);
}

.news-post-content td {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.news-post-content tr:nth-child(even) td {
  background-color: transparent;
}

.news-post-content tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

.news-post-content::-webkit-scrollbar-track {
  background: #17181d;
  border-radius: 0;
}

.news-post-content::-webkit-scrollbar-thumb {
  background: var(--t-red);
  border-radius: 0;
}

/* ============================================================
   Лайк материала — плоская панель
   ============================================================ */

.news-post .article-likes {
  margin-top: 18px;
}

.article-likes__btn,
.article-likes__readonly {
  gap: 10px;
  padding: 12px 20px;
  background: var(--t-panel-bg);
  border: 1px solid var(--t-panel-border);
  border-radius: 0;
  color: var(--t-text-muted);
  font-family: var(--t-font-mono);
  font-size: 13px;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.article-likes__btn:hover:not(:disabled) {
  border-color: rgba(255, 77, 77, 0.5);
  color: var(--t-red-bright);
  background: var(--t-panel-bg);
}

.article-likes__btn--active {
  border-color: rgba(255, 77, 77, 0.5);
  color: var(--t-red-bright);
  background: var(--t-panel-bg);
}

.article-likes__btn:focus-visible {
  outline: 1px solid var(--t-red-bright);
  outline-offset: 2px;
}

.article-likes__icon {
  width: 16px;
  height: 16px;
  color: var(--t-red-bright);
}

.article-likes__count {
  font-weight: 400;
  color: var(--t-text);
}

/* ============================================================
   Секция «02 — Комментарии»
   ============================================================ */

.news-post .article-comments {
  margin-top: 56px;
  padding-top: 0;
  border-top: none;
}

/* h2 несёт .t-section-head, но articleStyle перебивает его типографику —
   возвращаем канон секционного заголовка */
.article-comments__heading {
  margin: 0 0 18px;
  gap: 14px;
  font-family: var(--t-font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--t-text-faint);
}

.article-comments__total {
  min-width: 0;
  height: auto;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  background: transparent;
  color: var(--t-text-muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
}

.article-comments__empty {
  margin: 0 0 18px;
  color: var(--t-text-faint);
  font-size: 14px;
}

.article-comments__login-hint {
  margin-top: 24px;
  color: var(--t-text-muted);
  font-size: 14px;
}

.article-comments__login-hint a {
  color: var(--t-red-bright);
}

/* ============================================================
   Комментарии — плоские панели
   ============================================================ */

.article-comments__list {
  gap: 14px;
}

.comment {
  padding: 20px 24px;
  gap: 16px;
  background: var(--t-panel-bg);
  border: 1px solid var(--t-panel-border);
}

/* Гасим старые разделители между комментариями */
.comment,
.comment:last-child,
.comment--reply + .comment:not(.comment--reply),
.comment--reply:last-child {
  border-bottom: 1px solid var(--t-panel-border);
}

/* Вложенность: сдвиг панели вместо цветных линий */
.comment--depth-1,
.comment--depth-2,
.comment--depth-3 {
  padding-left: 24px;
  border-left: 1px solid var(--t-panel-border);
}

.comment--depth-1 { margin-left: 44px; }
.comment--depth-2 { margin-left: 88px; }
.comment--depth-3 { margin-left: 132px; }

/* --- Аватар: квадрат --- */
.comment__avatar {
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: #17181d;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 0;
}

/* --- Шапка комментария --- */
.comment__header {
  gap: 8px 14px;
  margin-bottom: 8px;
  align-items: baseline;
}

.comment__reply-label {
  width: 14px;
  height: 14px;
  color: var(--t-red-bright);
  align-self: center;
}

.comment__author {
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
}

.comment__date {
  font-family: var(--t-font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t-text-faint);
}

/* Бейджи в комментариях — без «пилюль» */
.comment__badges .badge {
  border-radius: 0;
  font-family: var(--t-font-mono);
  font-weight: 400;
  letter-spacing: 1px;
}

.comment__text {
  font-size: 15px;
  line-height: 1.6;
  color: #c9ced8;
}

.comment__text--deleted {
  font-style: normal;
  font-family: var(--t-font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--t-text-faint);
}

.comment--deleted .comment__header .comment__date {
  color: var(--t-text-faint);
}

/* --- Действия под комментарием --- */
.comment__actions {
  margin-top: 10px;
  gap: 18px;
}

.comment__like-btn,
.comment__like-readonly {
  gap: 6px;
  color: var(--t-text-muted);
  font-family: var(--t-font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  transition: color 0.18s ease;
}

.comment__like-btn:hover:not(:disabled) {
  color: var(--t-red-bright);
}

.comment__like-btn--active {
  color: var(--t-red-bright);
}

.comment__like-btn:focus-visible {
  outline: 1px solid var(--t-red-bright);
  outline-offset: 2px;
  border-radius: 0;
}

.comment__like-icon {
  width: 13px;
  height: 13px;
}

.comment__like-count {
  font-weight: 400;
}

.comment__reply-btn,
.comment__delete-btn {
  font-family: var(--t-font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--t-text-muted);
  transition: color 0.18s ease;
}

.comment__delete-btn {
  color: var(--t-text-faint);
}

.comment__reply-btn:hover,
.comment__delete-btn:hover:not(:disabled) {
  color: var(--t-red-bright);
}

/* ============================================================
   Формы комментариев
   ============================================================ */

/* Корневая форма — панель с кронштейнами (классы в разметке) */
.comment-form--root {
  margin-top: 24px;
  padding: 22px 24px;
  border: 1px solid var(--t-panel-border);
}

.comment-form__label {
  margin: 0 0 14px;
  font-family: var(--t-font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--t-text-muted);
}

.comment-form__textarea {
  background: rgba(12, 14, 16, 0.6);
  border: 1px solid var(--t-panel-border);
  border-radius: 0;
  color: var(--t-text);
  font-family: var(--t-font-body);
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 14px;
}

.comment-form__textarea::placeholder {
  color: var(--t-text-faint);
}

.comment-form__textarea:focus {
  border-color: var(--t-red);
}

.comment-form__footer {
  margin-top: 12px;
}

.comment-form__counter {
  font-family: var(--t-font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--t-text-faint);
}

.comment-form__submit {
  border-radius: 0;
  background: var(--t-red);
  color: #ffffff;
  font-family: var(--t-font-display);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 26px;
  transition: background 0.18s ease;
}

.comment-form__submit:hover:not(:disabled) {
  background: #e63946;
}

.comment-form__cancel {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0;
  background: transparent;
  color: var(--t-text-muted);
  font-family: var(--t-font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 11px 18px;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.comment-form__cancel:hover {
  border-color: var(--t-red-bright);
  color: var(--t-red-bright);
}

/* Форма ответа внутри комментария — компактнее */
.comment__reply-form {
  margin-top: 14px;
}

.comment__reply-form .comment-form__submit {
  padding: 10px 20px;
  font-size: 11px;
}

.comment__reply-form .comment-form__cancel {
  padding: 9px 14px;
  font-size: 10px;
}

/* ============================================================
   Тост ошибки и лайтбокс — в плоской геометрии
   ============================================================ */

.comment-error-toast {
  background: #101114;
  border: 1px solid var(--t-red);
  border-left-width: 2px;
  border-radius: 0;
  color: var(--t-text);
  font-family: var(--t-font-body);
}

.article-image-lightbox__img {
  border-radius: 0;
  box-shadow: none;
  border: 1px solid var(--t-panel-border);
}

.article-image-lightbox__close {
  border-radius: 0;
  background: var(--t-red);
}

.article-image-lightbox__close:hover {
  background: #e63946;
}

/* ============================================================
   Адаптив
   ============================================================ */

@media (max-width: 768px) {
  .news-post-breadcrumb {
    max-width: none;
    width: auto;
    margin: 24px auto 18px;
    padding: 0;
    border-radius: 0;
  }

  .news-post-title {
    font-size: 28px;
  }

  .news-post-content {
    padding: 24px 18px;
    font-size: 15px;
  }

  .news-post--patch .news-post-content {
    padding-left: 18px;
  }

  .comment {
    padding: 16px 14px;
    gap: 12px;
  }

  .comment__avatar {
    width: 36px;
    height: 36px;
  }

  .comment--depth-1,
  .comment--depth-2,
  .comment--depth-3 {
    padding-left: 14px;
  }

  .comment--depth-1 { margin-left: 16px; }
  .comment--depth-2 { margin-left: 32px; }
  .comment--depth-3 { margin-left: 48px; }

  .comment-form--root {
    padding: 18px 14px;
  }

  .comment-form__submit {
    padding: 11px 20px;
  }
}

@media (max-width: 480px) {
  .news-post-title {
    font-size: 23px;
  }

  .comment__date {
    margin-left: 0;
    width: 100%;
    order: 3;
  }
}
