/* Раздел «Новости и статьи» (ТЗ «Раздел новостей», §7, §6.3): списки, карточки, страница публикации, озвучка.
   Фирменный стиль сайта: токены tokens.css, прямые углы, Montserrat. */

/* ---------- Шапка раздела ---------- */
.news-head {
  background: var(--c-navy);
  color: var(--c-white);
}
.news-head__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 32px;
  padding-bottom: 40px;
}
.news-head .breadcrumbs,
.news-head .breadcrumbs a {
  color: var(--c-white);
}
.news-head .breadcrumbs {
  opacity: 0.85;
  margin-bottom: 8px;
}
.news-head__title {
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.news-head__intro {
  font-size: 17px;
  line-height: 1.55;
  max-width: 680px;
  color: var(--c-grey);
}

/* ---------- Тело списка ---------- */
.news-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 64px;
}
.news-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--c-grey);
  overflow-x: auto;
  scrollbar-width: none;
}
.news-tabs::-webkit-scrollbar {
  display: none;
}
.news-tabs__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  margin-bottom: -2px;
  font-size: 15px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-text-muted);
  text-decoration: none;
  border-bottom: 4px solid transparent;
}
.news-tabs__link:hover {
  color: var(--c-navy);
  text-decoration: none;
}
.news-tabs__link[aria-current="page"] {
  color: var(--c-navy);
  border-bottom-color: var(--c-red);
}
.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.news-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 2px solid var(--c-grey);
  background: var(--c-white);
  color: var(--c-navy);
  font-size: 14px;
  text-decoration: none;
}
.news-tag:hover {
  border-color: var(--c-navy);
  text-decoration: none;
}
.news-tag__n {
  font-size: 12px;
  color: var(--c-text-muted);
}
.news-tag--active {
  background: var(--c-navy);
  border-color: var(--c-navy);
  color: var(--c-white);
  font-weight: var(--fw-bold);
}
.news-tag--active:hover {
  background: var(--c-navy-hover);
  border-color: var(--c-navy-hover);
}
.news-tag__x {
  font-size: 12px;
}
.news-results {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.news-pager {
  display: flex;
  justify-content: center;
}
.news-empty {
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}
.news-empty__icon {
  color: var(--c-grey);
}

/* ---------- Карточка публикации (поверх .card из site.css) ---------- */
.post-card {
  border: 2px solid var(--c-grey-light);
  gap: 10px;
  padding: 18px 20px 20px;
}
.post-card .card__cover {
  margin: -18px -20px 0;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--c-grey-subtle);
  color: var(--c-grey);
}
.post-card__cover--empty {
  background: linear-gradient(135deg, #eef1f8, var(--c-grey-subtle));
  align-items: center;
  justify-content: center;
}
.post-card__cover--empty .post-card__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--c-navy-line);
  opacity: 0.6;
}
.post-card .card__cover-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  color: var(--c-text-muted);
  margin-top: 8px;
}
.post-card__pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--c-warn);
  font-weight: var(--fw-bold);
}
.post-card__kind {
  font-weight: var(--fw-bold);
  text-decoration: none;
}
.post-card__title {
  font-size: 19px;
  line-height: 1.3;
}
.post-card__lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__tags {
  margin-top: auto;
  padding-top: 4px;
}
.post-card__tags .chip {
  min-height: 28px;
  text-transform: none;
  font-weight: var(--fw-regular);
  font-size: 13px;
  background: var(--c-grey-subtle);
  border-color: var(--c-grey-light);
  color: var(--c-text-muted);
}
.post-card__tags .chip:hover {
  background: var(--c-navy);
  border-color: var(--c-navy);
  color: var(--c-white);
  opacity: 1;
}

/* Закреплённая публикация */
.post-pinned {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border: 2px solid var(--c-navy);
  background: var(--c-white);
  overflow: hidden;
}
.post-pinned__cover {
  display: block;
  position: relative;
  min-height: 260px;
  background: var(--c-grey-subtle);
  color: var(--c-navy-line);
}
.post-pinned__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.post-pinned__cover--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef1f8, var(--c-grey-subtle));
}
.post-pinned__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  min-width: 0;
}
.post-pinned__body .post-card__meta {
  margin-top: 0;
}
.post-pinned__title {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.25;
}
.post-pinned__title a {
  text-decoration: none;
}
.post-pinned__title a:hover {
  text-decoration: underline;
}
.post-pinned__lead {
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-pinned .chip {
  min-height: 28px;
  text-transform: none;
  font-weight: var(--fw-regular);
  font-size: 13px;
  background: var(--c-grey-subtle);
  border-color: var(--c-grey-light);
  color: var(--c-text-muted);
}

/* ---------- Страница публикации ---------- */
.post-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 64px;
  container-type: inline-size;
}
.post-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--c-warn-bg);
  color: var(--c-warn);
  border-left: 8px solid var(--c-warn);
  font-size: 14px;
  line-height: 1.5;
}
.post-banner svg {
  flex: none;
}
.post-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 48px;
  align-items: start;
}
.post-grid--toc {
  grid-template-columns: minmax(0, 760px) 260px;
}
.post {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.post__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  color: var(--c-text-muted);
}
.post__kind {
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--c-navy);
}
.post__title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.post__lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--c-text-muted);
}
.post__cover {
  width: 100%;
  height: auto;
  background: var(--c-grey-subtle);
}
.post__body .pb-gallery__tile img {
  object-fit: contain;
}
.post__tags {
  margin-top: 8px;
}
.post__tags .chip {
  min-height: 32px;
  text-transform: none;
  font-weight: var(--fw-regular);
  font-size: 13px;
  background: var(--c-grey-subtle);
  border-color: var(--c-grey-light);
  color: var(--c-text-muted);
}
.post__tags .chip:hover,
.post-pinned .chip:hover {
  background: var(--c-navy);
  border-color: var(--c-navy);
  color: var(--c-white);
  opacity: 1;
}
.post__share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--c-grey);
  padding-top: 20px;
}
.post__share-label {
  color: var(--c-text-muted);
  width: 100%;
}
.post__share-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 2px solid var(--c-grey);
  background: var(--c-white);
  color: var(--c-navy);
  font-size: 14px;
  font-weight: var(--fw-bold);
  text-decoration: none;
  cursor: pointer;
}
.post__share-link:hover {
  border-color: var(--c-navy);
  text-decoration: none;
}
.post__copy-msg {
  color: var(--c-text-muted);
}
.post__copy-msg.is-error {
  color: var(--c-error);
}
.post-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
  width: 100%;
  margin: 24px auto 0;
}
.post-related {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 40px;
  border-top: 2px solid var(--c-grey);
  padding-top: 32px;
}

/* Оглавление */
.post__aside {
  display: none;
  min-width: 0;
}
.post__toc {
  position: sticky;
  top: calc(var(--site-header-height, var(--header-h)) + 24px);
  border-left: 1px solid var(--c-grey);
  padding-left: 16px;
}
.post__toc-title {
  font-size: 13px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}
.post__toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post__toc-item a {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--c-text-muted);
  text-decoration: none;
}
.post__toc-item a:hover {
  color: var(--c-navy);
  text-decoration: underline;
}
.post__toc-item--3 a {
  padding-left: 14px;
  font-size: 13px;
}
.post__toc-mobile {
  border: 2px solid var(--c-navy);
  padding: 0 16px;
}
.post__toc-mobile summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  font-size: 14px;
  cursor: pointer;
}
.post__toc-mobile summary::-webkit-details-marker {
  display: none;
}
.post__toc-mobile nav {
  padding: 4px 0 12px;
}

/* ---------- «Слушать» и панель озвучки (§6.3) ---------- */
.post__listen-wrap {
  z-index: 20;
}
.post__listen-wrap.is-active {
  position: sticky;
  top: calc(var(--site-header-height, var(--header-h)) + 8px);
}
.post__listen-idle {
  display: flex;
  align-items: center;
  gap: 12px;
}
.post__listen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border: 2px solid var(--c-navy);
  background: var(--c-white);
  color: var(--c-navy);
  font-size: 15px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  cursor: pointer;
}
.post__listen:hover {
  background: var(--c-navy);
  color: var(--c-white);
}
.post__listen-hint {
  color: var(--c-text-muted);
}
.post__tts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 8px 10px;
  border: 2px solid var(--c-navy);
  background: var(--c-white);
  box-shadow: 0 16px 40px rgba(12, 33, 115, 0.16);
}
.post__tts[hidden] {
  display: none;
}
.post__tts-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--c-text-muted);
  min-height: var(--tap);
}
.post__tts-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-ok);
  flex: none;
}
.post__tts.is-paused .post__tts-dot {
  background: var(--c-grey-surface);
}
.post__tts-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.post__tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 14px;
  border: 2px solid var(--c-navy);
  background: var(--c-white);
  color: var(--c-navy);
  font-size: 14px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  cursor: pointer;
}
.post__tts-btn:hover {
  background: var(--c-navy);
  color: var(--c-white);
}
.post__tts-rate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--c-text-muted);
}
.post__tts-select {
  min-height: var(--tap);
  padding: 0 10px;
  border: 2px solid var(--c-grey);
  background: var(--c-white);
  color: var(--c-navy);
  font-size: 14px;
}
.post__tts-error {
  margin-top: 8px;
  color: var(--c-error);
  font-size: 14px;
  line-height: 1.5;
}
.post__tts-error[hidden] {
  display: none;
}

/* ---------- Пустые страницы (404, ссылка недействительна) ---------- */
.news-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 72px 16px;
  max-width: 560px;
  margin: 0 auto;
}
.news-state__icon {
  color: var(--c-grey);
}
.news-state__title {
  font-size: 26px;
  line-height: 1.25;
  text-transform: uppercase;
}
.news-state__text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text-muted);
}
.news-state .btn {
  margin-top: 8px;
}

/* ---------- Предпросмотр во фрейме ---------- */
.post-preview-frame {
  min-height: auto;
}
.pv-note {
  background: var(--c-warn-bg);
  color: var(--c-warn);
  font: 13px/1.5 var(--font);
  padding: 8px 16px;
}
[data-preview] a {
  cursor: default;
}

/* ---------- Просмотр галереи (news.js) ---------- */
.lightbox--news {
  flex-direction: column;
  gap: 12px;
}
.lightbox--news img {
  max-height: calc(100vh - 160px);
}
.lightbox--news .lightbox__caption {
  bottom: 40px;
}
.lightbox__count {
  position: absolute;
  left: 16px;
  top: 16px;
  color: var(--c-white);
  font-size: 14px;
  font-weight: var(--fw-bold);
}

/* ---------- Точки перелома ---------- */
@media (min-width: 1180px) {
  .post__aside {
    display: block;
  }
  .post__toc-mobile {
    display: none;
  }
}
@media (max-width: 1179px) {
  .post-grid--toc {
    grid-template-columns: minmax(0, 760px);
  }
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 719px) {
  .news-head__inner {
    padding-top: 24px;
    padding-bottom: 28px;
  }
  .news-tag {
    min-height: var(--tap);
  }
  .news-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-pinned {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-pinned__cover {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .post-pinned__body {
    padding: 18px 20px 20px;
  }
  .post-card__tags .chip,
  .post-pinned .chip,
  .post__tags .chip {
    min-height: 32px;
  }
  .post__lead {
    font-size: 18px;
  }
  .post__share-link {
    min-height: var(--tap);
  }
  .post__listen-wrap.is-active {
    top: 4px;
  }
  .post__tts-status {
    width: 100%;
  }
  .post__tts-rate-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .news-state {
    padding: 48px 0;
  }
  .news-state__title {
    font-size: 22px;
  }
}

/* Скрытые состояния (перекрывают display: flex) */
.post__listen-idle[hidden],
.post__tts-btn svg[hidden] {
  display: none;
}
