/* Huisheng Blog 2.13.4: compact hero, resolved media and mobile article containment. */
.hsb-article-hero {
    padding: 18px 0 38px;
}

.hsb-article-hero__grid {
    gap: 38px;
}

.hsb-article-hero h1 {
    font-size: clamp(36px, 4.2vw, 54px);
}

.hsb-article-hero img {
    height: 380px !important;
    aspect-ratio: auto !important;
    object-fit: cover;
    object-position: center;
}

.hsb-article-hero figcaption {
    margin-top: 10px;
    color: #40566d;
    font-size: 14px;
    line-height: 1.55;
}

.hsb-article-hero figcaption strong {
    display: block;
    margin-bottom: 3px;
    color: var(--hsb-ink);
    font-size: 16px;
    line-height: 1.35;
}

.hsb-article-hero figcaption span {
    display: block;
}

.hsb-media-pair img {
    display: block;
    width: 100%;
    height: 320px !important;
    aspect-ratio: auto !important;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 640px) {
    .hsb-article-hero {
        padding-bottom: 28px;
    }

    .hsb-article-hero__grid {
        gap: 24px;
    }

    .hsb-article-hero h1 {
        font-size: 34px;
    }

    .hsb-article-hero img {
        height: 240px !important;
    }

    .hsb-media-pair img {
        height: 220px !important;
    }
}

/* Prevent wide tables and rich article blocks from forcing the mobile grid wider than the viewport. */
@media (max-width: 980px) {
    .hsb-reading-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .hsb-reading-main,
    .hsb-article-body,
    .hsb-article-section,
    .hsb-toc,
    .hsb-answer,
    .hsb-conversion,
    .hsb-faq {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .hsb-table-wrap {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .hsb-media-pair,
    .hsb-checklist,
    .hsb-steps,
    .hsb-toc ol {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .hsb-reading-layout {
        padding-block: 34px;
    }

    .hsb-table-wrap {
        margin-inline: 0;
    }

    .hsb-table-wrap::after {
        content: "Swipe to view the full table →";
        display: block;
        position: sticky;
        left: 0;
        width: max-content;
        padding-top: 8px;
        color: #60748c;
        font-size: 12px;
        font-weight: 700;
    }
}
