/* =========================================================
   Blog index and article (loaded on /blog and /blog/{slug})
   ========================================================= */

/* ---------- Shared bits ---------- */
.post-chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 10px; background: rgba(124, 58, 237, .12); color: var(--violet-600); font-size: 13.5px; font-weight: 600; }
.post-chip .icon { color: var(--violet); }
.post-chip-lg { padding: 8px 16px; border-radius: 14px; font-size: 16px; color: var(--ink); background: rgba(255, 255, 255, .75); box-shadow: 0 8px 20px -12px rgba(76, 29, 149, .4); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; font-size: 14px; color: var(--ink); }
.post-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.post-meta > span + span { margin-left: 18px; padding-left: 18px; border-left: 1px solid rgba(15, 23, 42, .15); }
.post-meta .icon { color: var(--violet); }
.post-excerpt { color: #1E293B; font-size: 15px; }

/* ---------- Index hero ---------- */
.blog-hero { padding: 28px 0 8px; position: relative; overflow: hidden; }
.blog-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: center; }
.blog-hero h1 { font-size: clamp(38px, 4.2vw, 62px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; max-width: 16ch; }
.blog-lead { margin-top: 18px; font-size: 18px; color: #1E293B; max-width: 48ch; }
.blog-hero-visual img { width: 100%; max-width: 520px; margin: 0 auto; filter: drop-shadow(0 30px 50px rgba(124, 58, 237, .18)); }

/* ---------- Filters ---------- */
.blog-filters { display: flex; flex-wrap: wrap; gap: 12px; padding: 20px 0 4px; }
.blog-filter { display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .7); box-shadow: 0 10px 24px -14px rgba(76, 29, 149, .4); font-weight: 600; font-size: 16px; color: var(--ink); cursor: pointer; transition: background .2s, color .2s; }
.blog-filter .icon { width: 20px; height: 20px; color: var(--violet); }
.blog-filter:hover { background: #fff; color: var(--violet); }
.blog-filter.is-active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 12px 28px -10px rgba(99, 102, 241, .65); }
.blog-filter.is-active .icon { color: #fff; }
[data-cat][hidden], .blog-latest[hidden] { display: none; }

/* ---------- Featured post ---------- */
.post-featured { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: center; padding: 14px; }
.post-featured-img img, .post-card-img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 18px; background: rgba(237, 233, 254, .7); }
.post-featured-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 24px 18px 0; }
.post-featured h2 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 800; }
.post-featured h2 a, .post-card h3 a { color: var(--ink); }
.post-featured h2 a:hover, .post-card h3 a:hover { color: var(--violet); }
.post-featured .post-excerpt { font-size: 17px; max-width: 52ch; }
.post-featured-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.post-featured-foot .svc-link { margin-top: 0; }

/* ---------- Grid ---------- */
.blog-section-title { margin-bottom: 26px; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { display: flex; flex-direction: column; padding: 10px; transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 16px 12px 12px; }
.post-card h3 { font-size: 21px; font-weight: 800; }
.post-card .post-meta { margin-top: auto; padding-top: 6px; }

.blog-empty { max-width: 640px; margin: 20px auto; padding: 40px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.blog-empty h2 { font-size: 28px; }

/* ---------- Article hero ---------- */
.article-hero { padding: 28px 0 16px; position: relative; overflow: hidden; }
.article-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: center; }
.article-hero .crumbs li[aria-current] { min-width: 0; }
.crumb-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 38ch; }
.article-hero h1 { margin-top: 18px; font-size: clamp(34px, 3.8vw, 56px); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 0; margin-top: 24px; font-size: 14.5px; color: var(--ink); }
.article-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.article-meta > span + span { margin-left: 18px; padding-left: 18px; border-left: 1px solid rgba(15, 23, 42, .15); }
.article-meta .icon { color: var(--violet); }
.article-author { font-weight: 700; }
.article-author img { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: #fff; box-shadow: 0 6px 14px -8px rgba(76, 29, 149, .4); }
.article-share a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 6px 14px -8px rgba(76, 29, 149, .4); }
.article-share .icon { width: 18px; height: 18px; }
.article-share .icon-wa { width: 20px; height: 20px; }
.article-cover img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: rgba(237, 233, 254, .7); }

/* ---------- Article layout ---------- */
.article-section { padding: 24px 0 40px; }
.article-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.article-toc-col, .article-side { position: sticky; top: 110px; }

.toc { padding: 20px 16px; border-radius: 20px; }
.toc summary { display: flex; align-items: center; gap: 10px; list-style: none; font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--ink); pointer-events: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary .icon { width: 24px; height: 24px; color: var(--violet); }
.toc summary span { flex: 1; }
.toc .toc-chevron { display: none; }
.toc ol { margin-top: 14px; display: grid; gap: 2px; }
.toc a { display: block; padding: 8px 12px; border-radius: 10px; border-left: 3px solid transparent; font-size: 14.5px; line-height: 1.35; color: var(--ink); }
.toc a:hover { background: rgba(124, 58, 237, .1); border-left-color: var(--violet); color: var(--violet-600); }

.article-body { padding: 34px 40px; min-width: 0; }

/* Body copy */
.prose { font-size: 17px; line-height: 1.75; color: #1E293B; }
.prose > * + * { margin-top: 16px; }
.prose h2, .article-faq h2 { display: flex; align-items: center; gap: 16px; margin-top: 40px; font-size: clamp(24px, 2.2vw, 30px); font-weight: 800; line-height: 1.2; }
.prose h2::after, .article-faq h2::after { content: ""; flex: none; width: 44px; height: 3px; border-radius: 3px; background: var(--grad); }
.prose h3 { margin-top: 28px; font-size: 20px; }
.prose a { text-decoration: underline; text-decoration-color: rgba(124, 58, 237, .35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { display: grid; gap: 10px; }
.prose li { position: relative; padding-left: 34px; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .3em; width: 22px; height: 22px; border-radius: 7px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat, var(--grad); }
.prose .table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .6); }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose th, .prose td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { background: rgba(124, 58, 237, .08); font-family: var(--font-head); color: var(--ink); }
.prose tbody th { color: var(--ink); font-weight: 600; }
.prose tbody tr:last-child > * { border-bottom: 0; }

.article-faq { margin-top: 8px; }
.article-faq h2 { margin-bottom: 18px; }

/* Talk to us card */
.talk-card { display: grid; gap: 14px; padding: 24px; text-align: left; }
.talk-card img { width: 140px; height: 140px; object-fit: contain; margin: -6px auto 0; }
.talk-card h2 { font-size: 26px; font-weight: 800; }
.talk-card p { margin-top: 6px; font-size: 15.5px; color: #1E293B; }
.talk-card .btn { padding: 14px 18px; font-size: 16px; }
.talk-card .btn-ghost .icon-wa { width: 24px; height: 24px; }
.talk-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14.5px; font-weight: 600; text-align: center; }

/* Related posts */
.related-posts { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: center; }
.related-posts .section-title { font-size: clamp(30px, 3vw, 44px); }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.related-post { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease; }
.related-post:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.related-post img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: rgba(237, 233, 254, .7); }
.related-post-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 16px 56px 18px 20px; }
.related-post strong { font-family: var(--font-head); font-size: 18px; line-height: 1.25; }
.related-post .post-meta { margin-top: auto; font-size: 13px; }
.related-post .post-meta > span + span { margin-left: 10px; padding-left: 10px; }
.related-post-go { position: absolute; right: 16px; bottom: 16px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--violet); box-shadow: 0 6px 14px -8px rgba(76, 29, 149, .45); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .article-layout { grid-template-columns: 220px minmax(0, 1fr); }
    .article-side { grid-column: 2; position: static; }
    .talk-card { grid-template-columns: 120px minmax(0, 1fr); align-items: center; }
    .talk-card img { width: 120px; height: 120px; margin: 0; }
    .talk-card .btn, .talk-link { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
    .blog-hero-grid, .article-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .blog-hero-visual img { max-width: 440px; }
    .post-featured { gap: 24px; }
    .post-featured-body { padding: 8px 12px 8px 0; }
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .article-cover { max-width: 640px; }
    .article-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .article-toc-col { position: static; }
    .article-side { grid-column: auto; }
    .toc summary { pointer-events: auto; cursor: pointer; }
    .toc .toc-chevron { display: block; transition: transform .2s; }
    .toc[open] .toc-chevron { transform: rotate(180deg); }
    .related-posts { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 720px) {
    .blog-hero h1 { font-size: clamp(32px, 9.5vw, 42px); }
    .blog-lead { font-size: 16px; }
    .blog-filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 18px 16px 10px; scrollbar-width: none; }
    .blog-filters::-webkit-scrollbar { display: none; }
    .blog-filter { flex: none; padding: 10px 20px; font-size: 15px; }
    .post-featured { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .post-featured-body { padding: 12px 14px 14px; }
    .post-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .post-card h3 { font-size: 20px; }
    .post-featured .post-excerpt { font-size: 15.5px; }
    .post-featured-foot { flex-direction: column; align-items: flex-start; }
    .article-hero h1 { font-size: clamp(30px, 8.6vw, 40px); }
    .article-meta { gap: 10px 16px; }
    .article-meta > span + span { margin-left: 0; padding-left: 0; border-left: 0; }
    .article-share { flex-basis: 100%; }
    .article-body { padding: 22px 18px; }
    .prose { font-size: 16px; line-height: 1.7; }
    .prose h2, .article-faq h2 { margin-top: 32px; font-size: 23px; }
    .prose h2::after, .article-faq h2::after { width: 30px; }
    .talk-card { grid-template-columns: 88px minmax(0, 1fr); padding: 18px; }
    .talk-card img { width: 88px; height: 88px; }
    .talk-card h2 { font-size: 22px; }
    .related-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .related-post { flex-direction: row; align-items: center; }
    .related-post img { width: 120px; flex: none; aspect-ratio: 3 / 2; align-self: stretch; height: auto; }
    .related-post-body { padding: 12px 48px 12px 14px; }
    .related-post strong { font-size: 16px; }
    .related-post-go { bottom: 50%; transform: translateY(50%); right: 12px; }
}
