/* Forum is the canonical desktop rail and hero rhythm for primary product pages. */
body.mk-page-blog .site-main > .classic-forum-wrapper.forum-reference-wrapper,
body.mk-page-tools .site-main > .tools-page.classic-forum-wrapper.forum-reference-wrapper {
    width: min(calc(100% - (var(--mk-gutter, 24px) * 2)), var(--pm-rail, 1400px)) !important;
    max-width: var(--pm-rail, 1400px) !important;
    margin: clamp(1.25rem, 3vw, 2.25rem) auto 3rem !important;
    padding: 1.25rem 0 2.5rem !important;
    box-sizing: border-box !important;
}

.forum-reference-wrapper > .blog-hero,
.forum-reference-wrapper > .tools-hero {
    width: 100% !important;
    max-width: none !important;
    min-height: 220px !important;
    height: auto !important;
    margin: 0 0 1rem !important;
    padding: clamp(1.5rem, 3.2vw, 2.35rem) !important;
    box-sizing: border-box !important;
    display: grid !important;
    align-items: center !important;
}

.blog-reference-wrapper .blog-hero-inner,
.tools-page.forum-reference-wrapper .hero-content {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    align-items: center !important;
}

.blog-reference-wrapper .blog-page-hero .blog-hero-inner {
    display: grid !important;
    align-content: center !important;
    gap: .45rem !important;
}

.blog-reference-wrapper .blog-page-hero :is(h1, p),
.tools-page.forum-reference-wrapper :is(.hero-title, .hero-subtitle) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.blog-reference-wrapper .blog-page-hero .blog-search,
.tools-page.forum-reference-wrapper .hero-actions {
    margin-top: .55rem !important;
}

.forum-reference-wrapper > .blog-main-layout,
.forum-reference-wrapper > .blog-section-wrap,
.forum-reference-wrapper > main,
.forum-reference-wrapper > main > .blog-main-layout,
.forum-reference-wrapper > main > .blog-section-wrap {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.forum-reference-wrapper > main {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.blog-reference-wrapper .blog-main-layout {
    grid-template-columns: minmax(0, 1fr) 300px !important;
    gap: 1.5rem !important;
    margin-top: 1.25rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.blog-reference-wrapper .blog-main-layout > main,
.blog-reference-wrapper .blog-main-layout > section,
.blog-reference-wrapper .blog-main-layout > aside {
    min-width: 0 !important;
}

.blog-reference-wrapper .blog-main-layout > main.page-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.blog-reference-wrapper .blog-main-layout > main.page-shell > .post-grid {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.tools-page.forum-reference-wrapper {
    display: flex !important;
    flex-direction: column !important;
}

@media (max-width: 1040px) {
    .forum-reference-wrapper > .blog-hero,
    .forum-reference-wrapper > .tools-hero {
        height: auto !important;
        min-height: 220px !important;
    }

    .blog-reference-wrapper .blog-main-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 720px) {
    body.mk-page-blog .site-main > .classic-forum-wrapper.forum-reference-wrapper,
    body.mk-page-tools .site-main > .tools-page.classic-forum-wrapper.forum-reference-wrapper {
        width: min(calc(100% - 1rem), var(--pm-rail, 1400px)) !important;
        margin-top: .75rem !important;
        padding-top: 1rem !important;
    }

    .forum-reference-wrapper > .blog-hero,
    .forum-reference-wrapper > .tools-hero {
        min-height: 0 !important;
        padding: 1.25rem !important;
    }
}
@media (max-width: 720px) {
    .blog-reference-wrapper .blog-hero-inner,
    .tools-page.forum-reference-wrapper .hero-content {
        min-height: 0 !important;
    }
}

/* Forum-matched internal hero composition. */
.forum-reference-wrapper > .blog-featured-section,
.forum-reference-wrapper > .blog-featured-section > .blog-section-wrap {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (min-width: 1041px) {
    .blog-reference-wrapper .blog-page-hero .blog-hero-inner {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 480px) !important;
        grid-template-areas:
            "eyebrow search"
            "title search"
            "summary search" !important;
        column-gap: 2rem !important;
        row-gap: .25rem !important;
    }

    .blog-reference-wrapper .blog-page-hero .blog-eyebrow {
        grid-area: eyebrow !important;
        justify-self: start !important;
    }

    .blog-reference-wrapper .blog-page-hero h1 {
        grid-area: title !important;
        align-self: end !important;
    }

    .blog-reference-wrapper .blog-page-hero p {
        grid-area: summary !important;
        align-self: start !important;
    }

    .blog-reference-wrapper .blog-page-hero .blog-search {
        grid-area: search !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        align-self: center !important;
    }

    .blog-reference-wrapper .cat-hero .blog-hero-inner {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        grid-template-rows: auto auto auto !important;
        column-gap: 1rem !important;
        row-gap: .15rem !important;
        align-content: center !important;
    }

    .blog-reference-wrapper .cat-hero .breadcrumb {
        grid-column: 1 / 4 !important;
        grid-row: 1 !important;
        margin: 0 0 .2rem !important;
    }

    .blog-reference-wrapper .cat-hero .cat-icon-big {
        grid-column: 1 !important;
        grid-row: 2 / 4 !important;
        align-self: center !important;
        margin: 0 !important;
    }

    .blog-reference-wrapper .cat-hero h1 {
        grid-column: 2 !important;
        grid-row: 2 !important;
        margin: 0 !important;
    }

    .blog-reference-wrapper .cat-hero p {
        grid-column: 2 !important;
        grid-row: 3 !important;
        margin: 0 !important;
    }

    .blog-reference-wrapper .cat-hero .cat-stats {
        grid-column: 3 !important;
        grid-row: 2 / 4 !important;
        align-self: center !important;
        margin: 0 !important;
    }

    .blog-reference-wrapper .blog-post-hero .blog-hero-inner {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(260px, auto) !important;
        grid-template-rows: auto auto auto !important;
        column-gap: 2rem !important;
        row-gap: .2rem !important;
        align-content: center !important;
    }

    .blog-reference-wrapper .blog-post-hero .breadcrumb {
        grid-column: 1 !important;
        grid-row: 1 !important;
        margin: 0 !important;
    }

    .blog-reference-wrapper .blog-post-hero .post-title {
        grid-column: 1 !important;
        grid-row: 2 !important;
        margin: 0 !important;
    }

    .blog-reference-wrapper .blog-post-hero .post-lede {
        grid-column: 1 !important;
        grid-row: 3 !important;
        margin: 0 !important;
    }

    .blog-reference-wrapper .blog-post-hero .post-byline {
        grid-column: 2 !important;
        grid-row: 1 / 4 !important;
        align-self: center !important;
        justify-self: end !important;
        margin: 0 !important;
    }

    .tools-page.forum-reference-wrapper > .tools-hero .hero-content {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 1.5rem !important;
        align-items: center !important;
    }

    .tools-page.forum-reference-wrapper > .tools-hero .hero-left {
        min-width: 0 !important;
        max-width: none !important;
    }

    .tools-page.forum-reference-wrapper > .tools-hero .hero-title {
        font-size: clamp(1.75rem, 2.4vw, 2.15rem) !important;
        line-height: 1.08 !important;
    }

    .tools-page.forum-reference-wrapper > .tools-hero .hero-stats-grid {
        flex: 0 0 auto !important;
        margin: 0 !important;
    }
}
/* Exact forum-reference alignment: blog and tools. */
.blog-reference-wrapper :is(.blog-section-wrap, .blog-featured-section, .blog-category-page, .blog-post-wrap) {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.tools-page.forum-reference-wrapper > .tools-summary-bar {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-height: 60px !important;
    margin: 0 0 .75rem !important;
    gap: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--border-color, #e4e7ec) !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06) !important;
}

.tools-page.forum-reference-wrapper > .tools-summary-bar .hero-stat-card {
    min-width: 0 !important;
    min-height: 60px !important;
    padding: .7rem 1rem !important;
    border: 0 !important;
    border-right: 1px solid var(--border-color, #e4e7ec) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text-color, #172033) !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .65rem !important;
}

.tools-page.forum-reference-wrapper > .tools-summary-bar .hero-stat-card:last-child {
    border-right: 0 !important;
}

.tools-page.forum-reference-wrapper > .tools-summary-bar :is(.stat-value, .stat-label, .stat-icon) {
    color: inherit !important;
}

.tools-page.forum-reference-wrapper > .tools-summary-bar .stat-value {
    font-size: 1rem !important;
    line-height: 1 !important;
}

.tools-page.forum-reference-wrapper > .tools-summary-bar .stat-label {
    margin-top: .2rem !important;
    font-size: .72rem !important;
    line-height: 1.15 !important;
}

@media (min-width: 1041px) {
    .tools-page.forum-reference-wrapper > .tools-hero .hero-title {
        max-width: none !important;
        font-size: clamp(1.65rem, 2vw, 2rem) !important;
        line-height: 1.08 !important;
        white-space: nowrap !important;
    }

    .tools-page.forum-reference-wrapper > .tools-hero .hero-actions--reference {
        margin: 0 !important;
        align-self: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
    }
}

@media (max-width: 1180px) and (min-width: 1041px) {
    .tools-page.forum-reference-wrapper > .tools-hero .hero-title {
        font-size: 1.55rem !important;
    }
}

@media (max-width: 720px) {
    .tools-page.forum-reference-wrapper > .tools-summary-bar {
        grid-template-columns: 1fr !important;
    }

    .tools-page.forum-reference-wrapper > .tools-summary-bar .hero-stat-card {
        border-right: 0 !important;
        border-bottom: 1px solid var(--border-color, #e4e7ec) !important;
    }

    .tools-page.forum-reference-wrapper > .tools-summary-bar .hero-stat-card:last-child {
        border-bottom: 0 !important;
    }
}