/* Reading typography for category descriptions and blog articles.
 * Keep the theme's EN/VI font families; scope changes away from menus and cards.
 */
body:is(.single-post, .tax-product_cat, .category, .blog) {
    --kb-reading-heading: #24364b;
    --kb-reading-text: #49525e;
    --kb-reading-link: #80552f;
    --kb-reading-link-hover: #24364b;
}

:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) {
    color: var(--kb-reading-text);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.75;
}

:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) :is(h1, h2, h3, h4, h5, h6):not(:where(.kim-popup *)) {
    color: var(--kb-reading-heading);
    font-weight: 700;
    line-height: 1.25;
    margin-top: 1.25em;
    margin-bottom: .55em;
    /* Existing editor content stores inline text-align: justify on headings. */
    text-align: start !important;
    text-transform: none;
    overflow-wrap: break-word;
}

:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) h1:not(:where(.kim-popup *)) {
    font-size: clamp(2.25rem, 1.75rem + 2vw, 3rem);
}
:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) h2:not(:where(.kim-popup *)) {
    font-size: clamp(1.875rem, 1.5rem + 1vw, 2.25rem);
}
:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) h3:not(:where(.kim-popup *)) {
    font-size: clamp(1.5rem, 1.25rem + .8vw, 1.875rem);
}
:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) h4:not(:where(.kim-popup *)) {
    font-size: clamp(1.3125rem, 1.15rem + .5vw, 1.5rem);
}
:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) h5:not(:where(.kim-popup *)) {
    font-size: 1.25rem;
}
:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) h6:not(:where(.kim-popup *)) {
    font-size: 1.125rem;
}

/* Text links remain identifiable without hover or color perception.
 * Exclude buttons, linked media, sharing controls and the existing popup UI.
 */
:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) a[href]:not(.button, .wp-element-button, .icon, [role="button"]):not(:has(img, picture, svg, i)):not(:where(.blog-share *, .kim-popup *)) {
    color: var(--kb-reading-link);
    font-weight: 600;
    text-decoration-line: underline;
    text-decoration-color: currentColor;
    text-decoration-thickness: 1.5px;
    text-underline-offset: .18em;
    text-decoration-skip-ink: auto;
    overflow-wrap: anywhere;
}

:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) a[href]:not(.button, .wp-element-button, .icon, [role="button"]):not(:has(img, picture, svg, i)):not(:where(.blog-share *, .kim-popup *)):is(:hover, :focus-visible) {
    color: var(--kb-reading-link-hover);
    text-decoration-thickness: 2px;
}

:is(.single-post .entry-content.single-page, .tax-product_cat .description-content, .tax-product_cat .term-description, .category .taxonomy-description) a[href]:not(.button, .wp-element-button, .icon, [role="button"]):not(:has(img, picture, svg, i)):not(:where(.blog-share *, .kim-popup *)):focus-visible {
    outline: 2px solid var(--kb-reading-link-hover);
    outline-offset: 4px;
}

/* Page titles share the reading hierarchy. The mobile !important matches
 * the existing Customizer rule on h1.entry-title only.
 */
.single-post .entry-header h1.entry-title,
.tax-product_cat h1.kimbespoke-product-category-title,
.category h1.blog-category-title {
    color: var(--kb-reading-heading);
    font-size: clamp(2.25rem, 1.75rem + 2vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
}

.category .post_col h2.post-title {
    color: var(--kb-reading-heading);
    font-size: clamp(1.75rem, 1.5rem + .75vw, 2.125rem);
    font-weight: 600;
    line-height: 1.25;
}
.category .post_col h2.post-title a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: #80552f;
    text-decoration-thickness: 1px;
    text-underline-offset: .15em;
}
.category .post_col h2.post-title a:is(:hover, :focus-visible) {
    color: var(--kb-reading-link);
    text-decoration-thickness: 2px;
}
.category .post_col h2.post-title a:focus-visible {
    outline: 2px solid var(--kb-reading-heading);
    outline-offset: 4px;
}

@media (max-width: 549px) {
    .single-post .entry-header h1.entry-title {
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
    }
}
