/* WordPress ↔ Ghost class bridges (visual parity with Ghost marccoup theme). */

/* Site Identity icon (Ghost .site-brand__icon). Reinforced for WP img defaults. */
.site-brand .site-brand__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
}

.site-brand--icon-only .site-brand__icon {
    width: 32px;
    height: 32px;
}

.site-nav .current-menu-item a,
.site-nav .current_page_item a {
    color: var(--leaf-text);
}

.site-footer__nav .current-menu-item a,
.site-footer__nav .current_page_item a {
    color: var(--leaf-accent);
}

.site-nav .nav {
    list-style: none;
}

.site-search-form--panel {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 861px) {
    .site-search-form--panel.is-visible {
        position: static;
        width: auto;
        height: auto;
        margin: 0 0 1rem;
        clip: auto;
        overflow: visible;
    }

    .site-search-form--panel .search-field {
        border-bottom: 1px dashed color-mix(in srgb, var(--leaf-accent) 35%, var(--leaf-border));
    }

    .site-search-form--panel .search-field:focus {
        outline: none;
        border-bottom-color: color-mix(in srgb, var(--leaf-accent) 55%, var(--leaf-border));
    }
}

@media (max-width: 860px) {
    .site-search-form--panel {
        display: none;
    }
}

.site-search-form--chrome {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.75rem var(--leaf-space) 0.85rem;
    clip: auto;
    overflow: visible;
}

.site-search-form--chrome .search-field {
    width: 100%;
}

.site-chrome-search {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    background: color-mix(in srgb, var(--leaf-bg) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
    backdrop-filter: saturate(1.2) blur(10px);
    transition: grid-template-rows 0.22s ease;
}

.site-chrome-search:not(.is-open) {
    pointer-events: none;
}

.site-chrome-search.is-open {
    grid-template-rows: 1fr;
    pointer-events: auto;
}

.site-chrome-search__inner {
    min-height: 0;
    overflow: hidden;
}

.site-chrome-search__inner .site-search-form--chrome {
    opacity: 0;
    transition: opacity 0.22s ease;
}

.site-chrome-search.is-open .site-chrome-search__inner .site-search-form--chrome {
    opacity: 1;
}

.site-chrome-search.is-open {
    border-bottom: 1px solid var(--leaf-border);
}

.site-search-form--chrome .search-field {
    border-bottom: 1px dashed color-mix(in srgb, var(--leaf-accent) 35%, var(--leaf-border));
}

.site-search-form .search-field {
    width: 100%;
    padding: 0.35rem 0 0.5rem;
    border: 0;
    background: transparent;
    font-family: var(--leaf-font-ui);
    font-size: 0.875rem;
    color: var(--leaf-text);
}

.site-search-form--chrome .search-field:focus {
    outline: none;
    border-bottom-color: color-mix(in srgb, var(--leaf-accent) 55%, var(--leaf-border));
}

.site-search-form .search-submit {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .site-chrome-search,
    .site-chrome-search__inner .site-search-form--chrome {
        transition: none;
    }
}

/*
 * Logged-in view: offset sticky chrome and nav panel under the WP admin bar.
 */
@media (min-width: 861px) {
    body.admin-bar .site-body {
        min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
    }

    body.admin-bar .site-sidebar {
        top: var(--wp-admin--admin-bar--height, 32px);
        height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
    }

    body.admin-bar .site-sidebar__tab--expand {
        top: calc(var(--wp-admin--admin-bar--height, 32px) + var(--leaf-nav-tab-offset));
    }

    body.admin-bar .site-sidebar__tab--collapse {
        top: calc(var(--wp-admin--admin-bar--height, 32px) + var(--leaf-nav-tab-collapse-offset));
    }
}

@media (max-width: 860px) {
    body.admin-bar .site-chrome {
        top: var(--wp-admin--admin-bar--height, 32px);
    }

    body.admin-bar .site-sidebar__panel {
        top: calc(var(--leaf-header-height) + var(--wp-admin--admin-bar--height, 32px));
    }

    body.is-nav-open {
        overflow: hidden;
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-chrome {
        top: var(--wp-admin--admin-bar--height, 46px);
    }

    body.admin-bar .site-sidebar__panel {
        top: calc(var(--leaf-header-height) + var(--wp-admin--admin-bar--height, 46px));
    }
}

@media screen and (max-width: 600px) {
    body.admin-bar .site-chrome {
        top: 0;
    }

    body.admin-bar .site-sidebar__panel {
        top: var(--leaf-header-height);
    }
}

.search-empty {
    margin: 0;
    color: var(--leaf-text-muted);
    font-size: 1.0625rem;
    line-height: 1.55;
}

.theme-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
    margin-bottom: 0.15rem;
}

.theme-switcher__btn {
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--leaf-border);
    border-radius: var(--leaf-radius);
    background: transparent;
    color: var(--leaf-text-muted);
    font-family: var(--leaf-font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.theme-switcher__btn:hover {
    border-color: color-mix(in srgb, var(--leaf-accent) 40%, var(--leaf-border));
    color: var(--leaf-text);
}

.theme-switcher__btn[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--leaf-accent) 55%, var(--leaf-border));
    background: color-mix(in srgb, var(--leaf-accent) 12%, transparent);
    color: var(--leaf-accent);
}
