/* Blog: article and listing pages on the shared landing tokens and header. */
.blog-page .nav-link[aria-current="page"] { color: var(--brand-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; }

/* Breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--text-muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 40px; }
.crumbs a:hover { color: var(--brand-dark); }
.crumbs span[aria-hidden] { color: var(--border); }
.crumbs [aria-current] { color: var(--text-body); }

/* Article header and cover */
.post-header { padding: 24px 0 0; }
.post-header-inner { max-width: 840px; }
.post-category { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 18px; padding: 6px 12px; border: 1px solid var(--brand-border); border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.post-category .icon { width: 15px; height: 15px; }
.post-header h1 { font-size: clamp(34px, 3.5vw, 50px); line-height: 1.22; letter-spacing: -1.3px; }
.post-lead { margin-top: 20px; max-width: 740px; color: var(--text-body); font-size: 18px; line-height: 1.75; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 24px; color: var(--text-muted); font-size: 14px; }
.post-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.post-meta .icon { width: 17px; height: 17px; color: var(--brand-dark); }
.post-meta strong { color: var(--text-main); font-weight: 600; }
.post-cover { margin: 36px 0 0; }
.post-cover img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-muted); }

/* Two columns: reading column and a sticky table of contents */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; align-items: start; gap: 72px; padding-block: 48px 72px; }
.post-body { min-width: 0; max-width: 740px; }
.post-aside { position: sticky; top: calc(var(--navigation-height, 120px) + 24px); display: grid; gap: 20px; max-height: calc(100dvh - var(--navigation-height, 120px) - 48px); overflow-y: auto; scrollbar-width: thin; }
.post-toc { border: 1px solid var(--border); border-radius: 16px; background: var(--surface-card); }
.post-toc > summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px; list-style: none; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.post-toc > summary::-webkit-details-marker { display: none; }
.post-toc > summary .icon { width: 16px; height: 16px; transition: transform .18s; }
.post-toc[open] > summary .icon { transform: rotate(180deg); }
.post-toc ol { list-style: none; padding: 0 10px 12px; margin: 0; counter-reset: toc; }
.post-toc a { display: flex; gap: 10px; padding: 8px; border-radius: 8px; font-size: 14px; line-height: 1.5; color: var(--text-body); }
.post-toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); flex: 0 0 auto; padding-top: 1px; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.post-toc a:hover, .post-toc a[aria-current="true"] { background: var(--brand-soft); color: var(--brand-dark); }
.post-toc a[aria-current="true"]::before { color: var(--brand-dark); }
.aside-cta { padding: 22px; border: 1px solid var(--brand-border); border-radius: 16px; background: var(--brand-soft); }
.aside-cta strong { display: block; color: var(--text-main); font-size: 17px; line-height: 1.45; }
.aside-cta p { margin-top: 8px; color: var(--text-body); font-size: 14px; line-height: 1.7; }
.aside-cta .btn { width: 100%; min-height: 46px; margin-top: 16px; }

/* Reading typography */
.prose { color: var(--text-body); font-size: 17px; line-height: 1.85; }
.prose > * + * { margin-top: 20px; }
.prose h2 { margin-top: 56px; color: var(--text-main); font-size: 30px; line-height: 1.32; letter-spacing: -.7px; }
.prose h3 { margin-top: 36px; color: var(--text-main); font-size: 21px; line-height: 1.45; letter-spacing: -.3px; }
.prose h2 + *, .prose h3 + * { margin-top: 14px; }
.prose strong { color: var(--text-main); font-weight: 650; }
.prose a { color: var(--brand-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--brand-primary); font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin-block: 48px; }

/* Summary box at the top of an article */
.takeaways { padding: 24px 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-muted); }
.takeaways > p:first-child { display: flex; align-items: center; gap: 10px; color: var(--text-main); font-size: 15px; font-weight: 700; }
.takeaways > p:first-child .icon { width: 20px; height: 20px; color: var(--brand-strong); }
.takeaways ul { margin-top: 12px; padding-left: 22px; font-size: 16px; line-height: 1.75; }

/* Callouts */
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-card); font-size: 16px; line-height: 1.75; }
.callout > .icon { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 4px; color: var(--brand-dark); }
.callout > div > * + * { margin-top: 8px; }
.callout-tip { border-color: var(--brand-border); background: var(--brand-soft); }
.callout-warn { border-color: #fecaca; background: #fef2f2; }
.callout-warn > .icon { color: #b91c1c; }

/* Figures, diagrams and screenshots */
.figure { margin: 32px 0; }
.figure img, .figure svg { display: block; width: 100%; height: auto; }
.figure-frame { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-card); }
.figure-shot { display: flex; justify-content: center; padding: 28px 24px 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--brand-soft); }
.figure-shot img { width: min(280px, 72%); border: 6px solid #1c1917; border-bottom: 0; border-radius: 30px 30px 0 0; }
.figure figcaption { margin-top: 12px; color: var(--text-muted); font-size: 14px; line-height: 1.65; text-align: center; }
/* A caption inside the screenshot frame wraps below the phone instead of squeezing it. */
.figure-shot { flex-wrap: wrap; }
.figure-shot figcaption { flex-basis: 100%; margin: 14px 0 18px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.prose caption { padding: 14px 16px 0; text-align: left; color: var(--text-main); font-size: 14px; font-weight: 700; }
.prose th, .prose td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose thead th { background: var(--surface-muted); color: var(--text-main); font-weight: 700; }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose td strong { color: var(--brand-dark); }

/* Numbered step cards */
.steps { list-style: none; padding: 0 !important; display: grid; gap: 14px; counter-reset: step; }
.steps > li { position: relative; margin: 0 !important; padding: 20px 20px 20px 72px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-card); }
.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 20px; top: 20px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--brand-border); border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); font-size: 15px; font-weight: 700; }
.steps > li > strong { display: block; color: var(--text-main); font-size: 17px; line-height: 1.5; margin-bottom: 4px; }

/* Checklist */
.checklist { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.checklist > li { position: relative; margin: 0 !important; padding-left: 34px; }
.checklist > li::before { content: ''; position: absolute; left: 0; top: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2410c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat; border: 1px solid var(--brand-border); }

/* FAQ */
.post-faq { display: grid; gap: 0; border-top: 1px solid var(--border); }
.post-faq details { border-bottom: 1px solid var(--border); }
.post-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 60px; padding: 18px 0; list-style: none; cursor: pointer; color: var(--text-main); font-size: 17px; font-weight: 600; line-height: 1.55; }
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary .icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--text-muted); transition: transform .18s; }
.post-faq details[open] summary { color: var(--brand-dark); }
.post-faq details[open] summary .icon { transform: rotate(45deg); }
.post-faq details > div { padding: 0 32px 20px 0; font-size: 16px; line-height: 1.8; }
.post-faq details > div > * + * { margin-top: 10px; }

/* End-of-article call to action, author and related posts */
.post-cta { display: flex; align-items: center; gap: 24px; margin-top: 56px; padding: 28px; border: 1px solid var(--brand-border); border-radius: var(--radius-md); background: var(--brand-soft); }
.post-cta > div { flex: 1; min-width: 0; }
.post-cta strong { display: block; color: var(--text-main); font-size: 21px; line-height: 1.4; letter-spacing: -.3px; }
.post-cta p { margin-top: 6px !important; color: var(--text-body); font-size: 15px; line-height: 1.7; }
.post-cta .btn { flex: 0 0 auto; text-decoration: none; color: #fff; }
.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.author-box img { flex: 0 0 auto; width: 52px; height: 52px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: #fff; object-fit: contain; }
.author-box strong { display: block; color: var(--text-main); font-size: 16px; }
.author-box p { margin-top: 4px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.author-disclosure { display: block; margin-top: 6px; }
.author-disclosure a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.related { padding-block: 64px 80px; border-top: 1px solid var(--border); background: var(--surface-muted); }
.related h2 { font-size: 30px; letter-spacing: -.7px; margin-bottom: 28px; }

/* Post cards: related posts and the blog listing */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; }
.post-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-card); transition: border-color .18s, box-shadow .18s; }
.post-card:hover { border-color: var(--brand-border); box-shadow: var(--shadow-card); }
.post-card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.post-card-body { display: flex; flex: 1; flex-direction: column; padding: 20px 22px 22px; }
.post-card-tag { color: var(--brand-dark); font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.post-card h3 { margin-top: 8px; font-size: 19px; line-height: 1.45; letter-spacing: -.3px; }
.post-card h3 a::after { content: ''; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card p { margin-top: 8px; color: var(--text-body); font-size: 15px; line-height: 1.7; }
.post-card-meta { margin-top: auto; padding-top: 16px; color: var(--text-muted); font-size: 13px; }
.post-card:focus-within { outline: 3px solid var(--brand-dark); outline-offset: 3px; }
.post-card h3 a:focus-visible { outline: none; }

/* Blog listing */
.blog-hero { padding: 24px 0 48px; border-bottom: 1px solid var(--border); }
.blog-hero h1 { max-width: 760px; margin-top: 8px; font-size: clamp(38px, 4vw, 56px); line-height: 1.18; letter-spacing: -1.6px; }
.blog-hero h1 span { color: var(--brand-strong); }
.blog-hero p { max-width: 640px; margin-top: 18px; color: var(--text-body); font-size: 18px; line-height: 1.75; }
.blog-hero p a, .author-box strong a { color: var(--brand-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.author-box strong a { color: var(--text-main); text-decoration-color: var(--brand-border); }
.blog-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; list-style: none; padding: 0; }
.blog-topics a { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-card); color: var(--text-body); font-size: 14px; font-weight: 600; }
.blog-topics a:hover { border-color: var(--brand-border); background: var(--brand-soft); color: var(--brand-dark); }
.blog-featured { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 48px; position: relative; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-card); }
.blog-featured:hover { border-color: var(--brand-border); box-shadow: var(--shadow-card); }
.blog-featured img { width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: var(--radius-md); border: 1px solid var(--border); }
.blog-featured h2 { margin-top: 10px; font-size: 32px; line-height: 1.3; letter-spacing: -.8px; }
.blog-featured h2 a::after { content: ''; position: absolute; inset: 0; }
.blog-featured p { margin-top: 14px; color: var(--text-body); font-size: 16px; line-height: 1.75; }
.blog-featured .text-link { margin-top: 12px; color: var(--brand-dark); }
.blog-list { padding-block: 56px 80px; }
.blog-list > .container > h2 { margin: 56px 0 24px; font-size: 28px; letter-spacing: -.6px; }
.blog-list .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1100px) {
    .post-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 48px; }
    .post-grid { gap: 18px; }
}
@media (max-width: 960px) {
    .post-layout { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
    .post-aside { position: static; max-height: none; overflow: visible; order: -1; }
    .aside-cta { display: none; }
    .post-body { max-width: none; }
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blog-featured { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 700px) {
    .post-header h1 { font-size: clamp(30px, 8vw, 38px); letter-spacing: -.9px; }
    .post-lead { font-size: 17px; }
    .post-cover { margin-top: 28px; margin-inline: -20px; }
    .post-cover img { border-radius: 0; border-inline: 0; }
    .prose { font-size: 17px; line-height: 1.8; }
    .prose h2 { margin-top: 44px; font-size: 25px; }
    .prose h3 { font-size: 19px; }
    .takeaways { padding: 20px; }
    .figure-frame { margin-inline: -20px; padding: 14px 20px 16px; overflow-x: auto; overscroll-behavior-x: contain; border-inline: 0; border-radius: 0; }
    .figure-frame svg { min-width: 600px; }
    .figure-frame::before { content: 'Vuốt ngang để xem đầy đủ sơ đồ →'; position: sticky; left: 0; display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 13px; }
    .figure-frame figcaption { position: sticky; left: 0; max-width: calc(100vw - 40px); }
    .steps > li { padding: 18px 16px 18px 64px; }
    .steps > li::before { left: 16px; }
    .post-cta { flex-direction: column; align-items: stretch; padding: 24px 20px; }
    .post-cta .btn { width: 100%; }
    .post-faq summary { font-size: 16px; }
    .post-faq details > div { padding-right: 0; }
    .post-grid, .blog-list .post-grid { grid-template-columns: 1fr; }
    .blog-hero h1 { font-size: clamp(32px, 9vw, 42px); letter-spacing: -1px; }
    .blog-hero p { font-size: 17px; }
    .blog-featured { padding: 16px; }
    .blog-featured h2 { font-size: 25px; }
    .related { padding-block: 48px 56px; }
    .related h2 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) { .post-toc > summary .icon, .post-faq summary .icon, .post-card { transition: none; } }
@media print {
    .navbar, .footer, .post-aside, .related, .post-cta, .skip-link { display: none !important; }
    .post-layout { display: block; padding: 0; }
    .prose { font-size: 11pt; color: #000; }
}

/* Cashback calculator (/blog/may-tinh-tien-hoan/) */
.calc { margin: 24px 0 32px; padding: 24px; border: 1px solid var(--brand-border); border-radius: var(--radius-md); background: var(--brand-soft); }
.calc fieldset { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.calc-legend, .calc-field label { display: block; margin-bottom: 8px; color: var(--text-main); font-size: 15px; font-weight: 700; }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin-bottom: 18px; }
.calc-field[hidden] { display: none; }
.calc input[type="text"], .calc input[type="date"] { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text-main); font: inherit; font-size: 17px; }
.calc input[type="text"]:focus-visible, .calc input[type="date"]:focus-visible { outline: 3px solid var(--brand-border); border-color: var(--brand-primary); }
.calc-hint { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.calc-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.calc-seg label { position: relative; margin: 0; }
.calc-seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.calc-seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text-body); font-size: 15px; font-weight: 600; }
.calc-seg input:checked + span { border-color: var(--brand-strong); background: var(--brand-strong); color: #fff; }
.calc-seg input:focus-visible + span { outline: 3px solid var(--brand-border); outline-offset: 2px; }
.calc-result { padding: 20px 22px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.calc-result p { margin: 0; }
.calc-result-label { color: var(--text-muted); font-size: 15px; }
.calc-result-value { margin: 2px 0 8px !important; color: var(--brand-strong); font-size: clamp(34px, 6vw, 46px); font-weight: 800; line-height: 1.15; }
.calc-result-note { color: var(--text-body); font-size: 15px; line-height: 1.65; }
.calc .table-wrap { margin-top: 16px; background: #fff; }
.calc .table-wrap table { min-width: 0; }
.calc tr.is-active th, .calc tr.is-active td { background: var(--brand-soft); }
.calc td.is-active { color: var(--brand-dark); font-weight: 800; }
@media (max-width: 640px) {
    .calc { padding: 18px 16px; }
    .calc-grid { grid-template-columns: 1fr; }
}
