/* ─── Article feature extras ─────────────────────────────────────────────
   Trending sidebar, NEW badge, load-more, related articles, prev/next nav */

/* Layout: main column + trending sidebar (top right) */
.articles-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
.articles-main { min-width: 0; }
.articles-trending { position: sticky; top: 96px; }
@media (max-width: 1023px) {
  .articles-layout { grid-template-columns: 1fr; }
  .articles-trending { position: static; order: -1; }
}

/* Trending panel */
.trending-panel {
  background: rgba(15, 15, 26, 0.72);
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(12px);
}
.trending-panel__title {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.trending-panel__sub {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 12px;
}
.trending-list { display: flex; flex-direction: column; gap: 6px; }
.trending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s;
}
.trending-item:hover { background: rgba(124, 58, 237, 0.12); }
.trending-item__rank {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
  color: #64748b;
}
.trending-item:nth-child(1) .trending-item__rank { color: #facc15; }
.trending-item:nth-child(2) .trending-item__rank { color: #cbd5e1; }
.trending-item:nth-child(3) .trending-item__rank { color: #f59e0b; }
.trending-item__thumb {
  width: 58px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.trending-item__body { min-width: 0; }
.trending-item__title {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.trending-item__views {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

/* ─── Reading progress bar ─────────────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, #2563eb, #06b6d4);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ─── Table of contents ────────────────────────────────────────────────── */
.post-toc {
  background: rgba(15, 15, 26, 0.72);
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 0 0 28px;
}
.post-toc__title {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-toc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.post-toc__list a {
  display: block;
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 0.88rem;
  color: #94a3b8;
  text-decoration: none;
  padding: 5px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.post-toc__list a:hover { color: #e2e8f0; background: rgba(124, 58, 237, 0.1); }
.post-toc__list a.active { color: #c4b5fd; border-left-color: #7c3aed; background: rgba(124, 58, 237, 0.12); }

/* ─── Reactions (like) button ──────────────────────────────────────────── */
.post-reactions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 15, 26, 0.72);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 999px;
  padding: 10px 22px;
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.reaction-btn:hover { border-color: #7c3aed; background: rgba(124, 58, 237, 0.12); }
.reaction-btn:active { transform: scale(0.96); }
.reaction-btn__icon { font-size: 1.25rem; transition: transform 0.3s; }
.reaction-btn.liked { border-color: #ef4444; background: rgba(239, 68, 68, 0.12); color: #fecaca; }
.reaction-btn.liked .reaction-btn__icon { transform: scale(1.2); }
.reaction-btn__count { font-variant-numeric: tabular-nums; }
.reaction-hint { font-size: 0.82rem; color: #64748b; }
@keyframes like-pop { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }
.reaction-btn.just-liked .reaction-btn__icon { animation: like-pop 0.4s ease; }

/* ─── Video grid (YouTube lite-embed facade) ───────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.video-card {
  background: rgba(15, 15, 26, 0.72);
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.video-card:hover { transform: translateY(-3px); border-color: #7c3aed; }
.video-card__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  cursor: pointer;
  border: 0;
  padding: 0;
  display: block;
}
.video-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.45));
  transition: background 0.2s;
}
.video-card__frame:hover .video-card__play { background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.55)); }
.video-card__play svg { width: 62px; height: 62px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); transition: transform 0.2s; }
.video-card__frame:hover .video-card__play svg { transform: scale(1.1); }
.video-card__body { padding: 14px 16px 16px; }
.video-card__title {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card__date { font-family: 'Inter', sans-serif; font-size: 0.78rem; color: var(--text-muted, #94a3b8); margin-top: 6px; }
.video-card iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }

/* ─── In-article YouTube embed (click-to-play facade) ──────────────────── */
.yt-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  margin: 28px 0;
  border: 1px solid rgba(124, 58, 237, 0.3);
  background: #000;
  cursor: pointer;
  display: block;
  padding: 0;
  box-shadow: 0 12px 40px -16px rgba(0, 0, 0, 0.7);
}
.yt-embed > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-embed__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.45));
  transition: background 0.2s;
}
.yt-embed:hover .yt-embed__play { background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.55)); }
.yt-embed__play svg { width: 74px; height: 74px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.6)); transition: transform 0.2s; }
.yt-embed:hover .yt-embed__play svg { transform: scale(1.1); }
iframe.yt-embed { aspect-ratio: 16 / 9; border: 0; cursor: auto; }

/* ─── Homepage sections ────────────────────────────────────────────────── */
.home-section { padding: 64px 0 8px; }
.home-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.home-section__title {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  color: #fff;
  margin: 0;
}
.home-section__link {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #a78bfa;
  text-decoration: none;
  white-space: nowrap;
}
.home-section__link:hover { text-decoration: underline; }
.home-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* View counts */
.article-card__views {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}
.article-page__views {
  font-size: 0.82rem;
  color: var(--text-dim, #94a3b8);
}

/* NEW badge on article cards */
.article-card__new {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
}

/* Load more */
.articles-load-more {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

/* Related articles (post pages) */
.post-related { margin-top: 40px; }
.post-related__title {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 18px;
}
.post-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

/* Prev / Next navigation (post pages) */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }
.post-nav__link {
  display: block;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(15, 15, 26, 0.72);
  border: 1px solid rgba(124, 58, 237, 0.28);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.post-nav__link:hover { border-color: #7c3aed; transform: translateY(-2px); }
.post-nav__link--next { text-align: right; }
.post-nav__label {
  display: block;
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 6px;
}
.post-nav__title {
  font-family: 'Inter', 'Kantumruy Pro', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
