/*
 * MachAxis Edition archive-title flow guard (v1.03.0-alpha.6).
 * The page header is no longer a descendant of the sticky #masthead.
 * Intentionally scoped to archives and search: single-post custom backgrounds
 * and existing homepage/hero presentation remain unaffected.
 */
body:is(.archive, .search) #page > .page-header {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
    z-index: auto !important;
    background-color: var(--machaxis-edition-white, #fff) !important;
    background-image: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    isolation: isolate;
}

body:is(.archive, .search) #page > .page-header::after {
    display: none !important;
}

/* Keep the main navigation opaque even with a legacy transparent-header option. */
body:is(.archive, .search) #masthead,
body:is(.archive, .search) #machaxis-edition-header-inner {
    background-color: var(--machaxis-edition-white, #fff) !important;
    background-image: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* An absolute header is incompatible with the requested archive-header policy. */
body:is(.archive, .search).machaxis-edition-tsp-absolute #masthead {
    position: relative !important;
    inset: auto !important;
}

body:is(.archive, .search) #page > .page-header > .machaxis-edition-container {
    position: relative;
    z-index: 1;
}

/* Normal document flow: never allow category title/breadcrumbs to pin over posts. */
body:is(.archive, .search) #page > .page-header + #main {
    position: relative;
    z-index: 0;
}
