/* ================================
   📰 Public News List (Novicoins)
   ================================ */

/* --- Базовый контейнер --- */
body {
  padding-bottom: 120px; /* запас под фиксированный футер */
  font-family: system-ui, sans-serif;
}

.news-container {
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 0 16px;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 20px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Карточка новости --- */
.news-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 260px; /* 📌 больше воздуха для обычных карточек */
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* --- Медиа --- */
.news-card-media img,
.news-card-placeholder {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.news-card-placeholder {
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #bbb;
}

/* --- Тело карточки --- */
.news-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px;
  background: #fff;
  position: relative;
  z-index: 1;
}

.news-card-date {
  font-size: 0.75rem;
  color: #777;
  margin-bottom: 4px;
}

.news-card-title {
  font-size: 1rem;
  margin: 0 0 8px;
  line-height: 1.3;

  display: -webkit-box;
  -webkit-line-clamp: 2; 
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-title a {
  color: #4a3c8c;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-card-title a:hover {
  text-decoration: underline;
  color: #6e2ca0;
}

.news-card-teaser {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #333;
  margin-bottom: 8px;
}

.news-meta {
  font-size: 0.75rem;
  color: #777;
  margin-top: auto;       /* 📌 всегда прижимает вниз */
  align-self: flex-start; /* 📌 влево */
}

/* --- Admin actions --- */
.admin-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.btn-admin-action {
  background: none;
  border: none;
  color: #666;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}

.btn-admin-action:hover {
  color: #c00;
  text-decoration: underline;
}

.btn-pin {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #7c3aed;
  transition: transform 0.2s, color 0.2s;
}

.btn-pin:hover {
  transform: scale(1.2);
  color: #5b21b6;
}

.btn-pin.active {
  color: #5b21b6;
}

/* --- Hero Section --- */
.news-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 30px;
  padding: 0 16px;
}

.hero-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  position: relative;
}

.hero-card img,
.hero-card .news-card-placeholder {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.hero-card-body {
  flex: 1;
  min-height: 120px;
  padding: 16px;
  background: #fff;
  color: #333;
  position: relative;
  z-index: 1;
}

.hero-card-title {
  font-size: 1.4rem;
  margin: 0 0 10px;
}

.hero-card-title a {
  color: #4a3c8c;
  text-decoration: none;
}

.hero-card-title a:hover {
  color: #6e2ca0;
  text-decoration: underline;
}

.hero-card-teaser {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.5;
}

/* --- Highlight pinned news --- */
.news-card.pinned,
.hero-card.pinned {
  border: 2px solid #d6c6ff;
  box-shadow: 0 0 10px rgba(214,198,255,0.4);
}

.news-card.pinned .news-card-body,
.hero-card.pinned .hero-card-body {
  background: #f9f6ff;
}

.news-card.pinned .news-card-title a,
.hero-card.pinned .hero-card-title a {
  color: #5b3fc0;
}

/* --- Controls (search + sort) --- */
.news-controls {
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 0 16px;
}

.news-search-sort {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.news-search-sort input[type="text"],
.news-search-sort select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

.news-search-sort input[type="text"] {
  flex: 1;
}

.news-search-sort button {
  padding: 8px 14px;
  border: none;
  background: #4a3c8c;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.news-search-sort button:hover {
  background: #6e2ca0;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 30px 0;
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.pagination a {
  padding: 8px 14px;
  border-radius: 6px;
  background: #f0f0f0;
  color: #4a3c8c;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.pagination a:hover {
  background: #4a3c8c;
  color: #fff;
}

.pagination span {
  color: #555;
}

/* ================================
   📱 Mobile Responsive
   ================================ */
@media (max-width: 768px) {
  .news-hero {
    grid-template-columns: 1fr;
  }

  .hero-card img {
    height: 160px;
  }

  .hero-card-title {
    font-size: 1.2rem;
  }

  .news-list {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 12px;
    scroll-snap-type: x mandatory;
  }

  .news-card {
    flex: 0 0 80%;
    max-width: 80%;
    scroll-snap-align: start;
    min-height: auto; /* на мобилках можно убрать фиксированную высоту */
  }

  .news-card-media img,
  .news-card-placeholder {
    height: 140px;
  }

  .news-card-title {
    font-size: 1.1rem;
  }

  .news-card-teaser {
    font-size: 0.9rem;
  }

  .news-meta {
    font-size: 0.8rem;
  }

  .pagination {
    flex-direction: column;
    gap: 10px;
  }

  .pagination a,
  .pagination span {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
  }
}

/* ================================
   💻 Desktop Fine-Tuning
   ================================ */
@media (min-width: 769px) {
  .news-card-body {
    padding: 20px;
  }

  .news-card-title {
    font-size: 1rem;
    margin: 0 0 6px;
  }

  .news-card-teaser {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 6px;
  }

  .news-meta {
    font-size: 0.75rem;
  }
}
.icon-pin {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #7c3aed;      /* фиолетовая обводка */
  stroke-width: 2;
  vertical-align: middle;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.icon-pin.active {
  fill: #7c3aed;        /* заливка фиолетовым */
  stroke: #7c3aed;
}

.btn-pin {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;       /* чтобы убрать лишний отступ */
}

.btn-pin:hover .icon-pin {
  stroke: #5b21b6;      /* темнее при наведении */
  fill: rgba(124,58,237,0.2);
}

/* --- Стили для тизера новости --- */
.hero-card-teaser ul li::marker,
.hero-card-teaser ol li::marker {
  color: #8e7cc3 !important;
}

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

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

.hero-card-teaser p {
  line-height: 1.6;
  margin: 8px 0;
  color: #333;
}

.hero-card-teaser h2, 
.hero-card-teaser h3 {
  color: #4a3c8c;
  margin: 12px 0 8px;
}

.hero-card-teaser pre {
  background: #f4f1fa;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 14px;
  color: #333;
}
/* --- Ограничение тизера на 3 строки --- */
.news-card-teaser,
.hero-card-teaser {
  display: -webkit-box;
  -webkit-line-clamp: 3;   /* кол-во строк */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

