.ac-department-directory,
.ac-department-directory *,
.ac-department-directory *::before,
.ac-department-directory *::after {
    box-sizing: border-box;
}

.ac-department-directory {
    width: 100%;
    padding: 48px 20px 64px;
    overflow: clip;
    background: #e8f0f7;
}

.ac-department-directory__container {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
}

.ac-department-directory__heading {
    margin: 0 0 47px;
    color: #3c3c3b;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.ac-department-directory__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 25px;
    width: 100%;
}

.ac-department-directory-card {
    position: relative;
    isolation: isolate;
    display: flex;
    min-width: 0;
    height: 310px;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    border: 3px solid #fff;
    border-radius: 15px;
    background-color: #126caf;
    box-shadow: 0 5px 12px rgb(0 0 0 / 28%), 0 0 22px rgb(26 119 185 / 22%);
}

.ac-department-directory-card::before,
.ac-department-directory-card::after {
    position: absolute;
    inset: 0;
    display: block;
    content: '';
}

.ac-department-directory-card::before {
    z-index: -2;
    background: var(--ac-directory-background) center / cover no-repeat;
    transform: scale(1.01);
    transition: transform 0.3s ease;
}

.ac-department-directory-card::after {
    z-index: -1;
    background: linear-gradient(359.59deg, rgb(19 19 19 / 85%) 7.09%, rgb(24 114 205 / 85%) 114.91%);
}

.ac-department-directory-card:hover::before {
    transform: scale(1.045);
}

.ac-department-directory-card__toggle {
    appearance: none;
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 17px 17px 7px;
    color: #fff;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    text-align: start;
    text-transform: none;
    cursor: default;
}

.ac-department-directory-card__toggle:hover,
.ac-department-directory-card__toggle:focus {
    color: #fff;
    background: transparent;
}

.ac-department-directory-card__toggle:focus-visible,
.ac-department-directory-card__item-link:focus-visible,
.ac-department-directory-card__all-link:focus-visible,
.ac-department-directory__button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

.ac-department-directory-card__heading-group {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.ac-department-directory-card__icon {
    display: block;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin: 0;
    object-fit: contain;
    border: 0;
    box-shadow: none;
}

.ac-department-directory-card__title {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.5;
    text-align: start;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-department-directory-card__arrow {
    display: none;
}

.ac-department-directory-card__panel {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 0 17px 14px;
}

.ac-department-directory-card__list {
    display: flex;
    max-height: 160px;
    flex-direction: column;
    overflow: hidden;
    margin: 4px 0 10px;
    padding: 0;
    list-style: none;
}

.ac-department-directory-card__item {
    display: block;
    min-width: 0;
    height: 32px;
    margin: 0;
    padding: 0;
}

.ac-department-directory-card__item-link {
    display: block;
    width: 100%;
    min-width: 0;
    height: 32px;
    overflow: hidden;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    line-height: 32px;
    text-align: start;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-department-directory-card__item-link:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ac-department-directory-card__all-link {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    line-height: 32px;
    text-align: start;
    text-decoration: none;
}

.ac-department-directory-card__all-link:hover {
    color: #fff;
}

.ac-department-directory-card__all-link > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-department-directory-card__all-arrow {
    display: block;
    width: 28px;
    min-width: 28px;
    height: 32px;
    font-size: 32px;
    font-weight: 300;
    line-height: 28px;
    text-align: center;
}

.ac-department-directory[dir='rtl'] .ac-department-directory-card__all-arrow {
    transform: rotate(180deg);
}

.ac-department-directory__footer {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 40px;
}

.ac-department-directory__button {
    display: inline-flex;
    width: min(300px, 100%);
    min-height: 56px;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    color: #fff;
    border-radius: 4px;
    background: #246fae;
    box-shadow: 0 8px 22px rgb(0 0 0 / 18%);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

.ac-department-directory__button:hover {
    color: #fff;
    background: #195d95;
    transform: translateY(-1px);
}

.ac-department-directory__notice {
    margin: 1rem auto;
    padding: 0 20px;
    text-align: center;
}

@media (max-width: 1149px) {
    .ac-department-directory__grid {
        grid-template-columns: repeat(2, minmax(260px, 346px));
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .ac-department-directory {
        padding: 28px 10px 24px;
    }

    .ac-department-directory__heading {
        margin-bottom: 22px;
        font-size: 22px;
        line-height: 1.2;
    }

    .ac-department-directory__grid {
        display: flex;
        width: 100%;
        max-width: 346px;
        flex-direction: column;
        gap: 8px;
        margin-inline: auto;
    }

    .ac-department-directory-card {
        width: 100%;
        height: auto;
        min-height: 44px;
        border-width: 2px;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgb(0 0 0 / 25%), 0 0 10px rgb(22 113 181 / 18%);
    }

    .ac-department-directory-card__toggle {
        min-height: 40px;
        padding: 5px 7px;
        cursor: pointer;
    }

    .ac-department-directory-card__heading-group {
        gap: 6px;
    }

    .ac-department-directory-card__icon {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }

    .ac-department-directory-card__title {
        font-size: 14px;
        line-height: 20px;
    }

    .ac-department-directory-card__arrow {
        position: relative;
        display: block;
        width: 24px;
        min-width: 24px;
        height: 24px;
        border-radius: 4px;
        background: rgb(73 162 226 / 92%);
    }

    .ac-department-directory-card__arrow::before {
        position: absolute;
        top: 7px;
        left: 8px;
        width: 7px;
        height: 7px;
        content: '';
        border-right: 1.5px solid #fff;
        border-bottom: 1.5px solid #fff;
        transform: rotate(45deg);
        transition: transform 0.25s ease, top 0.25s ease;
    }

    .ac-department-directory-card.is-open .ac-department-directory-card__arrow::before {
        top: 10px;
        transform: rotate(225deg);
    }

    .ac-department-directory-card__panel {
        max-height: 0;
        flex: 0 0 auto;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        padding: 0 8px;
        transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease, visibility 0s linear 0.3s;
    }

    .ac-department-directory-card.is-open .ac-department-directory-card__panel {
        max-height: 230px;
        visibility: visible;
        opacity: 1;
        padding: 0 8px 9px;
        transition-delay: 0s;
    }

    .ac-department-directory-card__list {
        margin: 2px 0 10px;
    }

    .ac-department-directory-card__item,
    .ac-department-directory-card__item-link {
        height: 28px;
    }

    .ac-department-directory-card__item-link {
        font-size: 14px;
        line-height: 28px;
    }

    .ac-department-directory-card__all-link {
        min-height: 28px;
        font-size: 13px;
        line-height: 28px;
    }

    .ac-department-directory-card__all-arrow {
        width: 22px;
        min-width: 22px;
        height: 28px;
        font-size: 24px;
        line-height: 25px;
    }

    .ac-department-directory__footer {
        margin-top: 17px;
    }

    .ac-department-directory__button {
        min-height: 50px;
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ac-department-directory-card::before,
    .ac-department-directory-card__arrow::before,
    .ac-department-directory-card__panel,
    .ac-department-directory__button {
        transition: none;
    }
}
