.wp-block-amphibee-text-image {
    margin: 0 auto !important;
}

.wp-block-amphibee-text-image.alignwide {
    max-width: var(--gbg-wide-width) !important;
}

.wp-block-amphibee-text-image:not(.alignwide):not(.w-large) .text-image-wrapper {
    max-width: var(--gbg-wide-width);
    margin: 0 auto;
}

@media screen and (min-width: 998px) {
    .wp-block-amphibee-text-image.w-large .text-image-wrapper {
        max-width: var(--gbg-header-width);
        margin: auto;
    }
}

.wp-block-amphibee-text-image {
    padding: 0 !important;
}

.wp-block-amphibee-text-image:not(.alignwide).wp-block {
    max-width: inherit;
}

.wp-block-amphibee-text-image .text-image-wrapper {
    padding: 48px 32px;
}

/* Background support */
.wp-block-amphibee-text-image.background-light {
    background-color: var(--gbg-color-light);
}

.wp-block-amphibee-text-image.background-grey {
    background-color: var(--gbg-color-grey);
}

.wp-block-amphibee-text-image.background-primary {
    background-color: var(--gbg-color-primary);
    color: var(--gbg-color-light);
}

.wp-block-amphibee-text-image.background-primary .text-image-content .wp-block-heading:not(.has-text-color),
.wp-block-amphibee-text-image.background-primary .text-image-content p:not(.has-text-color) {
    color: var(--gbg-color-light) !important;
}

.wp-block-amphibee-text-image.background-light .text-image-content .wp-block-heading:not(.has-text-color),
.wp-block-amphibee-text-image.background-light.is-style-imgBox .text-image-content .wp-block-heading:not(.has-text-color),
.wp-block-amphibee-text-image.background-light .text-image-content .wp-block-heading:not(.has-text-color),
.wp-block-amphibee-text-image.background-light .text-image-content p:not(.has-text-color),
.wp-block-amphibee-text-image.background-light.is-style-imgBox .text-image-content p:not(.has-text-color) {
    color: var(--gbg-color-primary) !important;
}

.wp-block-amphibee-text-image.background-secondary {
    background-color: var(--gbg-color-secondary);
    color: var(--gbg-color-light);
}

.wp-block-amphibee-text-image.background-secondary .text-image-content .wp-block-heading, .wp-block-amphibee-text-image.background-secondary .text-image-content p {
    color: var(--gbg-color-light) !important;
}

/* Mobile styles (default) */
.wp-block-amphibee-text-image .text-image-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 16px !important;
}

/* Mobile image positioning */
.wp-block-amphibee-text-image .text-image-wrapper.mobile-image-top {
    flex-direction: column;
}

.wp-block-amphibee-text-image .text-image-wrapper.mobile-image-bottom {
    flex-direction: column-reverse;
}

/* Image area */
.wp-block-amphibee-text-image .text-image-media {
    flex: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-block-amphibee-text-image .text-image-media img {
    max-width: 100%;
    height: auto;
}

.wp-block-amphibee-text-image:not(.is-style-imgBox) .text-image-media img {
    max-height: 500px;
    object-fit: contain;
}

@media screen and (min-width: 998px) {
    .wp-block-amphibee-text-image:not(.is-style-imgBox) .text-image-media img {
        height: 500px;
    }
}

.wp-block-amphibee-text-image.w-large .text-image-media img {
    max-height: 600px;
}

/* Content area */
.wp-block-amphibee-text-image .text-image-content {
    flex: 1;
}

.editor-styles-wrapper .wp-block-amphibee-text-image .text-image-content .wp-block-buttons.wp-block {
    margin: 0;
}

/* Styles for inner blocks */
.wp-block-amphibee-text-image .text-image-content .wp-block-heading {
    margin: 0 0 16px 0;
    letter-spacing: 0;
    line-height: 1 !important;
}

.wp-block-amphibee-text-image .text-image-content .wp-block-heading:not([class*="-font-size"]):not([style*="font-size"]) {
    font-size: clamp(30px, 5vw, 56px) !important;
}

.wp-block-amphibee-text-image .text-image-content .wp-block-heading:not(.has-text-color) {
    color: var(--gbg-color-secondary) !important;
}

.wp-block-amphibee-text-image .text-image-content p {
    font-size: clamp(16px, 4vw, 18px);
    margin: 0 0 32px;
}

.wp-block-amphibee-text-image .text-image-content p:not(.has-text-color) {
    color: var(--gbg-color-text);
}

.wp-block-amphibee-text-image .text-image-content .wp-block-list {
    margin: 0 0 32px;
    font-size: clamp(16px, 4vw, 18px);
    padding: 0;
}

.wp-block-amphibee-text-image .text-image-content .wp-block-list li {
    list-style: none;
    padding-left: 24px;
}

.wp-block-amphibee-text-image .text-image-content .wp-block-list li::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 99999px;
    background-color: var(--gbg-color-light-citron);
}

.wp-block-amphibee-text-image.background-light .text-image-content .wp-block-list li::before {
    background-color: var(--gbg-color-primary);
}

.wp-block-amphibee-text-image .text-image-content .wp-block-buttons .wp-element-button{
    padding: 16px 32px !important;
    border-radius: 9999px;
    font-size: var(--gbg-font-size-xl);
    color: var(--gbg-color-primary);
    margin-top: 0;
    transition: background-color .3s;
}

@media screen and (min-width: 998px) {
    .wp-block-amphibee-text-image .text-image-wrapper {
        padding: 48px 0;
    }

    .wp-block-amphibee-text-image .text-image-content .wp-block-heading {
        margin: 0 0 32px 0;
    }

    .wp-block-amphibee-text-image .text-image-content p {
        max-width: 85% !important;
        line-height: 1.25 !important;
    }

    .wp-block-amphibee-text-image .text-image-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 100px;
    }

    /* Reversed layout for desktop */
    .wp-block-amphibee-text-image .text-image-wrapper.reversed {
        flex-direction: row-reverse;
    }

    /* Reset mobile column behavior */
    .wp-block-amphibee-text-image .text-image-wrapper.mobile-image-top, .wp-block-amphibee-text-image .text-image-wrapper.mobile-image-bottom {
        flex-direction: row;
    }

    .wp-block-amphibee-text-image .text-image-wrapper.mobile-image-top.reversed, .wp-block-amphibee-text-image .text-image-wrapper.mobile-image-bottom.reversed {
        flex-direction: row-reverse;
    }

    .wp-block-amphibee-text-image .text-image-media {
        flex: 0 0 40%;
        width: auto;
    }

    /* Vertical alignments (desktop only) */
    .wp-block-amphibee-text-image .text-image-wrapper.align-top {
        align-items: flex-start;
    }

    .wp-block-amphibee-text-image .text-image-wrapper.align-center {
        align-items: center;
    }

    .wp-block-amphibee-text-image .text-image-wrapper.align-bottom {
        align-items: flex-end;
    }
}

/* ============================================
   Styles : ImgBox
   ============================================ */

.wp-block-amphibee-text-image.is-style-imgBox .text-image-media img{
    aspect-ratio: 1/1;
    border-radius: var(--gbg-border-radius-xl);
    height: 100%;
    object-fit: cover;
}

.wp-block-amphibee-text-image.is-style-imgBox .text-image-wrapper {
    padding: 20px;
    align-items: stretch;
    gap: var(--gbg-spacing-sm);
}

.wp-block-amphibee-text-image.is-style-imgBox .text-image-content {
    padding: 0;
    align-content: center;
}

.wp-block-amphibee-text-image.is-style-imgBox .text-image-content {
    border-radius: var(--gbg-border-radius-xl);
    padding: 32px 16px;
}

.wp-block-amphibee-text-image.is-style-imgBox .text-image-content .wp-block-heading:not(.has-text-color),
.wp-block-amphibee-text-image.background-secondary .text-image-content .wp-block-heading:not(.has-text-color) {
    font-size: clamp(30px, 5vw, 56px) !important;
    color: var(--gbg-color-light-citron) !important;
}

.wp-block-amphibee-text-image.is-style-imgBox.background-grey .text-image-content {
    background-color: var(--gbg-color-light);
}

.wp-block-amphibee-text-image.is-style-imgBox.background-secondary .text-image-content {
    background-color: var(--gbg-color-primary);
}

.wp-block-amphibee-text-image.background-grey .text-image-content .wp-block-heading:not(.has-text-color),
.wp-block-amphibee-text-image.background-grey .text-image-content p:not(.has-text-color),
.wp-block-amphibee-text-image.background-grey.is-style-imgBox .text-image-content p:not(.has-text-color) {
    color: var(--gbg-color-primary) !important;
}

.wp-block-amphibee-text-image.is-style-imgBox .text-image-content p:not(.has-text-color) {
    display: block;
    color: var(--gbg-color-light) !important;
    font-size: clamp(16px, 4vw, 20px) !important;
}


@media screen and (min-width: 998px) {
    .wp-block-amphibee-text-image.is-style-imgBox .text-image-wrapper {
        padding: 56px 0;
    }

    .wp-block-amphibee-text-image.is-style-imgBox .text-image-content {
        padding: 56px;
    }
    .wp-block-amphibee-text-image.is-style-imgBox .text-image-content p {
        max-width: 70% !important;
    }
    .wp-block-amphibee-text-image.is-style-imgBox .text-image-media img{
        aspect-ratio: 4/5;
    }
    .wp-block-amphibee-text-image.is-style-imgBox .text-image-media {
        flex-basis: 33%;
    }
}

/* Editor styles */
.editor-styles-wrapper .wp-block-amphibee-text-image.is-style-imgBox .wp-block {
    max-width: unset;
}

.editor-styles-wrapper .wp-block-amphibee-text-image.is-style-imgBox .text-image-content .block-editor-block-list__layout .text-image-content {
    width: 100%;
    max-width: unset !important;
    margin: 0;
}

.editor-styles-wrapper .wp-block-amphibee-text-image.is-style-imgBox .text-image-content .block-editor-inner-blocks,
.editor-styles-wrapper .wp-block-amphibee-text-image.is-style-imgBox .text-image-content .block-editor-block-list__layout,
.editor-styles-wrapper .wp-block-amphibee-text-image.is-style-imgBox .text-image-content {
    height: 100%;
}

