/* Blog page specific styles */

/* --- MAIN LAYOUT --- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}

/* --- BLOG HEADER --- */
.blog-header {
  text-align: center;
  margin-bottom: 60px;
  padding-top: 20px;
}

.blog-header h1 {
  font-size: 42px;
  line-height: 1.1;
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
}

.blog-header h1 span {
  background: linear-gradient(to right, #38bdf8, #a855f7);
  -webkit-background-clip: text;
  color: transparent;
}

.blog-header p {
  font-size: 16px;
  color: var(--text-sub);
  max-width: 600px;
  margin: 0 auto;
}

/* --- BLOG GRID --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* --- BLOG CARDS --- */
.blog-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-card:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.blog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.blog-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

time {
  color: var(--text-sub);
}

.blog-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.blog-card h2 a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-card h2 a:hover {
  color: var(--accent);
}

.blog-excerpt {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.6;
  flex: 1;
}

.read-more {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.read-more:hover {
  gap: 8px;
  color: #7dd3fc;
}

/* --- ARTICLE PAGE STYLES --- */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}

.article-header {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-soft);
}

.article-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
}

.article-header h1 {
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
}

.article-description {
  font-size: 18px;
  color: var(--text-sub);
  line-height: 1.6;
  margin: 0;
}

.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-main);
}

.article-content h2 {
  font-size: 28px;
  margin: 40px 0 16px 0;
  color: var(--text-main);
  line-height: 1.3;
}

.article-content h3 {
  font-size: 22px;
  margin: 32px 0 12px 0;
  color: var(--accent);
  line-height: 1.4;
}

.article-content p {
  margin: 0 0 20px 0;
  color: var(--text-sub);
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
  color: var(--text-sub);
}

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

.article-content strong {
  color: var(--text-main);
  font-weight: 600;
}

.article-content code {
  background: rgba(148, 163, 184, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  color: var(--accent);
}

.article-content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: rgba(56, 189, 248, 0.05);
  border-radius: 0 8px 8px 0;
  color: var(--text-sub);
  font-style: italic;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(56, 189, 248, 0.3);
  transition: text-decoration-color 0.2s;
}

.article-content a:hover {
  text-decoration-color: var(--accent);
}

.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s, gap 0.2s;
}

.back-to-blog:hover {
  color: var(--accent);
  gap: 12px;
}

/* Active navigation link */
.nav-link.active {
  color: var(--accent);
}

/* --- MOBILE IMPROVEMENTS --- */
@media (max-width: 768px) {
  main {
    padding: 20px 16px 40px;
  }

  .blog-header {
    margin-bottom: 40px;
    padding-top: 20px;
  }

  .blog-header h1 {
    font-size: 32px;
  }

  .blog-header p {
    font-size: 15px;
  }

  .blog-card {
    padding: 20px;
  }

  .blog-card h2 {
    font-size: 18px;
  }

  .blog-excerpt {
    font-size: 13px;
  }

  /* Article page */
  .article-container {
    padding: 20px 16px 40px;
  }

  .article-header h1 {
    font-size: 28px;
  }

  .article-description {
    font-size: 16px;
  }

  .article-content {
    font-size: 15px;
  }

  .article-content h2 {
    font-size: 24px;
    margin: 32px 0 12px 0;
  }

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

  .article-meta {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .blog-header h1 {
    font-size: 28px;
  }

  .blog-header p {
    font-size: 14px;
  }

  .blog-card {
    padding: 16px;
  }

  .blog-card h2 {
    font-size: 17px;
  }

  .blog-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .article-header h1 {
    font-size: 24px;
  }

  .article-description {
    font-size: 15px;
  }

  .article-content {
    font-size: 14px;
  }

  .article-content h2 {
    font-size: 22px;
  }

  .article-content h3 {
    font-size: 18px;
  }
}
