/* ==========================================================================
   content.css — контентные списки и страницы записей по В1
   (T43, docs/DESIGN-FORMS.md §10). Подключается шаблонами
   content/news_list, articles_list, news_item, articles_item.
   Цвета и радиусы — только токены tokens.css (D17).
   ========================================================================== */

/* --- Список: сетка карточек ------------------------------------------------- */
/* 3 колонки на 1440, 2 на планшете, 1 на телефоне (§10) */

.m-clist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 12px;
  margin: 16px 0 0;
}

@media (min-width: 640px) {
  .m-clist { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .m-clist { grid-template-columns: repeat(3, 1fr); gap: 20px 16px; }
}

/* --- Карточка записи (новость/статья) --------------------------------------- */
/* Геометрия m-bcard главной: белая карточка, радиус 22, тень --shadow;
   картинка 16:9, чип рубрики на фото, заголовок до 3 строк, мета мелко */

.m-ncard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-nested);          /* T76: стекло внутри панели */
  border: 1px solid var(--card-nested-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.m-ncard:hover { text-decoration: none; }
.m-ncard:active { transform: scale(0.98); }

/* Фото 16:9; без фото — градиентный блок в стиле В1 (подложка значков
   плиток §8) с газетой; скелетон под фото — как у m-bcard (T21) */
.m-ncard__photo {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
  background: var(--photo);
}

.m-ncard__photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--photo);
  animation: m-skeleton 1.6s ease-in-out infinite;
}

.m-ncard__photo img {
  position: relative;          /* фото поверх «дышащей» подложки */
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

/* Заглушка «нет фото»: подложка и значок — как у плиток §8 */
.m-ncard__ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    var(--tile-fill) padding-box,
    var(--tile-edge) border-box;
}

.m-ncard__ph svg {
  width: 48px;
  height: 48px;
  color: var(--accent-ink);
  filter: var(--tile-icon-shadow);
}

/* Чип рубрики на фото (§10) */
.m-ncard__cat {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 12px;
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
}

.m-ncard__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}

.m-ncard__title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;       /* заголовок до 3 строк (§10) */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-ncard__meta {
  margin-top: auto;            /* мета прижата к низу карточки */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.m-ncard__meta a { color: inherit; }
.m-ncard__meta a:hover { color: var(--ink); text-decoration: none; }

.m-ncard__comments {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.m-ncard__comments svg { width: 15px; height: 15px; }

/* Пустое состояние списка .m-cempty — общий компонент, с T44 живёт в
   base.css (нужно и вне контентных списков: вопросы, стена профиля) */

/* --- Страница записи --------------------------------------------------------- */

/* Категория записи уже пилюля (base.css, ft_category); отступ блока */
.m-body .content_item .ft_category { margin-bottom: 14px; }

/* Подпись поля видео — над блоком, а не слева (плеер на всю ширину) */
.m-body .content_item .f_video_link { overflow: hidden; }
.m-body .content_item .f_video_link .field_label.title_left {
  float: none;
  margin: 0 0 8px;
}

/* Встроенное видео: 16:9, радиус 20 (§10). iframe — youtube-nocookie */
.m-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  background: var(--photo);
}

.m-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Ссылка на видео вне YouTube — кнопка «Смотреть» (§7, T27a) */
.m-video__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  background: var(--orange-fill);
  box-shadow: var(--orange-shadow);
  color: var(--orange-ink);
  font-size: 15px;
  font-weight: 800;
}

.m-video__btn:hover { text-decoration: none; filter: brightness(1.05); }
.m-video__btn:active {
  transform: translateY(1px);
  box-shadow: var(--orange-shadow-press);
}

.m-video__btn svg { width: 18px; height: 18px; }
