/* ============================================================
   HERO SECTION
============================================================ */
.hero-section {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: 680px;
  margin-bottom: 3rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--muted-fg);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   STATS GRID
============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 560px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.stat-icon {
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: 'Inter Tight', sans-serif;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--muted-fg);
  font-weight: 500;
}

/* ============================================================
   NEWS SECTION
============================================================ */
.news-section {
  padding: 3.5rem 0 4rem;
}

/* ============================================================
   BLOG GRID
============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  gap: 1.25rem;
}

/* ============================================================
   BLOG CARD
============================================================ */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
  border-color: hsl(199, 89%, 60%, 0.4);
  box-shadow: 0 0 24px -6px hsl(199, 89%, 60%, 0.15);
  transform: translateY(-2px);
}

.blog-card-featured {
  grid-column: span 2;
}

/* Banner */
.blog-banner {
  height: 140px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.blog-card-featured .blog-banner {
  height: 200px;
}

.blog-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: radial-gradient(circle at 30% 50%, currentColor 0%, transparent 60%);
}

.blog-banner-csgo {
  background: linear-gradient(135deg, hsl(222, 47%, 14%), hsl(199, 60%, 18%));
  color: var(--primary);
}

.blog-banner-lol {
  background: linear-gradient(135deg, hsl(222, 47%, 14%), hsl(38, 40%, 18%));
  color: var(--accent);
}

.blog-banner-dota2 {
  background: linear-gradient(135deg, hsl(222, 47%, 14%), hsl(0, 40%, 18%));
  color: var(--destructive);
}

.read-time {
  font-size: 0.8125rem;
  color: var(--muted-fg);
  background: hsl(222, 47%, 9%, 0.7);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  position: relative;
  z-index: 1;
}

.blog-banner .badge {
  position: relative;
  z-index: 1;
}

/* Card body */
.blog-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.blog-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--fg);
}

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

.blog-card-excerpt {
  font-size: 0.875rem;
  color: var(--muted-fg);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-date {
  font-size: 0.8125rem;
  color: var(--muted-fg);
  margin-top: auto;
}

/* ============================================================
   EXPANDED BLOG CARD (HTMX inline article)
============================================================ */
@keyframes expandIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

#article-expanded {
  margin-top: 1.25rem;
}

#article-expanded:empty {
  display: none;
}

.blog-card-expanded {
  animation: expandIn 0.25s ease;
  cursor: default;
  width: 100%;
}

.blog-card-expanded:hover {
  transform: none;
}

.blog-banner-expanded {
  height: 140px;
  justify-content: space-between;
  align-items: flex-start;
}

.blog-banner-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blog-card-close-btn {
  background: hsl(222, 47%, 9%, 0.7);
  border: 1px solid var(--border);
  color: var(--muted-fg);
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  transition: color 0.15s, border-color 0.15s;
  position: relative;
  z-index: 1;
}

.blog-card-close-btn:hover {
  color: var(--fg);
  border-color: var(--muted-fg);
}

.blog-card-expanded-header {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.blog-card-expanded-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--fg);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted-fg);
}

.blog-meta-author {
  font-weight: 600;
  color: var(--fg);
}

.blog-meta-role {
  color: var(--primary);
}

.blog-meta-sep {
  color: var(--border);
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.blog-tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--muted-fg);
  border: 1px solid var(--border);
}

/* ============================================================
   ARTICLE CONTENT (rendered inside expanded card)
============================================================ */
.article-content {
  padding: 1.25rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 860px;
}

.article-h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--fg);
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border);
}

.article-h2:first-child {
  margin-top: 0;
}

.article-p {
  font-size: 0.9375rem;
  color: var(--muted-fg);
  line-height: 1.75;
  margin: 0.5rem 0;
}

.article-ul,
.article-ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.article-ul li,
.article-ol li {
  font-size: 0.9375rem;
  color: var(--muted-fg);
  line-height: 1.65;
}

.article-ul {
  list-style: none;
  padding-left: 0;
}

.article-ul li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 0.625rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.article-ul li {
  display: flex;
  align-items: baseline;
}

.article-ol {
  list-style: none;
  padding-left: 0;
  counter-reset: article-counter;
}

.article-ol li {
  display: flex;
  gap: 0.75rem;
  counter-increment: article-counter;
}

.article-ol li::before {
  content: counter(article-counter);
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: hsl(199, 89%, 60%, 0.12);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1em;
}

.article-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.article-table th {
  padding: 0.625rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--fg);
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.article-table td {
  padding: 0.5rem 1rem;
  color: var(--muted-fg);
  border-bottom: 1px solid hsl(222, 47%, 14%);
}

.article-table tr:last-child td {
  border-bottom: none;
}

.article-table tbody tr:hover {
  background: hsl(222, 47%, 16%, 0.5);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-card-featured { grid-column: span 2; }
  .stats-grid { max-width: 100%; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 2rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-card-featured { grid-column: span 1; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.4rem; }
}
