/* ===== Single Post Dark Mode (elearningfx) ===== */

:root{
  --bg: #0b0f14;          /* nền */
  --bg-soft: #0f141b;     /* box/border */
  --text: #e6e8eb;        /* chữ chính */
  --muted: #9aa4af;       /* chữ phụ */
  --accent: #f7b500;      /* vàng điểm nhấn */
  --link: #ffd768;        /* link */
  --border: #1e2630;      /* viền */
  --code-bg: #111720;     /* code block */
  --success: #20c997;
  --danger: #ff6b6b;

  --radius: 14px;
  --container: 860px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

html, body{
  background: var(--bg);
  color: var(--text);
}

.single-post .container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 20px 10px;
}

/* Breadcrumb */
.breadcrumb{
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a{ color: var(--link); text-decoration: none; }
.breadcrumb a:hover{ text-decoration: underline; }

/* Title */
.entry-title{
  line-height: 1.2;
  margin: 10px 0 12px;
  letter-spacing: .2px;
}

/* Meta */
.entry-meta{
  color: var(--muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin-bottom: 22px;
}

/* Content / prose */
.single-post article{
  font-size: 17px;
  line-height: 1.9;
  word-break: break-word;
}
.single-post article h2,
.single-post article h3,
.single-post article h4{
  margin-top: 28px; margin-bottom: 12px;
}
.single-post article h2{ font-size: 26px; }
.single-post article h3{ font-size: 22px; }
.single-post article h4{ font-size: 18px; color: #d7dce2; }

.single-post article p{ margin: 14px 0; }

.single-post article a{
  color: var(--link);
  text-underline-offset: 2px;
}
.single-post article a:hover{
  color: var(--accent);
  text-decoration: underline;
}

.single-post article ul,
.single-post article ol{
  padding-left: 22px;
  margin: 12px 0;
}
.single-post article li{ margin: 6px 0; }

/* Blockquote */
.single-post article blockquote{
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  color: #f1f3f5;
}

/* Tables */
.single-post article table{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.single-post article th,
.single-post article td{
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
.single-post article thead th{
  background: #121821;
  color: #f0f2f4;
}

/* Code */
.single-post article pre{
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow: auto;
}
.single-post article code{
  background: rgba(255,255,255,0.04);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Images */
.single-post article img{
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 16px auto;
}

/* Tags */
.entry-tags{
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.entry-tags .tag-label{ color: var(--muted); }
.entry-tags a{
  background: #131a23;
  border: 1px solid var(--border);
  color: #eaeef3;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
}
.entry-tags a:hover{
  border-color: var(--accent);
  color: var(--accent);
}

/* Share buttons */
.share-buttons{ margin-top: 28px; color: var(--muted); }
.share-buttons a{
  display: inline-block;
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: #f1f5f9;
  background: #0f141b;
}
.share-buttons a:hover{
  border-color: var(--accent);
  color: var(--accent);
}

/* Related Posts */
.related-posts{
  margin-top: 36px;
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.related-posts h3{
  margin-top: 0; margin-bottom: 12px;
}
.related-posts li a{
  color: #e9edf2; text-decoration: none;
}
.related-posts li a:hover{ color: var(--accent); }

/* Comments */
.comments{
  margin-top: 38px;
  border-top: 1px dashed var(--border);
  padding-top: 20px;
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond textarea{
  width: 100%;
  background: #0e141c;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.comment-respond input[type="submit"]{
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}
.comment-respond input[type="submit"]:hover{
  filter: brightness(1.05);
}

/* Utility (nếu bạn đang dùng classes Tailwind trong HTML mẫu trước đó) */
.text-gray-400{ color: var(--muted) !important; }
.text-3xl{ font-size: 30px; }
.font-bold{ font-weight: 700; }
.mb-4{ margin-bottom: 1rem; }
.mt-6{ margin-top: 1.25rem; }
.mt-8{ margin-top: 2rem; }
.mt-10{ margin-top: 2.5rem; }

/* Responsive */
@media (max-width: 640px){
  .entry-title{ font-size: 24px; }
  .single-post article{ font-size: 16px; }
}

/* Optional: highlight tiêu đề cấp 2 trong nội dung như section */
.single-post article h2::after{
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(247,181,0,0));
  margin-top: 6px;
  border-radius: 999px;
}

/* Hero image */
.hero-thumb{ margin-bottom: 14px; }
.hero-img{
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display:block;
}

/* Grid 2 cột */
.single-grid{
  display: grid;
  grid-template-columns: 1fr 320px; /* content | sidebar */
  gap: 28px;
}

/* Sidebar */
.sidebar{
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 100px; /* dính khi cuộn */
  height: fit-content;
}
.sb-title{
  margin: 4px 0 10px;
  font-size: 18px;
  font-weight: 700;
}
.sb-list{ list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.sb-item{ display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; }
.sb-thumb img{
  width: 92px; height: 64px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
}
.sb-link{
  color: #e9edf2; text-decoration: none; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sb-link:hover{ color: var(--accent); }
.sb-date{ display:block; color: var(--muted); font-size: 12px; margin-top: 4px; }
/* Khoảng cách giữa các block trong sidebar */
.sb-section{ margin-top: 18px; }

/* Dùng lại style của .sb-list/.sb-item/.sb-thumb/.sb-link/.sb-date đã có */
/* Container rộng hơn để nội dung full-width thoáng đãng */
:root{ --container: 1160px; }

/* HERO 2 cột (Ảnh/tiêu đề/meta) | Sidebar */
.single-hero-grid{
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}
.hero-left{ min-width: 0; } /* fix overflow */
.hero-thumb{ margin-bottom: 12px; }
.hero-img{
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Sidebar (dùng lại style cũ, tinh chỉnh) */
.sidebar{
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 84px; /* dính khi cuộn */
  height: fit-content;
}
.sb-title{ margin: 4px 0 10px; font-size: 18px; font-weight: 700; }
.sb-section{ margin-top: 18px; }
.sb-list{ list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.sb-item{ display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; }
.sb-thumb img{ width: 92px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.sb-link{ color: #e9edf2; text-decoration: none; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sb-link:hover{ color: var(--accent); }
.sb-date{ display:block; color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Bài viết (full width) */
.content{ font-size: 17px; line-height: 1.9; }

/* Responsive */
@media (max-width: 1140px){
  .single-hero-grid{ grid-template-columns: 1fr; }
  .sidebar{ position: static; }
}


/* Responsive */
@media (max-width: 1024px){
  .single-grid{ grid-template-columns: 1fr; }
  .sidebar{ position: static; }
}

/* TOC */
.toc-box{
  margin: 14px 0 20px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 10px;
}
.toc-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 8px;
}
.toc-title{ font-weight:700; }
.toc-toggle{
  background: #121821; color: #e8ecf2; border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 10px; cursor: pointer;
}
.toc-toggle:hover{ border-color: var(--accent); color: var(--accent); }
.toc-list{ list-style:none; margin:0; padding:0; }
.toc-l2{ margin: 8px 0; }
.toc-l2 > a{
  color: #e9edf2; text-decoration:none;
}
.toc-l2 > a:hover{ color: var(--accent); }
.toc-l3{ list-style:none; margin: 6px 0 8px 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.toc-l3-item{ margin: 6px 0; }
.toc-l3-item a{ color: var(--muted); text-decoration:none; }
.toc-l3-item a:hover{ color: var(--accent); }

/* Giúp tiêu đề khi nhảy tới không bị che bởi header sticky */
.single-post article h2, 
.single-post article h3{
  scroll-margin-top: 90px; /* khớp headerOffset JS */
}

/* ===== Breadcrumb đẹp (dark) ===== */
.crumbs{
  margin: 8px 0 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.crumbs-list{
  display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
  overflow-x: auto; scrollbar-width: thin; margin:0; padding:0; list-style:none;
}
.crumbs-list::-webkit-scrollbar{ height: 6px; }
.crumbs-list::-webkit-scrollbar-thumb{ background: #1c232d; border-radius: 6px; }

.crumb-item{
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  position: relative;
}

/* Link + current */
.crumb-link{
  display: inline-flex; align-items: center; gap: 6px;
  color: #e9edf2; text-decoration: none;
  padding: 6px 10px; border-radius: 999px;
  transition: border-color .2s, color .2s, background .2s;
  border: 1px solid transparent;
}
.crumb-link:hover{
  color: var(--accent);
  border-color: var(--border);
  background: #0f141b;
}
.crumb-current{
  color: var(--muted);
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis;
}

/* Home icon */
.crumb-icon{
  display: inline-flex; width: 18px; height: 18px; color: var(--accent);
}

/* Chevron separator dùng pseudo */
.crumb-item + .crumb-item:before{
  content: "›";
  color: #5b6573;
  margin-right: 6px; margin-left: 2px;
}

/* Nhỏ gọn trên mobile */
@media (max-width: 640px){
  .crumbs{ padding: 6px 10px; }
  .crumb-current{ max-width: 60vw; }
}

/* ===== Khung nội dung bài viết ===== */
.single-post .content{
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
  font-size: 17px;
  line-height: 1.9;
  color: var(--text);
}

/* Làm heading nổi bật hơn trong khung */
.single-post .content h2,
.single-post .content h3{
  margin-top: 28px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Đoạn code block / quote tách biệt */
.single-post .content blockquote{
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin: 20px 0;
  padding: 14px 18px;
}
.single-post .content pre{
  background: var(--code-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  overflow-x: auto;
}

/* Responsive cho mobile */
@media (max-width: 640px){
  .single-post .content{
    padding: 18px 16px;
  }
}

/* Ẩn sidebar trên điện thoại */
@media (max-width: 768px){
  .single-hero-grid .sidebar{
    display: none;
  }
}
