.ray-support-custom-header {
    width: 100%;
    background: #ffffff;
    border-bottom: none;
    position: relative;
    z-index: 999;
}

/* Hide the extra horizontal rule that appears right after the default `#header` block. */
#header + hr {
    display: none !important;
}

/* Global cleanup: remove old classic footer block and its divider on all pages. */
#footer {
    display: none !important;
}

hr:has(+ #footer) {
    display: none !important;
}

/* Ensure custom footer has no extra top gap anywhere. */
.footer,
.ray-support-custom-footer {
    margin-top: 0 !important;
}

/* Keep footer position/layout consistent across all View All pages:
   page content on top, footer anchored at bottom when content is short. */
body[class*="ViewAll"],
body[class*="view-all"] {
    min-height: 100vh;
}

body[class*="ViewAll"] #page,
body[class*="view-all"] #page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body[class*="ViewAll"] .footer,
body[class*="view-all"] .footer,
body[class*="ViewAll"] .ray-support-custom-footer,
body[class*="view-all"] .ray-support-custom-footer {
    margin-top: auto !important;
}

/* The homepage template renders the default Twenty Twenty-Five `#header` first,
   then outputs `ray_support_custom_header()`. Hide the default header so we
   don't get extra vertical whitespace. */
body.page-template-new-ray-support-home #header,
body.page-template-new-ray-support-home #headerimg,
body.page-template-patternsnew-ray-support-home-php #header,
body.page-template-patternsnew-ray-support-home-php #headerimg {
    display: none !important;
}

/* View-all pages also call `get_header()` and then output the custom header.
   Hide WordPress default header to match the expected layout. */
body[class*="ViewAll"] #header,
body[class*="ViewAll"] #headerimg,
body[class*="view-all"] #header,
body[class*="view-all"] #headerimg,
body.single-docs #header,
body.single-docs #headerimg,
body.single-post #header,
body.single-post #headerimg,
body.search .wp-site-blocks > header.wp-block-template-part,
body.error404 .wp-site-blocks > header.wp-block-template-part {
    display: none !important;
}

/* View All pages: replace the `.hero` background image with local asset. */
body[class*="ViewAll"] .hero,
body[class*="view-all"] .hero {
    background: url("../images/View%20All%20BG.png") center/cover no-repeat !important;
}

/* Homepage only: custom hero background image */
body.page-template-new-ray-support-home .hero-section-ray-support-home,
body.page-template-patternsnew-ray-support-home-php .hero-section-ray-support-home {
    background-image: url("../images/Home%20Page%20BG.png") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Remove default WP footer block + divider (extra space + "is proudly powered by WordPress")
   on homepage and all view-all templates. Keep only the custom purple footer. */
body.page-template-new-ray-support-home #footer,
body.page-template-patternsnew-ray-support-home-php #footer,
body[class*="ViewAll"] #footer,
body[class*="view-all"] #footer,
body.single-docs #footer,
body.single-post #footer,
body.search .wp-site-blocks > footer.wp-block-template-part,
body.error404 .wp-site-blocks > footer.wp-block-template-part {
    display: none !important;
}

body.page-template-new-ray-support-home .footer + hr,
body.page-template-patternsnew-ray-support-home-php .footer + hr,
body[class*="ViewAll"] .footer + hr,
body[class*="view-all"] .footer + hr,
body.single-docs .footer + hr,
body.single-post .footer + hr {
    display: none !important;
}

/* Fallback: if footer class is missing, still hide the divider after footer. */
body.page-template-new-ray-support-home footer + hr,
body.page-template-patternsnew-ray-support-home-php footer + hr,
body[class*="ViewAll"] footer + hr,
body[class*="view-all"] footer + hr,
body.single-docs footer + hr,
body.single-post footer + hr {
    display: none !important;
}

/* Remove any remaining line under the custom purple footer. */
body.page-template-new-ray-support-home .footer,
body.page-template-patternsnew-ray-support-home-php .footer,
body[class*="ViewAll"] .footer,
body[class*="view-all"] .footer,
body.single-docs .footer,
body.single-post .footer {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
}
.ray-support-custom-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.ray-support-custom-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ray-support-custom-header-logo img {
    max-height: 34px;
    width: auto;
    display: block;
}
.ray-support-custom-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ray-support-custom-header-login-btn,
.ray-support-custom-header-signup-btn {
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ray-support-custom-header-login-btn {
    background-color: #AA47BB;
    color: #ffffff;
}
.ray-support-custom-header-signup-btn {
    background: #F3F5F7;
    color: #000000;
}
.ray-support-custom-header-signup-btn:hover {
    background: #f28c28;
}
.ray-support-home-container {
    width: 100%;
    max-width: 1620px;
    margin: 0 auto;
    padding: 0 20px;
}
@media (max-width: 767px) {
    .ray-support-custom-header-inner {
        padding: 12px 15px;
    }
    .ray-support-custom-header-logo img {
        max-height: 28px;
    }
    .ray-support-custom-header-login-btn,
    .ray-support-custom-header-signup-btn {
        padding: 7px 14px;
        font-size: 11px;
    }
}

/* Search results: title-only cards matching KB style. */
body.search .wp-block-query.alignwide {
    max-width: 1280px;
    margin: 0 auto;
}

/* Search heading section background only (match homepage hero look). */
body.search .ray-search-hero {
    background: url("../images/Home%20Page%20BG.png") center/cover no-repeat;
    border-radius: 0;
    padding: 60px 20px;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 26px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

body.search .ray-search-hero > * {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

body.search .ray-search-hero .wp-block-query-title {
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 22px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.14;
    font-weight: 600;
}

body.search .ray-search-hero .wp-block-search__inside-wrapper {
    background: #ffffff;
    max-width: 720px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

body.search .ray-search-hero .wp-block-search {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

body.search .ray-search-hero .wp-block-search__input {
    border: none;
    min-height: 52px;
    padding: 12px 18px;
}

body.search .ray-search-hero .wp-block-search__button {
    min-height: 52px;
    padding: 0 26px;
    border-radius: 0;
    background: #111111;
    border: none;
}

body.search .wp-block-query .wp-block-post-template {
    margin-top: 18px;
}

body.search .wp-block-query .wp-block-post-template > .wp-block-group.alignfull {
    background: #ffffff;
    border: 1px solid #eadcf3;
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 14px 18px !important;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px 18px;
    box-shadow: 0 1px 0 rgba(108, 47, 147, 0.05);
}

body.search .wp-block-query .wp-block-post-title {
    margin: 0 !important;
    font-size: 30px;
    line-height: 1.35;
    font-weight: 700;
}

body.search .wp-block-query .wp-block-post-title a {
    color: #6c2f93 !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

body.search .wp-block-query .wp-block-post-title a::before {
    content: "\1F5CE";
    font-size: 18px;
    line-height: 1;
    color: #b48ccc;
}

body.search .wp-block-query .wp-block-post-date {
    margin: 0 !important;
    color: #111111;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

body.search .wp-block-query .wp-block-post-date a {
    color: inherit !important;
    text-decoration: none !important;
}

body.search .wp-block-query .wp-block-post-date::before {
    content: "Last updated: ";
    color: #4b5563;
    font-weight: 600;
}

@media (max-width: 900px) {
    body.search .ray-search-hero {
        padding: 42px 18px;
        min-height: 260px;
    }

    body.search .wp-block-query .wp-block-post-template > .wp-block-group.alignfull {
        grid-template-columns: 1fr;
        align-items: start;
    }

    body.search .wp-block-query .wp-block-post-title {
        font-size: 20px;
    }
}

/* Search pagination: boxed style like reference screenshot. */
body.search .wp-block-query-pagination-numbers {
    display: inline-flex;
    align-items: center;
}

body.search .wp-block-query-pagination {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d4d4d8;
    border-radius: 2px;
    overflow: hidden;
    background: #ffffff;
}

/* Keep pagination centered under search results. */
body.search .wp-block-group.alignfull .wp-block-query-pagination {
    margin-left: auto;
    margin-right: auto;
}

body.search .wp-block-query-pagination > * {
    margin: 0 !important;
}

body.search .wp-block-query-pagination a,
body.search .wp-block-query-pagination .page-numbers,
body.search .wp-block-query-pagination .wp-block-query-pagination-next,
body.search .wp-block-query-pagination .wp-block-query-pagination-previous {
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: #374151;
    text-decoration: none !important;
    border-right: 1px solid #d4d4d8;
    background: #ffffff;
}

body.search .wp-block-query-pagination > *:last-child,
body.search .wp-block-query-pagination .page-numbers:last-child {
    border-right: none;
}

body.search .wp-block-query-pagination .page-numbers.current {
    background: #aa47bb;
    color: #ffffff;
}

body.search .wp-block-query-pagination a:hover,
body.search .wp-block-query-pagination .wp-block-query-pagination-next:hover,
body.search .wp-block-query-pagination .wp-block-query-pagination-previous:hover {
    background: #f5edfb;
    color: #6c2f93;
}