/* ==========================================================================
   KIYIZGROUP — новости (/news, /news/<slug>, ADR-205)
   Разметку собирает пограничная функция news-ssr; здесь только вид.
   Палитра сайта монохромная (base.css): выделение — весом, кеглем
   и трекингом, а не цветом.
   ========================================================================== */

/* ---------- общее ---------- */
.news-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.8rem;
  color: var(--ink-mute);
}
.news-crumbs a {
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.news-crumbs a:hover {
  color: var(--ink);
  border-bottom-color: currentColor;
}
.news-crumbs [aria-current] {
  color: var(--ink-soft);
  /* Длинный заголовок новости в крошках — одной строкой с многоточием */
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-card__cat {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- указатель ---------- */
.news-hero {
  padding: calc(var(--nav-h) + clamp(28px, 4vw, 56px)) 0 clamp(24px, 3vw, 40px);
}
.news-hero__title {
  margin: clamp(16px, 2.2vw, 26px) 0 0;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.1;
}
.news-hero__lead {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.66;
  color: var(--ink-soft);
}
.news-hero__lead a,
.news-empty a {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.news-list {
  padding: 0 0 clamp(56px, 8vw, 112px);
}
.news-empty {
  color: var(--ink-soft);
}

.news-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(20px, 2.6vw, 32px);
}
.news-card {
  min-width: 0;
}
.news-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.news-card__link:hover {
  border-color: var(--ink);
}
.news-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-sand);
  overflow: hidden;
}
.news-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: clamp(18px, 2vw, 24px);
}
.news-card__meta {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.news-card__title {
  display: block;
  font-size: clamp(1.12rem, 1.5vw, 1.3rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.news-card__excerpt {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.news-card__more {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- статья ---------- */
/*
  Колонка текста — 720px: на ней держится мера строки 65–75 знаков.
  Обложка и галерея шире колонки — до 1080px, — чтобы снимки стенда
  читались, а не терялись мелкими вставками.
*/
.news-article {
  --col: 720px;
  --wide: 1080px;
  padding: calc(var(--nav-h) + clamp(24px, 3.4vw, 48px)) var(--pad) 0;
}
.news-article__head,
.news-body,
.news-share,
.news-related {
  max-width: var(--col);
  margin-left: auto;
  margin-right: auto;
}
.news-note {
  margin: 18px 0 0;
  padding: 10px 14px;
  border-left: 2px solid var(--accent-mute);
  background: var(--bg-sand);
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.news-article__meta {
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.news-article__title {
  margin: 12px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.news-article__lead {
  margin: clamp(16px, 2vw, 24px) 0 0;
  font-size: clamp(1.08rem, 1.5vw, 1.26rem);
  line-height: 1.6;
  font-weight: 500;
}
.news-article__byline {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--ink-mute);
}
.news-article__author {
  color: var(--ink);
  font-weight: 600;
}
.news-langs {
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: var(--ink-mute);
}
.news-langs a {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.news-langs strong {
  color: var(--ink);
  font-weight: 600;
}

.news-cover {
  max-width: var(--wide);
  margin: clamp(24px, 3.4vw, 44px) auto 0;
}
.news-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r);
  background: var(--bg-sand);
}
.news-cover figcaption,
.news-figure figcaption,
.news-gallery__item figcaption,
.news-video figcaption,
.news-quote figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-mute);
}

/* ---------- текст ---------- */
.news-body {
  margin-top: clamp(28px, 3.6vw, 48px);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.75;
  overflow-wrap: break-word;
}
.news-body > * + * {
  margin-top: 1.1em;
}
.news-body p,
.news-body ul,
.news-body blockquote,
.news-body figure {
  margin-bottom: 0;
}
.news-body h2 {
  margin-top: 1.9em;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.25;
}
.news-body h3 {
  margin-top: 1.6em;
  font-size: 1.2rem;
  line-height: 1.3;
}
.news-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent-mute);
}
.news-body a:hover {
  border-bottom-color: var(--ink);
}
.news-body ul {
  padding-left: 1.2em;
}
.news-body li + li {
  margin-top: 0.4em;
}
.news-body li::marker {
  color: var(--accent-mute);
}
.news-body blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 18px;
  border-left: 2px solid var(--line);
  color: var(--ink-soft);
}

/* Цитата основателя — главный голос статьи: крупнее текста, без рамки-плашки */
.news-quote {
  margin: 2em 0 0;
  padding: clamp(22px, 3vw, 32px) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.news-quote blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
}
.news-quote p {
  margin: 0;
  font-size: clamp(1.12rem, 1.8vw, 1.4rem);
  line-height: 1.5;
  font-weight: 500;
  font-style: italic;
}
.news-quote p::before {
  content: '«';
}
.news-quote p::after {
  content: '»';
}
.news-quote figcaption {
  margin-top: 14px;
  font-style: normal;
  font-weight: 600;
  color: var(--ink-soft);
}

.news-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r);
}

/*
  Галерея. Снимки с выставки — вертикальные (телефон), поэтому три
  в ряд на компьютере и два на телефоне; выходит шире колонки текста,
  чтобы кадры не становились марками.
*/
.news-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
  width: min(var(--wide), calc(100vw - 2 * var(--pad)));
  margin-left: 50%;
  transform: translateX(-50%);
}
.news-gallery[data-count='1'] {
  grid-template-columns: minmax(0, 1fr);
}
.news-gallery[data-count='2'],
.news-gallery[data-count='4'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.news-gallery__item {
  margin: 0;
  min-width: 0;
}
.news-gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--r);
  background: var(--bg-sand);
}
.news-gallery[data-count='1'] .news-gallery__item img {
  aspect-ratio: auto;
}

/* Видео — обложка и кнопка; плеер появляется по нажатию (page.js) */
.news-video {
  margin: 0;
}
.news-video__play {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--dark);
  color: var(--ink-d);
  border: 0 !important;
}
.news-video__play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.news-video__btn {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}
.news-video__btn::after {
  content: '';
  position: absolute;
  left: 29px;
  top: 23px;
  border-style: solid;
  border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent var(--ink);
}
.news-video__label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
}
.news-video iframe,
.news-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--r);
  background: var(--dark);
}

/* ---------- поделиться, связанные ---------- */
.news-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: clamp(32px, 4vw, 52px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.news-share__label {
  margin-right: 6px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.news-share__btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: none;
  font: inherit;
  font-size: 0.84rem;
  color: var(--ink);
  cursor: pointer;
}
.news-share__btn:hover {
  border-color: var(--ink);
}

.news-related {
  margin-top: clamp(32px, 4vw, 48px);
}
.news-related h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.news-products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.news-products a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  font-size: 0.86rem;
  line-height: 1.35;
}
.news-products img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r);
  background: var(--bg-sand);
}
.news-products a:hover span {
  text-decoration: underline;
}
.news-links {
  margin: 0;
  padding-left: 1.1em;
  line-height: 1.7;
}
.news-links a {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.news-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.news-chips a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 40px;
  font-size: 0.86rem;
  color: var(--ink);
}
.news-chips a:hover {
  border-color: var(--ink);
}

.news-more {
  margin-top: clamp(48px, 6vw, 88px);
  padding: clamp(40px, 5vw, 72px) 0 clamp(56px, 7vw, 96px);
  background: var(--bg-sand);
}
.news-more__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(20px, 2.6vw, 32px);
}
.news-more__head h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}
.news-more__head a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

@media (max-width: 640px) {
  .news-gallery,
  .news-gallery[data-count='4'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .news-gallery[data-count='1'] {
    grid-template-columns: minmax(0, 1fr);
  }
  .news-crumbs [aria-current] {
    max-width: 100%;
  }
}

/* Других новостей пока нет — только ссылка на раздел под статьёй */
.news-back {
  /* Стоит после статьи, вне её отступов: та же колонка 720px плюс поля */
  max-width: calc(720px + 2 * var(--pad));
  margin: clamp(36px, 4vw, 52px) auto clamp(56px, 7vw, 96px);
  padding: 0 var(--pad);
  font-weight: 600;
  font-size: 0.9rem;
}
.news-back a {
  color: var(--ink);
}
