/* Clean Red Cyberpunk Blog Design - Pure Theme */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@300;400;500;600&display=swap');

/* CSS Variables */
:root {
  --pure-black: #000000;
  --dark-black: #0a0a0a;
  --neon-red: rgb(220, 53, 69);
  --cyber-red: #dc3545;
  --dark-red: #b02a37;
  --light-red: #e74c3c;
  --gray-dark: #1a1a1a;
  --gray-medium: #2a2a2a;
  --gray-light: #3a3a3a;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  --border-red: rgba(220, 53, 69, 0.3);
  --shadow-red: 0 0 30px rgba(220, 53, 69, 0.2);
  --gradient-red: linear-gradient(135deg, rgb(220, 53, 69) 0%, #dc3545 100%);
  --gradient-dark: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2a2a2a 100%);
  --gradient-red-dark: linear-gradient(135deg, #1a1a1a 0%, rgb(220, 53, 69) 50%, #b02a37 100%);
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--pure-black);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(220, 53, 69, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(220, 53, 69, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.articles-header {
  text-align: center;
  padding: 60px 0 40px;
  position: relative;
  overflow: hidden;
}

.articles-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: var(--gradient-red);
  box-shadow: 0 0 20px var(--neon-red);
}

.articles-header h1 {
  font-size: 3.5rem;
  font-weight: 900;
  background: var(--gradient-red-dark);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  position: relative;
  animation: cosmicGlow 3s ease-in-out infinite alternate;
}

.articles-header p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 300;
}

/* Non-uniform Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  padding: 40px 0 80px;
  grid-auto-rows: minmax(300px, auto);
}

/* Large featured article */
.article-card.featured {
  grid-column: span 2;
  grid-row: span 2;
  height: 720px;
  border-radius: 25px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.article-card.featured .article-image {
  height: 380px;
  border-radius: 25px 25px 0 0;
  position: relative;
}

.article-card.featured .article-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to top, var(--gray-dark), transparent);
}

.article-card.featured .article-content {
  height: 340px;
  padding: 30px;
  position: relative;
}

.article-card.featured .article-title {
  font-size: 1.7rem;
  height: auto;
  min-height: 4.2em;
  -webkit-line-clamp: 3;
  margin-bottom: 18px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.featured .article-excerpt {
  font-size: 1rem;
  height: auto;
  min-height: 10em;
  -webkit-line-clamp: 6;
  margin-bottom: 25px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.featured .article-category .badge {
  font-size: 0.85rem;
  padding: 10px 18px;
  margin-bottom: 25px;
}

/* Medium article */
.article-card.medium {
  grid-row: span 2;
  height: 720px;
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  position: relative;
}

.article-card.medium .article-image {
  height: 380px;
  border-radius: 22px 22px 0 0;
  position: relative;
}

.article-card.medium .article-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to top, var(--gray-dark), transparent);
}

.article-card.medium .article-content {
  height: 340px;
  padding: 25px;
  position: relative;
}

.article-card.medium .article-title {
  font-size: 1.4rem;
  height: auto;
  min-height: 4em;
  -webkit-line-clamp: 3;
  margin-bottom: 15px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.medium .article-excerpt {
  font-size: 0.95rem;
  height: auto;
  min-height: 9.5em;
  -webkit-line-clamp: 5;
  margin-bottom: 20px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.medium .article-category .badge {
  font-size: 0.8rem;
  padding: 8px 16px;
  margin-bottom: 20px;
}

/* Small article */
.article-card.small {
  height: 520px;
  border-radius: 20px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
  position: relative;
}

.article-card.small .article-image {
  height: 240px;
  border-radius: 20px 20px 0 0;
  position: relative;
}

.article-card.small .article-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, var(--gray-dark), transparent);
}

.article-card.small .article-content {
  height: 280px;
  padding: 20px;
  position: relative;
}

.article-card.small .article-title {
  font-size: 1.1rem;
  height: auto;
  min-height: 3.3em;
  -webkit-line-clamp: 3;
  margin-bottom: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.small .article-excerpt {
  font-size: 0.9rem;
  height: auto;
  min-height: 7.2em;
  -webkit-line-clamp: 4;
  margin-bottom: 15px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.small .article-category .badge {
  font-size: 0.75rem;
  padding: 6px 12px;
  margin-bottom: 15px;
}

/* Article Card Base Styles */
.article-card {
  background: var(--gray-dark);
  border: 1px solid var(--gray-medium);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  backdrop-filter: blur(10px);
  text-decoration: none;
  color: inherit;
  display: block;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.article-card:hover {
  transform: translateY(-8px);
  border-color: var(--neon-red);
  box-shadow: var(--shadow-red);
  text-decoration: none;
  color: inherit;
}

.article-card:hover::before {
  opacity: 1;
}

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

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-content {
  padding: 25px;
}

/* Category Badge */
.article-category {
  margin-bottom: 15px;
}

.article-category .badge {
  background: var(--neon-red);
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  transition: all 0.3s ease;
}

.article-card:hover .article-category .badge {
  background: var(--cyber-red);
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.4);
}

.article-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-primary);
  line-height: 1.3;
  transition: color 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-card:hover .article-title {
  color: var(--neon-red);
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--gray-medium);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-meta i {
  color: var(--neon-red);
  margin-right: 5px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--neon-red);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
}

.read-more::after {
  content: '→';
  transition: transform 0.3s ease;
}

.read-more:hover {
  color: var(--cyber-red);
  text-shadow: 0 0 10px var(--neon-red);
  text-decoration: none;
}

.read-more:hover::after {
  transform: translateX(5px);
}

/* Enhanced Search and Filters */
.search-form {
  margin-bottom: 35px;
  text-align: center;
  position: relative;
}

.search-form .input-group {
  max-width: 550px;
  margin: 0 auto;
  display: flex;
  box-shadow: 0 0 30px rgba(220, 53, 69, 0.2);
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--gray-medium);
  position: relative;
}

.search-form .input-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-form .input-group:focus-within::before {
  opacity: 1;
}

.search-form .form-control {
  background: var(--gray-dark);
  border: none;
  color: var(--text-primary);
  padding: 15px 20px;
  font-size: 1rem;
  flex: 1;
}

.search-form .form-control::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.search-form .form-control:focus {
  outline: none;
  box-shadow: none;
  background: var(--gray-dark);
}

.search-form .btn {
  background: linear-gradient(135deg, var(--neon-red), #ff3333);
  border: none;
  color: var(--text-primary);
  padding: 15px 25px;
  transition: all 0.4s ease;
  font-size: 1rem;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.search-form .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.search-form .btn:hover {
  background: linear-gradient(135deg, #ff3333, var(--neon-red));
  box-shadow: 0 0 25px rgba(220, 53, 69, 0.5);
  transform: scale(1.05);
}

.search-form .btn:hover::before {
  left: 100%;
}

.category-filter {
  text-align: center;
  margin-bottom: 35px;
  position: relative;
}

.category-filter .form-select {
  background: var(--gray-dark);
  border: 2px solid var(--gray-medium);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 15px;
  max-width: 250px;
  transition: all 0.4s ease;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
}

.category-filter .form-select:focus {
  border-color: var(--neon-red);
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
  outline: none;
  transform: translateY(-2px);
}

.category-filter .form-select:hover {
  border-color: var(--neon-red);
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
  transform: translateY(-2px);
}

.category-filter .form-select option {
  background: var(--gray-dark);
  color: var(--text-primary);
  padding: 12px;
}

/* Enhanced Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 50px;
  flex-wrap: wrap;
  position: relative;
}

.pagination .page-link {
  background: var(--gray-dark);
  border: 2px solid var(--gray-medium);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.4s ease;
  font-weight: 700;
  min-width: 45px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.pagination .page-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(220, 53, 69, 0.2), transparent);
  transition: left 0.6s ease;
}

.pagination .page-link:hover {
  background: linear-gradient(135deg, var(--neon-red), #ff3333);
  border-color: var(--neon-red);
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
  transform: translateY(-3px) scale(1.05);
}

.pagination .page-link:hover::before {
  left: 100%;
}

.pagination .current {
  background: linear-gradient(135deg, var(--neon-red), #ff3333);
  border-color: var(--neon-red);
  color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5); }
  50% { box-shadow: 0 6px 30px rgba(220, 53, 69, 0.8); }
}

.pagination i {
  font-size: 0.9rem;
}

/* Back to Articles Button */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--neon-red);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 30px;
  padding: 12px 20px;
  background: var(--gray-dark);
  border: 1px solid var(--gray-medium);
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.95rem;
}

.back-link::before {
  content: '←';
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.back-link:hover {
  color: var(--cyber-red);
  border-color: var(--neon-red);
  box-shadow: 0 0 15px rgba(220, 53, 69, 0.3);
  text-decoration: none;
  transform: translateX(-5px);
}

.back-link:hover::before {
  transform: translateX(-3px);
}

/* No Articles Message */
.no-articles {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.no-articles h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.no-articles p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.no-articles .btn {
  background: var(--neon-red);
  border: none;
  color: var(--text-primary);
  padding: 15px 30px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 1rem;
}

.no-articles .btn:hover {
  background: var(--cyber-red);
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
  text-decoration: none;
  transform: translateY(-2px);
}

/* Article Detail Page */
.article-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.article-detail-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}

.article-detail-title {
  font-size: 3rem;
  font-weight: 900;
  background: var(--gradient-red-dark);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  line-height: 1.2;
  animation: cosmicGlow 3s ease-in-out infinite alternate;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-detail-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.article-detail-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: var(--gray-dark);
  border: 1px solid var(--gray-medium);
  border-radius: 20px;
  font-size: 0.9rem;
}

.article-detail-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: var(--gray-dark);
  border: 1px solid var(--gray-medium);
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.article-detail-meta .meta-item:hover {
  border-color: var(--neon-red);
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.2);
}

.article-detail-meta i {
  color: var(--neon-red);
  margin-right: 5px;
}

.article-image-container {
  margin-bottom: 30px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.article-detail-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 40px;
  border: 1px solid var(--gray-medium);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.article-detail-image:hover {
  transform: scale(1.02);
}

.article-detail-content {
  background: var(--gray-dark);
  padding: 50px;
  border-radius: 12px;
  border: 1px solid var(--gray-medium);
  line-height: 1.8;
  font-size: 1.2rem;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

.article-detail-content h2 {
  font-size: 2rem;
  margin: 40px 0 20px;
  color: var(--neon-red);
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-detail-content h2::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 35px;
  background: var(--gradient-red);
  border-radius: 2px;
}

.article-detail-content h3 {
  font-size: 1.6rem;
  margin: 30px 0 15px;
  color: var(--cyber-red);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-detail-content p {
  margin-bottom: 25px;
  color: var(--text-secondary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-detail-content ul, 
.article-detail-content ol {
  margin: 25px 0;
  padding-left: 30px;
}

.article-detail-content li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-detail-content blockquote {
  border-left: 4px solid var(--neon-red);
  padding-left: 25px;
  margin: 35px 0;
  font-style: italic;
  color: var(--text-secondary);
  background: rgba(220, 53, 69, 0.05);
  padding: 25px;
  border-radius: 0 8px 8px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-detail-content code {
  background: var(--pure-black);
  color: var(--neon-red);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
}

.article-detail-content pre {
  background: var(--pure-black);
  padding: 25px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 25px 0;
  border: 1px solid var(--gray-medium);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-detail-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.article-detail-content a {
  color: var(--neon-red);
  text-decoration: none;
  border-bottom: 1px solid rgba(220, 53, 69, 0.3);
  transition: all 0.3s ease;
}

.article-detail-content a:hover {
  color: var(--cyber-red);
  border-bottom-color: var(--neon-red);
}

/* Улучшение читаемости на всех устройствах */
.article-detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.article-detail-content table {
  width: 100%;
  overflow-x: auto;
  display: block;
  font-size: 0.95rem;
  margin: 20px 0;
  border-collapse: collapse;
}

.article-detail-content table td,
.article-detail-content table th {
  padding: 10px;
  border: 1px solid var(--gray-medium);
  text-align: left;
}

.article-detail-content table th {
  background: var(--gray-medium);
  color: var(--text-primary);
  font-weight: 600;
}

/* Related Articles */
.related-articles {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--gray-medium);
}

.related-articles h3 {
  font-size: 1.8rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 30px;
}

.related-articles .row {
  gap: 20px;
}

.related-article-card {
  background: var(--gray-dark);
  border: 1px solid var(--gray-medium);
  padding: 25px;
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.related-article-card:hover {
  border-color: var(--neon-red);
  box-shadow: var(--shadow-red);
  text-decoration: none;
  color: inherit;
}

.related-article-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.related-article-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Animations */
@keyframes cosmicGlow {
  0% {
    text-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
  }
  100% {
    text-shadow: 0 0 30px rgba(220, 53, 69, 0.6);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Responsive Design */
@media (max-width: 1400px) {
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  
  .article-card.featured {
    height: 680px;
  }
  
  .article-card.medium {
    height: 680px;
  }
  
  .article-card.small {
    height: 480px;
  }
}

@media (max-width: 1200px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  
  .article-card.featured {
    height: 660px;
  }
  
  .article-card.medium {
    height: 660px;
  }
  
  .article-card.small {
    height: 460px;
  }
  
  .article-card.featured .article-image,
  .article-card.medium .article-image {
    height: 340px;
  }
  
  .article-card.featured .article-content,
  .article-card.medium .article-content {
    height: 320px;
  }
  
  .article-card.small .article-image {
    height: 220px;
  }
  
  .article-card.small .article-content {
    height: 240px;
  }
}

@media (max-width: 992px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .article-card.featured {
    height: 640px;
  }
  
  .article-card.medium {
    height: 640px;
  }
  
  .article-card.small {
    height: 440px;
  }
  
  .article-card.featured .article-image,
  .article-card.medium .article-image {
    height: 320px;
  }
  
  .article-card.featured .article-content,
  .article-card.medium .article-content {
    height: 320px;
  }
  
  .article-card.small .article-image {
    height: 200px;
  }
  
  .article-card.small .article-content {
    height: 240px;
  }
}

@media (max-width: 768px) {
  .articles-container {
    padding: 20px 0;
  }
  
  .articles-header h1 {
    font-size: 2.5rem;
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 30px 0 60px;
  }
  
  .article-card.featured,
  .article-card.medium,
  .article-card.small {
    height: 550px;
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .article-card.featured .article-image,
  .article-card.medium .article-image,
  .article-card.small .article-image {
    height: 250px;
  }
  
  .article-card.featured .article-content,
  .article-card.medium .article-content,
  .article-card.small .article-content {
    height: 300px;
    padding: 20px;
  }
  
  .search-form .input-group {
    flex-direction: column;
  }
  
  .category-filter .form-select {
    width: 100%;
  }
  
  /* Article keywords on mobile */
  .article-keywords {
    gap: 4px;
    margin-bottom: 12px;
  }
  
  .keyword-tag {
    font-size: 0.7rem;
    padding: 3px 6px;
  }
  
  /* Article detail keywords on mobile */
  .article-detail-keywords {
    margin: 20px 0;
    padding: 15px;
  }
  
  .article-detail-keywords h4 {
    font-size: 1rem;
    margin-bottom: 12px;
  }
  
  .keyword-tag-detail {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  /* Article Detail Mobile Styles */
  .article-detail-container {
    padding: 20px 0;
  }

  .article-detail {
    max-width: 100%;
    padding: 20px 15px 60px;
  }

  .article-detail-title {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .article-detail-meta {
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
  }

  .article-detail-meta span {
    font-size: 0.85rem;
    padding: 6px 12px;
    justify-content: center;
  }

  .article-detail-meta .meta-item {
    font-size: 0.85rem;
    padding: 6px 12px;
    justify-content: center;
  }

  .article-image-container {
    margin-bottom: 20px;
    border-radius: 8px;
  }

  .article-detail-image {
    margin-bottom: 25px;
    border-radius: 8px;
  }

  .article-detail-content {
    padding: 25px 20px;
    font-size: 1rem;
    line-height: 1.7;
    border-radius: 8px;
  }

  .article-detail-content h2 {
    font-size: 1.5rem;
    margin: 30px 0 15px;
  }

  .article-detail-content h2::before {
    left: -15px;
    width: 3px;
    height: 25px;
  }

  .article-detail-content h3 {
    font-size: 1.3rem;
    margin: 25px 0 12px;
  }

  .article-detail-content p {
    margin-bottom: 20px;
  }

  .article-detail-content ul,
  .article-detail-content ol {
    margin: 20px 0;
    padding-left: 20px;
  }

  .article-detail-content li {
    margin-bottom: 10px;
  }

  .article-detail-content blockquote {
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 6px 6px 0;
  }

  .article-detail-content pre {
    padding: 15px;
    margin: 20px 0;
    font-size: 0.9rem;
  }

  .article-detail-content code {
    font-size: 0.85rem;
    padding: 2px 6px;
  }

  /* Related Articles Mobile */
  .related-articles {
    margin-top: 40px;
    padding-top: 30px;
  }

  .related-articles h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .related-articles .row {
    gap: 15px;
  }

  .related-article-card {
    padding: 20px;
    border-radius: 6px;
  }

  .related-article-title {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .related-article-excerpt {
    font-size: 0.9rem;
  }

  /* Back link mobile */
  .back-link {
    font-size: 0.9rem;
    padding: 8px 15px;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .articles-header h1 {
    font-size: 2rem;
  }
  
  .article-card.featured,
  .article-card.medium,
  .article-card.small {
    height: 500px;
    border-radius: 15px;
  }
  
  .article-card.featured .article-image,
  .article-card.medium .article-image,
  .article-card.small .article-image {
    height: 220px;
    border-radius: 15px 15px 0 0;
  }
  
  .article-card.featured .article-content,
  .article-card.medium .article-content,
  .article-card.small .article-content {
    height: 280px;
    padding: 15px;
  }
  
  .articles-section .section-title {
    font-size: 1.8rem;
  }
  
  .articles-section .article-card {
    height: 350px;
  }
  
  .articles-section .article-overlay {
    padding: 15px;
  }
  
  .articles-section .article-title {
    font-size: 1.1rem;
  }
  
  .articles-section .article-excerpt {
    font-size: 0.9rem;
  }

  /* Article Detail Extra Small Mobile */
  .article-detail {
    padding: 15px 10px 50px;
  }

  .article-detail-title {
    font-size: 1.7rem;
    line-height: 1.2;
  }

  .article-detail-meta {
    gap: 10px;
  }

  .article-detail-meta span {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  .article-detail-meta .meta-item {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  .article-image-container {
    margin-bottom: 15px;
    border-radius: 6px;
  }

  .article-detail-image {
    margin-bottom: 20px;
    border-radius: 6px;
  }

  .article-detail-content {
    padding: 20px 15px;
    font-size: 0.95rem;
  }

  .article-detail-content h2 {
    font-size: 1.3rem;
    margin: 25px 0 12px;
  }

  .article-detail-content h3 {
    font-size: 1.1rem;
    margin: 20px 0 10px;
  }

  .article-detail-content blockquote {
    padding: 15px;
    margin: 20px 0;
  }

  .article-detail-content pre {
    padding: 12px;
    font-size: 0.85rem;
  }

  .related-articles h3 {
    font-size: 1.3rem;
  }

  .related-article-card {
    padding: 15px;
  }

  .related-article-title {
    font-size: 0.95rem;
  }

  .related-article-excerpt {
    font-size: 0.85rem;
  }

  /* Дополнительные стили для очень маленьких экранов */
  .article-detail-content img {
    border-radius: 4px;
    margin: 12px 0;
  }

  .article-detail-content table {
    font-size: 0.8rem;
    margin: 12px 0;
  }

  .article-detail-content table td,
  .article-detail-content table th {
    padding: 4px;
  }
}

/* Article Keywords */
.article-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}

.keyword-tag {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: var(--neon-red);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: default;
}

.keyword-tag:hover {
  background: rgba(220, 53, 69, 0.25);
  border-color: var(--neon-red);
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.3);
}

/* Featured article keywords */
.article-card.featured .keyword-tag {
  font-size: 0.8rem;
  padding: 5px 10px;
  margin-bottom: 20px;
}

/* Medium article keywords */
.article-card.medium .keyword-tag {
  font-size: 0.75rem;
  padding: 4px 8px;
  margin-bottom: 15px;
}

/* Small article keywords */
.article-card.small .keyword-tag {
  font-size: 0.7rem;
  padding: 3px 6px;
  margin-bottom: 10px;
}

/* Article Detail Keywords */
.article-detail-keywords {
  margin: 30px 0;
  padding: 20px;
  background: var(--gray-dark);
  border: 1px solid var(--gray-medium);
  border-radius: 15px;
}

.article-detail-keywords h4 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag-detail {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: var(--neon-red);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: default;
}

.keyword-tag-detail:hover {
  background: rgba(220, 53, 69, 0.3);
  border-color: var(--neon-red);
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.4);
  transform: translateY(-1px);
}

/* Homepage Articles Section - Separate styles */
.articles-section {
  padding: 80px 0;
  background: var(--pure-black);
  position: relative;
}

.articles-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 30% 70%, rgba(220, 53, 69, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(220, 53, 69, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.articles-section .container {
  position: relative;
  z-index: 1;
}

.articles-section .section-title {
  text-align: center;
  font-size: 3rem;
  font-weight: 900;
  background: var(--gradient-red-dark);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 50px;
  position: relative;
  animation: cosmicGlow 3s ease-in-out infinite alternate;
}

.articles-section .section-title::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 2px;
  background: var(--gradient-red);
  box-shadow: 0 0 15px var(--neon-red);
}

.articles-section .articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

.articles-section .article-card {
  position: relative;
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--gray-dark);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.4s ease;
  text-decoration: none;
}

.articles-section .article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(0, 0, 0, 0.8));
  z-index: 1;
  transition: all 0.4s ease;
}

.articles-section .article-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 40px rgba(220, 53, 69, 0.3);
}

.articles-section .article-card:hover::before {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2), rgba(0, 0, 0, 0.7));
}

.articles-section .article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s ease;
}

.articles-section .article-card:hover .article-image {
  transform: scale(1.1);
}

.articles-section .article-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(to top, var(--gray-dark) 0%, rgba(26, 26, 26, 0.9) 50%, transparent 100%);
  z-index: 2;
  transform: translateY(0);
  transition: all 0.4s ease;
}

.articles-section .article-card:hover .article-overlay {
  transform: translateY(-5px);
}

.articles-section .article-title {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
  display: block;
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.articles-section .article-title:hover {
  color: var(--neon-red);
  text-decoration: none;
}

.articles-section .article-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.articles-section .article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.articles-section .article-date,
.articles-section .article-category {
  display: flex;
  align-items: center;
  gap: 5px;
}

.articles-section .article-category {
  background: rgba(220, 53, 69, 0.2);
  color: var(--neon-red);
  padding: 4px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.articles-section .articles-cta {
  text-align: center;
  margin-top: 40px;
}

.articles-section .articles-cta .btn {
  background: var(--neon-red);
  color: var(--text-primary);
  padding: 15px 30px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-block;
  border: 2px solid var(--neon-red);
  position: relative;
  overflow: hidden;
}

.articles-section .articles-cta .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.articles-section .articles-cta .btn:hover {
  background: var(--cyber-red);
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
  transform: translateY(-2px);
  text-decoration: none;
}

.articles-section .articles-cta .btn:hover::before {
  left: 100%;
}

/* Responsive styles for homepage articles */
@media (max-width: 1200px) {
  .articles-section .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .articles-section {
    padding: 60px 0;
  }
  
  .articles-section .section-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
  }
  
  .articles-section .articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .articles-section .article-card {
    height: 350px;
  }
  
  .articles-section .article-overlay {
    padding: 25px;
  }
  
  .articles-section .article-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .articles-section .section-title {
    font-size: 2rem;
  }
  
  .articles-section .article-card {
    height: 300px;
  }
  
  .articles-section .article-overlay {
    padding: 20px;
  }
  
  .articles-section .article-title {
    font-size: 1.1rem;
  }
  
  .articles-section .article-excerpt {
    font-size: 0.9rem;
  }
}

/* Мобильные стили для изображений и таблиц */
.article-detail-content img {
  border-radius: 6px;
  margin: 15px 0;
}

.article-detail-content table {
  font-size: 0.85rem;
  margin: 15px 0;
}

.article-detail-content table td,
.article-detail-content table th {
  padding: 6px;
} 