/*
 * FAQ page layout extracted from its Custom HTML block.
 * Scope through the content wrapper so the same rules work in the editor.
 */
body:has(.kt-faq-document) .wp-block-post-content {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

body:has(.kt-faq-document) .wp-block-post-content > .wp-block-group,
body:has(.kt-faq-document) .wp-block-post-content > .kt-faq-document,
body:has(.kt-faq-document) .wp-block-post-content .kt-faq-document {
    width: 80% !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}

/* Neutralise nested constrained-width limits. */
body:has(.kt-faq-document) .kt-faq-document > *,
body:has(.kt-faq-document) .kt-faq-document .wp-block-group__inner-container,
body:has(.kt-faq-document) .kt-faq-document .wp-block-image,
body:has(.kt-faq-document) .kt-faq-document p,
body:has(.kt-faq-document) .kt-faq-document h2,
body:has(.kt-faq-document) .kt-faq-document h4,
body:has(.kt-faq-document) .kt-faq-document ul,
body:has(.kt-faq-document) .kt-faq-document ol {
    max-width: 100% !important;
}

/* Centred title hierarchy. */
body:has(.kt-faq-document) .kt-faq-title,
body:has(.kt-faq-document) .kt-faq-title-second {
    width: 100% !important;
    text-align: center !important;
    line-height: 1.3;
}

/* Readable, justified introduction and answers. */
body:has(.kt-faq-document) .kt-faq-document p {
    text-align: justify !important;
    text-justify: inter-word;
    line-height: 1.8;
    margin-top: 12px;
    margin-bottom: 20px;
}

/* Clearly separated, left-aligned questions. */
body:has(.kt-faq-document) .kt-faq-document h4.wp-block-heading {
    width: 100% !important;
    text-align: left !important;
    line-height: 1.5;
    margin-top: 28px;
    margin-bottom: 10px;
    padding: 0 0 10px 14px;
    border-left: 4px solid #30477f;
    border-bottom: 1px solid #d8dee7;
    box-sizing: border-box;
}

body:has(.kt-faq-document) .kt-faq-document ul,
body:has(.kt-faq-document) .kt-faq-document ol {
    padding-left: 1.6em;
}

body:has(.kt-faq-document) .kt-faq-document li {
    text-align: justify;
    line-height: 1.75;
    margin-bottom: 6px;
}

body:has(.kt-faq-document) .kt-faq-document figure.wp-block-image {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

body:has(.kt-faq-document) .kt-faq-document figure.wp-block-image img {
    max-width: 100%;
    height: auto;
}

/* Mobile layout. */
@media (max-width: 782px) {
    body:has(.kt-faq-document) .wp-block-post-content > .wp-block-group,
    body:has(.kt-faq-document) .wp-block-post-content > .kt-faq-document,
    body:has(.kt-faq-document) .wp-block-post-content .kt-faq-document {
        width: 90% !important;
    }
}

@media (max-width: 480px) {
    body:has(.kt-faq-document) .wp-block-post-content > .wp-block-group,
    body:has(.kt-faq-document) .wp-block-post-content > .kt-faq-document,
    body:has(.kt-faq-document) .wp-block-post-content .kt-faq-document {
        width: calc(100% - 32px) !important;
    }

    body:has(.kt-faq-document) .kt-faq-document p {
        line-height: 1.7;
    }
}

/* Release the outer constrained main layout on this page. */
body:has(.kt-faq-document) #main-content.is-layout-constrained > .wp-block-post-content {
    width: 100% !important;
    max-width: none !important;
}

body:has(.kt-faq-document) #main-content.is-layout-constrained > .wp-block-post-content > .kt-faq-document {
    width: 80% !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
