/* Новости — список и страница новости. Оформление в стиле сайта:
   те же карточки, чипы и пагинация, что у проектов (projects.css). */

/* ---------- Хиро ---------- */

.nw-hero {
  width: min(var(--container-width), calc(100vw - var(--rz-gutter) * 2));
  /* Верхний отступ теперь у крошек; здесь — 24px до заголовка. */
  margin: 24px auto 0;
}

.nw-lead {
  max-width: 900px;
  margin: 24px 0 0;
  color: var(--color-muted);
  font-size: clamp(17px, 1.25vw, 24px);
  letter-spacing: -0.05em;
  line-height: normal;
}

/* ---------- Сетка новостей ---------- */

.nw-cards {
  width: min(var(--container-width), calc(100vw - var(--rz-gutter) * 2));
  margin: 32px auto 0;
}

.nw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  transition: opacity 240ms var(--transition-soft);
}

.nw-cards.is-loading .nw-grid {
  opacity: 0.5;
}

.nw-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-panel);
}

.nw-card__media {
  position: relative;
  display: block;
  height: 240px;
  flex: 0 0 240px;
  overflow: hidden;
}

.nw-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 480ms var(--transition-soft);
}

.nw-card:hover .nw-card__media img {
  transform: scale(1.04);
}

.nw-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--color-border);
}

.nw-card__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--color-accent);
  color: var(--color-inverse);
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
}

.nw-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.nw-card__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nw-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #6b6b6b;
  font-size: 16px;
  letter-spacing: -0.04em;
  line-height: 1.3;
}

.nw-card__dot {
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 999px;
  background: currentColor;
}

.nw-card__title {
  margin: 0;
  overflow: hidden;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: clamp(20px, 1.46vw, 28px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.05em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.nw-card__text {
  margin: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 16px;
  letter-spacing: -0.04em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Кнопка «Читать» — как «Смотреть кейс» у проектов */
.nw-card__button {
  display: flex;
  height: 63px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 20px;
  border: 1px solid var(--color-inverse);
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-inverse);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.04vw, 20px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: normal;
  transition: background 240ms var(--transition-soft), color 240ms var(--transition-soft);
}

.nw-card__button-circle {
  display: grid;
  width: 47px;
  height: 47px;
  flex: 0 0 47px;
  place-items: center;
  border-radius: 999px;
  /* PNG с запечённым диском: белый диск + стрелка #003049 (black.png). */
  background: var(--color-inverse) url("../assets/icons/rasprodazha/arrow-bottom-left-black.png?v=20260812") center / 47px 47px no-repeat;
}

.nw-card__button-circle img {
  display: block;
  width: 47px;
  height: 47px;
  object-fit: contain;
  /* PNG из разметки не показываем — иконку рисует background круга (свап на hover). */
  opacity: 0;
}

.nw-card__button:hover {
  border-color: var(--color-accent);
  background: var(--color-inverse);
  color: var(--color-accent);
}

.nw-card__button:hover .nw-card__button-circle {
  /* Инверсия: диск #003049 + белая стрелка (white.png). */
  background-color: var(--color-accent);
  background-image: url("../assets/icons/rasprodazha/arrow-bottom-left-white.png?v=20260812");
}

/* =========================================================================
   Страница новости
   ====================================================================== */

.nw-single {
  padding-bottom: 100px;
}

.nw-single__head {
  width: min(920px, calc(100vw - var(--rz-gutter) * 2));
  margin: 40px auto 0;
  text-align: center;
}

.nw-single__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 20px;
  color: #6b6b6b;
  font-size: clamp(15px, 1.04vw, 18px);
  letter-spacing: -0.04em;
  line-height: 1.3;
}

.nw-single__tag {
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--color-accent);
  color: var(--color-inverse);
  font-size: 14px;
  font-weight: 600;
}

.nw-single__title {
  margin: 0;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: clamp(32px, 3.75vw, 64px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

.nw-single__lead {
  margin: 24px 0 0;
  color: var(--color-muted);
  font-size: clamp(17px, 1.25vw, 24px);
  letter-spacing: -0.05em;
  line-height: normal;
}

.nw-single__cover {
  width: min(var(--container-width), calc(100vw - var(--rz-gutter) * 2));
  margin: 48px auto 0;
  overflow: hidden;
  border-radius: 16px;
}

.nw-single__cover img {
  display: block;
  width: 100%;
  height: clamp(280px, 40vw, 620px);
  object-fit: cover;
}

/* Тело новости — читаемая колонка */
.nw-content {
  width: min(920px, calc(100vw - var(--rz-gutter) * 2));
  margin: 56px auto 0;
  color: var(--color-text);
  font-size: clamp(16px, 1.04vw, 20px);
  letter-spacing: -0.02em;
  line-height: 1.6;
}

.nw-content > * + * {
  margin-top: 20px;
}

.nw-content h2,
.nw-content h3 {
  margin-top: 40px;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.2;
}

.nw-content h2 { font-size: clamp(24px, 1.88vw, 36px); }
.nw-content h3 { font-size: clamp(20px, 1.46vw, 28px); }

.nw-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-position: from-font;
}

.nw-content ul,
.nw-content ol {
  padding-left: 22px;
}

.nw-content li + li {
  margin-top: 8px;
}

.nw-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.nw-content blockquote {
  margin: 32px 0;
  padding: 24px 28px;
  border-left: 2px solid var(--color-accent);
  border-radius: 12px;
  background: var(--color-panel);
  color: var(--color-muted);
}

.nw-source {
  width: min(920px, calc(100vw - var(--rz-gutter) * 2));
  margin: 40px auto 0;
  color: #6b6b6b;
  font-size: 16px;
  letter-spacing: -0.04em;
}

.nw-source a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-position: from-font;
}

/* ---------- Другие новости ---------- */

.nw-related {
  width: min(var(--container-width), calc(100vw - var(--rz-gutter) * 2));
  margin: 100px auto 0;
}

.nw-related__title {
  margin: 0 0 40px;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: clamp(28px, 2.5vw, 48px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1200px) {
  .nw-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .nw-hero {
    margin-top: 24px;
  }

  .nw-grid {
    grid-template-columns: 1fr;
  }

  .nw-related {
    margin-top: 64px;
  }

  .nw-content,
  .nw-single__head {
    margin-top: 32px;
  }
}
