/*
Theme Name:   MatterMint Theme
Theme URI:    https://mattermint.com
Description:  Custom theme for MatterMint connected legal workspace.
Author:       MatterMint
Version:      1.0.4
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain:  mattermint-theme
*/

/* WordPress Alignment and Core resets for full-width layout */
html, body {
    margin: 0;
    padding: 0;
}

body .is-layout-flow > * {
    margin-block-start: 0;
    margin-block-end: 0;
}

/* Ensure editor and frontend full width for custom blocks */
.wp-site-blocks,
main.wp-block-group {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Global Fixed Navigation Clearance Across All Pages
   ========================================================================== */
:root {
    --navbar-height: 72px;
    --navbar-top-offset: 14px;
    --navbar-clearance: 110px;
}

/* Add navbar spacing for main content across all pages */
main.wp-block-group {
    padding-top: var(--navbar-clearance, 110px);
    box-sizing: border-box;
}

/* Reset padding on front page or when page begins with full-bleed hero */
body.home main.wp-block-group,
main.wp-block-group:has(> .hero:first-child),
main.wp-block-group:has(> .wp-block-mattermint-hero-clean:first-child) {
    padding-top: 0;
}

/* WordPress Admin Bar Compatibility */
body.admin-bar #nav:not(.nav-docked) {
    top: calc(14px + 32px);
}

body.admin-bar main.wp-block-group {
    padding-top: calc(var(--navbar-clearance, 110px) + 32px);
}

body.admin-bar.home main.wp-block-group,
body.admin-bar main.wp-block-group:has(> .hero:first-child),
body.admin-bar main.wp-block-group:has(> .wp-block-mattermint-hero-clean:first-child) {
    padding-top: 0;
}

@media screen and (max-width: 991px) {
    :root {
        --navbar-clearance: 96px;
    }
}

@media screen and (max-width: 782px) {
    :root {
        --navbar-clearance: 88px;
    }

    body.admin-bar #nav:not(.nav-docked) {
        top: calc(14px + 46px);
    }

    body.admin-bar main.wp-block-group {
        padding-top: calc(var(--navbar-clearance, 88px) + 46px);
    }

    body.admin-bar.home main.wp-block-group,
    body.admin-bar main.wp-block-group:has(> .hero:first-child),
    body.admin-bar main.wp-block-group:has(> .wp-block-mattermint-hero-clean:first-child) {
        padding-top: 0;
    }
}