/* =========================================
   CSS for Knowledge Pages
   ========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin-top: 10px;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: #222;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.entry-content a {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100%;
    display: inline-block !important;
}

figure {
    margin: 0 0 1.5rem;
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.entry-content table {
    margin: 40px 0;
}

table th,
table td {
    border: 1px solid #dfe1e6;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    width: auto;
    max-width: 400px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}
:root {
    --site-gutter: clamp(1rem, 5vw, 6.5rem);
}

h1.wp-block-post-title,
body.single .entry-content.wp-block-post-content,
body.single .taxonomy-nsmg_section,
body.home .wp-block-post-template.is-layout-grid,
body.search-results .wp-block-group.alignwide.has-global-padding.is-layout-constrained,
body.search-results .wp-block-group.has-global-padding.is-content-justification-left.is-layout-constrained {
    padding-left: var(--site-gutter) !important;
    padding-right: var(--site-gutter) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 1400px !important;
    width: 100% !important;
    box-sizing: border-box;
}
body.archive .wp-block-query-title.alignwide {
    padding-left: clamp(0rem, 0vw, 3rem) !important;
    padding-right: clamp(0.5rem, 3vw, 3rem) !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    box-sizing: border-box;
}
body.archive .wp-block-post-template.is-layout-constrained,
body.archive .wp-block-post-template.is-layout-flow{
     padding-left: var(--site-gutter) !important;
    padding-right: var(--site-gutter) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    max-width: 1050px !important;
    width: 100% !important;
    box-sizing: border-box;
}
body.search-results .wp-block-group.is-layout-flow[style*="padding-right:6.5rem"] {
    max-width: 1050px !important;
    width: 100% !important;
    position: static;
    left: auto;
    right: auto;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: var(--site-gutter) !important;
    padding-right: var(--site-gutter) !important;
    box-sizing: border-box;
}

body.search-results .wp-block-column[style*="flex-basis:90%"] {
    flex-basis: 100% !important;
    width: 100% !important;
}

body.search-results .wp-block-columns.are-vertically-aligned-center {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.wp-container-core-columns-is-layout-28f84493 {
    max-width: 100% !important;
    width: 100% !important;
}

.wp-container-core-columns-is-layout-28f84493 > .wp-block-column {
    max-width: 100% !important;
    flex-basis: 100% !important;
}

/* Post titles: distinct sizes per heading level, but same font-family/weight/wrap behavior */
h1.wp-block-post-title,
.wp-block-query-title {
    font-size: clamp(1.75rem, 4.5vw, 2rem) !important;
    line-height: 1.2 !important;
    font-weight: 700;
}

h2.wp-block-post-title {
    font-size: clamp(1.5rem, 3.5vw, 1.75rem) !important;
    line-height: 1.25 !important;
    font-weight: 700;
}

h3.wp-block-post-title {
    font-size: clamp(1.25rem, 3vw, 1.5rem) !important;
    line-height: 1.3 !important;
    font-weight: 600;
}

h4.wp-block-post-title {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem) !important;
    line-height: 1.3 !important;
    font-weight: 600;
}

h5.wp-block-post-title {
    font-size: clamp(1rem, 2vw, 1.1rem) !important;
    line-height: 1.4 !important;
    font-weight: 500;
}

h6.wp-block-post-title {
    font-size: clamp(0.9rem, 1.5vw, 1rem) !important;
    line-height: 1.4 !important;
    font-weight: 500;
}

.wp-block-post-template .wp-block-post-title a {
    font-size: inherit !important;
}

.entry-content p,
.entry-content li {
    font-size: clamp(1rem, 1.5vw, 1.125rem) !important;
    line-height: 1.7 !important;
}

.entry-content p,
.entry-content a,
.entry-content li,
.wp-block-post-title,
.wp-block-post-title a,
.wp-block-query-title {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* ---------- Content width / layout resets ----------*/
.entry-content {
    width: 100%;
    max-width: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.entry-content:has(.is-layout-constrained) {
    width: 100%;
    max-width: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
}

.entry-content.is-layout-constrained > :where(
    :not(.alignleft):not(.alignright):not(.alignfull)
) {
    max-width: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ---------- Sticky footer layout ---------- */
.wp-site-blocks {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1;
}

.wp-site-blocks main {
    flex: 1 0 auto;
}

.wp-block-group:has(.wp-container-core-group-is-layout-6215b345) {
    padding-bottom: 30px !important;
    border-bottom: 1px solid #dfe1e6 !important;
}

main > .entry-content + .wp-block-group {
    display: none !important;
}

/* ---------- Search results page: fluid padding matching site-wide gutter ---------- */
body.search-results main.has-global-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.search-results .wp-block-post-title {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    border-bottom-width: 1px !important;
    border-bottom-style: solid !important;
    border-bottom-color: var(--wp--preset--color--contrast) !important;
    padding-bottom: 10px !important;
    margin-bottom: 20px !important;
    /* font-size: clamp(1.119rem, 1.119rem + ((1vw - 0.2rem) * 1.052), 1.75rem) !important; */
}

body.search-results .wp-block-post-title a {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

@media (max-width: 600px) {
    body.search-results .wp-block-columns.are-vertically-aligned-center {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

body.search-results .wp-block-query-pagination {
    flex-wrap: wrap !important;
    row-gap: 10px;
}

body.search-results .wp-block-search__input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
/* Ensure the live search dropdown isn't clipped on the search-results page */
body.search-results .wp-block-search__inside-wrapper {
    overflow: visible !important;
}

body.search-results .wp-block-group.alignwide.has-global-padding {
    overflow: visible !important;
}

body.search-results main.has-global-padding {
    overflow: visible !important;
}

body.search-results .live-search-results {
    width: 100% !important;
    max-height: none !important;
}

body.search-results .live-search-results ul {
    max-height: 400px !important;
}
:root :where(.wp-block-query-title span) {
    font-style: normal !important;
}

/* ---------- Global link/site-title resets ---------- */
.wp-site-blocks a {
    text-decoration: none !important;
}

:root :where(.wp-block-site-title) {
    font-size: 28px !important;
}

.wp-block-search__input {
    color: #1a1a1a !important;
}

.wp-block-search__input::placeholder {
    color: #767676;
}

/* ---------- Header ---------- */
header.wp-block-template-part .wp-block-group.alignfull {
    padding: 20px 0 !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 100;
}

header.wp-block-template-part .alignwide {
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

header.wp-block-template-part .wp-block-site-title {
    font-size: 26px;
    margin: 0;
}

header.wp-block-template-part .wp-block-site-title a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

header.wp-block-template-part .wp-block-site-title a:hover {
    opacity: 0.8;
}

header.wp-block-template-part .wp-block-navigation {
    gap: 32px;
}

header.wp-block-template-part .wp-block-navigation a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

header.wp-block-template-part .wp-block-navigation a:hover {
    color: #fff;
}

header.wp-block-template-part .wp-block-navigation__responsive-container-open,
header.wp-block-template-part .wp-block-navigation__responsive-container-close {
    color: #fff;
}

header.wp-block-template-part .wp-block-search__input {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #2c3338 !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

header.wp-block-template-part .wp-block-search__input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

header.wp-block-template-part .wp-block-search__button {
    background: #000;
    border: none;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

header.wp-block-template-part .wp-block-search__button svg {
    width: 20px;
    height: 20px;
}

header.wp-block-template-part .wp-block-search__button svg path {
    fill: #fff !important;
}
/* ---------- Fluid responsive header ---------- */
header.wp-block-template-part .alignwide {
    padding-top: clamp(10px, 2vw, 20px) !important;
    padding-bottom: clamp(10px, 2vw, 20px) !important;
    padding-left: clamp(1rem, 5vw, 7rem) !important;
    padding-right: clamp(1rem, 5vw, 7rem) !important;
}

header.wp-block-template-part .wp-block-group.is-layout-flex {
    gap: clamp(10px, 3vw, 32px) !important;
    flex-wrap: wrap !important;
}

header.wp-block-template-part .wp-block-site-title {
    font-size: clamp(18px, 4vw, 26px) !important;
    padding-right: 0 !important;
    margin: 0 !important;
    flex-shrink: 0;
}

header.wp-block-template-part .wp-block-navigation {
    flex: 1 1 auto;
    min-width: 0px;
    gap: clamp(12px, 2vw, 32px) !important;
}

header.wp-block-template-part .wp-block-search {
    flex: 1 1 auto;
    min-width: 0px;
    max-width: 100%;
}

header.wp-block-template-part .wp-block-search__inside-wrapper {
    width: 100%;
    display: flex;
}

header.wp-block-template-part .wp-block-search__input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%; 
    font-size: clamp(0.75rem, 1.5vw, 0.9rem) !important;
    padding: clamp(6px, 1vw, 8px) clamp(6px, 1.5vw, 12px) !important;
}

header.wp-block-template-part .wp-block-search__button {
    flex-shrink: 0;
    padding: clamp(6px, 1vw, 8px) clamp(8px, 1.5vw, 12px) !important;
}

@media (max-width: 600px) {
    header.wp-block-template-part .wp-block-group.is-layout-flex {
        flex-direction: column;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }

    header.wp-block-template-part .wp-block-navigation {
        width: 100%;
        min-width: 0;
        justify-content: flex-start !important;
    }

    header.wp-block-template-part .wp-block-search {
        width: 100%;
        max-width: 280px;
        min-width: 0;
        margin-left: 0 !important;
        margin-right: auto !important;
    }
}

/* ---------- Footer: base (mobile, single column, up to 479px) ---------- */
footer.wp-block-template-part .wp-block-group.alignfull {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    min-height: auto !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 30px !important;
}

footer.wp-block-template-part .wp-block-site-title {
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
}

footer.wp-block-template-part .wp-block-columns {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex-direction: column !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 30px !important;
}

footer.wp-block-template-part .wp-block-column {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

footer.wp-block-template-part .wp-block-column p {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

/* ---------- Footer: 480px and above (two columns side-by-side) ---------- */
@media (min-width: 601px) {
    footer.wp-block-template-part .wp-block-group.alignfull {
        min-height: 40vh !important;
        gap: var(--wp--preset--spacing--10, 40px) !important;
    }

    footer.wp-block-template-part .wp-block-columns {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: flex-start !important;
        gap: 60px !important;
    }

    footer.wp-block-template-part .wp-block-column {
        flex: 1 1 0 !important;   
        width: 0 !important;      
        max-width: 220px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: center;
    }
}
footer.wp-block-template-part .wp-block-group {
    padding: 10px 7rem !important;
    box-sizing: border-box;
    justify-content: center !important;
}

footer.wp-block-template-part .wp-block-site-title a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

footer.wp-block-template-part .wp-block-site-title a:hover {
    opacity: 0.8;
}

footer.wp-block-template-part .wp-block-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

footer.wp-block-template-part .wp-block-column > p:first-child {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

footer.wp-block-template-part .wp-block-column p:not(:first-child) {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin-block-start: 0 !important;
}

footer.wp-block-template-part .wp-block-column .wp-block-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 !important;
    padding-top: 0 !important;
    width: auto;
    gap: 0 !important;
}

footer.wp-block-template-part .wp-block-column .wp-block-group p {
    white-space: nowrap;
    width: auto;
}

footer.wp-block-template-part .wp-block-column .wp-block-group a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    display: inline;
    max-width: none;
    transition: color 0.2s ease;
}

footer.wp-block-template-part .wp-block-column .wp-block-group a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ---------- Taxonomy / Print row (top columns block, not header/footer) ---------- */
.wp-site-blocks > .wp-block-columns {
    flex-wrap: wrap !important;
    row-gap: 12px !important;
}

.wp-site-blocks > .wp-block-columns .taxonomy-nsmg_section {
    padding-left: clamp(1rem, 5vw, 6.5rem) !important;
    padding-right: clamp(1rem, 5vw, 6.5rem) !important;
}

.wp-site-blocks > .wp-block-columns .wp-block-column {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

@media (max-width: 600px) {
    .wp-site-blocks > .wp-block-columns {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .wp-site-blocks > .wp-block-columns .wp-block-column:has(.print-page-btn) {
        text-align: left !important;
        padding-left: clamp(1rem, 5vw, 6.5rem) !important;
        padding-right: 1rem !important;
    }
}
/* ---------- Taxonomy page: has-global-padding fix (all widths) ---------- */


/* ---------- Taxonomy page: MOBILE (up to 600px) ---------- */
@media (max-width: 600px) {
    body.archive main.has-global-padding,
    body.archive .wp-block-query.alignfull {
        max-width: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.archive .wp-block-post-template.is-layout-constrained,
    body.archive .wp-block-post-template.is-layout-flow,
    body.archive .wp-block-query-title.alignwide {
        padding-left: 2rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    body.single .taxonomy-nsmg_section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    body.archive main.has-global-padding {
    --wp--style--root--padding-right: 0px !important;
    --wp--style--root--padding-left: 0px !important;
}
}
/* ---------- Images shouldn't overflow on narrow screens ---------- */
.entry-content .wp-block-image.is-resized img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    margin-top: 20px !important;
}
/* Force long URLs/text to wrap instead of overflowing horizontally */
.entry-content p,
.entry-content a,
.entry-content li {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
}

/* Safety net: prevent any horizontal scroll at the page level */
body {
    overflow-x: hidden;
}

.entry-content {
    overflow-x: hidden;
}
/* ---------- Homepage/listing query grid: fluid padding + responsive columns ---------- */
.wp-block-query .wp-block-post-template.is-layout-grid {
    column-gap: clamp(20px, 4vw, 60px) !important;
    row-gap: clamp(16px, 3vw, 32px) !important;
}

/* Single column on narrow screens, two columns above 600px */
@media (max-width: 600px) {
    .wp-block-query .wp-block-post-template.columns-2 {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 601px) {
    .wp-block-query .wp-block-post-template.columns-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Post title links wrap properly, don't overflow narrow columns */
.wp-block-query .wp-block-post-title,
.wp-block-query .wp-block-post-title a {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Pagination: wrap on narrow screens instead of overflowing */
.wp-block-query-pagination {
    flex-wrap: wrap !important;
    row-gap: 10px;
    padding-left: 1rem;
    padding-right: 1rem;
}
/* ---------- Knowledge Page grid (homepage / section / search listings) ---------- */

.wp-block-post-template.is-layout-grid > li.wp-block-post {
    display: flex;
}

.wp-block-post-template.is-layout-grid > li.wp-block-post .wp-block-post-title {
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;
}

/* ---------- Print button (Single template) ---------- */
.print-page-btn {

     background: #000; 
     color: #fff; 
     border: none; 
     padding: 10px 20px; 
     border-radius: 4px; 
     cursor: pointer; 
     font-size: 0.9rem; 
     margin: 16px 0; 
    } 
   
.print-page-btn:hover { 
    opacity: 0.85; 
}
@media print { 
    header.wp-block-template-part, footer.wp-block-template-part, .print-page-btn {
         display: none !important; 
        } 
    }
.wp-block-column:has(.print-page-btn) {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: right !important;
    padding-right: 20px !important;
}

/* ---------- Live/auto search dropdown ---------- */
.live-search-results {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
}

.live-search-results ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
    max-height: 350px !important;
    overflow-y: auto !important;
}

.live-search-results li {
    padding: 10px 14px !important;
    border-bottom: 1px solid #eee !important;
    color: #222 !important;
}

.live-search-results li:last-child {
    border-bottom: none !important;
}

.live-search-results a {
    text-decoration: none !important;
    color: #222 !important;
    display: block !important;
}

.live-search-results a:hover {
    background: #f5f5f5 !important;
}