/* =========================================================
   1. PROJECT ARCHIVE & CF7 FORM STYLES
   ========================================================= */
:is(.kha-project-archive, .single-post, .single-duan) {
    --project-main: #2b9d8f;
    --project-button: #0f766e;
}

.kha-project-archive {
    padding: 34px 0 60px;
    background: var(--surface-soft);
}
.kha-project-archive-head { margin-bottom: 24px; }
.kha-project-archive-head h1 { margin: 0 0 8px; color: var(--heading); font-size: var(--h1); font-weight: var(--weight-bold); line-height: 1.2; font-family: var(--font-display); }
.kha-project-archive-desc { max-width: 760px; color: var(--subtle); font-size: var(--text-md); line-height: 1.7; font-family: var(--font-body); }
.kha-investor-identity { display: flex; align-items: center; gap: 18px; margin: 0 0 14px; }
.kha-investor-identity__logo { display: grid; place-items: center; flex: 0 0 88px; width: 88px; height: 88px; padding: 0; border: 1px solid rgba(17,24,39,.07); border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.06); overflow: hidden; }
.kha-investor-identity__logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kha-investor-identity__text { min-width: 0; }
.kha-investor-identity__label { display: block; margin-bottom: 6px; color: #6e6e73; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.kha-project-archive-head .kha-investor-identity h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -.035em; }
.kha-project-archive-head--investor { margin-bottom: 16px; }
.kha-investor-hero { --investor-logo-size: 108px; position: relative; min-height: 290px; overflow: hidden; isolation: isolate; border-radius: 26px; background: #f5f4f1; }
.kha-investor-hero__image { position: absolute; inset: 0 0 0 30%; background-position: center; background-size: cover; filter: saturate(.9); }
.kha-investor-hero__image::before { position: absolute; inset: 0; content: ''; background: linear-gradient(90deg, #f5f4f1 0%, rgba(245,244,241,.98) 10%, rgba(245,244,241,.9) 18%, rgba(245,244,241,.72) 26%, rgba(245,244,241,.45) 34%, rgba(245,244,241,.18) 40%, transparent 43%); }
.kha-investor-hero__content { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; min-height: 290px; padding: 42px 48px; }
.kha-investor-hero .kha-investor-identity { gap: 24px; margin-bottom: 0; }
.kha-investor-hero .kha-investor-identity__logo { flex-basis: var(--investor-logo-size); width: var(--investor-logo-size); height: var(--investor-logo-size); border-radius: 24px; }
.kha-project-archive-head .kha-investor-hero h1 { font-size: clamp(34px, 4vw, 48px); }
.kha-investor-hero .kha-project-archive-desc { max-width: 630px; margin: 18px 0 0; font-size: 18px; line-height: 1.55; }
.kha-investor-founded { display: grid; grid-template-columns: calc((var(--investor-logo-size) - 1px) / 2 - 12px) 1px minmax(0, 1fr); align-items: center; gap: 12px; max-width: 650px; margin-top: 22px; }
.kha-investor-founded__icon { display: grid; place-items: center; width: min(42px, 100%); aspect-ratio: 1; border-radius: 50%; background: #f7ddd5; color: #c9674f; }
.kha-investor-founded__icon svg { width: 22px; height: 22px; }
.kha-investor-founded__divider { align-self: stretch; width: 1px; background: #c9c7c3; }
.kha-investor-founded__text { display: flex; flex-direction: column; gap: 3px; color: #6b7280; font-size: 15px; line-height: 1.45; }
.kha-investor-founded__text strong { color: #b65d49; font-size: 17px; font-weight: 700; }
@media (max-width: 600px) {
    .kha-investor-identity { gap: 14px; }
    .kha-investor-identity__logo { flex-basis: 68px; width: 68px; height: 68px; border-radius: 15px; }
    .kha-investor-hero { --investor-logo-size: 76px; min-height: 300px; border-radius: 20px; }
    .kha-investor-hero__image { left: 35%; opacity: .45; }
    .kha-investor-hero__content { min-height: 300px; padding: 28px 24px; }
    .kha-investor-hero .kha-investor-identity { gap: 16px; }
    .kha-investor-hero .kha-investor-identity__logo { border-radius: 18px; }
    .kha-project-archive-head .kha-investor-hero h1 { font-size: clamp(30px, 7vw, 36px); }
    .kha-investor-hero .kha-project-archive-desc { font-size: 16px; }
    .kha-investor-founded { margin-top: 18px; }
    .kha-investor-founded__text { font-size: 13px; }
    .kha-investor-founded__text strong { font-size: 15px; }
}
.kha-investor-resale-links { position: relative; display: flex; align-items: center; width: 100%; height: 58px; margin-bottom: 24px; overflow: hidden; border: 1px solid #d5d9df; border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(20,25,30,.035); }
.kha-investor-resale-links__label { position: relative; z-index: 2; display: flex; flex: 0 0 auto; align-items: center; align-self: stretch; padding: 0 18px; background: #fff; color: #b91c1c; font-size: 14px; font-weight: 700; white-space: nowrap; }
.kha-investor-resale-links__label::before { position: absolute; inset: 8px 7px; z-index: -1; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; content: ''; }
.kha-investor-resale-links__viewport { flex: 1; min-width: 0; height: 100%; overflow-x: auto; scrollbar-width: none; }
.kha-investor-resale-links__viewport::-webkit-scrollbar { display: none; }
.kha-investor-resale-links.is-running .kha-investor-resale-links__viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.kha-investor-resale-links__track, .kha-investor-resale-links__group { display: flex; align-items: center; width: max-content; height: 100%; }
.kha-investor-resale-links__group { flex: 0 0 auto; padding-right: 26px; }
.kha-investor-resale-links__group a { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; height: 100%; padding: 0 17px; color: #42484f; font-size: 16px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.kha-investor-resale-links__group a:not(:last-child)::after { position: absolute; top: 50%; right: -1px; width: 1px; height: 16px; transform: translateY(-50%); background: #d9dde1; content: ''; }
.kha-investor-resale-links__group a:hover, .kha-investor-resale-links__group a:focus-visible { color: #b91c1c; text-decoration: underline; text-underline-offset: 5px; }
.kha-investor-resale-links__group a:focus-visible { outline: 2px solid #b91c1c; outline-offset: -3px; }
.kha-investor-resale-links.is-running .kha-investor-resale-links__track { animation: kha-investor-ticker var(--ticker-duration) linear infinite; }
.kha-investor-resale-links:is(:hover, :focus-within) .kha-investor-resale-links__track { animation-play-state: paused; }
@keyframes kha-investor-ticker { to { transform: translateX(calc(-1 * var(--ticker-distance))); } }
@media (prefers-reduced-motion: reduce) { .kha-investor-resale-links.is-running .kha-investor-resale-links__track { animation: none; } .kha-investor-resale-links.is-running .kha-investor-resale-links__viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; } }
@media (max-width: 700px) { .kha-investor-resale-links { height: 54px; border-radius: 14px; } .kha-investor-resale-links__label { padding: 0 13px; font-size: 13px; } .kha-investor-resale-links__label::before { inset: 8px 5px; } .kha-investor-resale-links__group a { padding: 0 14px; font-size: 14px; } }
.kha-project-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.kha-project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.kha-cf7-row { margin-bottom: 12px; }
.kha-cf7-button { margin-bottom: 0; margin-top: 4px; }
.kha-cf7-simple input[type="text"],
.kha-cf7-simple input[type="tel"],
.kha-cf7-simple textarea { width: 100%; display: block; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-soft); color: var(--text); font-size: var(--text-md); font-weight: var(--weight-regular); line-height: 1.4; padding: 14px 16px; outline: none; box-shadow: none; font-family: var(--font-body); }
.kha-cf7-simple textarea { height: 118px; min-height: 118px; max-height: 180px; resize: vertical; }
.kha-cf7-simple input::placeholder,
.kha-cf7-simple textarea::placeholder { color: #8e8e93; font-weight: var(--weight-regular); }
.kha-cf7-simple input[type="text"]:focus,
.kha-cf7-simple input[type="tel"]:focus,
.kha-cf7-simple textarea:focus { border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12); }
.kha-cf7-simple input[type="submit"],
.kha-cf7-simple .wpcf7-submit { width: 100%; min-height: 48px; border: 0; border-radius: var(--radius-pill); background: var(--submit-bg); color: var(--surface); font-size: var(--text-md); font-weight: var(--weight-bold); cursor: pointer; box-shadow: none; font-family: var(--font-body); transition: background var(--transition); }
.kha-cf7-simple input[type="submit"]:hover,
.kha-cf7-simple .wpcf7-submit:hover { background: var(--submit-hover); }
.kha-cf7-simple .wpcf7-not-valid-tip { margin-top: 6px; font-size: var(--text-xs); color: var(--danger); }
.kha-cf7-simple .wpcf7-response-output { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-md); font-size: var(--text-sm); line-height: 1.4; font-family: var(--font-body); }
.kha-cf7-simple .wpcf7-spinner { display: block; margin: 10px auto 0; }

/* =========================================================
   2. SINGLE POST GENERAL TYPOGRAPHY & LAYOUT
   ========================================================= */
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :where(p, li, blockquote, figcaption) { font-family: var(--font-body); }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) { width: 100%; max-width: var(--width-wide); margin-inline: auto; padding-inline: var(--content-pad); padding-bottom: 28px; box-sizing: border-box; color: var(--text); font-family: var(--font-body); font-size: var(--text-xl); font-weight: var(--weight-regular); line-height: 1.72; letter-spacing: 0; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) * { box-sizing: border-box; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :where(p, li, blockquote, figcaption) { font-size: var(--text-xl); }
.kha-project-layout, .kha-project-layout *, .kha-project-archive-head, .kha-project-archive-head * { font-family: var(--font-body); }
:is(.single-post, .single-duan) .post-header-wrap { padding-top: clamp(1.5rem, 3vw, 2.5rem); }

/* Đã tối ưu chuẩn H1 ở phần header */
:is(.single-post, .single-duan) .post-header-wrap :is(.page-title, .post-title, h1) { font-family: var(--font-display); font-size: var(--h1); font-weight: var(--weight-bold); line-height: 1.08; letter-spacing: -0.038em; color: var(--heading); text-align: center; text-wrap: balance; margin: 0 0 12px 0; }

:is(.single-post, .single-duan) .kha-post-hero-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; margin-bottom: 8px; font-family: var(--font-body); font-size: clamp(12px, 1vw, 14px); font-weight: var(--weight-regular); line-height: 1.35; color: rgba(110,110,115,.82); text-align: center; }
:is(.single-post, .single-duan) .kha-post-hero-meta > span { display: inline-flex; align-items: center; gap: .28em; color: inherit; }
:is(.single-post, .single-duan) .kha-post-hero-meta > span + span::before { content: "•"; margin-inline-end: 10px; color: rgba(110,110,115,.45); }
:is(.single-post, .single-duan) .post-custom-fields { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; margin: 20px 0; font-size: var(--meta); line-height: 1.25; color: var(--muted); font-family: var(--font-body); }
:is(.single-post, .single-duan) .post-custom-fields > * { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 8px 14px; border-radius: var(--radius-pill); white-space: nowrap; }
:is(.single-post, .single-duan) .post-custom-fields :is(dt, dd) { margin: 0; font: inherit; }
.post-custom-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.post-custom-field.kha-project-spec { border-radius: var(--radius-md); padding: 18px 20px; border: 1px solid rgba(0,0,0,.06); box-shadow: 0 8px 26px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 6px; }
.kha-project-spec-name { font-size: var(--text-sm); }
.kha-project-spec-value { font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--teal); }

@media(max-width: 768px) {
    .post-custom-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .post-custom-field.kha-project-spec { padding: 14px 12px; }
    .kha-project-spec-name { font-size: var(--text-xs); }
    .kha-project-spec-value { font-size: var(--text-md); }
    :is(.single-post, .single-duan) .kha-post-hero-meta { margin-top: 4px; margin-bottom: 6px; font-size: var(--text-xs); line-height: 1.3; }
    :is(.single-post, .single-duan) .kha-post-hero-meta > span + span::before { margin-inline-end: 8px; }
    :is(.single-post, .single-duan) .post-custom-fields { gap: 8px; margin-bottom: 10px; }
}

:is(.single-post, .single-duan) .post-custom-field.post_info_mdxd { background: #e3f4e8; border: 1px solid #b9e2c4; color: #2f7d46; }
:is(.single-post, .single-duan) .post-custom-field.post_info_mdxd :is(span, strong) { color: #2f7d46; }
:is(.single-post, .single-duan) :is(.post_info_quy_mo, .postinfoquymo, .post-info-quy-mo) { background: #eef4ff; color: #2457c5; }
:is(.single-post, .single-duan) :is(.post_info_von, .postinfovon, .post-info-von) { background: #f5f3ff; border: 1px solid rgba(109,40,217,.16); color: #6d28d9; }
:is(.single-post, .single-duan) :is(.post_info_year, .postinfoyear, .post-info-year) { background: #fff1ea; color: #c45a2b; }

:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(p, h2, h3, h4, h5, h6, ul, ol, blockquote) { max-width: min(100%, var(--width-reading)) !important; margin-inline: auto; width: 100%; box-sizing: border-box; }
:is(.single-post, .single-duan) .entry-content > :is(p, li, blockquote) { text-align: justify; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(ul, ol) { padding-inline-start: 1.25rem; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(ul, ol) :is(ul, ol),
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) li { width: auto !important; max-width: none !important; margin-inline: 0 !important; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) > p:first-of-type { font-size: var(--lead); line-height: 1.58; letter-spacing: -0.02em; margin-top: .1em; margin-bottom: 1.1em; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) > p { margin-bottom: 1.05em; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) b { font-weight: var(--weight-semibold); }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) em { font-style: italic; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) small { font-size: var(--small); color: var(--muted); }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) mark { padding: .08em .22em; border-radius: var(--radius-xs); background: #fff3b0; color: inherit; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(code, kbd, samp) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .94em; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) ::selection { background: rgba(0,113,227,.18); }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(h2, h3, h4, h5, h6) + p { margin-top: 0; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) > :last-child { margin-bottom: 0; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(h1, h2, h3, h4, h5, h6) { font-family: var(--font-display); font-weight: var(--weight-semibold); text-wrap: balance; scroll-margin-top: 90px; }

/* =========================================================
   3. HEADING STYLES (H1 đến H6)
   ========================================================= */
/* Đã tối ưu chuẩn H1 bên trong nội dung bài viết */
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) h1:not(.entry-title) { font-size: var(--h1); font-weight: var(--weight-bold); line-height: 1.08; letter-spacing: -0.038em; color: var(--heading); text-wrap: balance; margin: .9em 0 .55em; }

:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) h2 { font-size: var(--h2); font-weight: var(--weight-bold); line-height: 1.14; letter-spacing: -0.03em; margin: 1.5em auto .58em auto; color: var(--focus); }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) h3 { font-size: var(--h3); line-height: 1.22; letter-spacing: -0.022em; margin: 1.7em auto .58em auto; color: var(--focus); }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) h4 { font-size: var(--h4); line-height: 1.28; letter-spacing: -0.015em; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) h5 { font-size: var(--h5); line-height: 1.34; letter-spacing: -0.008em; margin: 1.25em 0 .52em; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) h6 { font-size: var(--h6); font-weight: var(--weight-semibold); line-height: 1.4; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); margin: 1.15em 0 .45em; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(h2, h3)::before,
:is(.single-post, .single-duan) .rank-math-question::before { content: none; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(h2, h3, h4, h5) + :is(h3, h4, h5, h6) { margin-top: .7em; }

:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) a { color: var(--link); text-decoration: none; transition: color var(--transition), border-color var(--transition); }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) a:hover,
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) a:focus { color: var(--link-hover); }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :is(hr, .wp-block-separator) { border: 0; border-top: 1px solid var(--border); margin: 2.4em auto; opacity: 1; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) blockquote { margin: 2em auto; padding: .2em 0 .2em 1.25em; border-left: 4px solid var(--border); background: transparent; color: #3a3a3c; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) blockquote p { margin: .25em 0; line-height: 1.58; letter-spacing: -.015em; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) blockquote > :last-child { margin-bottom: 0; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) figure { margin: 2em auto; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) figcaption { font-size: var(--small); line-height: 1.5; color: var(--muted); text-align: center; }
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) img { max-width: 100%; display: block; }

/* Extend content images by the actual desktop content padding only. */
@media (min-width: 992px) {
    .single-duan article.post-wrap .post-content-wrap > figure.wp-block-image {
        width: calc(100% + var(--content-pad) + var(--content-pad));
        max-width: none;
        margin-inline: calc(0px - var(--content-pad));
    }
    .single-duan article.post-wrap .post-content-wrap > figure.wp-block-image img {
        width: 100%;
        height: auto;
    }
}


/* =========================================================
   4. WORDPRESS TABLE STYLES (DESKTOP AUTO, MOBILE SCROLL)
   ========================================================= */
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) figure.wp-block-table,
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    margin: 2em auto;
}
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: var(--text-xl);
    line-height: 1.52;
    table-layout: fixed;
}
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) table.tablepress {
    table-layout: auto;
}
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) table.tablepress th,
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) table.tablepress td {
    word-break: normal;
}
@media (min-width: 768px) {
    :is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) table.tablepress :is(th, td):first-child {
        width: 1%;
        white-space: nowrap;
    }
}
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) th {
    font-weight: var(--weight-semibold);
    font-size: var(--text-lg);
    line-height: 1.4;
    background: var(--surface-soft);
}
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) th,
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) td {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-color: var(--border);
    text-align: left;
    vertical-align: middle;
    word-break: break-word;
}
:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) tbody tr:nth-child(even) {
    background: rgba(0,0,0,.02);
}

@media (max-width: 768px) {
    :is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) {
        font-size: var(--text-lg);
        line-height: 1.68;
    }
    :is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) :where(p, li, blockquote, figcaption) { font-size: var(--text-lg); }
    :is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) table {
        font-size: var(--text-md);
        table-layout: auto;
        min-width: 100%; 
    }
    :is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) th,
    :is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) td {
        padding: 10px 12px;
        min-width: 130px; 
    }
}

/* =========================================================
   5. TOC CONTAINER (TABLE OF CONTENTS) STYLES
   ========================================================= */
#toc_container { float: none; clear: both; display: block; box-sizing: border-box; width: 100%; max-width: var(--width-reading); margin: 28px auto 34px; padding: 14px; border: 1px solid var(--border-alpha); border-radius: var(--radius-3xl); background: var(--surface-soft); box-shadow: var(--shadow-sm); color: var(--text); font-family: var(--font-body); overflow: hidden; }
#toc_container .toc_title { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; box-sizing: border-box; margin: 0; padding: 0; color: var(--heading, var(--text)); font-family: var(--font-display, inherit); font-size: var(--h4, 1.22rem); font-weight: var(--weight-bold, 800); line-height: 1.25; letter-spacing: -0.02em; }
#toc_container .toc_title::before { content: none; }
#toc_container .toc_title + ul.toc_list { margin-top: 12px; }
#toc_container .toc_toggle { flex: 0 0 64px; width: 64px; min-width: 64px; text-align: right; white-space: nowrap; }
#toc_container .toc_toggle a { display: inline-flex; align-items: center; justify-content: center; width: 64px; min-width: 64px; min-height: 28px; box-sizing: border-box; padding: 0 10px; border-radius: var(--radius-pill); background: var(--surface-hover); color: var(--link); font-size: var(--meta); font-weight: var(--weight-bold); line-height: 1; text-decoration: none; }
#toc_container .toc_toggle a:hover { background: var(--link, #0066cc); color: var(--surface); }
#toc_container .toc_brackets { display: none; }
#toc_container .toc_list, #toc_container .toc_list ul { margin-inline-start: 0; padding-inline-start: 0; list-style: none; }
#toc_container .toc_list li { margin: 0 0 8px; }
#toc_container .toc_list a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; box-sizing: border-box; padding: 8px 12px 8px 10px; border: 1px solid rgba(0,0,0,.055); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font-size: var(--text-md); font-weight: var(--weight-semibold); line-height: 1.38; text-decoration: none; }
#toc_container .toc_list a:hover { border-color: rgba(0,102,204,.18); color: var(--link, #0066cc); }
#toc_container .toc_number { flex: 0 0 auto; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); background: var(--surface-hover); color: var(--link); font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: 1; }
#toc_container .toc_list ul { margin: 8px 0 0 16px; }
#toc_container .toc_list ul a { min-height: 36px; padding: 8px 10px; font-size: var(--text-md); }

@media (max-width: 768px) {
    #toc_container { width: 100%; max-width: 100%; margin: 22px 0 26px; padding: 12px 10px; border-radius: var(--radius-xl); }
    #toc_container .toc_title { gap: 8px; font-size: var(--text-md); }
    #toc_container .toc_title + ul.toc_list { margin-top: 10px; }
    #toc_container .toc_toggle { flex: 0 0 54px; width: 54px; min-width: 54px; }
    #toc_container .toc_toggle a { width: 54px; min-width: 54px; min-height: 24px; padding: 0 8px; font-size: var(--text-xs); }
    #toc_container .toc_list li { margin-bottom: 6px; }
    #toc_container .toc_list a { gap: 8px; min-height: 34px; padding: 6px 10px 6px 8px; border-radius: var(--radius-md); font-size: var(--text-sm); line-height: 1.34; }
    #toc_container .toc_number { min-width: 22px; height: 22px; font-size: var(--text-xs); }
    #toc_container .toc_list ul { margin: 6px 0 0 12px; }
    #toc_container .toc_list ul a { min-height: 30px; padding: 6px 8px; font-size: var(--text-sm); }
    :is(.single-post, .single-duan) #toc_container p.toc_title { font-size: clamp(22px, 5.6vw, 26px); }
    :is(.single-post, .single-duan) #toc_container .toc_toggle a { min-height: 30px; padding: 0 10px; font-size: var(--text-sm); }
}

/* =========================================================
   6. APPLE STYLE DETAILS BLOCK (ACCORDION)
   ========================================================= */
.wp-block-details { display: block; max-width: min(100%, var(--width-reading)) !important; margin: 0 auto 20px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.wp-block-details summary { padding: 16px 20px; font-size: var(--text-lg); font-weight: 600; color: var(--text); background: var(--surface-soft); cursor: pointer; list-style: none; position: relative; transition: background 0.2s ease; margin: 0; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary:hover { background: #e8e8ed; }
.wp-block-details summary::after { content: ''; position: absolute; right: 20px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-50%) rotate(45deg); transition: transform 0.3s ease; }
.wp-block-details[open] summary::after { transform: translateY(-50%) rotate(225deg); }
.wp-block-details[open] summary { border-bottom: 1px solid var(--border); }
.wp-block-details > *:not(summary) { padding-inline: 20px; color: #333336; line-height: 1.6; }
.wp-block-details > *:nth-child(2) { margin-top: 20px; }
.wp-block-details > *:last-child { margin-bottom: 20px; }
.wp-block-details ul.wp-block-list { list-style: none; margin-inline-start: 0; padding-inline: 20px; }
.wp-block-details ul.wp-block-list li { padding: 12px; font-size: var(--text-md); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.wp-block-details ul.wp-block-list li:last-child { border-bottom: none; }
.wp-block-details ul.wp-block-list li strong { color: var(--text); font-weight: 600; margin-bottom: 4px; }

@media (min-width: 600px) {
    .wp-block-details ul.wp-block-list li { align-items: baseline; }
    .wp-block-details ul.wp-block-list li strong { min-width: 110px; flex-shrink: 0; margin-inline-end: 16px; margin-bottom: 0; }
}

/* =========================================================
   8. BRAND, SIDEBAR & PAGINATION STYLES
   ========================================================= */
:is(.single-post, .single-duan) .kha-project-brand { display: flex; align-items: center; justify-content: center; width: 100%; padding: 0; }
:is(.single-post, .single-duan) .kha-project-brand-frame { margin: 0 0 1rem; --border-radius: var(--radius-md); --border-glow: var(--radius-sm); }
:is(.single-post, .single-duan) .kha-project-brand-logo { display: block; width: auto; max-width: min(280px, 68vw); max-height: 100px; height: auto; object-fit: contain; border-radius: var(--border-radius); position: relative; z-index: 1; margin: 0; }

@media (max-width: 768px) {
    :is(.single-post, .single-duan) .kha-project-brand { margin-bottom: 10px; }
    :is(.single-post, .single-duan) .kha-project-brand-logo { max-width: min(220px, 72vw); max-height: 80px; }
}

:is(.single-post, .single-duan) #toc_container .toc_title:only-child,
:is(.single-post, .single-duan) #toc_container p.toc_title { min-height: 44px; }

.kha-project-sidebar .widget-wrap { border: 1px solid var(--border-card); border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05); }
.kha-project-pagination { display: flex; justify-content: center; margin: 72px 0 32px; }
.kha-project-empty { padding: 24px; border-radius: var(--radius-lg); background: var(--surface); color: var(--subtle); }
.kha-project-pagination .nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.kha-project-pagination .page-numbers { display: flex; align-items: center; justify-content: center; min-width: 46px; height: 46px; padding: 0 18px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); text-decoration: none; transition: .25s; }
.kha-project-pagination a.page-numbers:hover { transform: translateY(-1px); }
.kha-project-pagination .current { background: var(--project-button, #0f766e); border-color: var(--project-button, #0f766e); color: var(--surface); }
.kha-project-pagination .prev,
.kha-project-pagination .next { padding: 0 22px; }

@media (max-width: 768px) {
    .kha-project-pagination { margin: 56px 0 24px; }
    .kha-project-pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 16px; }
}

@media (max-width: 992px) {
    .kha-project-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .kha-project-sidebar { display: block; width: 100%; margin-top: 8px; }
}

@media (max-width: 768px) {
    .kha-project-sidebar { margin-top: 4px; }
    .kha-project-sidebar .widget, .kha-project-sidebar .widget-wrap { margin-bottom: 18px; border-radius: var(--radius-2xl); }
    .kha-project-sidebar img, .kha-project-sidebar iframe { max-width: 100%; height: auto; }
    .kha-project-archive { padding: 24px 0 42px; }
    .kha-project-grid { grid-template-columns: 1fr; gap: 18px; }
    .kha-project-archive, .kha-project-archive > .container, .kha-project-layout, .kha-project-main, .kha-project-grid, .kha-project-card, .kha-project-card .kha-project-body, .kha-project-card .kha-project-content-top, .kha-project-card .kha-project-card-bottom { min-width: 0; max-width: 100%; box-sizing: border-box; }
    .kha-project-layout, .kha-project-main, .kha-project-grid, .kha-project-card { width: 100%; }
    .kha-project-card .kha-project-title, .kha-project-card .kha-project-title a, .kha-project-card .kha-project-excerpt { min-width: 0; max-width: 100%; }
}

/* Post tags */
:is(.single-post, .single-duan) .post-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}
:is(.single-post, .single-duan) .post-tag-list li { margin: 0; padding: 0; }

:is(.single-post, .single-duan) :is(.post-content-wrap, .entry-content) td strong {
    font-weight: 600;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--subtle);
    background: var(--surface);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out, transform 0.2s ease-out;
}

.post-tag::before {
    content: '#';
    color: #9ca3af;
    font-weight: 400;
    margin-inline-end: 4px;
    transition: color 0.2s ease-out;
}

.post-tag:hover {
    transform: translateY(-1px);
    background: var(--project-main);
    color: var(--surface);
    border-color: var(--project-main);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
    opacity: 1;
}

.post-tag:hover::before {
    color: rgba(255, 255, 255, 0.7);
}

.post-tag:active {
    transform: translateY(1px);
    background: var(--project-button);
    border-color: var(--project-button);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}



.btn {
    border-radius: var(--radius-pill);
}
