/* ATI Smart TOC - Elementor widget */

.ati-smart-toc,
.ati-smart-toc * {
    box-sizing: border-box;
}

.ati-smart-toc {
    --ati-toc-active-bg: #2050e5;
    --ati-toc-active-border: #2050e5;
    --ati-toc-active-text: #ffffff;
    --ati-toc-arrow-bg: #eaf0ff;
    --ati-toc-arrow-color: #2050e5;
    --ati-toc-toggle-bg: #eaf0ff;
    --ati-toc-toggle-color: #2050e5;
    width: 100%;
    padding: 30px;
    background: #f7f7f7;
    border: 0 solid #eeeeee;
    color: #101729;
}

.ati-toc__header {
    margin: 0 0 20px;
}

.ati-toc__title {
    margin: 0;
    color: #101729;
    font-family: "Marcellus", Georgia, serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1.35;
}

.ati-toc__body {
    width: 100%;
    max-height: var(--ati-max-height, 300px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 12px 0 0;
    scrollbar-width: thin;
    scrollbar-color: #2050e5 #dddddd;
    overscroll-behavior: contain;
}

.ati-toc__body::-webkit-scrollbar {
    width: 7px;
}

.ati-toc__body::-webkit-scrollbar-track {
    background: #dddddd;
    border-radius: 10px;
}

.ati-toc__body::-webkit-scrollbar-thumb {
    background: #2050e5;
    border-radius: 10px;
}

.ati-toc__list,
.ati-toc__children {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ati-toc__list {
    gap: 20px;
}

.ati-toc__item {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ati-toc__row {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.ati-toc__link {
    min-width: 0;
    color: #101729;
    text-decoration: none !important;
}

.ati-toc__link:focus-visible,
.ati-toc__toggle:focus-visible {
    outline: 2px solid #2050e5;
    outline-offset: 2px;
}

/* Main heading cards: white by default, blue ONLY on hover/focus or when expanded. */
.ati-toc__normal-link {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    width: 100%;
    min-height: 60px;
    padding: 12px 65px 12px 20px;
    overflow: hidden;
    border: 1px solid #e2e2e2;
    background: #ffffff;
    color: #101729;
    font-family: "Marcellus", Georgia, serif;
    font-size: 23px;
    font-weight: 400;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

/* Higher specificity than Elementor's saved Normal Card styles. */
.ati-smart-toc .ati-toc__normal-link:hover,
.ati-smart-toc .ati-toc__normal-link:focus-visible {
    border-color: var(--ati-toc-active-border);
    background: var(--ati-toc-active-bg);
    color: var(--ati-toc-active-text);
}

/* Normal card arrow. Identical stroke/circle geometry to accordion arrows,
   but its chevron points RIGHT to indicate anchor navigation. */
.ati-smart-toc .ati-toc__normal-link::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ati-toc-arrow-bg);
    transform: translateY(-50%);
    pointer-events: none;
}

.ati-smart-toc .ati-toc__normal-link::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 36px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--ati-toc-arrow-color);
    border-bottom: 2px solid var(--ati-toc-arrow-color);
    transform: translate(50%, -50%) rotate(-45deg);
    pointer-events: none;
}

/* Parent accordion cards should NEVER begin in the active color by default.
   The :not() guards also override stale Elementor-generated v1.4.0 CSS. */
.ati-smart-toc .ati-toc__item--accordion:not(.is-open) > .ati-toc__row--accordion:not(:hover) {
    border-color: #e2e2e2;
    background-color: #ffffff;
}

.ati-toc__row--accordion {
    border: 1px solid #e2e2e2;
    background: #ffffff;
    transition: border-color .18s ease, background-color .18s ease;
}

.ati-toc__parent-link {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    min-height: 60px;
    padding: 12px 12px 12px 20px;
    overflow: hidden;
    background: transparent;
    color: #101729;
    font-family: "Marcellus", Georgia, serif;
    font-size: 23px;
    font-weight: 400;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Override stale Elementor styles that previously made every accordion title white. */
.ati-smart-toc .ati-toc__item--accordion:not(.is-open) > .ati-toc__row--accordion:not(:hover) .ati-toc__parent-link {
    color: #101729;
}

.ati-smart-toc .ati-toc__item--accordion.is-open > .ati-toc__row--accordion,
.ati-smart-toc .ati-toc__item--accordion > .ati-toc__row--accordion:hover {
    border-color: var(--ati-toc-active-border);
    background-color: var(--ati-toc-active-bg);
}

.ati-smart-toc .ati-toc__item--accordion.is-open > .ati-toc__row--accordion .ati-toc__parent-link,
.ati-smart-toc .ati-toc__item--accordion > .ati-toc__row--accordion:hover .ati-toc__parent-link {
    color: var(--ati-toc-active-text);
}

/* Separate accordion toggle button, its chevron points DOWN when closed and UP when open. */
.ati-smart-toc .ati-toc__toggle {
    position: relative;
    display: flex;
    flex: 0 0 36px;
    align-self: center;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    margin: 0 18px 0 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ati-toc-toggle-bg);
    color: var(--ati-toc-toggle-color);
    cursor: pointer;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    transition: background-color .18s ease, color .18s ease;
}

.ati-smart-toc .ati-toc__toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translate(-50%, -60%) rotate(45deg);
    transform-origin: center;
    transition: transform .22s ease;
    pointer-events: none;
}

.ati-smart-toc .ati-toc__item--accordion.is-open > .ati-toc__row .ati-toc__toggle::before {
    transform: translate(-50%, -35%) rotate(225deg);
}

/* Expanded subheading panel */
.ati-toc__children {
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px 18px 15px;
    border: 1px solid #e2e2e2;
    border-top: 0;
    background: #ffffff;
}

.ati-toc__children[hidden] {
    display: none !important;
}

.ati-toc__child-item {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ati-toc__child-link {
    position: relative;
    display: block;
    width: 100%;
    padding: 0 0 0 15px;
    color: #101729;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    white-space: normal;
    overflow-wrap: anywhere;
}

.ati-toc__child-link::before {
    content: "";
    position: absolute;
    top: .72em;
    left: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #101729;
}

.ati-toc__child-link:hover,
.ati-toc__child-link.is-active {
    color: #2050e5;
}

/* Deeper nested heading levels */
.ati-toc__children--nested {
    gap: 7px;
    margin: 7px 0 0 12px;
    padding: 0 0 0 12px;
    border: 0;
    border-left: 1px solid #e2e2e2;
    background: transparent;
}

/* Long heading marquee */
.ati-toc__viewport {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.ati-toc__track {
    display: inline-block;
    width: max-content;
    max-width: none;
    white-space: nowrap;
    vertical-align: top;
    transform: translateX(0);
}

.ati-toc__track.is-scrolling {
    transform: translateX(0);
}

/* Only animate long titles while user interacts with that particular card. */
.ati-toc__link:hover .ati-toc__track.is-scrolling,
.ati-toc__link:focus-visible .ati-toc__track.is-scrolling {
    will-change: transform;
    animation: ati-toc-pingpong var(--ati-duration, 8s) ease-in-out infinite alternate;
}

@keyframes ati-toc-pingpong {
    0%, 10% {
        transform: translateX(0);
    }

    90%, 100% {
        transform: translateX(var(--ati-shift, 0px));
    }
}

.ati-toc__empty {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.ati-toc__empty[hidden] {
    display: none !important;
}

.ati-toc__item.is-active > .ati-toc__row .ati-toc__link {
    text-decoration: none;
}

/* Smooth native anchor navigation */
html.ati-toc-smooth-scroll {
    scroll-behavior: smooth;
}

/* Mobile */
@media (max-width: 767px) {
    .ati-smart-toc {
        padding: 20px;
    }

    .ati-toc__header {
        margin-bottom: 16px;
    }

    .ati-toc__title {
        font-size: 26px;
        line-height: 1.3;
    }

    .ati-toc__list {
        gap: 14px;
    }

    .ati-toc__normal-link {
        min-height: 56px;
        padding: 10px 55px 10px 15px;
        font-size: 18px;
        line-height: 1.4;
    }

    .ati-smart-toc .ati-toc__normal-link::after {
        right: 12px;
        width: 34px;
        height: 34px;
    }

    .ati-smart-toc .ati-toc__normal-link::before {
        right: 29px;
    }

    .ati-toc__parent-link {
        min-height: 56px;
        padding: 10px 8px 10px 15px;
        font-size: 18px;
        line-height: 1.4;
    }

    .ati-smart-toc .ati-toc__toggle {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        margin-right: 12px;
    }

    .ati-toc__children {
        padding: 11px 14px 13px;
    }

    .ati-toc__child-link {
        font-size: 15px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    html.ati-toc-smooth-scroll {
        scroll-behavior: auto;
    }

    .ati-toc__link .ati-toc__track.is-scrolling {
        animation: none !important;
        transform: none !important;
        will-change: auto;
    }

    .ati-toc__toggle::before {
        transition: none;
    }
}
