/* ════════════════════════════════════
   SINGLE POST (single.css)
   Mirrors luangiai.vn article structure:
   breadcrumb → title/meta → featured → [sidebar TOC | body content]
════════════════════════════════════ */

/* ─── ARTICLE HEADER ─── */
.article-header {
  padding: 96px 0 32px;
  background: linear-gradient(180deg, var(--deep) 0%, var(--night) 100%);
  border-bottom: .5px solid var(--border);
}
.breadcrumb { margin-bottom: 18px; }
.breadcrumb ol  { display: flex; align-items: center; gap: 6px; list-style: none; padding: 0; flex-wrap: wrap; }
.breadcrumb li  { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.breadcrumb li::after { content: '/'; opacity: .3; }
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--glow); }

.article-meta-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; font-size: 13px; color: var(--muted);
}
.article-date   { }
.article-author { color: var(--glow); font-weight: 500; }
.article-author::before { content: '·'; margin-right: 12px; opacity: .35; }
.article-read-time { font-size: 12px; }
.article-read-time::before { content: '·'; margin-right: 12px; opacity: .35; }

.article-title {
  font-size: clamp(26px, 4vw, 48px);
  font-weight: 400; line-height: 1.2; color: var(--text);
  max-width: 860px;
}

/* ─── FEATURED IMAGE ─── */
.article-featured-wrap { padding: 28px 0 0; background: var(--night); }
.article-featured-img {
  width: 100%; max-height: 500px; object-fit: cover;
  border-radius: var(--r-lg); border: .5px solid var(--border);
}

/* ─── TWO-COLUMN LAYOUT ─── */
.article-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 80px;
  align-items: start;
}
@media(max-width:1024px) {
  .article-layout { grid-template-columns: 220px 1fr; gap: 32px; }
}
@media(max-width:768px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { order: -1; }
}

/* ─── SIDEBAR ─── */
.article-sidebar {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 20px;
  max-height: calc(100vh - 100px); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--mid) transparent;
}
@media(max-width:768px) { .article-sidebar { position: static; max-height: none; overflow: visible; } }

/* TOC box — matches luangiai.vn style */
.toc-box {
  border: .5px solid var(--border); border-radius: var(--r-md);
  background: rgba(26,10,46,.7); overflow: hidden;
}
.toc-heading {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter',sans-serif; font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
  padding: 14px 18px; border-bottom: .5px solid var(--border);
  background: rgba(45,17,87,.4);
}
#toc-nav { padding: 10px 0; }
.toc-link {
  display: block; font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 6px 18px; border-left: 2px solid transparent; line-height: 1.45;
  transition: color .2s, border-color .2s, background .2s;
}
.toc-link:hover  { color: var(--glow); background: rgba(196,168,255,.05); }
.toc-link.active { color: var(--glow); border-left-color: var(--purple); background: rgba(123,63,196,.1); }
.toc-link.toc-h3 { padding-left: 32px; font-size: 12px; }
.toc-link.toc-h4 { padding-left: 44px; font-size: 11px; }

/* Info card (Hồ Sơ Tinh Diệu) */
.sidebar-info-card {
  border: .5px solid rgba(196,168,255,.22);
  border-radius: var(--r-md); overflow: hidden;
  background: rgba(45,17,87,.35);
}
.info-card-heading {
  font-family: 'Inter',sans-serif; font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
  padding: 12px 16px; border-bottom: .5px solid var(--border);
  background: rgba(45,17,87,.5);
}
.sidebar-info-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sidebar-info-card td {
  padding: 8px 14px; border-bottom: .5px solid var(--border);
  vertical-align: top; line-height: 1.5;
}
.sidebar-info-card tr:last-child td { border-bottom: none; }
.sidebar-info-card td:first-child { color: var(--muted); font-weight: 500; white-space: nowrap; width: 45%; }
.sidebar-info-card td:last-child  { color: var(--body); }

/* CTA card */
.sidebar-cta {
  padding: 24px 20px; text-align: center;
  background: rgba(45,17,87,.45); border: .5px solid rgba(196,168,255,.22);
  border-radius: var(--r-md);
}
.sidebar-cta-stars { color: var(--gold); font-size: 14px; letter-spacing: 4px; margin-bottom: 12px; }
.sidebar-cta h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.sidebar-cta p  { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 16px; font-weight: 300; }
.sidebar-cta-btn { width: 100%; justify-content: center; font-size: 14px; padding: 11px; }

/* Section label */
.sidebar-section-title {
  font-family: 'Inter',sans-serif; font-size: 11px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
  padding-bottom: 10px; border-bottom: .5px solid var(--border); margin-bottom: 14px;
}

/* Related posts */
.sidebar-related {
  border: .5px solid var(--border); border-radius: var(--r-md);
  background: rgba(15,6,32,.5); padding: 16px;
}
.related-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: .5px solid var(--border);
  text-decoration: none; transition: opacity .2s;
}
.related-item:last-child { border-bottom: none; }
.related-item:hover { opacity: .8; }
.related-thumb { width: 56px; height: 46px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.related-title { font-size: 13px; color: var(--text); line-height: 1.35; }
.related-date  { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* WP Widgets sidebar */
.sidebar-wp-widgets { display: flex; flex-direction: column; gap: 16px; }
.sidebar-wp-widgets .widget {
  border: .5px solid var(--border); border-radius: var(--r-md);
  background: rgba(15,6,32,.4); padding: 16px;
}
.sidebar-wp-widgets .widget-title {
  font-family: 'Inter',sans-serif; font-size: 11px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: .5px solid var(--border);
}
.sidebar-wp-widgets .widget ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sidebar-wp-widgets .widget a { font-size: 13px; color: var(--muted); }
.sidebar-wp-widgets .widget a:hover { color: var(--glow); }

/* ─── ARTICLE BODY TYPOGRAPHY ─── */
.article-body {
  font-size: 17px; line-height: 1.85; color: var(--body);
}
/* Heading anchors */
.article-body h2 {
  font-size: clamp(20px,3vw,28px); color: var(--text);
  margin: 52px 0 18px; padding-bottom: 12px;
  border-bottom: .5px solid var(--border);
}
.article-body h2 .anchor-link,
.article-body h3 .anchor-link {
  opacity: 0; font-size: .75em; color: var(--purple);
  margin-left: 8px; text-decoration: none; transition: opacity .2s;
}
.article-body h2:hover .anchor-link,
.article-body h3:hover .anchor-link { opacity: 1; }
.article-body h3 { font-size: clamp(17px,2.5vw,22px); color: var(--glow); margin: 36px 0 14px; }
.article-body h4 {
  font-family: 'Inter',sans-serif; font-size: 16px; font-weight: 500;
  color: var(--text); margin: 28px 0 10px;
}
.article-body p { margin-bottom: 1.4em; }
.article-body a { color: var(--glow); border-bottom: .5px solid rgba(196,168,255,.35); }
.article-body a:hover { color: var(--text); border-bottom-color: var(--text); }
.article-body strong { color: var(--text); font-weight: 500; }
.article-body em     { color: var(--glow); font-style: italic; }

/* Lists */
.article-body ul, .article-body ol { padding-left: 1.6em; margin-bottom: 1.4em; }
.article-body li { margin-bottom: .6em; }

/* Blockquote — ancient verse style */
.article-body blockquote {
  margin: 36px 0; padding: 22px 26px 22px 32px;
  border-left: 3px solid var(--purple);
  background: rgba(123,63,196,.1); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-style: italic; font-size: 17px;
}
.article-body blockquote p { color: var(--glow); margin: 0; font-style: italic; }
.article-body blockquote cite,
.article-body blockquote footer {
  display: block; font-size: 13px; color: var(--muted);
  font-style: normal; margin-top: 12px;
}
.article-body blockquote cite::before { content: '— '; }

/* Images */
.article-body img {
  border-radius: var(--r-md); margin: 24px auto;
  border: .5px solid var(--border);
}
.article-body figure { margin: 28px 0; }
.article-body figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; font-style: italic; }

/* Tables — info tables, comparison tables */
.article-body table {
  width: 100%; border-collapse: collapse; margin: 28px 0;
  font-size: 14px; border-radius: var(--r-md); overflow: hidden;
}
.article-body th {
  background: var(--mid); color: var(--glow); font-weight: 500;
  padding: 12px 16px; text-align: left; border: .5px solid var(--border);
  font-family: 'Inter',sans-serif; font-size: 13px;
}
.article-body td {
  padding: 10px 16px; border: .5px solid var(--border); color: var(--body);
  vertical-align: top;
}
.article-body tr:nth-child(even) td { background: rgba(45,17,87,.22); }
.article-body tbody tr:hover td    { background: rgba(123,63,196,.1); }

/* Horizontal rule */
.article-body hr { border: none; border-top: .5px solid var(--border); margin: 44px 0; }

/* Code */
.article-body code { background: rgba(123,63,196,.18); color: var(--glow); padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.article-body pre  { background: var(--deep); border: .5px solid var(--border); border-radius: var(--r-sm); padding: 20px; overflow-x: auto; font-size: 14px; margin-bottom: 1.4em; }

/* ─── TAGS ─── */
.article-tags {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 40px; padding-top: 24px; border-top: .5px solid var(--border);
}
.tags-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tag-pill {
  font-size: 12px; padding: 5px 13px; border-radius: 20px; text-decoration: none;
  background: rgba(196,168,255,.07); color: var(--muted); border: .5px solid var(--border);
  transition: background .2s, color .2s;
}
.tag-pill:hover { background: rgba(196,168,255,.16); color: var(--glow); }

/* ─── SHARE BAR ─── */
.article-share {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 20px;
}
.share-label { font-size: 12px; color: var(--muted); }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 8px 14px; border-radius: var(--r-sm);
  border: .5px solid var(--border-m); color: var(--muted);
  background: transparent; cursor: pointer; text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
  font-family: 'Inter',sans-serif;
}
.share-btn:hover   { border-color: var(--glow); color: var(--glow); background: rgba(196,168,255,.05); }
.share-btn.copied  { color: #1D9E75; border-color: #1D9E75; }

/* ─── AUTHOR BOX ─── */
.author-box {
  display: flex; align-items: flex-start; gap: 20px;
  margin-top: 40px; padding: 26px;
  background: rgba(45,17,87,.3); border: .5px solid var(--border); border-radius: var(--r-md);
}
.author-avatar { border-radius: 50%; border: 2px solid var(--border-m); flex-shrink: 0; object-fit: cover; }
.author-name { font-size: 15px; font-weight: 500; color: var(--glow); margin-bottom: 6px; }
.author-bio  { font-size: 13px; color: var(--muted); line-height: 1.6; }
@media(max-width:540px){ .author-box { flex-direction: column; } }

/* ─── POST NAVIGATION ─── */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 36px;
}
.post-nav-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border-radius: var(--r-md);
  border: .5px solid var(--border); background: rgba(45,17,87,.2);
  text-decoration: none; transition: border-color .2s, background .2s;
}
.post-nav-item:hover { border-color: var(--border-m); background: rgba(45,17,87,.4); }
.post-nav-next { text-align: right; }
.nav-direction { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.nav-title     { font-size: 14px; color: var(--text); line-height: 1.4; font-weight: 500; }
@media(max-width:540px){ .post-nav { grid-template-columns: 1fr; } }

/* ─── COMMENTS ─── */
.comments-area { margin-top: 52px; padding-top: 40px; border-top: .5px solid var(--border); }
.comments-title, .comment-reply-title { font-size: 22px; margin-bottom: 24px; }
.comment-list { list-style: none; padding: 0; }
.comment { margin-bottom: 20px; }
.comment-body {
  padding: 18px 22px; background: rgba(45,17,87,.25);
  border: .5px solid var(--border); border-radius: var(--r-md);
}
.comment-author { font-weight: 500; color: var(--glow); font-size: 14px; margin-bottom: 4px; }
.comment-metadata { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.comment-content p { font-size: 14px; }
.comment-reply-link { font-size: 12px; color: var(--purple); margin-top: 10px; display: inline-block; }
.comment-form input,
.comment-form textarea {
  width: 100%; background: rgba(255,255,255,.05);
  border: .5px solid var(--border-m); border-radius: var(--r-sm);
  padding: 11px 14px; color: var(--text); font-family: 'Inter',sans-serif;
  font-size: 14px; outline: none; transition: border-color .2s; margin-bottom: 12px;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--purple); }
.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }
.comment-form .submit {
  background: var(--purple); color: #fff; border: none; border-radius: var(--r-sm);
  padding: 11px 24px; font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: 'Inter',sans-serif; transition: background .2s;
}
.comment-form .submit:hover { background: var(--violet); }
