/* Tabcordions */
.custom-section.tabcordion.v3 {
    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, #FFF);
        border: 1px solid hsla(0, 0%, 81.2%, .5);
        box-shadow: 0 10px 30px rgba(19, 19, 19, .15);
        border-radius: 10px;
        padding: 4px;
        gap: 8px;
        position: relative;
        z-index: 1;
    }

    .tabcordion--panels {
        background-color: var(--panel-background-color, #F2F2F2);
        color: var(--panel-text-color, #333);
        border-radius: 12px;
    }

    &.has-tabs .tabcordion--panels {
        margin-top: -25px;
        padding-top: 30px;
    }

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

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

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

        &.is-active {
            overflow: visible;
            min-height: inherit;
        }
    }

    &.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 {
        overflow: hidden;
        width: var(--tabs-container-width, 1280px);
        max-width: 90%;
        margin-inline: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        
        @media only screen and (min-width: 1280px) {
            padding-top: 10px;
        }

        .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: inline-flex;
        flex-flow: wrap;
        margin: 0 auto;
        list-style: none;
        padding: 0;
    }

    .tabcordion--tabs .tab {
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        gap: 8px;
        background: var(--tab-background-color, #FFF);
        color: var(--tab-text-color, #333);
        padding: 15px 25px;
        font-size: 16px;
        font-weight: 700;
        text-align: center;
        border: 0;
        cursor: pointer;
        border-radius: 5px;
        transition: all .35s ease-in-out;

        &: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)));
    }

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

        .tab {
            display: none;
        }
    }
    .tabcordion--entry-container {
        overflow: hidden;
    }

    &:not(.has-tabs) .tabcordion--entry:not(:first-child) {
        margin-top: 8px;        
    }
    &:not(.has-tabs) {
        .tabcordion--panels {
            background: transparent;
        }

        .tabcordion--entry {
            background: var(--panel-background-color, #F2F2F2);
            border-radius: 10px;
        }
    }
    .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-content {
        position: relative;
        margin-top: -100%;
        height: 0;
        opacity: 0;
        transition: margin 500ms ease-in;
        padding: 15px 20px;

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

    .tabcordion--entry-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: center;

        @media only screen and (min-width: 760px) {
            flex-direction: row;
            gap: max(5%, 30px);
            align-items: flex-start;
        }
    }

    &.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: none;
            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-bottom {
        .tabcordion-container {
            flex-direction: column-reverse;
            overflow: visible;
        }
        .tabcordion--panels {
            margin-top: 0;
            margin-bottom: -25px;
            padding-bottom: 30px;
            padding-top: 0;
        }
    }
    &.has-tabs.tabsPosition-left,
    &.has-tabs.tabsPosition-right {
        .tabcordion-container {
            flex-direction: row;
            overflow: visible;
            align-items: stretch;
        }
        .tabcordion--panels {
            margin: 0;
            margin-left: -45px;
            padding: 0;
            padding-left: 60px;
            flex: 1;            

            .panel-content-details {
                padding-top: 10px;
            }
        }
        .tabcordion--tabs {
            margin: 0;
            margin-block: 35px;
            align-self: flex-start;
        }
        @media only screen and (max-width: 1080px) {
            .tabcordion--entry-content {
                flex-direction: column;
                gap: 10px;
            }
        }
    }
    &.has-tabs.tabsPosition-right {
        .tabcordion-container {
            flex-direction: row-reverse;
        }
        .tabcordion--panels {
            margin: 0;
            margin-right: -45px;
            padding: 0;
            padding-right: 60px;
        }
    }

    .panel-content-image {
        width: 100%;
        max-width: 300px;
        position: relative;
        transform: scale(0.9);
        transition: all .45s ease-in-out;

        @media only screen and (min-width: 760px) {
            min-width: 250px;
            max-width: 35%;
        }

        &::after {
            position: absolute;
            content: "";
            width: 200px;
            height: 60px;
            left: 0px;
            bottom: 0px;
            pointer-events: none;
            border-left: 1px solid var(--image-border-color, var(--primary-color));
            border-bottom: 1px solid var(--image-border-color, var(--primary-color));
            border-bottom-left-radius: 10px;
            transition: all .5s ease-in-out 0.2s;
        }

        img {
            display: block;
            max-width: 100%;
            height: auto;
            border-radius: 10px;
        }
    }

    .is-active {
        .panel-content-image {
            transform: scale(1);

            &::after {
                left: -8px;
                bottom: -10px;

                @media only screen and (min-width: 760px) {
                    left: -12px;
                    bottom: -12px;
                }
            }
        }
    }

    .panel-content-details {
        flex: 1;
        padding-top: 15px;
        position: relative;

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

    .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: clamp(1.375rem, 1.107rem + 0.714vw, 1.75rem);
            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;
        }

        ul {
            display: flex;
            flex-direction: column;
            gap: 7px;
            margin: 0;
        }
    }

    .tabcordion--entry-content .panel-button {
        display: flex;
        transition: all .45s ease-in-out;

        a {
            margin-top: 20px;
            text-decoration: none;
            font-weight: 700;
            color: var(--panel-read-more-button-text-color, var(--panel-text-color, #333));
            display: inline-flex;
            align-items: center;
            gap: 5px;
            position: relative;
            font-size: 16px;
            line-height: 1.1;
            isolation: isolate;
            padding: 15px 25px 15px 50px; 

            @media only screen and (min-width: 1280px) {
                font-size: 17px;
            }

            &:hover {
                color: var(--panel-read-more-button-hover-text-color, var(--primary-color-contrast));
            }

            &:before {
                position: absolute;
                content: "";
                width: 40px;
                height: 40px;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                pointer-events: none;
                border-radius: 50px;
                background: var(--panel-read-more-button-hover-bg-color, var(--primary-color));
                z-index: -1;
                transition: all .45s cubic-bezier(.34, .615, .4, .985);
            }

            &::after {
                content: '»';
                transition: all .35s ease-in-out;
                font-size: 18px;
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                height: 40px;
                z-index: 0;
                width: 40px;
                text-align: center;
                display: flex;
                align-items: center;
                justify-content: center;
                color: var(--panel-read-more-button-hover-text-color, var(--primary-color-contrast));
            }

            &:hover::before {
                width: 100%;
            }

            &:hover::after {
                transform: translate(10px, -50%);
            }
        }
    }

    .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 */