/* Tabcordions */
.custom-section.tabcordion.v2 {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    width: 100%;
    overflow: hidden;
    background: var(--section-bg-color, #FFF);
    color: var(--section-title-color, var(--primary-color));

    @media only screen and (min-width: 1280px) {
        padding-block: 50px;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    &.has-tabs .tabcordion--tabs {
        opacity: 1;
        height: auto;
        visibility: visible;
        background-color: var(--tabs-container-bg-color, #eee);
    }

    .tabcordion--panels {
        background-color: var(--panel-background-color, #f6f6f6);
        color: var(--panel-text-color, #333);
    }

    &.has-tabs .tabcordion--entry {
        min-height: 0;

        &:not(.is-active) {
            opacity: 0;
            visibility: hidden;
        }
    }

    &.has-tabs .tabcordion--entry::before {
        display: none;
    }

    &.has-tabs .tabcordion--entry.is-active .tabcordion--entry-content {
        opacity: 1;
        transition: opacity 400ms ease-in-out;
    }

    &.has-tabs .tabcordion--entry .tabcordion--entry-content {
        opacity: 0;
        transition: opacity 400ms ease-in-out;
    }

    .tabcordion-container {
        border-radius: 24px;
        overflow: hidden;
        border: 1px solid var(--tabs-container-border-color, #EEE);
        box-shadow: 0px 20px 24px -4px rgba(0, 0, 0, 0.04), 0px 8px 8px -4px rgba(0, 0, 0, 0.03);
        width: var(--tabs-container-width, 1280px);
        max-width: 90%;
        margin-inline: auto;

        .tab {         
            &.is-active {
                .icons-container {
                    background: var(--active-tab-text-color, var(--primary-color-contrast));
                    color: var(--active-tab-background-color, var(--primary-color));                    
                }
            } 
            .tab-title {
                flex: 1;
            }
            .icons-container {
                display: block;
                width: var(--icon-width, 35px);
                height: var(--icon-width, 35px);
                padding: 5px;
                background-color: var(--tab-text-color, #333);
                color: var(--tab-background-color, #ddd);
                border-radius: 50vw;
                position: relative;
                transition: all .35s ease-in-out;

                &:not(:has(svg)) {
                    display: none;
                }

                svg {
                    display: block;
                    position: absolute;
                    left: 50%;
                    top: 50%;
                    transform: translate(-50%, -50%);
                    width: 70%;
                    height: 70%;

                    &, * {
                        fill: currentColor;
                    }
                }
            }
        }
    }

    .tabcordion--tabs {
        opacity: 0;
        height: 0;
        visibility: hidden;
        display: flex;
        flex-flow: wrap;
        margin: 0;
        list-style: none;
        padding: 0;
    }

    .tabcordion--tabs .tab {
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        gap: 8px;
        background: var(--tab-background-color, #ddd);
        color: var(--tab-text-color, #333);
        padding: 20px 20px;
        font-size: 18px;
        font-weight: 400;
        border: 0;
        border-right: 1px solid var(--tab-border-color, #999);
        border-bottom: 1px solid var(--tab-border-color, #999);
        cursor: pointer;

        &:hover {
            filter: brightness(0.9);
        }
    }

    .tabcordion--tabs .tab:focus-visible {
        outline: 5px solid black;
    }

    .tabcordion--tabs .tab.is-active {
        background: var(--active-tab-background-color, var(--primary-color));
        color: var(--active-tab-text-color, var(--primary-color-contrast));
        font-weight: 700;

    }

    &.tabsPosition-left .tabcordion--tabs .tab.is-active {
        border-right-color: var(--active-tab-border-color, var(--active-tab-background-color, var(--primary-color)));
    }

    &.tabsPosition-top .tabcordion--tabs .tab.is-active {
        border-bottom-color: var(--active-tab-border-color, var(--active-tab-background-color, var(--primary-color)));
    }

    &.has-tabs .tabcordion--panels {
        border-top: 1px solid var(--tab-border-color, #999);
        margin-top: -1px;
    }

    .tabcordion--entry {
        overflow: hidden;
        position: relative;
        display: block;
        opacity: 1;
        visibility: visible;

        .tab {
            display: none;
        }
    }


    &:not(.has-tabs) .tabcordion--entry:not(:first-child) {
        border-top: 1px solid var(--tab-border-color, #999);
    }

    .tabcordion--entry::before {
        position: relative;
        content: attr(data-title);
        z-index: 1;
        display: block;
    }

    &:not(.has-tabs) .tabcordion--entry::before, &:not(.has-tabs) .tabcordion--entry .tab {
        background: var(--tab-background-color, #ddd);
        color: var(--tab-text-color, #333);
        padding: 10px 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        gap: 8px;
        border: none;
        width: 100%;
        text-align: left;
        font-size: 18px;
        line-height: 1.1;
    }
    &:not(.has-tabs) .tabcordion--entry.is-active .tab {
        .icons-container {
            background: var(--active-tab-text-color, var(--primary-color-contrast)); 
            color: var(--active-tab-background-color, var(--primary-color)); 
        }
    }
    &:not(.has-tabs) .tabcordion--entry::before {
        display: none !important;
    }

    &:not(.has-tabs) .tabcordion--entry:not(.is-active):before,
    &:not(.has-tabs) .tabcordion--entry:not(.is-active) .tab {
        padding-right: 35px;
    }

    &:not(.has-tabs) .tabcordion--entry:hover,
    &:not(.has-tabs) .tabcordion--entry:focus-visible {
        outline: none;
    }

    &:not(.has-tabs) .tabcordion--entry:hover::before,
    &:not(.has-tabs) .tabcordion--entry:focus-visible::before,
    &:not(.has-tabs) .tabcordion--entry:hover .tab,
    &:not(.has-tabs) .tabcordion--entry:focus-visible .tab {
        filter: brightness(0.9);
    }

    &:not(.has-tabs) .tabcordion--entry:not(.is-active):after,
    &:not(.has-tabs) .tabcordion--entry:not(.is-active) .tab::after {
        content: '';
        position: absolute;
        right: 15px;
        top: 15px;
        width: 12px;
        height: 12px;
        background-color: var(--tab-text-color, #333);
        mask-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 6H8V0H6V6H0V8H6V14H8V8H14V6Z' fill='%23002F6C'/%3E%3C/svg%3E%0A");
        mask-repeat: no-repeat no-repeat;
        mask-position: center center;
        mask-size: contain;
        z-index: 1;
        cursor: pointer;
    }
    &:not(.has-tabs) .tabcordion--entry:not(.is-active):after {
        display: none;
    }
    &:not(.has-tabs) .tabcordion--entry:not(.is-active) .tab::after {
        top: 50%;
        transform: translateY(-50%);
    }

    .tabcordion--entry.is-active .tabcordion--entry-content {
        margin-top: 0;
        height: auto;
        opacity: 1;
        transition: margin 400ms ease-out -100ms;
    }

    &:not(.has-tabs) .tabcordion--entry.is-active::before,
    &:not(.has-tabs) .tabcordion--entry.is-active .tab {
        background: var(--active-tab-background-color, var(--primary-color));
        color: var(--active-tab-text-color, var(--primary-color-contrast));
        border-bottom: 1px solid var(--tab-border-color, #ddd);
        font-weight: 700;
    }

    .tabcordion--entry-container {
        overflow: hidden;
    }

    .tabcordion--entry-content {
        position: relative;
        margin-top: -100%;
        height: 0;
        opacity: 0;
        transition: margin 500ms ease-in;
        padding: 15px 20px;

        @media only screen and (min-width: 1280px) {
            padding: 25px 30px;
        }
    }

    .tabcordion--entry-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    &.has-tabs.tabsPosition-left,
    &.has-tabs.tabsPosition-right {
        .tabcordion-container {
            display: flex;
        }

        .tabcordion--tabs {
            flex-direction: column;
            align-items: flex-start;
            width: 300px;
            opacity: 1;
            visibility: visible;
            height: auto;

            .tab {
                width: 100%;
                text-align: left;

                &:last-child {
                    border-bottom: 0;
                }
            }
        }

        .tabcordion--panels {
            width: calc(100% - 300px);
        }

        .tabcordion--entry-content {
            padding: 0;
        }

        .tabcordion--entry.is-active {
            padding: 15px 20px;
            overflow: visible;

            @media only screen and (min-width: 1280px) {
                padding: 25px 30px;
            }

            .tabcordion--entry-container {
                overflow: visible;
            }
        }

        .tabcordion--entry.is-active::before {
            display: block;
            font-weight: 700;
            color: var(--panel-title-color, var(--primary-color));
            font-size: clamp(1.313rem, 0.226rem + 1.774vw, 2rem);
            line-height: 1.1;
            margin-bottom: 20px;
        }
    }

    &.has-tabs.tabsPosition-right {
        .tabcordion--tabs {
            .tab {
                border-right: 0;
                border-left: 1px solid var(--tab-border-color, #999);

                &.is-active {
                    border-left-color: var(--active-tab-border-color, var(--active-tab-background-color, var(--primary-color)));
                }
            }
        }

        .tabcordion--panels {
            order: -1;
        }
    }

    .panel-content-text {
        color: currentColor;
        display: flex;
        flex-direction: column;
        gap: 10px;

        & > span {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        a {
            color: currentColor;
        }
        h3, h4, h5 {
            color: var(--panel-title-color, var(--primary-color));
        }
        h3 {
            font-size: 23px;
            line-height: 1.2;
        }
        h4 {
            font-size: 19px;
        }
        h5 {
            font-size: 16px;
        }
        .blockquote {
            margin: 0;
            border-color: var(--panel-title-color, var(--primary-color)) !important;
        }
    }

    .tabcordion--entry-content .panel-button {
        display: flex;
        justify-content: flex-end;
    }

    .tabcordion--entry-content .panel-button a {
        margin-top: 20px;
        text-decoration: none;
        font-weight: 700;
        color: var(--panel-read-more-button-color, var(--panel-text-color, #333));
        display: inline-flex;
        align-items: center;
        gap: 5px;
        position: relative;
        font-size: 18px;
        line-height: 1.1;

        &::after {
            content: '»';
            transition: all .35s ease-in-out;
            font-size: 18px;
        }
    }



    .tabcordion--entry-content .panel-button a:hover::after {
        -webkit-animation: wobble 2s ease infinite;
        animation: wobble 2s ease infinite;
    }

    .tabcordion--entry-content .panel-button:not(:has(a)) {
        display: none;
    }
}

@keyframes wobble {
    0% {
        transform: translateX(0%);
    }

    15% {
        transform: translateX(-25%) rotate(-5deg);
    }

    30% {
        transform: translateX(20%) rotate(3deg);
    }

    45% {
        transform: translateX(-15%) rotate(-3deg);
    }

    60% {
        transform: translateX(10%) rotate(2deg);
    }

    75% {
        transform: translateX(-5%) rotate(-1deg);
    }

    100% {
        transform: translateX(0%);
    }
}

/* END Tabcordions */