/* =========================================================
   LINUMEDIA
   GLOBAL HEADER + NAVIGATION
   DEFAULT ROCKFIELD FOOTER REMOVED
   ========================================================= */


/* =========================================================
   GLOBAL LOGO
========================================================= */

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

    margin: 0 !important;
    padding: 0 !important;
}


.custom-logo-link {
    display: flex !important;
    align-items: center !important;

    margin: 0 !important;
    padding: 0 !important;

    line-height: 0 !important;
}


.custom-logo-link img,
.custom-logo,
.site-logo img {
    display: block !important;

    width: 180px !important;
    max-width: 180px !important;

    height: auto !important;
    max-height: 50px !important;

    object-fit: contain !important;
    object-position: left center !important;

    margin: 0 !important;
    padding: 0 !important;
}


/* =========================================================
   DESKTOP HEADER
   FULL-WIDTH BACKGROUND
   LOGO ALIGNED WITH HERO COPY
========================================================= */

@media screen and (min-width: 769px) {

    /*
     * Header stays at Rockfield's original height.
     * Only positioning/background are changed.
     */
    .site-header {
        position: relative !important;

        display: flex !important;
        align-items: center !important;

        width: 100% !important;
        max-width: none !important;

        margin: 0 !important;
        padding-left: 19.3vw !important;
        padding-right: 60px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;

        box-sizing: border-box !important;

        background: #141414 !important;
    }


    /* Remove width restrictions from Rockfield wrapper */
    .site-header .wrapper,
    .site-header .site-header-wrapper,
    .site-header .header-wrapper,
    .site-header .header-inner {
        width: 100% !important;
        max-width: none !important;

        margin: 0 !important;
        padding: 0 !important;

        box-sizing: border-box !important;
    }


    /* Logo */
    .site-branding {
        display: flex !important;
        align-items: center !important;

        margin: 0 auto 0 0 !important;
        padding: 0 !important;
    }


    .custom-logo-link {
        height: 50px !important;
    }


    /* Navigation remains towards right */
    .main-navigation {
        display: flex !important;
        align-items: center !important;

        margin-left: auto !important;
        margin-right: 0 !important;

        padding: 0 !important;

        align-self: stretch !important;
    }


    .main-navigation > div {
        display: flex !important;
        align-items: center !important;

        height: 100% !important;
    }


    .main-navigation ul,
    .main-navigation .menu,
    .main-navigation .nav-menu {
        display: flex !important;
        align-items: center !important;

        height: 100% !important;

        margin: 0 !important;
        padding: 0 !important;
    }


    .main-navigation li {
        display: flex !important;
        align-items: center !important;

        height: 100% !important;

        margin: 0 !important;
    }


    .main-navigation a {
        display: flex !important;
        align-items: center !important;

        height: 100% !important;
    }

}


/* =========================================================
   BLACK HEADER BACKGROUND FULL BLEED
   WITHOUT CHANGING HEADER WIDTH / HEIGHT
========================================================= */

.site-header::before {
    content: "";
    position: absolute;

    top: 0;
    bottom: 0;

    left: 50%;
    width: 100vw;

    transform: translateX(-50%);

    background: #141414;

    z-index: -1;
    pointer-events: none;
}


/* =========================================================
   REMOVE GAP BETWEEN HEADER AND HERO
========================================================= */

.site-header + *,
.site-header + .site-content,
.site-header + #content,
#masthead + *,
#masthead + .site-content,
#masthead + #content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
/* =========================================================
   MOBILE HEADER
========================================================= */

@media screen and (max-width: 768px) {

    .site-header {
        position: relative !important;

        display: flex !important;
        align-items: center !important;

        padding-left: 10px !important;
        padding-right: 10px !important;

        box-sizing: border-box !important;
    }


    .site-header .wrapper,
    .site-header .site-header-wrapper,
    .site-header .header-wrapper,
    .site-header .header-inner {
        width: 100% !important;

        margin: 0 !important;

        padding-left: 0 !important;
        padding-right: 0 !important;
    }


    /* -----------------------------------------------------
       MOBILE LOGO
    ----------------------------------------------------- */

    .custom-logo-link {
        height: 42px !important;
    }


    .custom-logo-link img,
    .custom-logo,
    .site-logo img {
        width: 150px !important;
        max-width: 150px !important;

        height: auto !important;
        max-height: 42px !important;
    }


    /* -----------------------------------------------------
       NAVIGATION CONTAINER
    ----------------------------------------------------- */

    .main-navigation {
        position: static !important;

        margin-left: auto !important;
        margin-right: 0 !important;

        padding: 0 !important;

        height: auto !important;
        min-height: 0 !important;
    }


    /* -----------------------------------------------------
       RESET THEME MENU BUTTON
    ----------------------------------------------------- */

    .main-navigation input,
    .main-navigation button,
    .main-navigation .menu-toggle,
    .site-header input[aria-expanded],
    .site-header button[aria-expanded] {
        position: relative !important;

        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;

        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;

        margin: 0 !important;
        padding: 0 !important;

        border: 0 !important;
        outline: 0 !important;
        box-shadow: none !important;

        background: transparent !important;
        background-color: transparent !important;
        background-image: none !important;

        color: transparent !important;

        font-size: 0 !important;
        line-height: 0 !important;

        text-indent: -9999px !important;

        appearance: none !important;
        -webkit-appearance: none !important;

        cursor: pointer !important;
    }


    .main-navigation input:hover,
    .main-navigation input:focus,
    .main-navigation input:active,
    .main-navigation button:hover,
    .main-navigation button:focus,
    .main-navigation button:active {
        border: 0 !important;
        outline: 0 !important;
        box-shadow: none !important;

        background: transparent !important;
    }


    /* -----------------------------------------------------
       HIDE THEME MENU LABEL
    ----------------------------------------------------- */

    .main-navigation label,
    .main-navigation .menu-toggle span,
    .main-navigation .menu-toggle .menu-label,
    .main-navigation .menu-toggle .menu-text {
        font-size: 0 !important;
        color: transparent !important;

        border: 0 !important;
        background: transparent !important;

        box-shadow: none !important;

        padding: 0 !important;
        margin: 0 !important;
    }


    /* -----------------------------------------------------
       MOBILE MENU PANEL
    ----------------------------------------------------- */

    .main-navigation ul,
    .main-navigation .menu,
    .main-navigation .nav-menu {
        position: absolute !important;

        top: 100% !important;
        left: 0 !important;
        right: 0 !important;

        width: 100% !important;
        max-width: none !important;

        height: auto !important;
        min-height: 0 !important;

        margin: 0 !important;
        padding: 8px 0 !important;

        background: #000000 !important;

        box-sizing: border-box !important;

        z-index: 999 !important;
    }


    /* -----------------------------------------------------
       MOBILE MENU ITEMS
    ----------------------------------------------------- */

    .main-navigation li,
    .main-navigation .menu li,
    .main-navigation .nav-menu li {
        display: block !important;

        width: 100% !important;
        height: auto !important;

        margin: 0 !important;
        padding: 0 !important;

        float: none !important;
    }


    /* -----------------------------------------------------
       MOBILE MENU LINKS
    ----------------------------------------------------- */

    .main-navigation li a,
    .main-navigation .menu li a,
    .main-navigation .nav-menu li a {
        display: block !important;

        width: 100% !important;
        height: auto !important;

        margin: 0 !important;

        padding: 14px 20px !important;

        text-align: left !important;

        line-height: 1.3 !important;

        box-sizing: border-box !important;
    }


    .main-navigation li + li {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }


    /* -----------------------------------------------------
       USE ROCKFIELD'S NATIVE BURGER / X
       REMOVE OLD CUSTOM BURGER
    ----------------------------------------------------- */

    .main-navigation::before,
    .main-navigation::after {
        content: none !important;
        display: none !important;

        background: none !important;
        box-shadow: none !important;
    }

}



/* =========================================================
   MENU HOVER / ACTIVE COLOUR
   DESKTOP + MOBILE
========================================================= */

.main-navigation a:hover,
.main-navigation a:focus,
.main-navigation a:active,
.main-navigation li:hover > a,
.main-navigation li:focus-within > a {
    color: #7DB3B2 !important;
}


/* CURRENT PAGE */

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_ancestor > a {
    color: #7DB3B2 !important;
}


/* REMOVE THEME HOVER BACKGROUND */

.main-navigation a:hover,
.main-navigation a:focus,
.main-navigation a:active,
.main-navigation li:hover,
.main-navigation li:focus-within {
    background-color: transparent !important;
}



/* =========================================================
   REMOVE DEFAULT ROCKFIELD / WORDPRESS FOOTER
   CUSTOM .lm-footer IS NOT AFFECTED
========================================================= */

body footer.site-footer,
body #colophon {
    display: none !important;
}



/* =========================================================
   REMOVE WORDPRESS CREDIT ELEMENTS
   FALLBACK IN CASE THE THEME OUTPUTS THEM ELSEWHERE
========================================================= */

.site-info,
.site-info a,
.site-info .powered-by,
.powered-by-wordpress {
    display: none !important;
}
/* =========================================================
   HOME PAGE
   REMOVE COMMENTS / EXTRA SPACE BELOW CUSTOM FOOTER
========================================================= */

/* Remove WordPress comments area */
.home .comments-area,
.home #comments,
.home .comment-respond,
.home #respond {
    display: none !important;
}


/* Remove any spacing created by the comments container */
.home .comments-area,
.home #comments {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}


/* Make sure the homepage ends directly after content */
.home .site-main,
.home #primary,
.home .content-area,
.home .entry-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
/* =========================================================
   FINAL FIX
   REMOVE GAP BETWEEN HEADER AND HERO
   HOMEPAGE ONLY
========================================================= */

/* Header must end with zero bottom spacing */
.home .site-header,
.home #masthead,
.home .site-header .wrapper,
.home .site-header .site-header-wrapper,
.home .site-header .header-wrapper,
.home .site-header .header-inner {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}


/* Remove spacing from containers between header and page */
.home .site-content,
.home #content,
.home .content-area,
.home #primary,
.home .site-main,
.home article,
.home .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}


/* Gutenberg adds block spacing to first element */
.home .entry-content > :first-child,
.home .wp-block-post-content > :first-child {
    margin-top: 0 !important;
}


/* Remove WordPress flow-layout gap before first block */
.home .entry-content.is-layout-flow > :first-child,
.home .wp-block-post-content.is-layout-flow > :first-child {
    margin-block-start: 0 !important;
}


/* Remove paragraph / spacer accidentally sitting above hero */
.home .entry-content > .wp-block-spacer:first-child,
.home .wp-block-post-content > .wp-block-spacer:first-child {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* Make first Custom HTML / hero wrapper touch header */
.home .entry-content > .wp-block-html:first-child,
.home .wp-block-post-content > .wp-block-html:first-child {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}

/* =========================================================
   PROJECTS PAGE
   REMOVE WORDPRESS COMMENTS BELOW CUSTOM FOOTER
========================================================= */

/*
 * The Projects page is outputting the WordPress/Rockfield
 * comments area AFTER the custom Linumedia footer.
 *
 * Hide every comments wrapper used by WordPress/Rockfield.
 */

body.page-template-default:has(.lm-final-cta) .comments-area,
body.page-template-default:has(.lm-final-cta) #comments,
body.page-template-default:has(.lm-final-cta) .comment-respond,
body.page-template-default:has(.lm-final-cta) #respond,
body.page-template-default:has(.lm-final-cta) .comments-wrapper,
body.page-template-default:has(.lm-final-cta) .wp-block-comments,
body.page-template-default:has(.lm-final-cta) .wp-block-post-comments-form {
    display: none !important;

    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;

    margin: 0 !important;
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;

    padding: 0 !important;

    border: 0 !important;

    overflow: hidden !important;
}


/* =========================================================
   REMOVE SPACE RESERVED FOR COMMENTS
========================================================= */

body.page-template-default:has(.lm-final-cta) .site-main,
body.page-template-default:has(.lm-final-cta) #primary,
body.page-template-default:has(.lm-final-cta) .content-area,
body.page-template-default:has(.lm-final-cta) article,
body.page-template-default:has(.lm-final-cta) .entry-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}


/* =========================================================
   FINAL CUSTOM HTML BLOCK
========================================================= */

body.page-template-default:has(.lm-final-cta)
.entry-content > .wp-block-html:has(.lm-final-cta) {
    margin-bottom: 0 !important;
    margin-block-end: 0 !important;

    padding-bottom: 0 !important;
}


/* =========================================================
   CUSTOM FOOTER
========================================================= */

body.page-template-default:has(.lm-final-cta) .lm-final-cta,
body.page-template-default:has(.lm-final-cta) .lm-footer {
    margin-bottom: 0 !important;
}


/* =========================================================
   REMOVE DEFAULT THEME FOOTER
========================================================= */

body.page-template-default:has(.lm-final-cta) footer.site-footer,
body.page-template-default:has(.lm-final-cta) #colophon {
    display: none !important;

    margin: 0 !important;
    padding: 0 !important;

    height: 0 !important;
    min-height: 0 !important;
}
/* =========================================================
   LINUMEDIA
   REMOVE THEME GAP BELOW HEADER / MENU
========================================================= */

/* Main theme content wrapper */
#primary,
.site-main,
main.site-main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}


/* WordPress article/page wrapper */
.site-main > article,
#primary > article,
article.page,
article.hentry {
    margin-top: 0 !important;
    padding-top: 0 !important;
}


/* Main page content */
.entry-content,
.wp-block-post-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}


/* Remove Gutenberg first-block spacing */
.entry-content > *:first-child,
.wp-block-post-content > *:first-child {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}


/* Custom HTML block when it is first on the page */
.entry-content > .wp-block-html:first-child,
.wp-block-post-content > .wp-block-html:first-child {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}


/* Remove empty theme title/header area */
.entry-header:empty,
.page-header:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
}
/* =========================================================
   LINUMEDIA
   GLOBAL FOOTER / PAGE-END CLEANUP
========================================================= */


/* ---------------------------------------------------------
   1. REMOVE WORDPRESS / JETPACK COMMENTS AREA
   AFTER THE CUSTOM FOOTER
--------------------------------------------------------- */

.comments-area,
#comments,
.comment-respond,
#respond,
.wp-block-comments,
.wp-block-post-comments,
.wp-block-post-comments-form {
    display: none !important;

    margin: 0 !important;
    padding: 0 !important;

    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;

    overflow: hidden !important;
}


/* ---------------------------------------------------------
   2. REMOVE PAGE WRAPPER SPACE BELOW CUSTOM FOOTER
--------------------------------------------------------- */

body:has(.lm-footer) .site-main,
body:has(.lm-footer) #primary,
body:has(.lm-footer) .content-area,
body:has(.lm-footer) article,
body:has(.lm-footer) .hentry,
body:has(.lm-footer) .entry-content,
body:has(.lm-footer) .wp-block-post-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}


/* ---------------------------------------------------------
   3. REMOVE GUTENBERG MARGIN AROUND FOOTER HTML BLOCK
--------------------------------------------------------- */

.wp-block-html:has(.lm-footer) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;

    margin-block-start: 0 !important;
    margin-block-end: 0 !important;

    padding-bottom: 0 !important;
}


/* ---------------------------------------------------------
   4. REMOVE FLOW GAP AFTER FOOTER
--------------------------------------------------------- */

body:has(.lm-footer)
.is-layout-flow > .wp-block-html:has(.lm-footer),

body:has(.lm-footer)
.is-layout-constrained > .wp-block-html:has(.lm-footer) {
    margin-bottom: 0 !important;
    margin-block-end: 0 !important;
}


/* ---------------------------------------------------------
   5. FOOTER MUST BE THE VISUAL END OF PAGE
--------------------------------------------------------- */

body:has(.lm-footer) main,
body:has(.lm-footer) .site-content,
body:has(.lm-footer) #content {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}


/* ---------------------------------------------------------
   6. REMOVE EMPTY THEME ELEMENTS AFTER FOOTER
--------------------------------------------------------- */

body:has(.lm-footer) .entry-content > *:last-child,
body:has(.lm-footer) .wp-block-post-content > *:last-child {
    margin-bottom: 0 !important;
}


/* ---------------------------------------------------------
   MOBILE
--------------------------------------------------------- */

@media (max-width: 700px) {

    body:has(.lm-footer) .site-main,
    body:has(.lm-footer) #primary,
    body:has(.lm-footer) .content-area,
    body:has(.lm-footer) article,
    body:has(.lm-footer) .hentry,
    body:has(.lm-footer) .entry-content,
    body:has(.lm-footer) .wp-block-post-content,
    body:has(.lm-footer) main,
    body:has(.lm-footer) .site-content,
    body:has(.lm-footer) #content {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }


    .comments-area,
    #comments,
    .comment-respond,
    #respond,
    .wp-block-comments,
    .wp-block-post-comments,
    .wp-block-post-comments-form {
        display: none !important;

        margin: 0 !important;
        padding: 0 !important;

        height: 0 !important;
        min-height: 0 !important;

        overflow: hidden !important;
    }

}
/* =========================================================
   HOMEPAGE MOBILE
   REMOVE SPACE AFTER CUSTOM FOOTER
========================================================= */

@media (max-width: 700px) {

    /* Remove comments and every comments wrapper */
    .home .comments-area,
    .home #comments,
    .home .comment-respond,
    .home #respond,
    .home .wp-block-comments,
    .home .wp-block-post-comments,
    .home .wp-block-post-comments-form {
        display: none !important;

        margin: 0 !important;
        padding: 0 !important;

        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;

        border: 0 !important;

        overflow: hidden !important;
    }


    /* Remove WordPress space after page content */
    .home #primary,
    .home .content-area,
    .home .site-main,
    .home article,
    .home .hentry,
    .home .entry-content,
    .home .wp-block-post-content {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }


    /* Remove theme content-container bottom spacing */
    .home #content,
    .home .site-content {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }


    /* Last Gutenberg block must not create a bottom gap */
    .home .entry-content > *:last-child,
    .home .wp-block-post-content > *:last-child {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }


    /* Collapse any comments container immediately after article */
    .home article + .comments-area,
    .home article ~ .comments-area,
    .home article + #comments,
    .home article ~ #comments {
        display: none !important;

        margin: 0 !important;
        padding: 0 !important;

        height: 0 !important;
        min-height: 0 !important;
    }

}