.custom-text-image {
    display: grid;
    grid-gap: var(--spacing-v2);
}

.custom-text-image .se-tabs__wrapper {
    display: none;
}

.custom-text-image .se-title-text {
    box-sizing: content-box;
    padding-right: var(--spacing-h1);
    padding-left: var(--spacing-h1);
}

.custom-text-image .custom-content-block {
    order: 0;
    max-width: var(--spacing-container-max-width);
}

.custom-text-image__item {
    display: grid;
    grid-gap: var(--spacing-v3);
    padding-top: var(--spacing-v2);
    padding-bottom: var(--spacing-v2);
    border-top: 1px solid var(--main-colors-grey);
    --arrow-size: 32px;
    --shift: calc(var(--arrow-size) + var(--spacing-h3));
}

.custom-text-image__item:last-child {
    border-bottom: 1px solid var(--main-colors-grey);
}

.custom-text-image__item:not(.active) .custom-content-block .se-text,
.custom-text-image__item:not(.active) .custom-text-image__item-image,
.custom-text-image__item:not(.active) .custom-text-image__content-button-mobile {
    display: none;
}

.custom-text-image__item.active {
    background-color: var(--main-colors-grey-3);
}

.custom-text-image__item[hidden] {
    display: grid;
}

.custom-text-image__item .se-title {
    position: relative;
    width: calc(100% - var(--shift));
    scroll-margin-top: 77px;
    text-align: left;
}

.custom-text-image__item .se-title::after {
    content: '';
    display: block;
    width: var(--arrow-size);
    height: var(--arrow-size);
    border-radius: 8px;
    background-image: url('/wp-content/themes/se_theme/page-templates/front-page/front-page-2025/assets/images/arrow-up.svg');
    border: 1px solid var(--main-colors-black);
    position: absolute;
    top: 50%;
    transform: translate(var(--shift), -50%);
    right: 0;
    background-position: center;
    cursor: pointer;
}

.custom-text-image__item:not(.active) .se-title::after {
    transform: translate(var(--shift), -50%) rotate(180deg);
    border: 1px solid var(--main-colors-grey);
}

.custom-text-image__item-image {
    overflow: auto;
    padding: 0 var(--spacing-h1) 8px var(--spacing-h1);
}

.custom-text-image[accordion] .se-card__top .se-title {
    position: relative;
}

.custom-text-image__content-button-desktop {
    display: none;
}

@media screen and (min-width: 768px) {
    .custom-text-image .se-tabs__wrapper,
    .custom-text-image__content-button-desktop {
        display: flex;
    }

    .custom-text-image__item,
    .custom-text-image__item[hidden] {
        display: none;
        padding: 0;
    }

    .custom-text-image__item.active {
        display: grid;
        grid-gap: var(--spacing-v2);
        border-top: none;
        background-color: transparent;
    }

    .custom-text-image__item:last-child {
        border: none;
    }

    .custom-text-image__item-image {
        padding-bottom: 0;
    }

    .custom-text-image__item .se-title {
        width: auto;
        padding-top: 0;
    }

    .custom-text-image__item .se-title::after {
        content: none;
    }

    .custom-text-image__content {
        display: grid;
        grid-gap: var(--spacing-v3);
    }

    .custom-text-image__content-button-mobile,
    .custom-text-image__item:not(.active) .custom-text-image__content-button-mobile {
        display: none;
    }

    .custom-text-image__content-button-desktop {
        padding-right: var(--spacing-h1);
        padding-left: var(--spacing-h1);
    }

    .custom-content-block {
        display: grid;
        grid-gap: var(--spacing-v3);
    }
}

@media screen and (min-width: 1024px) {
    .custom-text-image > .se-title-text {
        max-width: none;
    }

    .custom-text-image .custom-content-block,
    .custom-text-image .se-title-text,
    .custom-text-image__content-button-desktop {
        padding: 0;
    }

    .custom-text-image[content-type='list'] .custom-text-image__item {
        align-items: start;
    }

    .custom-text-image__content {
        padding-left: var(--spacing-h1);
        padding-right: var(--spacing-h1);
        max-width: var(--spacing-container-max-width);
        margin-left: auto;
        margin-right: auto;
    }

    .custom-text-image__item {
        align-items: center;
        --image-width: var(--spacing-grid-6);
        margin: 0 auto;
        width: fit-content;
    }

    .custom-text-image__item[first-element='image'] {
        justify-content: start;
        grid-template-columns: var(--image-width) auto;
    }

    .custom-text-image__item[first-element='image'] .custom-text-image__item-image-wrapper {
        order: 0;
    }

    .custom-text-image__item[first-element='image'] .custom-content-block {
        order: 1;
    }

    .custom-text-image__item[first-element='text'] {
        justify-content: space-between;
        grid-template-columns: auto var(--image-width);
    }

    .custom-text-image__item[first-element='text'] .custom-text-image__item-image-wrapper {
        order: 1;
    }

    .custom-text-image__item[first-element='text'] .custom-content-block {
        order: 0;
    }

    .custom-text-image__item-image {
        padding: 0;
    }

    .custom-text-image__item-image .se-image {
        width: 100%;
        max-width: none;
    }
}