/* ===== COMMON NEWS STYLES ===== */
/* Общие стили для новостей - принцип DRY */

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* News Cards */
.news-card, .news-featured-news-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-featured-news-card {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.news-card:hover, .news-featured-news-card:hover {
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1);
}

/* News Image */
.news-image,
.news-featured-news-card .news-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 62.5%; /* 8:5 aspect ratio */
  overflow: hidden;
}

.news-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

.news-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 500;
  gap: 8px;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.news-image-placeholder svg {
  opacity: 0.8;
  color: rgba(255, 215, 0, 0.6);
}

/* News Content */
.news-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-featured-news-card .news-content {
  padding: 24px;
}

/* News Meta */
.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.news-date {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 500;
}

.news-author {
  color: rgba(255, 215, 0, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
}

.news-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-badge.news-featured {
  background: rgba(255, 215, 0, 0.2);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* News Title */
.news-title-text {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #fff;
  line-height: 1.4;
}

.news-featured-news-card .news-title-text {
  font-size: 1.4rem;
}

/* News Description */
.news-description {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 20px 0;
  flex-grow: 1;
}

/* News Actions */
.news-actions {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}

.news-link, .news-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.news-link::before, .news-read-more::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.news-link:hover::before, .news-read-more:hover::before {
  left: 100%;
}

.news-link:hover, .news-read-more:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.news-link-icon {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.news-link:hover .news-link-icon,
.news-read-more:hover .news-link-icon {
  transform: translateX(2px);
}

/* No News State */
.news-no-news {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.news-no-news-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.news-no-news-text {
  font-size: 1rem;
  margin: 0;
}

/* News Block Styles */
.news-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0;
  margin-top: 40px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.news-block .news-block-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 24px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.news-block .news-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.news-block .news-block-title h2 {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.news-block .news-header-accent-line {
  height: 2px;
  background: linear-gradient(90deg, #FFD700 0%, transparent 100%);
  border-radius: 1px;
}

.news-block .news-block-content {
  padding: 24px 32px 32px;
}

/* ===== NEWS MODAL STYLES ===== */
/* Оригинальные стили для модального окна новостей */

.news-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.news-modal.active {
  display: flex;
}

.news-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.news-modal-content {
  position: relative;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
}

.news-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.news-modal-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  flex: 1;
  padding-right: 20px;
}

.news-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.news-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.news-modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.6) rgba(255, 255, 255, 0.1);
}

.news-modal-body::-webkit-scrollbar {
  width: 8px;
}

.news-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.news-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.8), rgba(255, 165, 0, 0.6));
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.news-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 215, 0, 1), rgba(255, 165, 0, 0.8));
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.news-modal-body::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, rgba(255, 215, 0, 1), rgba(255, 165, 0, 1));
}

.news-modal-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.news-modal-content-text {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  font-size: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.5) rgba(255, 255, 255, 0.08);
}

.news-modal-content-text::-webkit-scrollbar {
  width: 7px;
}

.news-modal-content-text::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
}

.news-modal-content-text::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.7), rgba(255, 165, 0, 0.5));
  border-radius: 3px;
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.news-modal-content-text::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.9), rgba(255, 165, 0, 0.7));
  box-shadow: 0 0 7px rgba(255, 215, 0, 0.25);
}

/* Loading placeholder */
.news-loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.news-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #FFD700;
  border-radius: 50%;
  animation: news-spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes news-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.news-loading-placeholder p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-size: 0.9rem;
}

/* Article Content Styles */
#news-article-content {
  min-height: 400px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.4) rgba(255, 255, 255, 0.05);
}

#news-article-content::-webkit-scrollbar {
  width: 6px;
}

#news-article-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

#news-article-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.6), rgba(255, 165, 0, 0.4));
  border-radius: 3px;
  border: 1px solid rgba(255, 215, 0, 0.1);
}

#news-article-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.8), rgba(255, 165, 0, 0.6));
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.2);
}

/* Стили для ссылок в модальном окне */
#news-article-content a {
  color: #FFD700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  transition: border-color 0.3s ease;
}

#news-article-content a:hover {
  border-bottom-color: #FFD700;
}

/* Дополнительные элементы форматирования */
#news-article-content mark {
  background: rgba(255, 215, 0, 0.3);
  color: #FFD700;
  padding: 2px 4px;
  border-radius: 3px;
}

#news-article-content strong {
  color: #fff;
  font-weight: 600;
}

#news-article-content em {
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
}

#news-article-content u {
  text-decoration: underline;
  text-decoration-color: #FFD700;
}

#news-article-content s {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

#news-article-content cite {
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9em;
}

#news-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  overflow: hidden;
}

#news-article-content th,
#news-article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#news-article-content th {
  background: rgba(255, 215, 0, 0.1);
  color: #FFD700;
  font-weight: 600;
}

#news-article-content tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Изображения в модальном окне */
.news-modal-content-text .news-image-caption {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
  font-style: italic;
}

.news-modal-content-text .news-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.news-modal-content-text .news-image-gallery img {
  margin: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.news-modal-content-text .news-image-gallery img:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.news-modal-content-text h1, .news-modal-content-text h2, .news-modal-content-text h3 {
  color: #fff;
  margin-top: 24px;
  margin-bottom: 12px;
}

.news-modal-content-text h1:first-child,
.news-modal-content-text h2:first-child,
.news-modal-content-text h3:first-child {
  margin-top: 0;
}

.news-modal-content-text p {
  margin-bottom: 16px;
}

.news-modal-content-text ul, .news-modal-content-text ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.news-modal-content-text li {
  margin-bottom: 8px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .news-block .news-block-header {
    padding: 20px;
  }
  
  .news-block .news-block-content {
    padding: 20px;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .news-content {
    padding: 16px;
  }
  
  .news-title-text {
    font-size: 1.1rem;
  }
  
  .news-description {
    font-size: 0.9rem;
  }
  
  /* Modal Mobile */
  .news-modal {
    padding: 10px;
  }
  
  .news-modal-content {
    max-height: 95vh;
  }
  
  .news-modal-header {
    padding: 20px;
  }
  
  .news-modal-title {
    font-size: 1.3rem;
  }
  
  .news-modal-body {
    padding: 20px;
    max-height: calc(95vh - 80px);
  }
  
  .news-modal-meta {
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.85rem;
  }
}
