/* ═══════════════════════════════════════════════════════
   GUNRAT — страница новости (news_item) и карточки ленты
   Подключается в news.html и news_item.html
   ═══════════════════════════════════════════════════════ */

/* ── Карточки в ленте: кликабельные ── */
.news-card { position: relative; }
.news-card-link { display: block; color: inherit; text-decoration: none; }
.news-card-link:hover { color: inherit; }
.news-card-img { transition: transform 0.45s ease; }
.news-card-media { overflow: hidden; display: block; }
.news-card:hover .news-card-img { transform: scale(1.03); }
.news-card-title a { color: inherit; text-decoration: none; }
.news-card-title a::after {          /* вся карточка — ссылка, но кнопка «поделиться» работает */
  content: ''; position: absolute; inset: 0; z-index: 1;
}
.news-card-title a:hover { color: inherit; }   /* заголовок при наведении не перекрашивается */
.news-card-text { white-space: pre-line; }
.news-card-footer { position: relative; }
.news-card-footer .share-btn-icon,
.news-card-more { position: relative; z-index: 2; }
.news-card-actions { display: flex; align-items: center; gap: 14px; }
.news-card-more {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--magenta);
}
.news-card:hover .news-card-more { color: var(--gold2); }
.share-btn-icon.share-copied::after { content: 'Link copied'; }

/* ═══ Статья ═══════════════════════════════════════════ */
.na {
  max-width: 1152px;   /* = ширина контейнера сайта (.container) */
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.na-back { margin-bottom: 24px; }

.na-preview {
  margin-bottom: 20px;
  padding: 10px 16px;
  border-left: 3px solid var(--gold2);
  background: rgba(245,204,0,0.08);
  color: var(--gold2);
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: 4px;
}

.na-cover {
  margin: 0 0 28px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  background: var(--bg3);
}
.na-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.na-head { margin-bottom: 28px; }
.na-meta {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  margin-bottom: 12px;
}
.na-meta__tag {
  padding: 2px 8px;
  border: 1px solid var(--magenta);
  border-radius: 3px;
  color: var(--magenta);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 11px;
}
.na-title {
  font-family: var(--font-title);
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.2;
  color: var(--gold2);
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.na-lead {
  font-size: 19px;
  line-height: 1.6;
  color: #ece8df;
  font-weight: 600;
  padding-left: 18px;
  border-left: 3px solid var(--magenta);
  white-space: pre-line;
}

.na-body { color: var(--text); font-size: 17px; line-height: 1.8; }
.na-body p { margin: 0 0 1.1em; white-space: pre-line; }
.na-body p:last-child { margin-bottom: 0; }

.na-section-title {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--gold2);
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.na-section-title span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 8px;
}

/* ── Выделенные блоки (анонсы) ── */
.na-callout {
  --c: var(--gold2);
  --c-bg: rgba(245,204,0,0.06);
  --c-glow: rgba(200,168,0,0.18);
  position: relative;
  margin: 32px 0;
  padding: 22px 26px;
  /* лёгкая рамка с мягким свечением, без полосы слева */
  background: linear-gradient(var(--c-bg), var(--c-bg)), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0 22px var(--c-glow);
}
.na-callout--magenta { --c: var(--magenta); --c-bg: rgba(224,64,251,0.07); --c-glow: rgba(224,64,251,0.18); }
.na-callout--green   { --c: var(--green);   --c-bg: rgba(0,230,118,0.06);  --c-glow: rgba(0,230,118,0.14); }
.na-callout--warning { --c: #ff6b4a;        --c-bg: rgba(255,107,74,0.07); --c-glow: rgba(255,107,74,0.16); }
.na-callout__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c);
  margin-bottom: 8px;
}
.na-callout__title {
  font-family: var(--font-title);
  font-size: 20px;
  line-height: 1.3;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.na-callout__body { font-size: 16px; line-height: 1.7; color: var(--text); white-space: pre-line; }

/* ── GIF-акцент ── */
.na-gif { margin: 40px 0; }
.na-gif__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.na-gif__pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 0 0 rgba(224,64,251,0.7);
  animation: na-pulse 1.6s infinite;
}
.na-gif__label {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--magenta);
  text-shadow: 0 0 8px rgba(224,64,251,0.6);
}
.na-gif__frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--magenta);
  background: #000;
  animation: na-glow 2.4s ease-in-out infinite;
}
.na-gif__frame img { display: block; width: 100%; height: auto; }
.na-gif__frame::before,
.na-gif__frame::after {          /* уголки-прицел */
  content: ''; position: absolute; width: 22px; height: 22px; z-index: 2;
  border: 2px solid var(--gold2); pointer-events: none;
}
.na-gif__frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.na-gif__frame::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.na-gif__caption {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-line;
}
@keyframes na-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224,64,251,0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(224,64,251,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,64,251,0); }
}
@keyframes na-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(224,64,251,0.30); }
  50%      { box-shadow: 0 0 34px rgba(224,64,251,0.65); }
}
@media (prefers-reduced-motion: reduce) {
  .na-gif__pulse, .na-gif__frame { animation: none; }
}

/* ── Галерея ── */
.na-gallery { margin: 40px 0; }
.na-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.na-gallery__item { margin: 0; }
/* нечётное число фото: первое — на всю ширину */
.na-gallery__item:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.na-gallery--single .na-gallery__grid { grid-template-columns: 1fr; }
.na-gallery__open {
  display: block; width: 100%; padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: zoom-in;
  background: var(--bg3); aspect-ratio: 16 / 9;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.na-gallery__open:hover,
.na-gallery__open:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(200,168,0,0.25);
  outline: none;
}
.na-gallery__open img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.4s ease;
}
.na-gallery__open:hover img { transform: scale(1.04); }
.na-gallery__item figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ── Лайтбокс ── */
.na-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.92);
  padding: 48px 64px;
}
.na-lightbox[hidden] { display: none; }
.na-lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.na-lightbox__figure img {
  max-width: 100%; max-height: calc(100vh - 140px);
  object-fit: contain; border-radius: 6px; display: block; margin: 0 auto;
}
.na-lightbox__figure figcaption {
  margin-top: 12px; color: var(--text); font-size: 15px;
}
.na-lightbox__close,
.na-lightbox__nav {
  position: absolute; background: rgba(20,20,20,0.8); color: #fff;
  border: 1px solid var(--border); cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.na-lightbox__close:hover, .na-lightbox__nav:hover { border-color: var(--magenta); color: var(--magenta); }
.na-lightbox__close { top: 16px; right: 16px; width: 40px; height: 40px; font-size: 16px; }
.na-lightbox__nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 28px; line-height: 1; }
.na-lightbox__nav--prev { left: 12px; }
.na-lightbox__nav--next { right: 12px; }
.na-lightbox--single .na-lightbox__nav,
.na-lightbox--single .na-lightbox__count { display: none; }
.na-lightbox__count {
  position: absolute; top: 24px; left: 24px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
}

/* ── Подпись Low Res и копирайт ── */
.na-credits { margin-top: 40px; }
.na-credits--signed {                 /* верхний разделитель — только если есть подпись */
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.na-sign { display: flex; align-items: center; gap: 14px; min-width: 0; }
.na-sign__logo {
  max-height: 40px; width: auto; display: block; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px;
  box-sizing: content-box;
}
.na-sign__logo--text {
  font-family: var(--font-title); font-size: 11px; line-height: 1.2;
  color: var(--text-dim); text-align: center;
}
.na-sign__text { display: flex; flex-direction: column; min-width: 0; }
.na-sign__name { font-family: var(--font-title); font-size: 14px; color: var(--text); letter-spacing: 1px; }
.na-sign__sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

/* Мелкий шрифт: копирайт (как пометка reCAPTCHA) */
.na-legal {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}
.na-sign + .na-legal { margin-top: 16px; }

/* Нижний разделитель и кнопка «поделиться» */
.na-actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}

/* ── Соседние новости ── */
.na-pager {
  margin-top: 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.na-pager__link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.na-pager__link:hover { border-color: var(--magenta); }
.na-pager__link--right { text-align: right; grid-column: 2; }
.na-pager__dir { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.na-pager__title { font-family: var(--font-title); font-size: 14px; color: var(--gold2); line-height: 1.35; }

@media (max-width: 640px) {
  .na { padding: 28px 16px 48px; }
  .na-lead { font-size: 17px; }
  .na-body { font-size: 16px; }
  .na-callout { padding: 18px 20px; }
  .na-gallery__grid { grid-template-columns: 1fr; }
  .na-pager { grid-template-columns: 1fr; }
  .na-pager__link--right { grid-column: auto; }
  .na-lightbox { padding: 56px 8px; }
  .na-lightbox__nav { top: auto; bottom: 16px; transform: none; }
  .na-lightbox__nav--prev { left: calc(50% - 60px); }
  .na-lightbox__nav--next { right: calc(50% - 60px); }
}
