/* Article detail, following the post layout used by bao-hiem-cluser. */
.post-detail-page { --post-primary: var(--brand-dark, #173665); --post-blue-bg: #f3f6fb; --post-line: #e5e9ef; --post-muted: #758096; background: #fff; color: #17243b; }
.post-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 1.4rem; color: var(--post-muted); font-size: .88rem; }
.post-breadcrumb a { color: var(--post-primary); text-decoration: none; }
.post-breadcrumb a:hover { text-decoration: underline; }

.post-detail-header { margin-bottom: 2.5rem; }
.post-detail-header h1 { margin: 0 0 .8rem; color: var(--post-primary); font-size: clamp(1.6rem, 2.8vw, 2.4rem); font-weight: 800; line-height: 1.2; }
.post-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; padding: 1.2rem 0; border-top: 1px solid var(--post-line); border-bottom: 1px solid var(--post-line); }
.post-author { display: flex; align-items: center; gap: .65rem; }
.post-author-avatar { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; overflow: hidden; border-radius: 0; background: var(--post-blue-bg); color: var(--post-primary); font-size: 1.2rem; object-fit: cover; }
.post-author-copy { display: grid; line-height: 1.3; }
.post-author strong { display: block; color: #26344f; font-size: .88rem; }
.post-author-link { color: inherit; text-decoration: none; }
.post-author-link:hover strong { color: var(--post-primary); }
.post-author-role { color: var(--post-muted); font-size: .76rem; }
.post-meta-info { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; color: var(--post-muted); font-size: .82rem; }
.post-meta-info time, .post-meta-info span { display: inline-flex; align-items: center; gap: .3rem; }
.post-share { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.post-share > span { margin-right: .15rem; color: var(--post-muted); font-size: .82rem; }
.post-share a, .post-share button { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 1px solid var(--post-line); border-radius: 0; background: #fff; color: var(--post-muted); font-size: .9rem; text-decoration: none; cursor: pointer; transition: color .15s, border-color .15s, background-color .15s; }
.post-share a:hover, .post-share button:hover { border-color: var(--post-primary); background: var(--post-primary); color: #fff; }

.post-layout { align-items: flex-start; }
.post-detail { min-width: 0; }
.post-sidebar { position: sticky; top: 7.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.post-detail .cms-content { color: #26344f; font-size: 1.075rem; line-height: 1.75; overflow-wrap: anywhere; }
.post-detail .cms-content > :first-child { margin-top: 0; }
.post-detail .cms-content h2, .post-detail .cms-content h3, .post-detail .cms-content h4 { margin-top: 2rem; }
.post-detail .cms-content h2 { scroll-margin-top: 7rem; }
.post-detail .cms-content > h2 { display: flex; align-items: center; gap: .75rem; margin: 2.4rem 0 1rem; color: var(--post-primary); font-size: 1.35rem; font-weight: 800; line-height: 1.35; }
.post-detail .cms-content > h2::before { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 0; background: var(--post-primary); color: #fff; content: counter(cms-section); counter-increment: cms-section; font-size: 1rem; font-weight: 800; }
.post-detail .cms-content { counter-reset: cms-section; }
.post-detail .cms-content > h3 { margin: 1.8rem 0 .7rem; color: #26344f; font-size: 1.02rem; font-weight: 800; line-height: 1.45; }
.post-detail .cms-content > h4 { margin: 1.5rem 0 .6rem; color: #26344f; font-size: .96rem; font-weight: 700; }
.post-detail .cms-content p { margin: 0 0 1rem; }
.post-detail .cms-content ul, .post-detail .cms-content ol { padding-left: 1.5rem; }
.post-detail .cms-content li { margin-bottom: .4rem; }
.post-detail .cms-content a { color: #1c4c9c; }
.post-detail .cms-content img { max-width: 100%; height: auto; }
.post-detail .cms-content figure.image { display: table; clear: both; max-width: 100%; margin: 1rem auto; text-align: center; }
.post-detail .cms-content figure.image img { display: block; min-width: 50px; max-width: 100%; height: auto; margin: 0 auto; }
.post-detail .cms-content figure.image.image_resized { display: block; box-sizing: border-box; max-width: 100%; }
.post-detail .cms-content figure.image.image_resized img { width: 100%; }
.post-detail .cms-content figure.image.image-style-side { float: right; max-width: 50%; margin: 0 0 1rem 1.5rem; }
.post-detail .cms-content figure.image.image-style-align-left { float: left; margin: 0 1.5rem 1rem 0; }
.post-detail .cms-content figure.image.image-style-align-right { float: right; margin: 0 0 1rem 1.5rem; }
.post-detail .cms-content figure.image.image-style-align-center { margin-right: auto; margin-left: auto; }
.post-detail .cms-content figure.image figcaption { padding: .45rem .6rem; color: var(--post-muted); font-size: .82rem; line-height: 1.45; text-align: center; }
.post-detail .cms-content figure.table { display: block; max-width: 100%; margin: 1.25rem 0; overflow-x: auto; }
.post-detail .cms-content table { width: 100%; margin: 1.25rem 0; border-collapse: collapse; font-size: .9rem; }
.post-detail .cms-content th { padding: .7rem .9rem; border: 1px solid rgba(255,255,255,.28); background: var(--post-primary); color: #fff; font-size: .82rem; font-weight: 700; text-align: left; }
.post-detail .cms-content td { padding: .65rem .9rem; border: 1px solid var(--post-line); color: #26344f; vertical-align: top; }
.post-detail .cms-content tr:nth-child(even) td { background: #f6f8fc; }
.post-detail .cms-content blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 3px solid #173665; background: #f4f6fb; color: #4f5c70; }
.post-detail .cms-content pre { overflow: auto; padding: 1.25rem; border-radius: 0; background: #111827; color: #e5e7eb; }
.post-detail .cms-content .text-tiny { font-size: .7em; }
.post-detail .cms-content .text-small { font-size: .85em; }
.post-detail .cms-content .text-big { font-size: 1.4em; }
.post-detail .cms-content .text-huge { font-size: 1.8em; }
.post-detail .cms-content .marker-yellow { background: #fdfd77; }
.post-detail .cms-content .marker-green { background: #63f963; }
.post-detail .cms-content .marker-pink { background: #fc7999; }
.post-detail .cms-content .marker-blue { background: #72cdfd; }
.post-detail .cms-content .pen-red { color: #e71313; }
.post-detail .cms-content .pen-green { color: #118811; }

.post-toc { padding: 1.2rem 1.35rem; border: 1px solid var(--post-line); border-radius: 0; background: #fff; }
.post-toc-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .8rem; padding-bottom: .8rem; border-bottom: 1px solid var(--post-line); color: var(--post-primary); font-size: .95rem; font-weight: 800; }
.post-toc .post-toc-list { max-height: calc(100vh - 16rem); overflow-y: auto; }
.post-toc-list { margin: 0; padding: 0; list-style: none; counter-reset: toc-item; }
.post-toc-list li { margin: 0; counter-increment: toc-item; }
.post-toc-list li.post-toc-subitem { padding-left: .85rem; }
.post-toc-list a { display: block; padding: .55rem 0; border-bottom: 1px solid var(--post-line); color: #3b4650; font-size: .86rem; line-height: 1.45; text-decoration: none; transition: color .15s; }
.post-toc-list li:last-child a { border-bottom: 0; }
.post-toc-list a::before { color: var(--post-primary); content: counter(toc-item) '. '; font-weight: 700; }
.post-toc-list a:hover, .post-toc-list a.active { color: var(--post-primary); }
.post-toc-list a.active { font-weight: 700; }

.post-cta-box { padding: 1.5rem 1.35rem; border-radius: 0; background: var(--post-blue-bg); text-align: center; }
.post-cta-box h2 { margin: 0 0 1rem; color: var(--post-primary); font-size: 1.05rem; font-weight: 800; }
.post-cta-btn { display: block; padding: .7rem 1rem; border-radius: 0; background: var(--post-primary); color: #fff; font-size: .88rem; font-weight: 700; text-align: center; text-decoration: none; transition: background-color .15s; }
.post-cta-btn:hover { background: #0f2447; color: #fff; }

.post-toc-fab { display: none; }
.post-toc-modal .modal-content { border: 0; border-radius: 0; }
.post-toc-modal .modal-title { color: var(--post-primary); font-size: 1.25rem; font-weight: 800; }
.post-toc-modal .post-toc-list a { padding: .8rem 0; }

.related-posts { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--post-line); }
.related-posts-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.5rem; }
.related-posts h2 { margin: 0; color: var(--post-primary); font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 800; }
.related-more { display: inline-flex; align-items: center; gap: .35rem; color: var(--post-primary); font-weight: 800; text-decoration: none; }
.related-more:hover { text-decoration: underline; }
.related-card { display: block; height: 100%; color: #26344f; text-decoration: none; }
.related-card img { display: block; width: 100%; aspect-ratio: 16/10; margin-bottom: .85rem; border-radius: 0; object-fit: cover; }
.related-card strong { display: block; color: #26344f; font-size: 1.05rem; line-height: 1.4; }
.related-card:hover strong { color: var(--post-primary); }
.related-card time { display: block; margin-top: .35rem; color: #8a938d; font-size: .85rem; }

@media (max-width: 991.98px) {
    .post-sidebar { position: static; }
    .post-toc { display: none; }
    .post-toc-fab { position: fixed; top: 50%; right: 0; z-index: 1020; display: grid; width: 3rem; height: 3rem; place-items: center; padding: 0; border: 0; border-radius: 0; background: var(--post-primary); color: #fff; font-size: 1.4rem;  transform: translateY(-50%); }
}
@media (max-width: 575.98px) {
    .post-detail-page > .container:first-child { padding-top: 2rem !important; }
    .post-detail-header h1 { font-size: 1.5rem; }
    .post-meta-row { flex-direction: column; align-items: flex-start; gap: .8rem; }
    .post-share { margin-left: 0; }
    .post-detail .cms-content { font-size: 1rem; }
    .post-detail .cms-content > h2 { gap: .6rem; font-size: 1.2rem; }
    .post-detail .cms-content > h2::before { width: 30px; height: 30px; font-size: .9rem; }
    .post-detail .cms-content figure.image.image-style-side, .post-detail .cms-content figure.image.image-style-align-left, .post-detail .cms-content figure.image.image-style-align-right { float: none; max-width: 100%; margin: 1rem auto; }
    .post-cta-box { margin-top: .5rem; }
}
.related-placeholder { display: grid; width: 100%; aspect-ratio: 16/10; margin-bottom: .85rem; place-items: center; border-radius: 0; background: var(--brand-soft); color: var(--brand-primary); font-size: 3rem; }

/* Phones and tablets: targets big enough for thumbs, small print at a readable size. */
@media (max-width: 991.98px) {
    .post-breadcrumb a { display: inline-block; padding: .65rem 0; }
    .post-detail-header .post-share a, .post-detail-header .post-share button, .post-share a, .post-share button { width: 44px; height: 44px; }
    .post-detail .related-posts a.related-more, a.related-more { display: inline-flex; align-items: center; min-height: 44px; }
    .post-breadcrumb, .post-author strong, .post-author-role, .post-meta-info, .post-meta-info span, .post-meta-info time, .post-share > span, .related-card time { font-size: .875rem; }
}
