.ctrl-pages-header {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.ctrl-pages-header figure {
    min-width: 100%;
    min-height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@media only screen and (min-width: 640px) {
    .ctrl-pages-header figure img {
        max-width: inherit;
    }

    .page-header-content-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

@media only screen and (min-width: 640px) and (max-width: 959px) {
    /* 1.6:1 ratio */
    .ctrl-pages-header {
        aspect-ratio: 16/10;
    }
}

@media only screen and (min-width: 960px) and (max-width: 1279px) {
    /* 2.5:1 ratio */
    .ctrl-pages-header {
        aspect-ratio: 5/2;
    }
}

@media only screen and (min-width: 1280px) {
    /* 4:1 ratio */
    .ctrl-pages-header {
        aspect-ratio: 4/1;
    }
}


#table-of-contents {
    position: relative; /* Allows margin-top changes */
    /* transition: margin-top 0.1s ease-out;  Optional smooth movement */
    counter-reset: heading;
}

#table-of-contents .toc-level-1:before {
    content: counter(heading) ". ";
    counter-increment: heading;
}

#table-of-contents .toc-level-1 {
    counter-reset: subheadingLVL2;
}

#table-of-contents .toc-level-2:before {
    content: counter(heading) "." counter(subheadingLVL2) ". ";
    counter-increment: subheadingLVL2;
}

#table-of-contents .toc-level-2 {
    counter-reset: subheadingLVL3;
}

#table-of-contents .toc-level-3:before {
    content: counter(heading) "." counter(subheadingLVL2) "." counter(subheadingLVL3) ". ";
    counter-increment: subheadingLVL3;
}

#table-of-contents .toc-level-3 {
    counter-reset: subheadingLVL4;
}

#table-of-contents .toc-level-4:before {
    content: counter(heading) "." counter(subheadingLVL2) "." counter(subheadingLVL3) "." counter(subheadingLVL4) ". ";
    counter-increment: subheadingLVL4;
}

#table-of-contents .toc-level-4 {
    counter-reset: subheadingLVL5;
}

#table-of-contents .toc-level-5:before {
    content: counter(heading) "." counter(subheadingLVL2) "." counter(subheadingLVL3) "." counter(subheadingLVL4) "." counter(subheadingLVL5) ". ";
    counter-increment: subheadingLVL5;
}

#table-of-contents .toc-level-5 {
    counter-reset: subheadingLVL6;
}

#table-of-contents .toc-level-6:before {
    content: counter(heading) "." counter(subheadingLVL2) "." counter(subheadingLVL3) "." counter(subheadingLVL4) "." counter(subheadingLVL5) "." counter(subheadingLVL6) ". ";
    counter-increment: subheadingLVL6;
}


#table-of-contents li {
    line-height: 1.75rem;
}

#table-of-contents li::before {
    transition: border-left-width 0.15s ease-in-out;
    border-left: 0.2rem solid rgba(0, 0, 0, 0.1);
    padding-left: 0.2rem;
}

#table-of-contents li a {
    color: inherit;
    text-decoration: none;
}

#table-of-contents li a:hover {
    text-decoration: underline;
}

#table-of-contents li a:focus {
    outline: 0.1rem solid #0a53be;
    outline-offset: .25rem;
}

#table-of-contents li:has(> .table-of-contents-link.active) > a {
    color: #0a53be;
    text-decoration: none;
}

#table-of-contents li:has(> .table-of-contents-link.active)::before {
    border-left: 0.2rem solid #0a53be;
    color: #0a53be;
}


.enlarge-on-click {
    position: relative;
    cursor: pointer;
    transition: transform 0.5s ease-in-out;
}

.enlarge-on-click picture {
    position: relative;
    display: block;
    height: auto;
}

.enlarge-on-click picture::before {
    position: absolute;
    content: '';
    speak: never;
    inset: 0 0 0 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: block;
    transition: all 0.2s ease-in-out;
    opacity: 0;
}

.enlarge-on-click picture::after {
    position: absolute;
    content: '';
    speak: never;
    inset: calc(50% - 1.5rem) calc(50% - 1.5rem);
    -webkit-mask: url('/assets/images/magnifying-glass-plus.svg') no-repeat center;
    mask: url('/assets/images/magnifying-glass-plus.svg') no-repeat center;
    background-color: #fff;
    width: 3rem;
    height: 3rem;
    display: block;
    transition: all 0.2s ease-in-out;
    opacity: 0;
}

.enlarge-on-click picture:hover::before,
.enlarge-on-click picture:hover::after,
.enlarge-on-click picture:focus-within::before,
.enlarge-on-click picture:focus-within::after {
    opacity: 1;
}

.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    opacity: 0;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 0.5s ease-in-out;
}

.image-overlay img {
    position: absolute;
    max-width: none;
    max-height: none;
    transition: all 0.5s ease-in-out;
}


/* Swiper carousel overrides */
.swiper-button-prev,
.swiper-button-next {
    border: 1px solid #512A44;
    border-radius: .75rem;
    background-color: #C9E3B9;
}

.swiper-button-prev::after {
    content: "" !important;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateY(-50%) translateX(-50%) rotate(180deg);
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    background-image: url(/assets/images/chevron-right.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.swiper-button-next::after {
    content: "" !important;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateY(-50%) translateX(-50%);
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    background-image: url(/assets/images/chevron-right.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}