/* ============================================================================
   BLOG.CSS — danh sách bài viết và trang bài viết ("Sổ tay ôn thi Địa lí")
   ========================================================================== */
.blog { padding: 124px 0 80px; }
.blog-head { max-width: 760px; }
.blog-head h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; }
.blog-head .lead { margin-top: 12px; color: var(--ink-soft); font-size: 1.1rem; line-height: 1.65; max-width: 58ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 34px; }
.tagchip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: .9rem; font-weight: 600; color: var(--ink-soft); background: var(--paper-raised); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 7px 13px; transition: color .15s, border-color .15s; }
.tagchip small { color: var(--ink-faint); font-weight: 500; font-size: .8rem; }
.tagchip:hover { color: var(--oxblood); border-color: var(--gold); }
.tagchip.on { background: var(--oxblood); color: #fdf6ec; border-color: var(--oxblood-deep); }
.tagchip.on small { color: rgba(253,246,236,.75); }

.kicker { font-size: .88rem; color: var(--gold-deep); font-weight: 600; }
.meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-faint); }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta i { font-size: .8rem; }

/* Bài nổi bật (mới nhất) */
.featured { display: grid; grid-template-columns: 1.25fr 1fr; text-decoration: none; color: inherit; background: var(--paper-raised); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2); margin-bottom: 34px; }
.featured img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.featured .fb { padding: 30px 34px; display: flex; flex-direction: column; justify-content: center; }
.featured h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; margin-top: 8px; }
.featured p { margin-top: 12px; color: var(--ink-soft); line-height: 1.65; }
.featured .meta { margin-top: 16px; }

/* Lưới bài */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); color: inherit; }
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: 1px solid var(--rule); }
.card .cb { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 1.22rem; line-height: 1.25; margin-top: 6px; }
.card p { margin-top: 8px; color: var(--ink-soft); font-size: .96rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 14px; }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); background: var(--paper-raised); border: 1px dashed var(--rule-strong); border-radius: var(--r-lg); }
.empty a { color: var(--oxblood); font-weight: 600; }

/* Khối kêu gọi cuối trang danh sách */
.blog-cta { margin-top: 60px; background: linear-gradient(160deg, var(--spine-2), var(--spine)); color: var(--parchment); border: 1px solid var(--gold-deep); border-radius: var(--r-lg); padding: 34px 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.blog-cta h2 { color: #f3ead4; font-size: 1.5rem; }
.blog-cta p { margin-top: 6px; color: var(--parchment-dim); max-width: 52ch; line-height: 1.55; }
.blog-cta .btn-solid { background: var(--gold); color: var(--spine); border-color: var(--gold-deep); }
.blog-cta .btn-solid:hover { background: var(--gold-tint); color: var(--spine); }

/* ---------- Trang bài viết ---------- */
.post { padding: 124px 0 80px; }
.crumbs { font-size: .9rem; color: var(--ink-faint); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--oxblood); }
.post-head { max-width: 800px; margin-top: 18px; }
.post-head .tags { margin: 0 0 14px; }
.post-head h1 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.1; text-wrap: balance; }
.post-lead { margin-top: 16px; font-size: 1.15rem; line-height: 1.65; color: var(--ink-soft); }
.post-head .meta { margin-top: 16px; }
.post-cover { margin: 30px 0 34px; }
.post-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); border: 1px solid var(--rule-strong); box-shadow: var(--sh-2); }
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
.post-grid > * { min-width: 0; }

.prose { font-size: 1.08rem; line-height: 1.8; max-width: min(70ch, 100%); }
.prose h2 { font-size: 1.7rem; line-height: 1.2; margin: 2.2em 0 .6em; scroll-margin-top: 96px; }
.prose h3 { font-size: 1.3rem; margin: 1.8em 0 .5em; scroll-margin-top: 96px; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1.2em; }
.prose li { margin: .4em 0; }
.prose li::marker { color: var(--gold-deep); }
.prose a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 1.5em 0; padding: 1em 1.3em; border-left: 3px solid var(--gold); background: var(--gold-tint); border-radius: 0 var(--r) var(--r) 0; color: var(--ink-soft); }
.prose blockquote p:last-child { margin: 0; }
.prose .tbl { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--paper-raised); }
.prose table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.prose table.cols-3 { min-width: 440px; }
.prose table.cols-4, .prose table.cols-5, .prose table.cols-6 { min-width: 580px; }
.prose th, .prose td { padding: 11px 14px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { background: var(--paper-deep); font-family: var(--serif-display); font-weight: 600; color: var(--ink); border-bottom: 2px solid var(--rule-strong); }
.prose tr:last-child td { border-bottom: 0; }
.prose img { border-radius: var(--r-lg); border: 1px solid var(--rule-strong); margin: 1.5em 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }

.post-foot { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .92rem; color: var(--ink-faint); }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share a, .share button { display: inline-flex; align-items: center; gap: 7px; font-family: var(--serif-body); font-size: .9rem; font-weight: 600; color: var(--ink-soft); background: var(--paper-raised); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 7px 13px; text-decoration: none; cursor: pointer; transition: color .15s, border-color .15s; }
.share a:hover, .share button:hover { color: var(--oxblood); border-color: var(--gold); }

.post-aside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 18px; }
.toc { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px 20px; }
.toc-t { font-family: var(--serif-display); font-weight: 600; font-size: 1rem; margin-bottom: 10px; }
.toc ol { list-style: none; border-left: 1px solid var(--rule); }
.toc li { margin: 0; }
.toc li.d3 a { padding-left: 24px; font-size: .88rem; }
.toc a { display: block; color: var(--ink-soft); text-decoration: none; font-size: .93rem; line-height: 1.4; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover, .toc a.on { color: var(--oxblood); border-left-color: var(--gold); }
.toc-mobile { display: none; margin-bottom: 26px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 0 18px; }
.toc-mobile summary { cursor: pointer; padding: 14px 0; font-family: var(--serif-display); font-weight: 600; list-style: none; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile ol { list-style: none; padding-bottom: 12px; }
.toc-mobile a { display: block; padding: 6px 0; color: var(--ink-soft); text-decoration: none; }
.toc-mobile li.d3 a { padding-left: 16px; font-size: .92rem; }

.cta-card { background: linear-gradient(160deg, var(--spine-2), var(--spine)); color: var(--parchment); border: 1px solid var(--gold-deep); border-radius: var(--r-lg); padding: 20px 22px; }
.cta-card h3 { color: #f3ead4; font-size: 1.15rem; line-height: 1.25; }
.cta-card p { margin: 8px 0 14px; color: var(--parchment-dim); font-size: .95rem; line-height: 1.55; }
.cta-card .btn-solid { background: var(--gold); color: var(--spine); border-color: var(--gold-deep); font-size: .95rem; padding: 11px 16px; }
.cta-card .btn-solid:hover { background: var(--gold-tint); color: var(--spine); }

.related { margin-top: 70px; }
.related h2 { font-size: 1.6rem; margin-bottom: 18px; }

/* 404 */
.notfound { padding: 160px 0 100px; text-align: center; }
.notfound h1 { font-size: clamp(2rem, 4vw, 3rem); }
.notfound p { margin: 14px auto 26px; color: var(--ink-soft); max-width: 48ch; line-height: 1.65; }

@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .post-aside { position: static; }
  .toc { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 720px) {
  .blog, .post { padding-top: 100px; }
  .featured { grid-template-columns: 1fr; }
  .featured .fb { padding: 22px; }
  .grid { grid-template-columns: 1fr; }
  .blog-cta { padding: 26px 22px; }
  .prose { font-size: 1.03rem; }
}
