/* Atmosphere Responsive Site Fix 1.1.0
 * Targeted to the existing Gutenberg/GutenTools markup and ACRF form classes.
 */

/* The current header logo is an alignleft figure. Remove only that float so the
 * header owns its real height and following page content cannot wrap beside it. */
#sticky-header {
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 0 !important;
    height: auto !important;
    clear: both;
    overflow: visible;
    z-index: 1000;
}

#sticky-header > .wp-block-image.alignleft {
    float: none !important;
    display: block !important;
    flex: 0 1 auto;
    width: auto !important;
    margin: 0 !important;
    line-height: 0;
}

#sticky-header > .wp-block-image.alignleft > img,
#sticky-header img.wp-image-96 {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: min(264px, 100%) !important;
    object-fit: contain !important;
}

/* The form page currently follows the floated header and collapses to 76px on
 * a 390px viewport. Force only this template's content back into normal flow. */
body.page-template-schedule-consultation .wp-block-post-content,
body.page-template-schedule-consultation .entry-content,
body.page-template-schedule-consultation .acrf-page,
.acrf-page {
    box-sizing: border-box;
    clear: both !important;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.page-template-schedule-consultation .acrf-page,
.acrf-page {
    padding-top: clamp(32px, 7vw, 96px) !important;
    overflow-x: clip !important;
}

body.page-template-schedule-consultation .acrf-form,
.acrf-page .acrf-form {
    width: min(1120px, calc(100% - 28px)) !important;
    max-width: 1120px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.page-template-schedule-consultation .acrf-grid,
body.page-template-schedule-consultation .acrf-choice-grid,
body.page-template-schedule-consultation .acrf-option-grid,
body.page-template-schedule-consultation .acrf-service-grid,
body.page-template-schedule-consultation .acrf-section,
.acrf-page .acrf-grid,
.acrf-page .acrf-choice-grid,
.acrf-page .acrf-option-grid,
.acrf-page .acrf-service-grid,
.acrf-page .acrf-section {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.page-template-schedule-consultation .acrf-page input,
body.page-template-schedule-consultation .acrf-page select,
body.page-template-schedule-consultation .acrf-page textarea,
body.page-template-schedule-consultation .acrf-page button,
.acrf-page input,
.acrf-page select,
.acrf-page textarea,
.acrf-page button {
    max-width: 100%;
}

/* Preserve the native dimensions of ordinary images and branded graphics.
 * Cover backgrounds are intentionally excluded because they are decorative. */
.wp-site-blocks figure.wp-block-image img,
.wp-site-blocks img.wp-image-94,
.wp-site-blocks img.wp-image-96,
.wp-site-blocks img.wp-image-88,
.wp-site-blocks img.wp-image-111 {
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

/* Fallback menu appears only when a custom template omitted Navigation entirely. */
.asrf-fallback-nav {
    margin-left: auto;
    color: #ebc310;
    font-family: inherit;
    line-height: 1.25;
}

.asrf-fallback-nav__toggle {
    display: none;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid currentColor;
    border-radius: 6px;
    padding: 8px 10px;
    color: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.asrf-fallback-nav__links {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.asrf-fallback-nav a {
    color: inherit;
    text-decoration: none;
}

/* Verified clickable QR badges, placed once in the existing footer contact area. */
.asrf-qr-links {
    display: grid;
    grid-template-columns: minmax(200px, 230px);
    gap: 18px;
    align-items: start;
    justify-items: start;
    margin: 30px 0;
}

.asrf-qr-badge {
    display: grid;
    gap: 10px;
    justify-items: center;
    width: 100%;
    border-radius: 12px;
    color: #0a2d80 !important;
    background: #fff;
    text-align: center;
    text-decoration: none !important;
}

.asrf-qr-badge:focus-visible {
    outline: 4px solid #ebc310;
    outline-offset: 5px;
}

.asrf-qr-badge__image {
    display: block;
    width: 100%;
    height: auto !important;
    max-width: 230px !important;
    aspect-ratio: 6 / 7;
    object-fit: contain !important;
    border-radius: 12px;
}

.asrf-qr-badge__text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 14px;
    color: #fff;
    background: #0a2d80;
    border-radius: 8px;
    font-weight: 700;
}

@media (max-width: 782px) {
    #sticky-header {
        padding: 6px 12px !important;
        gap: 10px;
    }

    #sticky-header > .wp-block-image.alignleft > img,
    #sticky-header img.wp-image-96 {
        max-width: min(170px, 58vw) !important;
    }

    .asrf-fallback-nav__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .asrf-fallback-nav__links {
        display: none;
        position: absolute;
        top: 100%;
        right: 10px;
        z-index: 1001;
        width: min(300px, calc(100vw - 20px));
        border: 1px solid rgba(235, 195, 16, 0.7);
        border-radius: 8px;
        padding: 10px;
        background: #071f62;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    }

    .asrf-fallback-nav.is-open .asrf-fallback-nav__links {
        display: grid;
    }

    .asrf-fallback-nav__links a {
        display: block;
        min-height: 44px;
        padding: 12px 10px;
    }

    .asrf-qr-links {
        grid-template-columns: 1fr;
        justify-items: center;
        width: 100%;
    }

    .asrf-qr-badge,
    .asrf-qr-badge__image {
        max-width: 280px !important;
    }

    footer.wp-block-template-part .wp-block-columns {
        display: block !important;
    }

    footer.wp-block-template-part .wp-block-columns > .wp-block-column {
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .wp-block-columns:not(.is-not-stacked-on-mobile) {
        flex-wrap: wrap !important;
    }

    .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
        flex-basis: 100% !important;
        min-width: 0 !important;
    }

    body.page-template-schedule-consultation .acrf-two,
    body.page-template-schedule-consultation .acrf-address-grid,
    body.page-template-schedule-consultation .acrf-choice-grid,
    body.page-template-schedule-consultation .acrf-option-grid,
    body.page-template-schedule-consultation .acrf-service-grid,
    .acrf-page .acrf-two,
    .acrf-page .acrf-address-grid,
    .acrf-page .acrf-choice-grid,
    .acrf-page .acrf-option-grid,
    .acrf-page .acrf-service-grid {
        grid-template-columns: 1fr !important;
    }

    body.page-template-schedule-consultation .acrf-section h2,
    .acrf-page .acrf-section h2 {
        width: calc(100% - 28px) !important;
        max-width: 660px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow-wrap: normal;
        word-break: normal;
    }
}

@media (max-width: 480px) {
    #sticky-header > .wp-block-image.alignleft > img,
    #sticky-header img.wp-image-96 {
        max-width: min(145px, 52vw) !important;
    }

    body.page-template-schedule-consultation .acrf-page,
    .acrf-page {
        padding-top: 32px !important;
    }

    body.page-template-schedule-consultation .acrf-form,
    .acrf-page .acrf-form {
        width: calc(100% - 20px) !important;
    }
}
