/* newsnet: галерея в статье (собирается gallery.js из figure с картинками,
   когда их три и больше). Цвета нейтральные, чтобы подходить любой теме. */
.nn-gallery { margin: 1.5em 0; }
.nn-gallery-stage { position: relative; background: #111; border-radius: 10px; overflow: hidden; }
.nn-gallery-stage img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; background: #111; }
.nn-gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; font-size: 22px; line-height: 44px; text-align: center; cursor: pointer;
  opacity: .85; transition: opacity .15s ease, background .15s ease;
}
.nn-gallery-nav:hover { opacity: 1; background: rgba(0,0,0,.7); }
.nn-gallery-nav[disabled] { opacity: .25; cursor: default; }
.nn-gallery-prev { left: 10px; }
.nn-gallery-next { right: 10px; }
.nn-gallery-counter { position: absolute; right: 12px; bottom: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.nn-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 4px; }
.nn-gallery-thumb { flex: 0 0 auto; width: 96px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #eee; cursor: pointer; scroll-snap-align: start; opacity: .75; transition: opacity .15s ease, border-color .15s ease; }
.nn-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nn-gallery-thumb:hover { opacity: 1; }
.nn-gallery-thumb.is-active { opacity: 1; border-color: currentColor; }
.nn-gallery-caption { margin-top: 10px; font-size: .92em; line-height: 1.45; opacity: .8; text-align: center; font-style: italic; }
.nn-gallery-caption:empty { display: none; }
@media (max-width: 600px) {
  .nn-gallery-thumb { width: 72px; height: 52px; }
  .nn-gallery-nav { width: 36px; height: 36px; line-height: 36px; font-size: 18px; }
}

/* newsnet: видео YouTube в статье (см. gallery.js). */
.nn-video { position: relative; margin: 1.5em 0; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.nn-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nn-video-play { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.nn-video-play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: opacity .2s ease, transform .3s ease; }
.nn-video-play:hover img { opacity: 1; transform: scale(1.02); }
.nn-video-icon { position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; margin: -27px 0 0 -38px; border-radius: 14px; background: rgba(0,0,0,.72); transition: background .2s ease; }
.nn-video-icon::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -11px 0 0 -7px; border-style: solid; border-width: 11px 0 11px 20px; border-color: transparent transparent transparent #fff; }
.nn-video-play:hover .nn-video-icon { background: #e62117; }

/* newsnet: картинки внутри текста статьи тоже не обрезаются - вписываются по
   масштабу. Галерея (выше) уже показывает кадр целиком через object-fit: contain;
   это правило для одиночных figure, которые в галерею не собираются. */
[data-article-body] figure img,
[data-article-body] p > img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  margin-inline: auto;
  object-fit: contain;
}
