/**
 * Theme:	Flat Blocks
 * File:	custom-fixedheader.css
 * 
 * The stylesheet for the theme's custom fixed header and fixed navigation menus
 * 
 * NOTE: These are ONLY the styles for the front-end. Styles for both front-end and
 * the Block Editor are in the main flat-blocks.css file.
 *
 * @package flat-blocks
 * @since 	1.0
 */

/*--------------------------------------------------------------
# Fixed Header: Front-end Styles
--------------------------------------------------------------*/
.wp-block-group.is-style-fixed-header {
    position: fixed;
    top: 0;
	left: 0;
	right: 0;
    z-index: 10;
    margin-top: 0;
}

/* Adjust fixed header position so its underneath the WordPress admin bar */
.admin-bar .is-style-fixed-header {
  top: var(--wp-admin--admin-bar--height, 32px);
}

/* Fix WordPress Admin bar on phones not sticking to the top 
 *
 * Note to theme reviewers, this issues a warning but is actually fixing an issue
 * in core WordPress v6.0. It is not hiding the admin bar like the warning indicates.
 */
@media screen and (max-width: 600px) {
    #wpadminbar {
        position: fixed;
    }
}

/*--------------------------------------------------------------
# Fixed Navigation Menu: Front-end Styles
--------------------------------------------------------------*/

.wp-block-navigation.is-style-fixed-menu {
    position: fixed;
    top: var(--wp--preset--spacing--60);
    right: max(calc(0.5 * (100% - var(--wp--style--global--wide-size))), var(--wp--style--root--padding-left, calc(2 * var(--wp--preset--spacing--50)) ) );
    left: auto;
    z-index: 10;
}

/* Adjust fixed header position so its underneath the WordPress admin bar */
.admin-bar .is-style-fixed-menu {
  top: calc( var(--wp--preset--spacing--60) + var(--wp-admin--admin-bar--height, 0) );
}

.is-content-justification-left > .wp-block-navigation.is-style-fixed-menu,
.is-content-justification-left > .wp-block-template-part > .wp-block-navigation.is-style-fixed-menu {
    left: max(calc(0.5 * (100% - var(--wp--style--global--wide-size))), var(--wp--style--root--padding-left, calc(2 * var(--wp--preset--spacing--50)) ) );
    right: auto;
}

.wp-block-navigation.is-style-fixed-menu .wp-block-navigation__responsive-container {
	right: 0;
	left: unset;
}