/* ═══════════════════════════════════════════
   UltraStreamHub — Blog Stylesheet
   Append this to css/style.css OR keep separate
   and add <link rel="stylesheet" href="../css/blog.css"> in blog pages
═══════════════════════════════════════════ */

/* ── BLOG INDEX PAGE ── */
.blog-hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.blog-hero::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, rgba(91,110,245,0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* ── SEARCH BAR ── */
.blog-search-wrap {
  max-width: 520px;
  margin: 28px auto 0;
  position: relative;
}
.blog-search {
  width: 100%;
  padding: 16px 52px 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.blog-search:focus { border-color: var(--accent); }
.blog-search::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.search-icon svg { width: 20px; height: 20px; }

/* ── CATEGORY FILTER ── */
.blog-cats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 32px 0 0;
}
.blog-cat-btn {
  padding: 8px 18px;
  border-radius: 40px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.blog-cat-btn:hover, .blog-cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ── BLOG GRID ── */
.blog-section { padding: 64px 0 100px; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  border-color: var(--border2);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.blog-card.hidden { display: none; }

/* Card Thumbnail */
.blog-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.blog-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

/* Card Body */
.blog-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.blog-tag {
  display: inline-block;
  background: rgba(91,110,245,0.12);
  color: var(--accent);
  border: 1px solid rgba(91,110,245,0.2);
  padding: 3px 10px;
  border-radius: 40px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.blog-tag.tag-guide { background: rgba(34,197,94,0.1); color: var(--green); border-color: rgba(34,197,94,0.2); }
.blog-tag.tag-iptv { background: rgba(0,212,255,0.1); color: var(--accent2); border-color: rgba(0,212,255,0.2); }
.blog-tag.tag-sport { background: rgba(234,179,8,0.1); color: var(--yellow); border-color: rgba(234,179,8,0.2); }
.blog-tag.tag-tuto { background: rgba(124,58,237,0.12); color: #a78bfa; border-color: rgba(124,58,237,0.2); }

.blog-date {
  font-size: 12px;
  color: var(--text-dim);
}
.blog-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.35;
  transition: color 0.2s;
}
.blog-card:hover .blog-card-title { color: var(--accent); }
.blog-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.blog-read-time {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}
.blog-read-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}
.blog-card:hover .blog-read-more { gap: 8px; }

/* ── FEATURED POST ── */
.blog-featured {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  margin-bottom: 48px;
  transition: all 0.3s;
}
.blog-featured:hover {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(91,110,245,0.1);
}
.blog-featured-img {
  aspect-ratio: 16/10;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  border-right: 1px solid var(--border);
}
.blog-featured-body {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(91,110,245,0.1);
  border: 1px solid rgba(91,110,245,0.2);
  color: var(--accent);
  padding: 5px 14px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
}
.blog-featured-title {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.25;
  transition: color 0.2s;
}
.blog-featured:hover .blog-featured-title { color: var(--accent); }
.blog-featured-excerpt {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.7;
}
.blog-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Empty state */
.blog-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.blog-empty svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.3; }

/* ── SINGLE ARTICLE PAGE ── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 60px;
  align-items: start;
  padding: 64px 0 100px;
}

/* Article Header */
.article-header { margin-bottom: 40px; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.article-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 20px;
}
.article-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}
.article-info {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.article-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-info-item svg { width: 14px; height: 14px; }

/* Hero Image */
.article-hero-img {
  width: 100%;
  aspect-ratio: 16/7;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  margin-bottom: 48px;
  overflow: hidden;
}
.article-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Article Content Typography */
.article-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-muted);
}
.article-content h2 {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.article-content h3 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 12px;
}
.article-content p { margin-bottom: 18px; }
.article-content strong { color: var(--text); font-weight: 600; }
.article-content em { color: var(--accent); font-style: normal; font-weight: 500; }
.article-content ul, .article-content ol {
  margin: 16px 0 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-content li { color: var(--text-muted); }
.article-content ul li { list-style: none; padding-left: 20px; position: relative; }
.article-content ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }
.article-content ol li { list-style: decimal; }

.article-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-content a:hover { color: var(--accent2); }

/* Callout boxes */
.callout {
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 28px 0;
  border-left: 4px solid;
}
.callout-tip { background: rgba(34,197,94,0.07); border-color: var(--green); }
.callout-tip strong { color: var(--green); }
.callout-info { background: rgba(91,110,245,0.07); border-color: var(--accent); }
.callout-info strong { color: var(--accent); }
.callout-warning { background: rgba(234,179,8,0.07); border-color: var(--yellow); }
.callout-warning strong { color: var(--yellow); }

/* Code blocks */
.article-content code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--accent2);
}
.article-content pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
}
.article-content pre code { background: none; border: none; padding: 0; }

/* Comparison Table */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.article-content th {
  background: var(--surface2);
  color: var(--text);
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--border);
  font-weight: 600;
}
.article-content td {
  padding: 11px 16px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.article-content tr:hover td { background: rgba(255,255,255,0.02); }

/* Share & CTA */
.article-share {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 48px;
  flex-wrap: wrap;
}
.article-share span { font-size: 14px; font-weight: 600; color: var(--text); }
.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn svg { width: 16px; height: 16px; }

.article-cta-box {
  background: linear-gradient(135deg, var(--surface), rgba(91,110,245,0.1));
  border: 1px solid rgba(91,110,245,0.3);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin-top: 48px;
}
.article-cta-box h3 { font-size: 20px; margin-bottom: 10px; }
.article-cta-box p { font-size: 14px; margin-bottom: 20px; }

/* Related articles */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: all 0.2s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-card-emoji { font-size: 28px; margin-bottom: 10px; }
.related-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
  transition: color 0.2s;
}
.related-card:hover .related-card-title { color: var(--accent); }
.related-card-tag { font-size: 11px; color: var(--text-dim); }

/* ── SIDEBAR ── */
.blog-sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 24px; }
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.sidebar-widget h4 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-links { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s;
  background: transparent;
}
.sidebar-link:hover {
  background: rgba(91,110,245,0.06);
  color: var(--accent);
  padding-left: 16px;
}
.sidebar-link-count {
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 40px;
  font-size: 11px;
  color: var(--text-dim);
}
.sidebar-cta {
  background: linear-gradient(135deg, rgba(91,110,245,0.15), rgba(0,212,255,0.08));
  border-color: rgba(91,110,245,0.3);
  text-align: center;
}
.sidebar-cta p { font-size: 13px; margin-bottom: 16px; }
.sidebar-cta .btn { width: 100%; justify-content: center; font-size: 14px; }
.sidebar-recent { display: flex; flex-direction: column; gap: 16px; }
.sidebar-post { display: flex; gap: 12px; align-items: flex-start; }
.sidebar-post-emoji { font-size: 28px; flex-shrink: 0; }
.sidebar-post-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  transition: color 0.2s;
}
.sidebar-post:hover .sidebar-post-title { color: var(--accent); }
.sidebar-post-date { font-size: 11px; color: var(--text-dim); }

/* ── PAGINATION ── */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 60px;
}
.page-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.page-btn:hover, .page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.page-btn.disabled { opacity: 0.3; pointer-events: none; }

/* ── TABLE OF CONTENTS (article sidebar) ── */
.toc-widget { max-height: 380px; overflow-y: auto; }
.toc-list { display: flex; flex-direction: column; gap: 4px; list-style: none; }
.toc-item a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: all 0.2s;
}
.toc-item a:hover, .toc-item a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(91,110,245,0.05);
  padding-left: 16px;
}
.toc-item.h3-item a { padding-left: 24px; font-size: 12px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-featured { grid-template-columns: 1fr; }
  .blog-featured-img { border-right: none; border-bottom: 1px solid var(--border); }
  .blog-featured-body { padding: 28px; }
  .blog-featured-title { font-size: 22px; }
  .related-grid { grid-template-columns: 1fr; }
}
