/* Общие стили */
.articles-section {
  padding: 20px;
}

.articles-section h1,
.article-category h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #0cf;
}

.article-category {
  margin-bottom: 30px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  justify-items: center;
}

.article-card {
  text-decoration: none;
  color: inherit;
  width: 100%;
  max-width: 400px; /* Cap width for consistency */
}

.article-preview {
  display: flex;
  background: linear-gradient(145deg, #3a3a3a, #1a1a1a);
  border-radius: 10px;
  box-shadow: 20px 20px 60px #0f0f0f, -20px -20px 60px #2a2a2a;
  overflow: hidden;
  width: 100%;
  min-height: 150px; /* Ensure consistent height */
  transition: transform 0.2s ease-in-out;
}

.article-card:hover .article-preview {
  transform: scale(1.05);
}

.article-preview img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #2a2a2a; /* Fallback if image fails to load */
}

.article-content {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px; /* Ensure content area has minimum height */
}

.article-content h3 {
  margin-bottom: 10px;
  font-size: 1.2em;
  color: #fff;
}

.article-content p {
  margin-bottom: 10px;
  line-height: 1.5;
  flex-grow: 1;
  color: #ddd; /* Slightly lighter for readability */
}

.article-date {
  font-size: 0.8em;
  color: #aaa;
}

/* Медиа-запрос для больших экранов */
@media (min-width: 992px) {
  .article-grid {
    grid-template-columns: repeat(3, 1fr);
    margin: 0 auto;
  }
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 767px) {
  .articles-section {
    padding-left: 10px;
    padding-right: 10px;
  }
  .article-grid {
    grid-template-columns: 1fr;
  }
  .article-preview {
    flex-direction: column;
    align-items: center;
  }
  .article-preview img {
    width: 100%;
    height: 200px;
  }
  .article-content {
    text-align: center;
    width: 100%;
  }
}

/* Скрытые карточки */
.article-grid .article-card.hidden {
  display: none;
}

/* Кнопка "Показать ещё" */
.show-more-btn {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background: linear-gradient(145deg, #3a3a3a, #1a1a1a);
  border: none;
  border-radius: 5px;
  color: #0cf; /* Твой кибер-цвет */
  font-family: 'Courier New', Courier, monospace;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 20px 20px 60px #0f0f0f, -20px -20px 60px #2a2a2a;
  transition: transform 0.2s ease-in-out, background-color 0.2s;
}

.show-more-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(145deg, #4a4a4a, #2a2a2a); /* Лёгкое осветление */
}

.show-more-btn.hidden {
  display: none;
}

/* Адаптив: На мобильных кнопка шире */
@media (max-width: 767px) {
  .show-more-btn {
    width: 100%;
  }
}