/* ================================
   📰 News Detail Styles (Novicoins)
   ================================ */

/* === Article === */
.news-article {
  max-width: 850px;
  margin: 0 auto 30px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.news-article h1 {
  font-size: 2rem;
  color: #4a3c8c;
  margin-bottom: 8px;
}

.news-article .date {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 15px;
}

/* === Media (Image/Video) === */
.media-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #f5f5f5;
  margin: 15px 0;
  aspect-ratio: 16 / 9; /* фиксируем пропорции */
}

/* Скелетон-анимация */
.media-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 0;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.news-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: relative;
  z-index: 1;
}

.news-cover.loaded {
  opacity: 1;
}

/* === Content === */
.news-article .content {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 20px;
}

/* === Actions (лайки и др.) === */
.news-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
}

.news-actions span {
  font-size: 0.95rem;
  color: #444;
}

/* 💜 Кнопка лайка */
.like-btn {
  border: none;
  background: none;
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  padding: 0;
  line-height: 1;
}
.like-btn:hover {
  transform: scale(1.2);
}
.like-btn.liked {
  color: #4a3c8c;
}
.like-btn:not(.liked) {
  color: #aaa;
}

/* ================================
   💬 Comments
   ================================ */
.comments {
  max-width: 850px;
  margin: 0 auto;
  padding: 20px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #eee;
}

.comments h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #4a3c8c;
}

/* --- Comment form --- */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.comment-form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #ccc;
  resize: vertical;
  font-size: 1rem;
}
.comment-form textarea:focus {
  border-color: #4a3c8c;
  outline: none;
}
.comment-form button {
  align-self: flex-start;
  border: 2px solid #4a3c8c;
  background: transparent;
  color: #4a3c8c;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
.comment-form button:hover {
  background: #4a3c8c;
  color: #fff;
}

/* --- Comment list --- */
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.comment-list li {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
}
.comment-list strong {
  color: #4a3c8c;
}
.comment-date {
  font-size: 0.8rem;
  color: #777;
  margin-left: 6px;
}

/* ================================
   ✏️ Inline Edit Form (comments)
   ================================ */
.inline-edit-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inline-edit-form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #ccc;
  resize: vertical;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.inline-edit-form textarea:focus {
  border-color: #4a3c8c;
  box-shadow: 0 0 4px rgba(74, 60, 140, 0.3);
  outline: none;
}
.inline-edit-form .comment-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.inline-edit-form .comment-actions .nk-btn {
  border: 2px solid #4a3c8c;
  background: transparent;
  color: #4a3c8c;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}
.inline-edit-form .comment-actions .nk-btn:hover {
  background: #4a3c8c;
  color: #fff;
}

/* 📱 На мобилках кнопки в колонку */
@media (max-width: 600px) {
  .inline-edit-form .comment-actions {
    flex-direction: column;
  }
  .inline-edit-form .comment-actions .nk-btn {
    width: 100%;
    text-align: center;
  }
}

/* ================================
   ✏️ Edit/Delete actions (comments)
   ================================ */
.comment-actions a,
.comment-actions button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
  color: #777;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}
.comment-actions a:hover,
.comment-actions button:hover {
  color: #4a3c8c;
}
.comment-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
}

/* ================================
   📄 Pagination
   ================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}
.pagination a {
  border: 2px solid #4a3c8c;
  background: transparent;
  color: #4a3c8c;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}
.pagination a:hover {
  background: #4a3c8c;
  color: #fff;
}
.pagination span {
  font-size: 0.95rem;
  color: #444;
}

/* ================================
   📱 Responsive
   ================================ */
@media (max-width: 1024px) {
  .media-wrapper {
    aspect-ratio: 16 / 10;
  }
}
@media (max-width: 768px) {
  .news-article,
  .comments {
    padding: 15px;
  }
  .news-article h1 {
    font-size: 1.6rem;
  }
  .comment-form button,
  .pagination a {
    font-size: 0.85rem;
    padding: 4px 10px;
  }
  .media-wrapper {
    aspect-ratio: 4 / 3;
  }
}
@media (max-width: 480px) {
  .media-wrapper {
    aspect-ratio: 1 / 1; /* квадрат на мобилке */
  }
}
/* ================================
   📝 News Text Blocks (Markdown)
   ================================ */
.news-text {
  margin: 16px 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #333;
  font-family: system-ui, sans-serif;
}

/* Абзацы */
.news-text p {
  margin: 0 0 12px;
}

/* Нумерованные списки */
.news-text ol {
  padding-left: 1.6rem;
  margin: 0 0 14px;
  list-style: decimal;
}

/* Маркированные списки */
.news-text ul {
  padding-left: 1.6rem;
  margin: 0 0 14px;
  list-style: disc;
}

/* Вложенные списки */
.news-text ul ul,
.news-text ol ol,
.news-text ul ol,
.news-text ol ul {
  margin: 6px 0 6px;
  padding-left: 1.2rem;
  list-style-type: circle;
}

/* Элементы списка */
.news-text li {
  margin-bottom: 6px;
}

/* Ссылки */
.news-text a {
  color: #4a3c8c;
  text-decoration: underline;
  transition: color 0.2s ease;
}
.news-text a:hover {
  color: #6e2ca0;
}

/* Цитаты */
.news-text blockquote {
  border-left: 4px solid #ccc;
  padding-left: 12px;
  margin: 12px 0;
  color: #666;
  font-style: italic;
}

/* Заголовки внутри текста */
.news-text h2,
.news-text h3,
.news-text h4 {
  margin: 18px 0 10px;
  font-weight: 600;
  color: #4a3c8c;
}
.news-text h2 { font-size: 1.5rem; }
.news-text h3 { font-size: 1.3rem; }
.news-text h4 { font-size: 1.1rem; }

/* Кодовые блоки */
.news-text pre {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.95rem;
}
.news-text code {
  background: #f0f0f0;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.95rem;
}
/* ================================
   📱 Responsive for Mobile
   ================================ */
@media (max-width: 600px) {
  .news-text {
    font-size: 1rem;
    line-height: 1.5;
  }

  /* Списки */
  .news-text ul,
  .news-text ol {
    padding-left: 1.2rem; /* чуть меньше отступ */
  }

  /* Вложенные списки */
  .news-text ul ul,
  .news-text ol ol,
  .news-text ul ol,
  .news-text ol ul {
    padding-left: 1rem;
  }

  /* Цитаты */
  .news-text blockquote {
    margin: 10px 0;
    padding-left: 10px;
    font-size: 0.95rem;
  }

  /* Кодовые блоки */
  .news-text pre {
    padding: 8px;
    font-size: 0.9rem;
    white-space: pre-wrap;   /* ✅ перенос длинных строк */
    word-wrap: break-word;   /* ✅ чтобы не уезжало за экран */
  }

  .news-text code {
    font-size: 0.9rem;
  }
}

/* --- Стили для текста новости (как у поста) --- */
.news-text ul li::marker,
.news-text ol li::marker {
  color: #8e7cc3 !important; /* лёгкий фиолетовый */
}

.news-text blockquote {
  font-style: italic;
  border-left: 3px solid #4a3c8c;
  padding-left: 10px;
  margin: 10px 0;
  color: #555;
}

.news-text a {
  color: #4a3c8c;
  text-decoration: none;
}
.news-text a:hover {
  text-decoration: underline;
}

.news-text p {
  line-height: 1.6;
  margin: 8px 0;
  color: #333;
}

.news-text h1, 
.news-text h2, 
.news-text h3 {
  color: #4a3c8c;
  margin: 12px 0 8px;
}

.news-text pre {
  background: #f4f1fa;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 14px;
  color: #333;
}
