/*--------------------------------------------------------------
# Imports
--------------------------------------------------------------*/
@import "_navigation.css";

/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
.site-header-wrapper {
    position: relative;
    margin: 0;
    padding-top: 5px;
    padding-bottom: 5px;
    border-top: 0;
    background: var(--color-header-bg);
    min-height: 51px;
    z-index: 999;
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 5px 10px 0 rgba(189, 189, 189, 0.15);
}

.sticky-header .site-header-wrapper.has-sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
}

@media (max-width: 767px) {
    .site-header-wrapper {
        z-index: 9999;
    }
}

.sticky-header .site-header-wrapper.has-sticky-header {
    box-shadow: 0 1px 0 0 rgba(206, 206, 206, 0.05), 0 5px 10px 0 rgba(132, 132, 132, 0.15);
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.header-image {
    margin: 0 auto;
}

.header-image img {
    display: block;
    margin: 0 auto;
}

.custom-logo-link {
    display: block;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-logo-wrapper>a {
    margin-right: 15px;
}

.site-branding img {
    width: auto;
    max-height: 64px;
    object-fit: contain;
}

/* Dark-mode logo swap. Both <img> render in the same anchor; CSS shows
   the right one based on the resolved color mode. The visitor's explicit
   light / dark choice always wins over the body class that marks the
   active style preset itself as dark - otherwise picking "Dark"
   variation locks the logo regardless of the visitor's toggle (the
   symptom on BuddyX free 5.1.0 release-review). Cascade reads as:
     1. Default - light logo visible, dark logo hidden.
     2. Body.buddyx-dark-style-variation - admin picked a Dark variation;
        becomes the dark default when visitor hasn't overridden.
     3. Visitor explicit light / dark - wins via higher-specificity
        selector chain (:root[data-bx-mode="..."] body .custom-logo--*).
     4. Auto + prefers-color-scheme - OS preference decides only when
        visitor hasn't pinned a mode. Always overrides the body class
        because the visitor opted into "let the OS decide". */
.custom-logo--dark {
    display: none;
}

/* Admin's "Dark variation" default - applies when visitor has no
   explicit mode override (data-bx-mode unset or "auto"). */
body.buddyx-dark-style-variation .custom-logo--light {
    display: none;
}

body.buddyx-dark-style-variation .custom-logo--dark {
    display: inline-block;
}

/* Visitor explicit light always wins. The body descendant in the
   selector chain bumps specificity to (0,3,2), one above the body-class
   rule (0,2,1), so the body-class default cannot clobber a visitor's
   light toggle even when the Dark variation is active. */
:root[data-bx-mode="light"] body .custom-logo--light {
    display: inline-block;
}

:root[data-bx-mode="light"] body .custom-logo--dark {
    display: none;
}

/* Visitor explicit dark always wins (same specificity ladder). */
:root[data-bx-mode="dark"] body .custom-logo--light {
    display: none;
}

:root[data-bx-mode="dark"] body .custom-logo--dark {
    display: inline-block;
}

/* Auto mode: OS preference decides. Both branches are wired so an
   OS-light visitor never inherits the dark variation's logo (the
   visitor opted into "follow my OS", not "follow the admin"). */
@media (prefers-color-scheme: dark) {
    :root[data-bx-mode="auto"] body .custom-logo--light {
        display: none;
    }

    :root[data-bx-mode="auto"] body .custom-logo--dark {
        display: inline-block;
    }
}

@media (prefers-color-scheme: light) {
    :root[data-bx-mode="auto"] body .custom-logo--light {
        display: inline-block;
    }

    :root[data-bx-mode="auto"] body .custom-logo--dark {
        display: none;
    }
}

.site-title {
    margin: 0;
    margin-bottom: 6px;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-site-title);
}

.site-title a {
    text-decoration: none;
    color: var(--color-site-title);
}

.site-title:hover,
.site-title a:hover {
    color: var(--color-site-title-hover);
}

.site-description {
    margin: -5px 0 0;
    font-size: 14px;
    font-weight: inherit;
    line-height: 1.4;
    word-wrap: break-word;
    color: var(--color-site-tagline);
}

nav div.wp-block-navigation__responsive-dialog {

	@media (--narrow-menu-query) {
		margin: 1em;
	}
}



/*--------------------------------------------------------------
# Site Sub Header Layout
--------------------------------------------------------------*/

.bp-user .site-sub-header,
.single-item.groups .site-sub-header,
.group-create .site-sub-header {
    display: none;
}

.site-sub-header {
    position: relative;
    color: var(--bx-color-subheader-fg, var(--color-subheader-title));
    margin-bottom: 1rem;
    padding: 30px 0;
    background: var(--bx-color-subheader-bg, #f3f4f6);
    /* Full-bleed band (matches site header + footer behavior) regardless of
     * boxed/full-width layout. The 100vw + negative margin trick spans
     * viewport width even when ancestor is constrained. */
    width: 100vw;
    margin-left: -50vw;
    left: 50%;
}

.site-sub-header>.container,
.site-sub-header .woocommerce-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-flow: row wrap;
    padding: 0 15px;
}

.site-sub-header .woocommerce-products-header {
    width: 100%;
    padding: 0;
}

.site-sub-header>.container::before {
    content: none;
}

@media (max-width: 991px) {
    .site-sub-header>.container {
        padding: 0 20px;
    }
}

.archive-description p {
    margin: 0;
}

.site-sub-header .entry-header .entry-title,
.site-sub-header .page-header .page-title,
.site-sub-header .entry-header,
.site-sub-header .page-header,
.site-sub-header .entry-title,
.site-sub-header .page-title {
    position: relative;
    margin: 0;
    z-index: 1;
}

.site-sub-header .entry-title,
.site-sub-header .page-title,
.site-sub-header .page-header,
.site-sub-header .entry-header-title {
    color: var(--color-subheader-title);
    margin-right: auto;
}

.site-sub-header .entry-title a,
.site-sub-header .page-title a,
.site-sub-header .page-header a,
.site-sub-header .entry-header-title a {
    color: inherit;
}

@media (--narrow-menu-query) {

    .site .site-sub-header .entry-title,
    .site .site-sub-header .page-title {
        font-size: 24px;
    }
}


/*--------------------------------------------------------------
# Breadcrumbs
--------------------------------------------------------------*/

.buddyx-breadcrumbs,
#breadcrumbs {
    font-size: 14px;
    margin: 0;
}

.buddyx-breadcrumbs a,
#breadcrumbs a {
    color: var(--color-theme-primary);
}

.buddyx-breadcrumbs a:hover,
#breadcrumbs a:hover {
    text-decoration: underline;
}

.buddyx-trail-items {
    list-style: none;
}

.buddyx-trail-items,
.buddyx-trail-items li {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: none;
    background: inherit;
    text-indent: 0;
}

.buddyx-trail-items li:not(.trail-end)::after {
    padding: 0 0.3em;
    content: "\00bb";
}
