:root {
  --bg-main: #f4f7f9;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --accent-color: #4f46e5;
  --accent-hover: #4338ca;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 60px 0;
}

.news-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Заголовок сторінки */
.page-header {
  margin-bottom: 60px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.page-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -1px;
  color: var(--text-dark);
  line-height: 1.1;
}

.page-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 600px;
  border-left: 4px solid var(--accent-color);
  padding-left: 16px;
}

/* Сітка новин */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
}

/* Картка новини */
.news-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.02);
  height: 100%;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.1);
}

/* Обгортка зображення та беджі */
.news-image-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.news-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.news-card:hover .news-image {
  transform: scale(1.08);
}

.news-badges {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.badge {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 6px;
}

.views-badge {
  color: var(--accent-color);
}

/* Контент картки */
.news-content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.4;
  color: var(--text-dark);
}

.news-card-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
  flex-grow: 1;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent-color);
  margin-top: auto;
  font-size: 0.95rem;
  transition: var(--transition);
}

.news-card:hover .read-more {
  gap: 12px;
  color: var(--accent-hover);
}

/* Спеціальний стиль для ПЕРШОЇ новини (Головна новина) */
@media (min-width: 992px) {
  .news-card:first-child {
    grid-column: 1 / -1; /* Займає всю ширину */
    flex-direction: row;
  }
  
  .news-card:first-child .news-image-wrapper {
    width: 60%;
    height: 100%;
  }
  
  .news-card:first-child .news-content {
    width: 40%;
    padding: 40px;
    justify-content: center;
  }
  
  .news-card:first-child .news-card-title {
    font-size: 2.2rem;
    margin-bottom: 20px;
  }
  
  .news-card:first-child .news-card-desc {
    font-size: 1.15rem;
  }
}

/* Стани "Немає новин" та "Помилка" */
.empty-state {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 80px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.8;
}

.empty-text {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(79, 70, 229, 0.2);
}

/* Адаптивність */
@media (max-width: 768px) {
  .page-header {
    margin-bottom: 40px;
  }
  
  .page-title {
    font-size: 2.5rem;
  }
  
  .news-list {
    grid-template-columns: 1fr;
  }
  
  .news-image-wrapper {
    height: 220px;
  }
}
