.accordion {
    --acc-bg-color: #12265d;
    --acc-accent-color: #ffe56b;
    --acc-icon-color: #162d68;
    background: var(--acc-bg-color);
    overflow: hidden;
    margin-bottom: 4px;
}

.accordion__title-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
}

.accordion__checkbox {
    all: unset;
    box-sizing: border-box;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #eef1ff;
    border-radius: 6px;
    transition: background-color .3s;
}

    .accordion__checkbox:checked {
        background: var(--acc-accent-color);
    }

:is(.accordion__checkbox, .accordion__checkbox:checked):after {
    content: ' ';
    display: inline-block;
    width: 16px;
    height: 16px;
    border-bottom: 3px solid var(--acc-icon-color);
    border-right: 3px solid var(--acc-icon-color);
    transition: transform .3s;
}

.accordion__checkbox:after {
    transform: rotate(-45deg) translateX(-2px) translateY(-2px);
}

.accordion__checkbox:checked:after {
    transform: rotate(45deg) translateX(-2px) translateY(-2px);
}

.accordion__checkbox:focus-visible {
    outline: 3px solid white;
    outline-offset: 3px;
}

.accordion__heading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.accordion__title {
    color: white;
    margin: 0;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1.15;
}

.district__subtitle {
    color: white;
    margin: 2px 0 0;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.2;
}

.district .accordion__checkbox:checked + .accordion__heading
.accordion__title {
    color: var(--acc-accent-color);
}

.accordion__content-box {
    background-color: white;
    opacity: 1;
    overflow: hidden;
    border: 0;
}

.accordion__content {
    padding: 24px 22px 32px;
}

.accordion__title-container:has( > .accordion__checkbox:not(:checked) ) ~ .accordion__content-box {
    height: 0;
}

@media (max-width: 600px) {
    .accordion__title-container {
        gap: 12px;
        padding: 12px;
    }

    .accordion__checkbox {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .accordion__title {
        font-size: 1.25rem;
    }

    .district__subtitle {
        font-size: 1rem;
    }
}

.district .accordion__content {
    padding: 28px 24px 36px;
}

.district__details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.district__detail {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0;
    color: #111;
    font-size: 1.125rem;
    line-height: 1.4;
}

.district__detail-icon {
    display: block;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.district__detail-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.district__detail a {
    color: #1d3977;
    text-decoration: underline;
    text-underline-offset: 3px;
}

    .district__detail a:hover,
    .district__detail a:focus-visible {
        color: #0f2050;
        text-decoration-thickness: 2px;
    }

.district__content {
    margin-top: 28px;
}

@media (max-width: 600px) {
    .district .accordion__content {
        padding: 22px 16px 28px;
    }

    .district__details {
        gap: 16px;
    }

    .district__detail {
        align-items: flex-start;
        gap: 14px;
        font-size: 1rem;
    }

    .district__detail-icon {
        flex-basis: 26px;
        width: 26px;
        height: 26px;
    }
}

/* OPEN ANIMATION HANDLING
These styles are used along with the `expand-animation.js` script
to animation the opening process of an element
 
The animation works by having the height as 0 when closed
Then we animate the open to a specific height calculated by the
javascript scrollHeight property of the element which the --openHeight variable is set to
When the animation completes the height is set to auto so that everything is responsive at that point
 
IMPORTANT NOTE: `flex-direction: column` is necessary for the scrollHeight to calculate properly
despite not being a flex element...
*/

.js-accordion-animate-open:not(input[type="checkbox"]) {
    transition: height 0.3s ease-out, translate 0.3s ease-out;
    overflow: hidden;
    height: 0;
    flex-wrap: nowrap;
    flex-direction: column;
}

.js-accordion-animate-open:not(.js-accordion-animate-open--auto):not(input[type="checkbox"]) {
    display: flex;
}

.js-accordion-animate-open--show:not(input[type="checkbox"]) {
    height: var(--openHeight) !important;
}

.js-accordion-animate-open--auto:not(input[type="checkbox"]) {
    height: auto;
}