/* ==========================================================================
   WordPress Block Styles
   ========================================================================== */

/* 1. Global & Structural Blocks */
.wp-site-blocks,
.site-header,
.site-footer,
.site-main,
.wp-block-template-part {
    margin: 0;
    margin-block-start: 0;
    margin-block-end: 0;
    width: 100%;
}

.wp-site-blocks {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

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

header.wp-block-template-part {
    margin-top: 0 !important;
}

/* Bare authored Groups without a WordPress layout class need the same
   sibling rhythm that Core supplies for Flow and Constrained layouts. */
.wp-block-group:not(.is-layout-flow):not(.is-layout-constrained):not(.is-layout-flex):not(.is-layout-grid):not(.is-style-system-panel):not(.is-style-system-panel-header):not(.is-style-system-panel-footer):not(.is-panel-wrapper)>*+*,
.wp-block-group:not(.is-layout-flow):not(.is-layout-constrained):not(.is-layout-flex):not(.is-layout-grid):not(.is-style-system-panel):not(.is-style-system-panel-header):not(.is-style-system-panel-footer):not(.is-panel-wrapper)>.block-editor-block-list__layout> :not(.block-list-appender)+ :not(.block-list-appender) {
    margin-block-start: var(--wp--preset--spacing--30);
    margin-block-end: 0;
}

/* Panel Wrapper is a paint-neutral Group composition primitive. It shares the
   canonical Panel radius without acquiring Panel spacing or enhancement. */
.wp-block-group.is-panel-wrapper {
    --wp--style--block-gap: 0;

    border: 0;
    border-radius: var(--wp--custom--border-radius);
    gap: 0;
    padding: 0;
}

.wp-block-group.is-panel-wrapper>*+*,
.wp-block-group.is-panel-wrapper>.block-editor-block-list__layout:not(.wp-block)> :not(.block-list-appender)+ :not(.block-list-appender) {
    margin-block-start: 0;
}

/* Color Lab shade ladders use persistent theme classes so generated runtime
   shades survive pattern insertion without Block Custom CSS support. */
.wp-block-group.strap-color-ladder {
    align-items: stretch;
    flex: 0 0 3.5rem;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    min-width: 3.5rem;
    width: 3.5rem;
}

.wp-block-group.strap-color-ladder>.strap-color-ladder__swatch {
    min-height: 1rem;
    width: 100%;
}

.strap-color-ladder__swatch.has-primary-10-background-color {
    background-color: var(--wp--preset--color--primary-10);
}

.strap-color-ladder__swatch.has-primary-20-background-color {
    background-color: var(--wp--preset--color--primary-20);
}

.strap-color-ladder__swatch.has-primary-30-background-color {
    background-color: var(--wp--preset--color--primary-30);
}

.strap-color-ladder__swatch.has-primary-40-background-color {
    background-color: var(--wp--preset--color--primary-40);
}

.strap-color-ladder__swatch.has-primary-50-background-color {
    background-color: var(--wp--preset--color--primary-50);
}

.strap-color-ladder__swatch.has-primary-60-background-color {
    background-color: var(--wp--preset--color--primary-60);
}

.strap-color-ladder__swatch.has-primary-70-background-color {
    background-color: var(--wp--preset--color--primary-70);
}

.strap-color-ladder__swatch.has-primary-80-background-color {
    background-color: var(--wp--preset--color--primary-80);
}

.strap-color-ladder__swatch.has-primary-90-background-color {
    background-color: var(--wp--preset--color--primary-90);
}

.strap-color-ladder__swatch.has-secondary-10-background-color {
    background-color: var(--wp--preset--color--secondary-10);
}

.strap-color-ladder__swatch.has-secondary-20-background-color {
    background-color: var(--wp--preset--color--secondary-20);
}

.strap-color-ladder__swatch.has-secondary-30-background-color {
    background-color: var(--wp--preset--color--secondary-30);
}

.strap-color-ladder__swatch.has-secondary-40-background-color {
    background-color: var(--wp--preset--color--secondary-40);
}

.strap-color-ladder__swatch.has-secondary-50-background-color {
    background-color: var(--wp--preset--color--secondary-50);
}

.strap-color-ladder__swatch.has-secondary-60-background-color {
    background-color: var(--wp--preset--color--secondary-60);
}

.strap-color-ladder__swatch.has-secondary-70-background-color {
    background-color: var(--wp--preset--color--secondary-70);
}

.strap-color-ladder__swatch.has-secondary-80-background-color {
    background-color: var(--wp--preset--color--secondary-80);
}

.strap-color-ladder__swatch.has-secondary-90-background-color {
    background-color: var(--wp--preset--color--secondary-90);
}

.strap-color-ladder__swatch.has-success-10-background-color {
    background-color: var(--wp--preset--color--success-10);
}

.strap-color-ladder__swatch.has-success-20-background-color {
    background-color: var(--wp--preset--color--success-20);
}

.strap-color-ladder__swatch.has-success-30-background-color {
    background-color: var(--wp--preset--color--success-30);
}

.strap-color-ladder__swatch.has-success-40-background-color {
    background-color: var(--wp--preset--color--success-40);
}

.strap-color-ladder__swatch.has-success-50-background-color {
    background-color: var(--wp--preset--color--success-50);
}

.strap-color-ladder__swatch.has-success-60-background-color {
    background-color: var(--wp--preset--color--success-60);
}

.strap-color-ladder__swatch.has-success-70-background-color {
    background-color: var(--wp--preset--color--success-70);
}

.strap-color-ladder__swatch.has-success-80-background-color {
    background-color: var(--wp--preset--color--success-80);
}

.strap-color-ladder__swatch.has-success-90-background-color {
    background-color: var(--wp--preset--color--success-90);
}

.strap-color-ladder__swatch.has-info-10-background-color {
    background-color: var(--wp--preset--color--info-10);
}

.strap-color-ladder__swatch.has-info-20-background-color {
    background-color: var(--wp--preset--color--info-20);
}

.strap-color-ladder__swatch.has-info-30-background-color {
    background-color: var(--wp--preset--color--info-30);
}

.strap-color-ladder__swatch.has-info-40-background-color {
    background-color: var(--wp--preset--color--info-40);
}

.strap-color-ladder__swatch.has-info-50-background-color {
    background-color: var(--wp--preset--color--info-50);
}

.strap-color-ladder__swatch.has-info-60-background-color {
    background-color: var(--wp--preset--color--info-60);
}

.strap-color-ladder__swatch.has-info-70-background-color {
    background-color: var(--wp--preset--color--info-70);
}

.strap-color-ladder__swatch.has-info-80-background-color {
    background-color: var(--wp--preset--color--info-80);
}

.strap-color-ladder__swatch.has-info-90-background-color {
    background-color: var(--wp--preset--color--info-90);
}

.strap-color-ladder__swatch.has-warning-10-background-color {
    background-color: var(--wp--preset--color--warning-10);
}

.strap-color-ladder__swatch.has-warning-20-background-color {
    background-color: var(--wp--preset--color--warning-20);
}

.strap-color-ladder__swatch.has-warning-30-background-color {
    background-color: var(--wp--preset--color--warning-30);
}

.strap-color-ladder__swatch.has-warning-40-background-color {
    background-color: var(--wp--preset--color--warning-40);
}

.strap-color-ladder__swatch.has-warning-50-background-color {
    background-color: var(--wp--preset--color--warning-50);
}

.strap-color-ladder__swatch.has-warning-60-background-color {
    background-color: var(--wp--preset--color--warning-60);
}

.strap-color-ladder__swatch.has-warning-70-background-color {
    background-color: var(--wp--preset--color--warning-70);
}

.strap-color-ladder__swatch.has-warning-80-background-color {
    background-color: var(--wp--preset--color--warning-80);
}

.strap-color-ladder__swatch.has-warning-90-background-color {
    background-color: var(--wp--preset--color--warning-90);
}

.strap-color-ladder__swatch.has-danger-10-background-color {
    background-color: var(--wp--preset--color--danger-10);
}

.strap-color-ladder__swatch.has-danger-20-background-color {
    background-color: var(--wp--preset--color--danger-20);
}

.strap-color-ladder__swatch.has-danger-30-background-color {
    background-color: var(--wp--preset--color--danger-30);
}

.strap-color-ladder__swatch.has-danger-40-background-color {
    background-color: var(--wp--preset--color--danger-40);
}

.strap-color-ladder__swatch.has-danger-50-background-color {
    background-color: var(--wp--preset--color--danger-50);
}

.strap-color-ladder__swatch.has-danger-60-background-color {
    background-color: var(--wp--preset--color--danger-60);
}

.strap-color-ladder__swatch.has-danger-70-background-color {
    background-color: var(--wp--preset--color--danger-70);
}

.strap-color-ladder__swatch.has-danger-80-background-color {
    background-color: var(--wp--preset--color--danger-80);
}

.strap-color-ladder__swatch.has-danger-90-background-color {
    background-color: var(--wp--preset--color--danger-90);
}

.strap-color-ladder__swatch.has-light-10-background-color {
    background-color: var(--wp--preset--color--light-10);
}

.strap-color-ladder__swatch.has-light-20-background-color {
    background-color: var(--wp--preset--color--light-20);
}

.strap-color-ladder__swatch.has-light-30-background-color {
    background-color: var(--wp--preset--color--light-30);
}

.strap-color-ladder__swatch.has-light-40-background-color {
    background-color: var(--wp--preset--color--light-40);
}

.strap-color-ladder__swatch.has-light-50-background-color {
    background-color: var(--wp--preset--color--light-50);
}

.strap-color-ladder__swatch.has-light-60-background-color {
    background-color: var(--wp--preset--color--light-60);
}

.strap-color-ladder__swatch.has-light-70-background-color {
    background-color: var(--wp--preset--color--light-70);
}

.strap-color-ladder__swatch.has-light-80-background-color {
    background-color: var(--wp--preset--color--light-80);
}

.strap-color-ladder__swatch.has-light-90-background-color {
    background-color: var(--wp--preset--color--light-90);
}

.strap-color-ladder__swatch.has-dark-10-background-color {
    background-color: var(--wp--preset--color--dark-10);
}

.strap-color-ladder__swatch.has-dark-20-background-color {
    background-color: var(--wp--preset--color--dark-20);
}

.strap-color-ladder__swatch.has-dark-30-background-color {
    background-color: var(--wp--preset--color--dark-30);
}

.strap-color-ladder__swatch.has-dark-40-background-color {
    background-color: var(--wp--preset--color--dark-40);
}

.strap-color-ladder__swatch.has-dark-50-background-color {
    background-color: var(--wp--preset--color--dark-50);
}

.strap-color-ladder__swatch.has-dark-60-background-color {
    background-color: var(--wp--preset--color--dark-60);
}

.strap-color-ladder__swatch.has-dark-70-background-color {
    background-color: var(--wp--preset--color--dark-70);
}

.strap-color-ladder__swatch.has-dark-80-background-color {
    background-color: var(--wp--preset--color--dark-80);
}

.strap-color-ladder__swatch.has-dark-90-background-color {
    background-color: var(--wp--preset--color--dark-90);
}

/* Adjacent System Details roots intentionally share one joined stack. */
.wp-block-group:not(.is-layout-flow):not(.is-layout-constrained):not(.is-layout-flex):not(.is-layout-grid):not(.is-style-system-panel):not(.is-style-system-panel-header):not(.is-style-system-panel-footer)>.wp-block-details.is-style-system-details+.wp-block-details.is-style-system-details,
.wp-block-group:not(.is-layout-flow):not(.is-layout-constrained):not(.is-layout-flex):not(.is-layout-grid):not(.is-style-system-panel):not(.is-style-system-panel-header):not(.is-style-system-panel-footer)>.block-editor-block-list__layout>.wp-block-details.is-style-system-details+.wp-block-details.is-style-system-details {
    margin-block-start: 0;
}

/* Core background defaults paint direct Panel content without changing its
   vertical geometry. Inline authored spacing remains authoritative. */
.wp-block-group.is-style-system-panel> :is(h1, h2, h3, h4, h5, h6, .wp-block-list, .wp-block-columns).has-background,
.wp-block-group.is-style-system-panel>.block-editor-block-list__layout> :is(h1, h2, h3, h4, h5, h6, .wp-block-list, .wp-block-columns).has-background {
    padding-block: 0;
}

/* Safety Net for SVG Icons in Flex Containers */
.wp-block-icon {
    flex-shrink: 0;
    line-height: 1;
}

/* If the icon lacks a specific size, prevent it from exploding */
.wp-block-icon>svg:not([width]) {
    width: 2rem;
    height: auto;
}

.site-header.is-position-sticky {
    top: calc(0px + var(--wp-admin--admin-bar--position-offset, 0));
    position: sticky;
    z-index: 10;
}

/* 3. Typography & Headings */
.wp-block-site-title.site-title,
.wp-block-site-title.site-title a {
    font-family: var(--wp--preset--font-family--heading);
    font-size: var(--wp--preset--font-size--x-large);
    font-style: normal;
    font-weight: var(--wp--custom--font-weight-heading);
    line-height: 1.2;
    text-decoration: none;
}

.entry-title,
.wp-block-post-title,
.wp-block-query-title,
.entry-content,
.entry-summary,
.wp-block-post-excerpt,
.wp-block-post-excerpt__excerpt,
.wp-block-post-content {
    -ms-word-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
    word-break: break-word;
}

.post-template-no-title .entry-header,
.page-template-no-title .entry-header {
    display: none !important;
}

/* 4. Layout & Images */

/* GeneratePress-style explicit override to prevent featured image blowout */
.wp-block-post-featured-image img {
    width: auto !important;
    max-width: 100% !important;
}

@media (min-width: 768px) {
    .media-object .wp-block-post-featured-image {
        margin-right: var(--wp--preset--spacing--30, 1rem) !important;
    }
}

/* 5. Specific Block Fixes */
/* Safe, predictable scoping using spacing variables */

.wp-block-archives-list.list-group>li,
.wp-block-categories-list.list-group>li {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
}

.wp-block-terms-query .wp-block-term-template {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wp-block-terms-query .wp-block-term-template>li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wp-block-terms-query .wp-block-term-template>li+li {}

.wp-block-terms-query .wp-block-term-name {
    margin: 0;
    min-width: 0;
}

.wp-block-terms-query .wp-block-term-name>a {
    display: block;
    padding: var(--wp--preset--spacing--20);
    color: inherit;
    text-decoration: none;
}

.wp-block-terms-query .wp-block-term-template>li.wp-block-term {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.wp-block-terms-query .wp-block-term-template li.wp-block-term .wp-block-group>.block-editor-inner-blocks>.block-editor-block-list__layout.is-layout-flex {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.wp-block-terms-query .wp-block-term-count {
    display: flex;
    align-items: center;
    margin: 0 var(--wp--preset--spacing--30) 0 0;
}

.wp-block-terms-query .wp-block-term-count>.system-badge {
    display: inline-block;
    padding: var(--wp--custom--badge-padding-y) var(--wp--custom--badge-padding-x);
    font-size: var(--wp--preset--font-size--x-small, .75rem);
    line-height: 1;
    margin: 0 var(--wp--preset--spacing--30) 0 0;
}

/* 7. Badges & Pills */
.badge .is-layout-flow {
    margin-block-start: 0;
}

.is-style-pill a {
    --badge-padding-x: var(--wp--preset--font-size--x-small, .75rem);
    --badge-padding-y: calc(var(--wp--preset--font-size--x-small, .75rem) * .5);
    --badge-font-size: var(--wp--preset--font-size--x-small, .75rem);
    --badge-font-weight: var(--wp--custom--font-weight-button);
    --badge-border-radius: var(--wp--custom--border-radius, .375rem);

    display: inline-block;
    padding: var(--badge-padding-y) var(--badge-padding-x);
    font-size: var(--badge-font-size);
    font-weight: var(--badge-font-weight);
    line-height: 1;
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.is-style-pill a {
    background-color: var(--wp--preset--color--secondary, #ACAEB0);
    color: var(--wp--preset--color--base, #ffffff);
    margin-bottom: calc(var(--wp--preset--font-size--medium, 1rem) * .5);
}

.is-style-pill a:hover {
    background-color: var(--wp--preset--color--primary, #2D4054);
    color: var(--wp--preset--color--base, #ffffff);
}

.wp-block-paragraph.badge {
    margin: .2rem !important;
}

/* Core Quote — Large keeps the native quote identity with editorial scale. */
.wp-block-quote.is-style-large:not(.is-style-plain),
.wp-block-quote.is-large:not(.is-style-plain) {
    padding:
        var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) calc(var(--wp--preset--spacing--40) + clamp(2.25rem, 6vw, 3rem));
}

.wp-block-quote.is-style-large:not(.is-style-plain)::before,
.wp-block-quote.is-large:not(.is-style-plain)::before {
    top: var(--wp--preset--spacing--20);
    left: var(--wp--preset--spacing--30);
    font-size: clamp(4rem, 8vw, 6rem);
    color: color-mix(in srgb, currentColor 30%, transparent);
}

.wp-block-quote.is-style-large:not(.is-style-plain) p,
.wp-block-quote.is-large:not(.is-style-plain) p {
    max-width: 42ch;
    margin-block: 0;
    font-size: var(--wp--preset--font-size--xx-large);
    line-height: 1.4;
}

.wp-block-quote.is-style-large:not(.is-style-plain) :is(cite, footer),
.wp-block-quote.is-large:not(.is-style-plain) :is(cite, footer) {
    margin-top: var(--wp--preset--spacing--30);
    padding-top: var(--wp--preset--spacing--20);
}

/* ==========================================================================
   8. Button Block Variations & Enhancements
   ========================================================================== */

.wp-block-button__link {
    transition: var(--wp--custom--btn-transition);
    transform: var(--wp--custom--btn-transform);
    box-shadow: var(--wp--preset--shadow--btn-resting, none);
}

.wp-block-button__link:hover {
    transform: var(--wp--custom--btn-hover-transform);
    box-shadow: var(--wp--preset--shadow--btn-hover, none);
}

.wp-block-button__link:active {
    box-shadow: var(--wp--preset--shadow--btn-active, none);
}

/* Universal Dynamic Hover Wash (Calculates automatically based on text color) */
.wp-block-button__link:not(:disabled):hover,
.wp-element-button:not(:disabled):hover,
.wp-block-search__button:not(:disabled):hover,
.wp-block-file__button:not(:disabled):hover,
.wp-block-post-terms.is-style-system-badge a:not(:disabled):hover {
    box-shadow: var(--wp--custom--btn-hover-wash, inset 0 0 0 9999px color-mix(in srgb, currentColor 15%, transparent)), var(--wp--preset--shadow--btn-hover, none) !important;
}

.wp-block-button__link:not(:disabled):active,
.wp-element-button:not(:disabled):active,
.wp-block-search__button:not(:disabled):active,
.wp-block-file__button:not(:disabled):active,
.wp-block-post-terms.is-style-system-badge a:not(:disabled):active {
    box-shadow: var(--wp--custom--btn-active-wash, inset 0 0 0 9999px color-mix(in srgb, currentColor 25%, transparent)), var(--wp--preset--shadow--btn-active, none) !important;
}

/* Base style for outline buttons to ensure they have transparent background so the wash shows up properly */
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-button-pill-outline .wp-block-button__link,
.wp-block-button.is-style-button-square-outline .wp-block-button__link,
.wp-block-button.wc-block-components-product-button.is-style-button-pill-outline-woo>.wp-block-button__link.wc-block-components-product-button__button,
.wp-block-button.wc-block-components-product-button.is-style-button-square-outline-woo>.wp-block-button__link.wc-block-components-product-button__button {
    background-color: transparent;
}

/* Override WP core bloated button padding with our sleek spacing scale across all button variations */
.wp-block-button__link,
.wp-element-button,
.wp-block-search__button,
.wp-block-file__button {
    padding-top: calc(var(--wp--preset--font-size--small) * .5);
    padding-bottom: calc(var(--wp--preset--font-size--small) * .5);
    padding-left: var(--wp--preset--font-size--medium);
    padding-right: var(--wp--preset--font-size--medium);
    border-width: var(--wp--custom--border-width, 1px);
}

/* BuddyPress maps ordinary transactional controls onto this canonical Button
   contract through the request-level default-style class. Nouveau keeps DOM,
   action semantics, disabled state, and AJAX ownership. */
body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-secondary, .strap-bp-default-button-style-link, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button) {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: var(--strap-bp-button-display, inline-flex);
    align-items: center;
    justify-content: center;
    width: var(--strap-bp-button-width, fit-content);
    min-height: var(--strap-bp-button-min-height, 0);
    height: var(--strap-bp-button-height, auto);
    border-width: var(--wp--custom--border-width, 1px);
    border-style: var(--wp--custom--border-style, solid);
    border-radius: var(--wp--custom--btn-border-radius);
    font-family: var(--wp--preset--font-family--button);
    font-size: var(--strap-bp-button-font-size, var(--wp--preset--font-size--medium));
    font-weight: var(--wp--custom--font-weight-button);
    letter-spacing: .03em;
    line-height: var(--strap-bp-button-line-height, 1.45);
    padding: var(--strap-bp-button-padding, calc(var(--wp--preset--font-size--small) * .5) var(--wp--preset--font-size--medium));
    text-decoration: none;
    transition: var(--wp--custom--btn-transition);
}

body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-secondary, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(:disabled):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button):hover {
    box-shadow: var(--wp--custom--btn-hover-wash, inset 0 0 0 9999px color-mix(in srgb, currentColor 15%, transparent)), var(--wp--preset--shadow--btn-hover, none) !important;
    transform: var(--wp--custom--btn-hover-transform);
}

body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-secondary, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(:disabled):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button):active {
    box-shadow: var(--wp--custom--btn-active-wash, inset 0 0 0 9999px color-mix(in srgb, currentColor 25%, transparent)), var(--wp--preset--shadow--btn-active, none) !important;
}

body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-square) .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button) {
    background-color: var(--wp--preset--color--primary) !important;
    border-color: var(--wp--custom--btn-border-color) !important;
    color: var(--wp--preset--color--primary-text) !important;
}

body.strap-bp-default-button-style-secondary .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button) {
    background-color: var(--wp--preset--color--secondary) !important;
    border-color: var(--wp--custom--btn-border-color) !important;
    color: var(--wp--preset--color--secondary-text) !important;
}

body.strap-bp-default-button-style-link .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button) {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: inherit;
    padding: 0 !important;
}

body.strap-bp-default-button-style-link .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button):hover {
    text-decoration: underline;
    transform: none !important;
}

body:is(.strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline) .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button) {
    border-radius: 50rem !important;
}

body:is(.strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button) {
    border-radius: 0 !important;
}

body:is(.strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square-outline) .main-buddypress .buddypress-wrap :is(a.button, button.button, input[type="button"], input[type="submit"]):not(.dashicons, .text-button, .button-small, .bp-icons, .bp-priority-nav-more-toggle, .submenu-expand, .wp-hide-pw, .wp-cancel-pw, .bp-remove-item, .messages-button, .group-members-paginate-button, .bp-search, .nouveau-search-submit, .bp-secondary-action, .leave-group, .unfriend, .member-ban, .member-unban, .member-promote-to-mod, .member-promote-to-admin, .mod-promote-to-admin, .mod-demote-to-member, .admin-demote-to-member, .delete-activity, .spam-activity, .message-action-delete, .message-action-exit, .message-action-star, .message-action-unstar, .group-remove-invite-button, #delete-account-button, #delete-group-button) {
    background-color: transparent !important;
    border-color: var(--wp--preset--color--primary) !important;
    color: var(--wp--preset--color--primary) !important;
}

/* BuddyPress Button API and block controls use the same selected canonical
   style outside the post-content wrapper. The mapper adds this explicit class
   only to semantically classified controls. */
body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-secondary, .strap-bp-default-button-style-link, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) :is(.strap-bp-default-button, #activity-stream .activity-list > li.load-more > a) {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: var(--strap-bp-button-display, inline-flex);
    align-items: center;
    justify-content: center;
    width: var(--strap-bp-button-width, fit-content);
    min-height: var(--strap-bp-button-min-height, 0);
    height: var(--strap-bp-button-height, auto);
    border-width: var(--wp--custom--border-width, 1px);
    border-style: var(--wp--custom--border-style, solid);
    border-radius: var(--wp--custom--btn-border-radius);
    font-family: var(--wp--preset--font-family--button);
    font-size: var(--strap-bp-button-font-size, var(--wp--preset--font-size--medium));
    font-weight: var(--wp--custom--font-weight-button);
    letter-spacing: .03em;
    line-height: var(--strap-bp-button-line-height, 1.45);
    padding: var(--strap-bp-button-padding, calc(var(--wp--preset--font-size--small) * .5) var(--wp--preset--font-size--medium));
    text-decoration: none;
    transition: var(--wp--custom--btn-transition);
}

body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-secondary, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) :is(.strap-bp-default-button, #activity-stream .activity-list > li.load-more > a):not(:disabled):is(:hover, :focus-visible) {
    box-shadow: var(--wp--custom--btn-hover-wash, inset 0 0 0 9999px color-mix(in srgb, currentColor 15%, transparent)), var(--wp--preset--shadow--btn-hover, none) !important;
    transform: var(--wp--custom--btn-hover-transform);
}

body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-secondary, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) :is(.strap-bp-default-button, #activity-stream .activity-list > li.load-more > a):not(:disabled):active {
    box-shadow: var(--wp--custom--btn-active-wash, inset 0 0 0 9999px color-mix(in srgb, currentColor 25%, transparent)), var(--wp--preset--shadow--btn-active, none) !important;
}

body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-square) :is(.strap-bp-default-button:not(.strap-bp-danger-button), #activity-stream .activity-list > li.load-more > a) {
    background-color: var(--wp--preset--color--primary) !important;
    border-color: var(--wp--custom--btn-border-color) !important;
    color: var(--wp--preset--color--primary-text) !important;
}

body.strap-bp-default-button-style-secondary :is(.strap-bp-default-button:not(.strap-bp-danger-button), #activity-stream .activity-list > li.load-more > a) {
    background-color: var(--wp--preset--color--secondary) !important;
    border-color: var(--wp--custom--btn-border-color) !important;
    color: var(--wp--preset--color--secondary-text) !important;
}

body.strap-bp-default-button-style-link :is(.strap-bp-default-button, #activity-stream .activity-list > li.load-more > a) {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: inherit;
    padding: 0 !important;
}

body.strap-bp-default-button-style-link :is(.strap-bp-default-button, #activity-stream .activity-list > li.load-more > a):is(:hover, :focus-visible) {
    text-decoration: underline;
    transform: none !important;
}

body:is(.strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline) :is(.strap-bp-default-button, #activity-stream .activity-list > li.load-more > a) {
    border-radius: 50rem !important;
}

body:is(.strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) :is(.strap-bp-default-button, #activity-stream .activity-list > li.load-more > a) {
    border-radius: 0 !important;
}

body:is(.strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square-outline) :is(.strap-bp-default-button:not(.strap-bp-danger-button), #activity-stream .activity-list > li.load-more > a) {
    background-color: transparent !important;
    border-color: var(--wp--preset--color--primary) !important;
    color: var(--wp--preset--color--primary) !important;
}

.strap-bp-default-button.strap-bp-button-small {
    --strap-bp-button-font-size: var(--wp--preset--font-size--small);
    --strap-bp-button-line-height: 1.3;
    --strap-bp-button-padding: calc(var(--wp--preset--font-size--small) * .5) var(--wp--preset--spacing--20);
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 0;
    height: auto;
    font-size: var(--strap-bp-button-font-size);
    line-height: var(--strap-bp-button-line-height);
    padding: var(--strap-bp-button-padding);
}

body #activity-stream .strap-bp-default-button.strap-bp-button-small {
    font-size: var(--wp--preset--font-size--small);
    line-height: 1.3;
}

.strap-bp-default-button.strap-bp-button-full {
    --strap-bp-button-width: 100%;
    display: inline-flex;
    justify-content: center;
    width: 100%;
}

:is(.strap-bp-load-more-button, #activity-stream .activity-list > li.load-more > a) {
    display: inline-flex;
    width: fit-content;
}

.main-buddypress #activity-stream .bp-profile-button>.button {
    font-size: var(--wp--preset--font-size--small);
    line-height: 1.3;
}

/* Activity reply-thread actions use the canonical compact button geometry;
   directory and object-card small controls retain their existing dimensions. */
body:is(.strap-bp-default-button-style-primary, .strap-bp-default-button-style-secondary, .strap-bp-default-button-style-pill, .strap-bp-default-button-style-pill-outline, .strap-bp-default-button-style-square, .strap-bp-default-button-style-square-outline) #buddypress .activity-comments .strap-bp-default-button.strap-bp-button-small {
    box-shadow: var(--wp--preset--shadow--btn-resting, none);
}

/* BuddyPress Danger controls retain canonical Button construction. Danger
   supplies semantic color after that base mapping; selected styles still own
   shape while Danger wins surface, border, and foreground. */
body #buddypress .strap-bp-default-button.strap-bp-danger-button {
    background-color: var(--wp--preset--color--danger) !important;
    border-color: var(--wp--preset--color--danger) !important;
    color: var(--wp--preset--color--danger-text) !important;
}

/* Link Button */
.wp-block-button.is-style-button-link .wp-block-button__link,
.wp-block-button.wc-block-components-product-button.is-style-button-link-woo>.wp-block-button__link.wc-block-components-product-button__button {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    color: inherit;
    text-decoration: none;
}

.wp-block-button.is-style-button-link .wp-block-button__link:hover,
.wp-block-button.wc-block-components-product-button.is-style-button-link-woo>.wp-block-button__link.wc-block-components-product-button__button:hover {
    text-decoration: underline;
    transform: none !important;
    box-shadow: none !important;
}

/* Base outline logic for all outline variations */
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-button-pill-outline .wp-block-button__link,
.wp-block-button.is-style-button-square-outline .wp-block-button__link,
.wp-block-button.wc-block-components-product-button.is-style-button-pill-outline-woo>.wp-block-button__link.wc-block-components-product-button__button,
.wp-block-button.wc-block-components-product-button.is-style-button-square-outline-woo>.wp-block-button__link.wc-block-components-product-button__button {
    background-color: transparent !important;
    border: var(--wp--custom--border-width, 1px) solid currentColor !important;
    color: inherit;
    padding-top: calc(var(--wp--preset--font-size--small) * .5) !important;
    padding-bottom: calc(var(--wp--preset--font-size--small) * .5) !important;
    padding-left: var(--wp--preset--font-size--medium) !important;
    padding-right: var(--wp--preset--font-size--medium) !important;
}

/* Pill & Square Shape Overrides */
.wp-block-button.is-style-button-pill .wp-block-button__link,
.wp-block-button.is-style-button-pill-outline .wp-block-button__link,
.wp-block-button.wc-block-components-product-button.is-style-button-pill-woo>.wp-block-button__link.wc-block-components-product-button__button,
.wp-block-button.wc-block-components-product-button.is-style-button-pill-outline-woo>.wp-block-button__link.wc-block-components-product-button__button {
    border-radius: 50rem !important;
}

.wp-block-button.is-style-button-square .wp-block-button__link,
.wp-block-button.is-style-button-square-outline .wp-block-button__link,
.wp-block-button.is-style-squared .wp-block-button__link,
.wp-block-button.wc-block-components-product-button.is-style-button-square-woo>.wp-block-button__link.wc-block-components-product-button__button,
.wp-block-button.wc-block-components-product-button.is-style-button-square-outline-woo>.wp-block-button__link.wc-block-components-product-button__button {
    border-radius: 0 !important;
}

/* Shared icon-button utility. The legacy Button selector remains a consumer so
   existing SystemStrap carousel markup continues to receive this contract. */
:is(.strap-icon-button, .wp-block-button.is-style-system-btn-icon .wp-block-button__link) {
    --strap-icon-button-hover-background: rgba(var(--wp--preset--color--secondary-bg-rgb), .75);
    --strap-icon-button-hover-color: var(--wp--preset--color--contrast);
    --strap-icon-button-hover-border-color: var(--wp--custom--btn-icon-hover-border-color, var(--wp--custom--system-ui-border-color));
    --strap-icon-button-hover-shadow: var(--wp--preset--shadow--btn-icon-hover, none);
    --strap-icon-button-hover-transform: var(--wp--custom--btn-icon-hover-transform, none);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50% !important;
    padding: 0 !important;
    background: rgba(var(--wp--preset--color--secondary-bg-rgb), .5);
    color: var(--wp--preset--color--secondary-color);
    border: var(--wp--custom--border-width, 1px) solid var(--wp--custom--btn-icon-border-color, transparent);
    box-shadow: var(--wp--preset--shadow--btn-icon-resting, none);
    transform: var(--wp--custom--btn-icon-transform, none);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

html body :is(.strap-icon-button:not(.strap-icon-button--woo), .wp-block-button.is-style-system-btn-icon .wp-block-button__link):is(:hover, :focus, :active) {
    background-color: var(--strap-icon-button-hover-background);
    color: var(--strap-icon-button-hover-color) !important;
    border-color: var(--strap-icon-button-hover-border-color) !important;
    box-shadow: var(--strap-icon-button-hover-shadow);
    transform: var(--strap-icon-button-hover-transform);
}

.system-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
}

.system-icon-left {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
}

.system-icon-right {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
}

.system-icon-close {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}

.has-background .wp-block-button.is-style-system-btn-icon .wp-block-button__link {
    background-color: inherit;
}

.has-text-color .wp-block-button.is-style-system-btn-icon .wp-block-button__link {
    color: inherit;
}

/* ==========================================================================
   9. Navigation & Menu Block Variations & Enhancements
   ========================================================================== */

.wp-block-navigation {
    position: relative;
    z-index: 10;
}

.wp-block-navigation:has(.wp-block-navigation-submenu__toggle[aria-expanded="true"]) {
    z-index: 20;
}

.wp-block-navigation,
.wp-block-navigation .wp-block-navigation-item,
.wp-block-navigation .wp-block-navigation-item__content,
.wp-block-navigation .wp-block-navigation-submenu__toggle {
    color: inherit;
}

/* Canonical WP Default Navigation: plain links with item-owned state
 * underlines. The pseudo-element preserves authored item backgrounds and
 * gradients while keeping decoration independent of the anchor text. */
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen)>.wp-block-navigation__container>.wp-block-navigation-item,
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen) .wp-block-navigation__responsive-container-content>.wp-block-navigation__container>.wp-block-navigation-item {
    position: relative;
    padding-block: var(--wp--custom--navigation-item-padding-block);
}

.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen)>.wp-block-navigation__container>.wp-block-navigation-item>.wp-block-navigation-item__content,
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen) .wp-block-navigation__responsive-container-content>.wp-block-navigation__container>.wp-block-navigation-item>.wp-block-navigation-item__content {
    text-decoration: none !important;
}

.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen)>.wp-block-navigation__container>.wp-block-navigation-item::after,
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen) .wp-block-navigation__responsive-container-content>.wp-block-navigation__container>.wp-block-navigation-item::after {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: var(--wp--custom--border-width, 1px);
    background: currentColor;
    content: "";
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: left center;
}

.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen)>.wp-block-navigation__container>.wp-block-navigation-item:has(> :is(.wp-block-navigation-item__content, .wp-block-navigation-submenu__toggle):is(:hover, :focus-visible))::after,
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen)>.wp-block-navigation__container>.wp-block-navigation-item:is(.current-menu-item, .current-menu-ancestor):has(> .wp-block-navigation-item__content)::after,
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen)>.wp-block-navigation__container>.wp-block-navigation-item:has(> .wp-block-navigation-item__content[aria-current="page"])::after,
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen) .wp-block-navigation__responsive-container-content>.wp-block-navigation__container>.wp-block-navigation-item:has(> :is(.wp-block-navigation-item__content, .wp-block-navigation-submenu__toggle):is(:hover, :focus-visible))::after,
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen) .wp-block-navigation__responsive-container-content>.wp-block-navigation__container>.wp-block-navigation-item:is(.current-menu-item, .current-menu-ancestor):has(> .wp-block-navigation-item__content)::after,
.wp-block-navigation:not(.is-vertical):not(.is-style-system-nav-button):not(.is-style-system-nav-gen) .wp-block-navigation__responsive-container-content>.wp-block-navigation__container>.wp-block-navigation-item:has(> .wp-block-navigation-item__content[aria-current="page"])::after {
    transform: scaleX(1);
}

/* Override WordPress's hardcoded default submenu colors */
/* We target the .wp-block-navigation-submenu (the LI) to check if a user applied a custom color */

/* Default Submenu Colors */
.wp-block-navigation-submenu:not(.has-text-color)>.wp-block-navigation__submenu-container,
.wp-block-navigation-submenu:not(.has-text-color)>.block-editor-inner-blocks .wp-block-navigation__submenu-container {
    color: var(--wp--preset--color--contrast);
}

.wp-block-navigation-submenu:not(.has-background)>.wp-block-navigation__submenu-container,
.wp-block-navigation-submenu:not(.has-background)>.block-editor-inner-blocks .wp-block-navigation__submenu-container {
    background-color: var(--wp--preset--color--base);
    border: var(--wp--custom--dropdown-border-width) solid var(--wp--custom--dropdown-border-color);
    border-radius: var(--wp--custom--dropdown-border-radius);
    padding: var(--wp--custom--navigation-submenu-panel-padding-block) 0;
}

/* Global Submenu Hover - Adaptive */
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item:hover {
    background: color-mix(in srgb, currentColor 8%, transparent) !important;
}

/* EDITOR SPECIFIC FIX: Prevent the editor from forcefully inheriting top-level backgrounds */
.wp-block-navigation-submenu:not(.has-background)>.block-editor-inner-blocks,
.wp-block-navigation-submenu:not(.has-background) .wp-block-navigation__submenu-container.block-editor-inner-blocks {
    background-color: var(--wp--preset--color--base) !important;
    border: var(--wp--custom--dropdown-border-width) solid var(--wp--custom--dropdown-border-color) !important;
    border-radius: var(--wp--custom--dropdown-border-radius) !important;
    padding: var(--wp--custom--navigation-submenu-panel-padding-block) 0 !important;
}

.wp-block-navigation-submenu:not(.has-text-color)>.block-editor-inner-blocks,
.wp-block-navigation-submenu:not(.has-text-color) .wp-block-navigation__submenu-container.block-editor-inner-blocks {
    color: var(--wp--preset--color--contrast) !important;
}

/* ==========================================================================
   Global Dropdown Enhancements (Boundaries & Carets)
   ========================================================================== */

/* Boundary Alignments (applied by dropdown-boundary.js) */
.wp-block-navigation-item.has-child .wp-block-navigation__submenu-container.is-align-right {
    left: auto !important;
    right: 0 !important;
}

.wp-block-navigation-item.has-child .wp-block-navigation__submenu-container.is-align-top {
    top: auto !important;
    bottom: 100% !important;
    margin-top: 0 !important;
}

/* ==========================================================================
   Hardcode Core Accordion Fixes
   ========================================================================== */
.wp-block-accordion .wp-block-accordion-heading__toggle {

    text-decoration: none !important;
}

:where(.wp-block-latest-posts.wp-block-latest-posts__list a.wp-block-latest-posts__post-title),

.wp-block-latest-posts:not(.is-grid) .wp-block-latest-posts__post-title .title,

.is-style-system-panel .wp-block-accordion .wp-block-accordion-heading__toggle {
    font-size: var(--wp--preset--font-size--medium, 1rem);
}

/* Ensure latest posts titles reliably inherit the correct heading properties */
.wp-block-latest-posts .wp-block-latest-posts__post-title,

.wp-block-latest-posts__post-title {
    font-family: var(--wp--preset--font-family--heading);
    font-weight: calc(var(--wp--custom--font-weight-body) + 100);
}

/* ==========================================================================
   Native Form Semantics
   theme.json owns text-control paint, geometry, and typography. CSS retains
   only native-label typography and the focus-state behavior unavailable to
   theme.json textInput/select elements.
   ========================================================================== */
label {
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: var(--wp--custom--font-weight-body);
    line-height: 1.6;
}

button:not(.wp-block-icon) {
    font-family: var(--wp--preset--font-family--button);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: var(--wp--custom--font-weight-button);
    letter-spacing: 0.03em;
    line-height: 1.45;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea,
select {
    transition: var(--wp--custom--form-transition);
}

/* Focus State */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--wp--custom--form-focus-border-color);
    box-shadow: var(--wp--preset--shadow--form-focus, none);
}

/* ==========================================================================
   System Badge Component
   ========================================================================== */

/* Block-level Badges and Inline Highlights */
.system-badge,
:is(.has-system-badge, .is-style-system-badge) mark.has-inline-color {
    display: inline-block;
    padding: var(--wp--custom--badge-padding-y) var(--wp--custom--badge-padding-x);
    font-size: var(--wp--custom--badge-font-size);
    font-weight: var(--wp--custom--badge-font-weight);
    line-height: 1;
    color: var(--wp--preset--color--base, #fff);
    /* Default contrast */
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--wp--custom--badge-border-radius);
    background-color: var(--wp--preset--color--primary, #0d6efd);
    /* Default bg */
    border: none;
    text-decoration: none;
}

/* Ensure empty badges collapse nicely */
.system-badge:empty,
:is(.has-system-badge, .is-style-system-badge) mark.has-inline-color:empty {
    display: none;
}

/* Widget Header Icon Alignment */
.widget-title svg,
.widget-title i,
.wp-block-heading svg,
.wp-block-heading i {
    font-size: 1em;
}

/* ==========================================================================
   System Header Component
   ========================================================================== */
.site-header .is-style-system-panel {
    border-top: none;
    border-right: none;
    border-left: none;
    border-radius: 0 !important;
}

/* ==========================================================================
   10. Native Block Baselines
   ========================================================================== */

/* Push post counts to the right on bog-standard list items */
.wp-block-archives:not([class*="is-style-system"]) li,
.wp-block-categories:not([class*="is-style-system"]) li,
.wp-block-archives-list:not([class*="is-style-system"]) li,
.wp-block-categories-list:not([class*="is-style-system"]) li {
    display: flex;
    flex-wrap: wrap;
    /* Fix hierarchical structure loss */
    justify-content: space-between;
    align-items: center;
    gap: var(--wp--preset--spacing--10);
}

/* Force nested lists to their own row to maintain indentation */
.wp-block-archives:not([class*="is-style-system"]) li>ul,
.wp-block-categories:not([class*="is-style-system"]) li>ul,
.wp-block-archives-list:not([class*="is-style-system"]) li>ul,
.wp-block-categories-list:not([class*="is-style-system"]) li>ul {
    width: 100%;
}

/* Base Post Terms Styling (Tags/Categories at bottom of post) */
.wp-block-post-terms:not([class*="is-style-system"]) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--10, 0.5rem);
    align-items: center;
}

.wp-block-post-terms:not([class*="is-style-system"]) a {
    display: inline-block;
    max-width: fit-content;
}

/* Search Block Baseline */
.wp-block-search__inside-wrapper {
    display: flex;
    align-items: stretch;
}

.wp-block-search__button-outside .wp-block-search__inside-wrapper {
    gap: var(--wp--preset--spacing--10, 0.5rem);
}

.wp-block-search__input {
    min-height: 100%;
    padding-top: calc(var(--wp--preset--font-size--small) * .5);
    padding-bottom: calc(var(--wp--preset--font-size--small) * .5);
    padding-left: var(--wp--preset--font-size--small);
    padding-right: var(--wp--preset--font-size--small);
    border: var(--wp--custom--border-width, 1px) solid var(--wp--custom--form-border-color);
    border-radius: var(--wp--custom--border-radius, 4px);
    background-color: var(--wp--custom--form-bg-color, var(--wp--preset--color--base));
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.wp-block-search__input:focus {
    outline: none;
    border-color: var(--wp--custom--form-focus-border-color, currentColor);
    box-shadow: var(--wp--preset--shadow--form-focus, none);
}

/* Button Inside Baseline Fix */
.wp-block-search__button-inside .wp-block-search__inside-wrapper {
    border: var(--wp--custom--border-width, 1px) solid var(--wp--custom--form-border-color);
    border-radius: var(--wp--custom--border-radius, 4px);
    background-color: var(--wp--custom--form-bg-color, var(--wp--preset--color--base));
    overflow: hidden;
    transition: var(--wp--custom--form-transition);
}

.wp-block-search__button-inside .wp-block-search__inside-wrapper:focus-within {
    border-color: var(--wp--custom--form-focus-border-color, currentColor);
    box-shadow: var(--wp--preset--shadow--form-focus, none);
}

.wp-block-search__button-inside .wp-block-search__input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.wp-block-search__button-inside .wp-block-search__button {
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    height: auto;
}

/* Separator Block Baseline */
.wp-block-separator:not(.is-style-system-divider) {
    border-color: var(--wp--custom--form-border-color);
}

/* ==========================================================================
   11. Dynamic Count Badges
   Applied via .is-style-system-list, .is-style-system-list-flush, or .is-style-system-badge
   ========================================================================== */

:is(.is-style-system-list, .is-style-system-flat-list, .is-style-system-list-flush, .is-style-system-badge, .is-style-outline, .is-style-system-tags) :is(.wp-block-categories__count,
    .wp-block-archives__count,
    .tag-link-count,
    .wp-block-term-count,
    .wc-block-product-categories-list-item-count) {
    display: inline-block;
    padding: var(--wp--custom--badge-padding-y) var(--wp--custom--badge-padding-x);
    font-size: var(--wp--custom--badge-font-size);
    font-weight: var(--wp--custom--badge-font-weight);
    line-height: 1;
    border-radius: var(--wp--custom--badge-border-radius);

    /* Dynamic shading inherited from current text color */
    background-color: color-mix(in srgb, currentColor 10%, transparent);
    color: color-mix(in srgb, currentColor 90%, #000);
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

:is(.is-style-system-list, .is-style-system-flat-list, .is-style-system-list-flush) :is(.wp-block-categories__count,
    .wp-block-archives__count,
    .wp-block-term-count,
    .wc-block-product-categories-list-item-count) {
    transform: translateY(1px);
}

/* Tame the big and gawky WordPress Core outline tag clouds */
.wp-block-tag-cloud.is-style-outline a {
    display: inline-flex !important;
    align-items: center !important;
    padding: calc(var(--wp--preset--spacing--10) * 0.5) var(--wp--preset--spacing--20) !important;
    font-size: var(--wp--preset--font-size--small) !important;
}

/* Balance horizontal padding when a badge is present inside the tag */
.wp-block-tag-cloud:is(.is-style-system-tags, .is-style-outline) a:has(.tag-link-count) {
    padding-inline-end: calc(var(--wp--preset--spacing--20) * 0.5) !important;
}

/* Ensure tag clouds actually inherit custom text colors */
.wp-block-tag-cloud.has-text-color a {
    color: inherit;
}

:is(.is-style-system-list, .is-style-system-flat-list, .is-style-system-list-flush, .is-style-system-badge, .is-style-outline, .is-style-system-tags) .tag-link-count {
    margin-inline-start: var(--wp--preset--spacing--10, 0.5rem);
}

/* Hide the parentheses structurally when badges are active */
:is(.is-style-system-list, .is-style-system-flat-list, .is-style-system-list-flush, .is-style-system-badge, .is-style-outline, .is-style-system-tags) :is(.wp-block-categories__count,
    .wp-block-archives__count,
    .tag-link-count,
    .wp-block-term-count,
    .wc-block-product-categories-list-item-count) .count-paren {
    display: none;
}

/* Woo emits count parentheses through pseudo-elements rather than markup. */
:is(.is-style-system-list, .is-style-system-flat-list, .is-style-system-list-flush, .is-style-system-badge) .wc-block-product-categories-list-item-count::before,
:is(.is-style-system-list, .is-style-system-flat-list, .is-style-system-list-flush, .is-style-system-badge) .wc-block-product-categories-list-item-count::after {
    content: none;
}
