/* Knowledge hub and article */

/* ============ Knowledge hub ============ */
.kh-hero .wrap { row-gap: 0; padding-block: clamp(2rem, 1.5rem + 2vw, 3rem) clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.kh-hero .crumbs { margin-bottom: clamp(1.25rem, 1rem + 1vw, 2rem); }
.kh-hero .ph-copy { grid-column: 1 / 8; }
.kh-hero h1 { font-size: clamp(2.1rem, 1.2rem + 2.6vw, 3.2rem); }
.kh-search { grid-column: 1 / -1; margin-top: 2.25rem; }
.kh-bar { position: relative; max-width: 46rem; }
.kh-bar svg { position: absolute; left: 1.1rem; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.kh-bar input { width: 100%; height: 56px; padding: 0 1rem 0 3.1rem; border-radius: 12px; border: 0; background: var(--white); font-size: 1.05rem; box-shadow: 0 30px 60px -30px oklch(0.1 0.08 266 / .8); }
.kh-bar input:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.topics { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; align-items: center; }
.topics > span { font-size: .84rem; color: var(--on-night-muted); margin-right: .25rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; padding: .4rem .85rem; border-radius: 999px; border: 1px solid oklch(0.97 0.01 266 / .28); font-size: .88rem; font-weight: 600; color: var(--on-night); cursor: pointer; }
.chip:hover span { border-color: var(--on-night); }
.chip input:checked + span { background: var(--sun); border-color: var(--sun); color: var(--night); }
.chip input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
@media (max-width: 900px) { .kh-hero .ph-copy { grid-column: 1 / -1; } }

/* Featured */
.featured { padding-bottom: 0; }
.feat { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 1.5rem; align-items: stretch; text-decoration: none; }
.feat-art { grid-column: 1 / 7; position: relative; overflow: hidden; border-radius: 14px; background: var(--night); color: var(--on-night); padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; }
.feat-art svg.bg { position: absolute; z-index: -1; right: -18%; top: -25%; width: 120%; opacity: .9; }
.feat-art .num { font-size: clamp(4.5rem, 3rem + 5vw, 7.5rem); line-height: .85; font-weight: 800; font-variation-settings: "wdth" 118; letter-spacing: -0.04em; color: var(--sun); }
.feat-art .num small { display: block; font-size: 1rem; letter-spacing: 0; font-weight: 600; color: var(--on-night-muted); margin-top: .75rem; font-variation-settings: "wdth" 100; }
.feat-copy { grid-column: 7 / -1; display: flex; flex-direction: column; justify-content: center; }
.feat-copy .k { font-size: .76rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.feat-copy h2 { margin-top: .75rem; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); line-height: 1.22; transition: color .25s var(--ease); }
.feat-copy p { margin-top: 1rem; color: var(--muted); }
.feat-copy .meta { margin-top: 1.25rem; font-size: .88rem; color: var(--muted); }
.feat-copy .more { margin-top: 1.5rem; font-weight: 700; color: var(--brand); display: inline-flex; gap: .4rem; align-items: center; }
.feat-copy .more svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.feat:hover h2 { color: var(--brand); }
.feat:hover .more svg { transform: translateX(3px); }
@media (max-width: 900px) { .feat-art, .feat-copy { grid-column: 1 / -1; } .feat-art { min-height: 220px; } }

/* Article list */
.arts { border-top: 1.5px solid var(--ink); }
.arts > li { border-bottom: 1px solid var(--rule); }
.arts a.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); padding-block: 1.5rem; text-decoration: none; align-items: baseline; position: relative; }
.arts a.row::before { content: ""; position: absolute; inset: 0 calc(var(--col-gap) * -0.5); background: var(--paper-2); opacity: 0; z-index: -1; border-radius: var(--radius); transition: opacity .25s var(--ease); }
.arts { position: relative; z-index: 0; }
.arts a.row:hover::before { opacity: 1; }
.arts .k { grid-column: 1 / 3; font-size: .76rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.arts h3 { grid-column: 3 / 9; font-size: 1.12rem; line-height: 1.38; }
.arts p { grid-column: 3 / 9; color: var(--muted); font-size: .95rem; margin-top: .35rem; }
.arts .m { grid-column: 10 / -1; grid-row: 1; justify-self: end; font-size: .86rem; color: var(--muted); white-space: nowrap; }
.arts a.row:hover h3 { color: var(--brand); }
.arts li[hidden] { display: none; }
.kh-empty { padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed var(--rule-strong); border-radius: 12px; margin-top: 1rem; }
.kh-empty[hidden] { display: none; }
@media (max-width: 760px) { .arts a.row { display: block; } .arts .m { display: block; margin-top: .5rem; } .arts h3 { margin-top: .4rem; } }

/* Guides by standard */
.guides { background: var(--white); border-block: 1px solid var(--rule); }
.glist { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.glist a { background: var(--white); padding: 1.35rem 1.2rem 1.25rem; text-decoration: none; display: flex; flex-direction: column; gap: .4rem; min-height: 11rem; transition: background-color .25s var(--ease); }
.glist a:hover { background: var(--paper-2); }
.glist b { font-size: 1.35rem; font-weight: 800; font-variation-settings: "wdth" 108; letter-spacing: -0.015em; }
.glist span { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.glist em { margin-top: auto; font-style: normal; font-size: .86rem; font-weight: 700; color: var(--brand); }
@media (max-width: 1000px) { .glist { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .glist { grid-template-columns: 1fr 1fr; } .glist a { min-height: 9rem; } }

/* Glossary */
.gloss { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); border-top: 1.5px solid var(--ink); }
.gloss div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding-block: 1.1rem; border-bottom: 1px solid var(--rule); }
.gloss dt { font-weight: 750; line-height: 1.4; }
.gloss dt small { display: block; font-weight: 500; color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.gloss dd { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
@media (max-width: 900px) { .gloss { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .gloss div { grid-template-columns: 1fr; gap: .3rem; } }


/* ============ Article ============ */
html { scroll-padding-top: 96px; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--sun); z-index: 70; }
.art-head { background: var(--night); color: var(--on-night); padding: 0; position: relative; overflow: hidden; isolation: isolate; }
.art-head::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; z-index: -1;
  background: url("guilloche-wave.svg") center bottom / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 55%); mask-image: linear-gradient(180deg, transparent 0%, #000 55%); }
.art-head .wrap { padding-block: clamp(2rem, 1.5rem + 2vw, 3rem) clamp(3rem, 2rem + 3vw, 4.5rem); }
.art-head .inner { max-width: 50rem; }
.art-head .crumbs { margin-bottom: 2rem; }
/* The current crumb repeats the H1 below it: keep it to one line */
.art-head .crumbs li:last-child { min-width: 0; flex: 1 1 10rem; }
.art-head .crumbs [aria-current] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-cat { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
.art-cat a, .art-cat span { font-size: .78rem; font-weight: 750; letter-spacing: .06em; padding: .25rem .6rem; border-radius: 4px; background: oklch(0.85 0.15 92 / .18); color: var(--sun); text-decoration: none; }
.art-head h1 { margin-top: 1.1rem; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.2rem); line-height: 1.15; }
.art-head .dek { margin-top: 1.25rem; font-size: var(--fs-lead); color: var(--on-night-muted); max-width: 40em; }
.byline { display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--on-night-rule); font-size: .9rem; color: var(--on-night-muted); }
.byline b { color: var(--on-night); font-weight: 650; }

.art-body { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem) clamp(3.5rem, 2.5rem + 3vw, 5.5rem); }
.art-body .wrap > .g { align-items: start; row-gap: 2rem; }
.toc { grid-column: 1 / 4; position: sticky; top: 96px; }
.toc p { font-size: var(--fs-label); font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.toc ol { border-left: 1.5px solid var(--rule); counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: grid; grid-template-columns: 1.6rem 1fr; padding: .45rem 0 .45rem .9rem; margin-left: -1.5px; border-left: 1.5px solid transparent; text-decoration: none; font-size: .9rem; line-height: 1.4; color: var(--muted); }
.toc a::before { content: counter(t, decimal-leading-zero); font-variant-numeric: tabular-nums; font-size: .78rem; padding-top: .1rem; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--brand); border-left-color: var(--brand); font-weight: 650; }
.toc .toc-cta { margin-top: 1.5rem; padding: 1rem; border-radius: 10px; background: var(--paper-2); font-size: .88rem; color: var(--muted); }
.toc .toc-cta b { display: block; color: var(--ink); font-size: .95rem; margin-bottom: .25rem; }
.toc .toc-cta a { display: inline; padding: 0; border: 0; margin: 0; color: var(--brand); font-weight: 700; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }
.toc .toc-cta a::before { content: none; }

.prose { grid-column: 4 / 11; font-size: 1.075rem; line-height: 1.75; max-width: 44rem; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { font-size: clamp(1.45rem, 1.2rem + .8vw, 1.85rem); margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--rule); line-height: 1.25; }
.prose h2:first-of-type { margin-top: 2.5rem; }
.prose h3 { font-size: 1.15rem; margin-top: 1.75rem; }
.prose p, .prose li { color: oklch(0.32 0.03 266); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol.list { padding-left: 1.4rem; display: grid; gap: .45rem; }
.prose ul li { list-style: disc; }
.prose ol.list li { list-style: decimal; }
.prose li::marker { color: var(--brand); }
.prose a { color: var(--brand); font-weight: 600; text-underline-offset: 3px; }
.keypoints { padding: 1.4rem 1.5rem; border-radius: 12px; background: var(--white); border: 1px solid var(--rule); }
.keypoints p.kp-title { font-size: var(--fs-label); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.keypoints ul { margin-top: .75rem; }
.callout { display: grid; grid-template-columns: 1.75rem 1fr; gap: .25rem; padding: 1.1rem 1.25rem; border-radius: 10px; font-size: 1rem; line-height: 1.6; }
.callout svg { grid-column: 1; width: 20px; height: 20px; margin-top: .2rem; }
.callout > :not(svg) { grid-column: 2; }
.callout > p:empty { display: none; }
/* Callouts written in post content carry no inline icon (wpautop breaks it): draw it here. */
.callout:not(:has(> svg))::before { content: ""; grid-column: 1; width: 20px; height: 20px; margin-top: .2rem; background: currentColor; -webkit-mask: var(--ico) no-repeat center / contain; mask: var(--ico) no-repeat center / contain; }
.callout.warn { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3 2 21h20L12 3Zm0 6v5m0 3v.5'/%3E%3C/svg%3E"); color: oklch(0.5 0.12 80); }
.callout.info { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Cpath d='M4 12l5 5L20 6'/%3E%3C/svg%3E"); color: var(--brand); }
.callout.warn { background: oklch(0.85 0.15 92 / .2); }
.callout.warn svg { color: oklch(0.5 0.12 80); }
.callout.info { background: oklch(0.46 0.13 266 / .07); }
.callout.info svg { color: var(--brand); }
.callout p { color: var(--ink); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--white); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 30rem; }
.prose th, .prose td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; min-width: 8.5rem; }
.prose th:first-child, .prose td:first-child { min-width: 6.5rem; }
.prose td.n, .prose th.n { min-width: 4.5rem; width: 1%; white-space: nowrap; }
.prose th { font-size: .8rem; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--paper-2); }
.prose tr:last-child td { border-bottom: 0; }
.prose td.n { font-variant-numeric: tabular-nums; font-weight: 750; text-align: right; }
.prose tfoot td { font-weight: 750; background: var(--paper-2); }
.newctl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; padding: 0 !important; }
.newctl li { list-style: none !important; background: var(--white); padding: .8rem 1rem; display: grid; grid-template-columns: 3.4rem 1fr; gap: .5rem; font-size: .95rem; line-height: 1.45; }
.newctl li.note { display: block; color: var(--muted); font-size: .88rem; }
.newctl li b { font-variant-numeric: tabular-nums; color: var(--brand); }
.author { display: grid; grid-template-columns: 64px 1fr; gap: 1.1rem; align-items: start; margin-top: 3rem; padding: 1.25rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--white); }
.author .av { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; background: var(--night); color: var(--sun); display: grid; place-items: center; font-weight: 800; font-variation-settings: "wdth" 112; }
.author b { display: block; color: var(--ink); }
.author span { font-size: .92rem; color: var(--muted); line-height: 1.55; display: block; margin-top: .5rem; }
.author .au-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .2rem; }
.prose .au-tags, .au-tags { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: .5rem 0 0; padding: 0; }
.prose .au-tags li, .au-tags li { list-style: none; margin: 0; line-height: 1.5; font-size: .76rem; font-weight: 650; padding: .15rem .55rem; border-radius: 4px; background: oklch(0.46 0.13 266 / .08); color: var(--brand); }
.au-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; margin-top: .9rem; font-size: .9rem; }
.au-links a { color: var(--brand); text-underline-offset: 3px; }
.au-links .au-btn { padding: .45rem .9rem; border-radius: 8px; background: var(--brand); color: var(--white); text-decoration: none; font-weight: 650; }
.au-links .au-btn:hover { background: var(--night); }
@media (max-width: 520px) { .author { grid-template-columns: 48px 1fr; } .author .av { width: 48px; height: 48px; } }
.share { display: flex; align-items: center; gap: .5rem; margin-top: 1.5rem; font-size: .9rem; color: var(--muted); }
.share a, .share button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--rule-strong); display: grid; place-items: center; background: var(--white); color: var(--ink); cursor: pointer; }
.share svg { width: 16px; height: 16px; }
.share a:hover, .share button:hover { border-color: var(--brand); color: var(--brand); }

.art-aside { grid-column: 11 / -1; }
@media (max-width: 1180px) { .toc { grid-column: 1 / 4; } .prose { grid-column: 4 / -1; } .art-aside { display: none; } }
@media (max-width: 900px) {
  .toc { grid-column: 1 / -1; position: static; }
  .toc ol { display: none; }
  .toc details summary { cursor: pointer; }
  .prose { grid-column: 1 / -1; }
}
.toc-mobile { display: none; }
@media (max-width: 900px) {
  .toc > p, .toc .toc-cta { display: none; }
  .toc-mobile { display: block; border: 1px solid var(--rule); border-radius: 10px; background: var(--white); }
  .toc-mobile summary { padding: .9rem 1.1rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary::after { content: "+"; font-weight: 400; font-size: 1.2rem; line-height: 1; }
  .toc-mobile[open] summary::after { content: "−"; }
  .toc-mobile ol { display: grid !important; border: 0; padding: 0 1.1rem 1rem; }
  .toc-mobile a { border: 0; padding-left: 0; }
}
@media (max-width: 560px) { .newctl { grid-template-columns: 1fr; } .prose { font-size: 1.03rem; } }

/* Related */
.related-art { background: var(--paper-2); border-top: 1px solid var(--rule); }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); }
.acard { display: flex; flex-direction: column; padding: 1.4rem; border-radius: 12px; background: var(--white); border: 1px solid var(--rule); text-decoration: none; transition: border-color .25s var(--ease), transform .25s var(--ease); }
.acard:hover { border-color: var(--brand); transform: translateY(-2px); }
.acard .k { font-size: .74rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.acard h3 { margin-top: .6rem; font-size: 1.08rem; line-height: 1.35; }
.acard p { margin-top: .5rem; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.acard .more { margin-top: auto; padding-top: 1rem; font-size: .88rem; font-weight: 700; color: var(--brand); }
@media (max-width: 900px) { .cards3 { grid-template-columns: 1fr; } }


/* Editor content inside articles */
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-radius: 10px; background: oklch(0.85 0.15 92 / .18); }
.prose blockquote p { font-size: 1rem; line-height: 1.65; font-weight: 450; letter-spacing: 0; max-width: none; color: var(--ink); }
.prose blockquote p::before { content: none; }
.prose figure.wp-block-table { margin: 1.5rem 0; }
.prose .wp-block-table table { border: 0; }
.prose .wp-block-table td, .prose .wp-block-table th { border-left: 0; border-right: 0; }
.prose .wp-block-table thead { border-bottom: 1px solid var(--rule); }
.prose img { height: auto; border-radius: 8px; }

/* Article "Nguồn tham khảo" list */
.prose ul.sources { list-style: none; padding-left: 0; gap: .55rem; font-size: .95rem; }
.prose ul.sources li { list-style: none; padding-left: 1.2rem; position: relative; color: var(--muted); }
.prose ul.sources li::before { content: "↗"; position: absolute; left: 0; top: .05em; color: var(--muted); font-size: .85rem; }
.prose ul.sources a { font-weight: 600; }
