/*
 * Tough Smudge Desktop Logo v1.0.5
 *
 * The desktop logo layout and responsive-navigation state now share one
 * breakpoint. The standard header is static below 1200px, preventing content
 * from scrolling underneath it. At phone/tablet widths the closed responsive
 * menu is hidden and its hamburger opener is explicitly available.
 */

[data-ts-desktop-logo-layout="1"],
[data-ts-desktop-logo="1"],
[data-ts-desktop-logo="1"] > a,
[data-ts-desktop-logo="1"] .custom-logo-link,
[data-ts-desktop-logo="1"] img {
    box-sizing: border-box !important;
}

@media (max-width: 1199px) {
    [data-ts-responsive-header-shell="1"],
    [data-ts-responsive-header="1"],
    [data-ts-responsive-header-layout="1"] {
        position: static !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        inset: auto !important;
        transform: none !important;
    }

    [data-ts-responsive-header-shell="1"],
    [data-ts-responsive-header="1"] {
        z-index: auto !important;
    }

    /* WordPress Navigation block: closed state and hamburger control. */
    [data-ts-responsive-navigation="1"] .wp-block-navigation__responsive-container-open {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-inline: auto !important;
    }

    [data-ts-responsive-navigation="1"] .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* The full-screen panel is used only after the visitor presses hamburger. */
    [data-ts-responsive-navigation="1"] .wp-block-navigation__responsive-container.is-menu-open {
        display: flex !important;
        visibility: visible !important;
        pointer-events: auto !important;
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        z-index: 100000 !important;
    }

    [data-ts-responsive-navigation="1"] .wp-block-navigation__responsive-container.is-menu-open
        .wp-block-navigation__responsive-container-close {
        display: flex !important;
    }

    [data-ts-responsive-navigation="1"] {
        position: relative !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

/*
 * Extend the established mobile stack through portrait-tablet and narrow
 * desktop widths. Phones at 900px and below continue to use the theme's own
 * existing mobile geometry.
 */
@media (min-width: 901px) and (max-width: 1199px) {
    [data-ts-tablet-header-layout="1"] {
        box-sizing: border-box !important;
    }

    [data-ts-tablet-header-layout="1"] .wp-block-navigation__responsive-container-open {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}
