/* Audace — Front styles */

/* Available viewport height = 100vh - admin bar - site header. */
:root {
    --audace-viewport-h: calc(100vh - var(--wp-admin--admin-bar--height, 0px) - var(--audace-header-h, 0px));
}


/********* VERTICAL SLIDES ***********/
.is-style-slides-container > * {
    position: -webkit-sticky;
    position: sticky;
    z-index: 1;
    top: calc(0px + var(--wp-admin--admin-bar--height, 0px) + var(--audace-header-h, 0px));
}

.has-audace-full-height .wp-block-cover {
    height: var(--audace-viewport-h);
}

@media (max-width: 782px) {

    .has-audace-full-height:has(.wp-block-cover.is-style-bottom-sticky) {
        position: relative;
        top: unset;
    }

    .has-audace-full-height:has(.wp-block-cover.is-style-bottom-sticky) .wp-block-cover {
        max-height:40vh;
    }

    .has-audace-full-height:has(.wp-block-cover.is-style-bottom-sticky) .wp-block-column:first-child {
        min-height: calc(var(--audace-viewport-h) - 40vh);
    }

    .has-audace-full-height:has(.wp-block-cover.is-style-bottom-sticky) .wp-block-column:nth-child(2) {
        max-height: 40vh;
        position: -webkit-sticky;
        position: sticky;
        bottom: 0;
        overflow: hidden;
    }

}

/* Covers */
.wp-block-cover, .wp-block-cover-image {
    padding: 0;
}

.wp-block-cover.is-style-bottom-sticky,
.wp-block-cover-image.is-style-bottom-sticky {
    position: -webkit-sticky;
    position: sticky;
    bottom: 0;
}

/* Clean no margin */
:where(.wp-site-blocks) > *,
:root :where(.is-layout-constrained) > *  {
    margin-block-start: 0;
    margin-block-end: 0;
}

/* ---------- Columns: lock width regardless of inner content/padding ---------- */
@media (min-width: 782px) {
    .wp-block-columns > .wp-block-column[style*="width"] {
        flex: 0 0 auto !important;
        flex-basis: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box !important;
        overflow-wrap: break-word;
    }
}

/* ---------- Hide-title: also hide a container that only wraps the title ---------- */
.audace-title-hidden :is(.wp-block-group, .wp-block-cover, header, section):has(> .audace-hidden-title:only-child) {
    display: none;
}

/* ---------- Full-height (core/columns, core/cover) ---------- */
.has-audace-full-height {
    min-height: var(--audace-viewport-h);
}

/* Admin bar height as CSS var (front side).
 * WP defaults: 32px desktop, 46px between 601-782px, hidden ≤ 600px. */
body.admin-bar { --wp-admin--admin-bar--height: 32px; }
@media (max-width: 782px) {
    body.admin-bar { --wp-admin--admin-bar--height: 46px; }
}
@media (max-width: 600px) {
    body.admin-bar { --wp-admin--admin-bar--height: 0px; }
}

/* ---------- Custom CTA style on navigation links ---------- */
.wp-block-navigation-item.is-style-audace-button > .wp-block-navigation-item__content {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--base);
    padding: 0.6rem 1.2rem;
    border-radius: 0;
    font-weight: 600;
    text-decoration: none;
}
.wp-block-navigation-item.is-style-audace-button > .wp-block-navigation-item__content:hover {
    background: var(--wp--preset--color--accent);
}

/* ---------- Custom nav icon ---------- */
.wp-block-navigation__responsive-container-open .audace-nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: block;
}

/* ---------- Menu overlay ---------- */
.audace-menu-overlay[hidden] { display: none !important; }

.audace-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--wp--preset--color--base);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.audace-menu-overlay__inner {
    min-height: 100%;
}

.audace-menu-overlay__close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
    line-height: 1;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.audace-menu-overlay__close:hover { opacity: 0.7; }

/* When open, hide the native Navigation overlay panel so only ours shows. */
html.audace-overlay-open .wp-block-navigation__responsive-container.is-menu-open {
    display: none !important;
}

/* Push overlay below admin bar when logged in. */
body.admin-bar .audace-menu-overlay {
    top: var(--wp-admin--admin-bar--height, 32px);
}
body.admin-bar .audace-menu-overlay__close {
    top: calc(var(--wp-admin--admin-bar--height, 32px) + 1rem);
}

