/* Лента новостей: колонка для чтения, карточки-посты, опросы и картинки. */

.news-page {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: clamp(22px, 3vw, 40px) 0 26px;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.2vw, 26px);
  -webkit-font-smoothing: antialiased;
}

/* Логотип шапки — как на главной, ценах и в галерее. */
@media (min-width: 781px) {
  .page-news .brand-logo {
    height: 48px;
  }
}

.page-news .site-footer {
  margin-top: 18px;
}

@media (min-width: 781px) {
  .page-news .site-footer {
    width: min(1180px, 92vw);
  }
}

/* ------------------------------- hero ------------------------------- */

.news-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-left: 22px;
  max-width: 720px;
  text-align: left;
}

.news-hero::before {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #78bdff, var(--blue));
  box-shadow: 0 0 22px rgba(55, 143, 255, 0.36);
  content: "";
}

.news-kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.news-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.news-lede {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ------------------------------ toolbar ----------------------------- */

.news-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  padding: 6px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(10, 19, 35, 0.94), rgba(5, 12, 24, 0.9));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.18);
}

.news-tab {
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition-property: color, background-color, scale;
  transition-duration: 0.18s;
  transition-timing-function: ease-out;
}

.news-tab:hover {
  color: var(--ink);
}

.news-tab:active {
  scale: 0.96;
}

.news-tab.is-active {
  color: #fff;
  background: linear-gradient(120deg, var(--blue), var(--cyan));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 22px var(--shadow);
}

.news-tab:focus-visible,
.news-more-button:focus-visible,
.news-poll-option:focus-visible,
.news-image-button:focus-visible,
.news-lightbox-close:focus-visible,
.news-card-title a:focus-visible {
  outline: 2px solid #8ac4ff;
  outline-offset: 2px;
}

/* -------------------------------- feed ------------------------------- */

.news-feed {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 22px);
  width: 100%;
}

.news-card {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 792px;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: clamp(18px, 2.4vw, 26px);
  border-radius: 24px;
  background: var(--panel);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 2px 6px rgba(0, 0, 0, 0.06),
    0 18px 44px rgba(0, 0, 0, 0.18);
  transition-property: opacity, translate, box-shadow;
  transition-duration: 0.5s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.news-card.is-entering {
  opacity: 0;
  translate: 0 14px;
  transition-delay: var(--enter-delay, 0ms);
}

.news-card.is-highlighted {
  box-shadow:
    0 0 0 1px rgba(86, 167, 255, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.06),
    0 18px 44px rgba(12, 52, 120, 0.3);
}

.news-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.news-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.news-badge--update {
  color: #9ecbff;
  background: rgba(24, 116, 217, 0.18);
  box-shadow: inset 0 0 0 1px rgba(86, 167, 255, 0.32);
}

.news-badge--contest {
  color: #ffd08a;
  background: rgba(214, 145, 24, 0.16);
  box-shadow: inset 0 0 0 1px rgba(240, 176, 68, 0.32);
}

.news-badge--poll {
  color: #c3b0ff;
  background: rgba(124, 92, 240, 0.18);
  box-shadow: inset 0 0 0 1px rgba(150, 122, 255, 0.32);
}

.news-badge--post {
  color: var(--muted);
  background: rgba(122, 135, 155, 0.14);
  box-shadow: inset 0 0 0 1px rgba(122, 135, 155, 0.28);
}

.news-pin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.news-pin::before {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.news-date {
  margin-left: auto;
  color: var(--soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.news-card-title {
  margin: 0;
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(22px, 2.6vw, 27px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.news-card-title a {
  color: inherit;
  text-decoration: none;
}

.news-card-title a:hover {
  color: var(--cyan);
}

/* Ширину строки задаёт сама карточка: отдельный лимит на текст оставлял
   справа пустое поле в треть карточки. */
.news-card-summary,
.news-card-body {
  max-width: 100%;
}

.news-card-summary {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
  opacity: 0.86;
  text-wrap: pretty;
}

/* ------------------------------ body text ---------------------------- */

.news-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.62;
  text-wrap: pretty;
}

.news-card-body > * {
  margin: 0;
}

.news-card-body h3,
.news-card-body h4,
.news-card-body h5 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.news-card-body h4,
.news-card-body h5 {
  font-size: 16px;
}

.news-card-body a {
  color: var(--cyan);
  text-decoration-color: rgba(86, 167, 255, 0.45);
  text-underline-offset: 3px;
}

.news-card-body a:hover {
  text-decoration-color: currentColor;
}

.news-card-body strong {
  color: var(--ink);
  font-weight: 700;
}

.news-card-body code {
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(120, 160, 220, 0.14);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

.news-card-body ul,
.news-card-body ol {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
}

.news-card-body li::marker {
  color: var(--cyan);
}

.news-card-body blockquote {
  margin: 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid rgba(86, 167, 255, 0.45);
  color: var(--ink);
  font-style: italic;
  opacity: 0.9;
}

.news-rule {
  width: 100%;
  height: 1px;
  margin: 4px 0;
  border: 0;
  background: var(--line);
}

/* ------------------------------- images ------------------------------ */

.news-images {
  display: grid;
  gap: 10px;
  width: 100%;
}

/* Кадрировать нечем: страницы комикса бывают и вытянутыми, и широкими —
   любое фиксированное соотношение срезает часть рисунка. */
.news-images--grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.news-image {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(6, 12, 24, 0.6);
  cursor: zoom-in;
  transition-property: scale, box-shadow;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.news-image-button:hover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.news-image-button:active {
  scale: 0.98;
}

.news-image-button img {
  display: block;
  width: 100%;
  height: auto;
  /* Тонкий контур даёт картинкам одинаковую глубину на любом сюжете. */
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

.news-image figcaption {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.4;
}

/* Одиночную картинку держим по высоте, а не по ширине: на 1180 px страница
   комикса во всю карточку перекрикивает сам текст записи. */
@media (min-width: 781px) {
  .news-images--single .news-image-button {
    width: fit-content;
    max-width: 100%;
  }

  .news-images--single .news-image-button img {
    width: auto;
    max-width: 100%;
    max-height: 380px;
  }

  .news-images--grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* -------------------------------- poll ------------------------------- */

.news-poll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 620px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(120, 160, 220, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.news-poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-poll-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: rgba(9, 17, 31, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition-property: background-color, box-shadow, scale;
  transition-duration: 0.18s;
  transition-timing-function: ease-out;
}

.news-poll-option:hover:not(:disabled) {
  background: rgba(16, 30, 54, 0.9);
  box-shadow: inset 0 0 0 1px rgba(86, 167, 255, 0.45);
}

.news-poll-option:active:not(:disabled) {
  scale: 0.96;
}

.news-poll-option:disabled {
  cursor: progress;
  opacity: 0.65;
}

.news-poll-marker {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(140, 170, 215, 0.5);
  transition: box-shadow 0.18s ease-out;
}

.news-poll-option:hover .news-poll-marker {
  box-shadow: inset 0 0 0 2px var(--cyan);
}

.news-poll-result {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(9, 17, 31, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.news-poll-result.is-choice {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(86, 167, 255, 0.5);
}

.news-poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--share, 0%);
  background: linear-gradient(90deg, rgba(24, 116, 217, 0.42), rgba(86, 167, 255, 0.28));
  transition: width 0.62s cubic-bezier(0.2, 0, 0, 1);
}

.news-poll-result.is-choice .news-poll-bar {
  background: linear-gradient(90deg, rgba(24, 116, 217, 0.7), rgba(86, 167, 255, 0.42));
}

.news-poll.is-fresh .news-poll-bar {
  width: 0;
}

.news-poll-result .news-poll-text,
.news-poll-result .news-poll-share {
  position: relative;
}

.news-poll-text {
  flex: 1 1 auto;
}

.news-poll-share {
  flex: 0 0 auto;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.news-poll-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.news-poll-choice::before {
  margin-right: 6px;
  content: "·";
}

.news-poll-error {
  margin: 0;
  color: #ff9a9a;
  font-size: 13px;
}

.news-poll-error[hidden] {
  display: none;
}

/* -------------------------------- cta -------------------------------- */

.news-cta {
  align-self: flex-start;
  min-height: 46px;
  text-decoration: none;
}

/* ------------------------- status and paging ------------------------- */

.news-status {
  padding: 22px 0;
  color: var(--soft);
  text-wrap: pretty;
}

.news-status[hidden] {
  display: none;
}

.news-more {
  display: flex;
  justify-content: center;
  width: 100%;
}

.news-more[hidden] {
  display: none;
}

.news-more-button {
  min-width: 200px;
}

/* ------------------------------ lightbox ----------------------------- */

.news-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(2, 6, 14, 0.9);
  backdrop-filter: blur(6px);
  animation: news-lightbox-in 0.22s cubic-bezier(0.2, 0, 0, 1);
}

.news-lightbox[hidden] {
  display: none;
}

.news-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

.news-lightbox-close {
  position: absolute;
  top: clamp(12px, 3vw, 24px);
  right: clamp(12px, 3vw, 24px);
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(12, 22, 40, 0.86);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: #dcecff;
  cursor: pointer;
  transition-property: background-color, scale;
  transition-duration: 0.18s;
}

.news-lightbox-close:hover {
  background: rgba(20, 34, 60, 0.94);
}

.news-lightbox-close:active {
  scale: 0.96;
}

.news-lightbox-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

body.is-lightbox-open {
  overflow: hidden;
}

@keyframes news-lightbox-in {
  from {
    opacity: 0;
  }
}

/* ------------------------------- toast ------------------------------- */

.news-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 70;
  padding: 11px 18px;
  border-radius: 14px;
  background: rgba(10, 19, 35, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 18px 44px rgba(0, 0, 0, 0.34);
  color: #eaf3ff;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  translate: -50% 12px;
  pointer-events: none;
  transition-property: opacity, translate;
  transition-duration: 0.24s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.news-toast.is-visible {
  opacity: 1;
  translate: -50% 0;
}

/* ------------------------------ responsive ---------------------------- */

@media (max-width: 780px) {
  .news-page {
    width: calc(100% - 28px);
    padding: 20px 0 22px;
    gap: 16px;
  }

  .news-hero {
    padding-left: 16px;
  }

  .news-lede {
    font-size: 15px;
  }

  .news-toolbar {
    align-self: stretch;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .news-toolbar::-webkit-scrollbar {
    display: none;
  }

  /* Пять фильтров должны умещаться в 390 px без прокрутки; на экранах уже
     ряд всё равно прокручивается. */
  .news-toolbar {
    gap: 4px;
  }

  .news-tab {
    flex: 0 0 auto;
    padding-inline: 9px;
    font-size: 12.5px;
  }

  .news-card {
    border-radius: 20px;
  }

  .news-date {
    margin-left: 0;
    width: 100%;
  }

  .news-card-summary {
    font-size: 16px;
  }

  .news-cta {
    align-self: stretch;
    justify-content: center;
    width: 100%;
  }

  /* На телефоне две-три полноразмерные страницы комикса превращают пост в
     бесконечную прокрутку — показываем плитку, полный кадр открывается
     по тапу. */
  .news-images--grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .news-images--grid .news-image-button img {
    aspect-ratio: 1;
    object-fit: cover;
  }
}

@media (max-width: 420px) {
  .news-toolbar {
    gap: 3px;
    padding: 5px 4px;
  }

  .news-tab {
    padding-inline: 8px;
    font-size: 12px;
  }

  .news-card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-card,
  .news-poll-bar,
  .news-toast,
  .news-lightbox {
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
  }

  .news-card.is-entering {
    opacity: 1;
    translate: none;
  }
}
