.history-section {
    padding: 88px 0 120px;
}


/* =========================================================
   기간 선택 탭
========================================================= */

.foundation-history__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    width: min(100%, 760px);
    margin: 0 auto 84px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f7f9fc;
    box-shadow: 0 12px 30px rgba(4, 29, 56, 0.05);
}

.foundation-history__tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    padding: 10px 20px;
    border-right: 1px solid var(--line);
    color: #697684;
    background: transparent;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
    text-decoration: none;
    transition:
        color 0.25s ease,
        background-color 0.25s ease;
}

.foundation-history__tabs a:last-child {
    border-right: 0;
}

.foundation-history__tabs a:hover {
    color: var(--blue);
    background: #edf4fa;
}

.foundation-history__tabs a.active {
    color: var(--white);
    background:
        linear-gradient(
            135deg,
            var(--navy) 0%,
            var(--blue) 100%
        );
}


/* =========================================================
   타임라인
========================================================= */

.foundation-history__timeline {
    position: relative;
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.foundation-history__timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 27px;
    bottom: 58px;
    width: 1px;
    background:
        linear-gradient(
            180deg,
            #8facc8 0%,
            #d7e0e8 100%
        );
    transform: translateX(-50%);
}


/* =========================================================
   연혁 항목
========================================================= */

.foundation-history__item {
    position: relative;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        164px
        minmax(0, 1fr);
    column-gap: 46px;
    align-items: start;
}

.foundation-history__item +
.foundation-history__item {
    margin-top: 54px;
}


/* =========================================================
   연도
========================================================= */

.foundation-history__year {
    position: relative;
    z-index: 3;
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 9px 16px;
    border-radius: 999px;
    color: var(--white);
    background: var(--navy);
    box-shadow: 0 9px 22px rgba(4, 29, 56, 0.16);
    text-align: center;
}

.foundation-history__year strong {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.foundation-history__current {
    margin-bottom: 4px;
    color: var(--gold);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.12em;
}


/* =========================================================
   연혁 카드
========================================================= */

.foundation-history__card {
    position: relative;
    min-height: 148px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--white);
    box-shadow: 0 14px 36px rgba(4, 29, 56, 0.07);
    box-sizing: border-box;
}

.foundation-history__card::before {
    content: "";
    position: absolute;
    top: 27px;
    width: 47px;
    height: 1px;
    background: #a7bed3;
}


/* 오른쪽 카드 */

.foundation-history__item--right
.foundation-history__card {
    grid-column: 3;
}

.foundation-history__item--right
.foundation-history__card::before {
    left: -47px;
}


/* 왼쪽 카드 */

.foundation-history__item--left
.foundation-history__card {
    grid-column: 1;
    grid-row: 1;
}

.foundation-history__item--left
.foundation-history__card::before {
    right: -47px;
}


/* 현재 회기 */

.foundation-history__item--current
.foundation-history__year {
    background:
        linear-gradient(
            135deg,
            var(--navy) 0%,
            var(--blue) 100%
        );
}

.foundation-history__item--current
.foundation-history__card {
    border-color: rgba(200, 155, 44, 0.55);
    box-shadow:
        0 16px 40px rgba(4, 29, 56, 0.09),
        inset 4px 0 0 var(--gold);
}


/* =========================================================
   카드 상단
========================================================= */

.foundation-history__card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e8edf2;
}

.foundation-history__card-head--single {
    justify-content: flex-end;
}

.foundation-history__date {
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
}

.foundation-history__position {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--navy);
    background: #eef3f8;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}


/* =========================================================
   이사장 정보
========================================================= */

.foundation-history__chairman {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-top: 18px;
}

.foundation-history__chairman strong {
    color: var(--navy);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.foundation-history__chairman span {
    color: #586775;
    font-size: 15px;
    line-height: 1.6;
}


/* =========================================================
   장학금
========================================================= */

.foundation-history__amount {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 17px;
    padding: 7px 13px;
    border-radius: 999px;
    color: var(--blue);
    background: #edf5fb;
    font-size: 13px;
    line-height: 1.4;
}

.foundation-history__amount span {
    font-weight: 700;
}

.foundation-history__amount strong {
    font-weight: 900;
}


/* =========================================================
   데이터 없음
========================================================= */

.foundation-history__empty {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 58px 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #f8fafc;
    text-align: center;
}

.foundation-history__empty-mark {
    display: block;
    margin-bottom: 10px;
    color: var(--gold-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.foundation-history__empty strong {
    display: block;
    color: var(--navy);
    font-size: 19px;
    font-weight: 800;
}

.foundation-history__empty p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}


/* =========================================================
   태블릿
========================================================= */

@media (max-width: 900px) {
    .foundation-history__timeline {
        width: min(100%, 760px);
    }

    .foundation-history__item {
        grid-template-columns:
            minmax(0, 1fr)
            148px
            minmax(0, 1fr);
        column-gap: 32px;
    }

    .foundation-history__card {
        padding: 22px;
    }

    .foundation-history__card::before {
        width: 33px;
    }

    .foundation-history__item--right
    .foundation-history__card::before {
        left: -33px;
    }

    .foundation-history__item--left
    .foundation-history__card::before {
        right: -33px;
    }

    .foundation-history__card-head {
        display: grid;
        justify-content: stretch;
        gap: 8px;
    }

    .foundation-history__card-head--single {
        justify-content: start;
    }

    .foundation-history__position {
        width: fit-content;
    }

    .foundation-history__chairman {
        display: block;
    }

    .foundation-history__chairman span {
        display: block;
        margin-top: 3px;
    }
}


/* =========================================================
   모바일
========================================================= */

@media (max-width: 640px) {
    .history-section {
        padding: 70px 0 84px;
    }

    .foundation-history__tabs {
        margin-bottom: 52px;
        border-radius: 12px;
    }

    .foundation-history__tabs a {
        min-height: 54px;
        padding: 8px 10px;
        font-size: 14px;
    }


    /* 타임라인 */

    .foundation-history__timeline {
        padding-left: 44px;
    }

    .foundation-history__timeline::before {
        left: 18px;
        top: 24px;
        bottom: 40px;
        transform: none;
    }

    .foundation-history__item {
        display: block;
    }

    .foundation-history__item +
    .foundation-history__item {
        margin-top: 42px;
    }


    /* 연도 */

    .foundation-history__year {
        width: fit-content;
        min-width: 146px;
        min-height: 44px;
        padding: 8px 15px;
    }

    .foundation-history__year strong {
        font-size: 14px;
    }


    /* 카드 */

    .foundation-history__card,
    .foundation-history__item--left
    .foundation-history__card,
    .foundation-history__item--right
    .foundation-history__card {
        margin-top: 16px;
        padding: 21px 19px;
        border-radius: 18px;
    }

    .foundation-history__card::before,
    .foundation-history__item--left
    .foundation-history__card::before,
    .foundation-history__item--right
    .foundation-history__card::before {
        left: -27px;
        right: auto;
        top: 28px;
        width: 27px;
    }

    .foundation-history__card-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .foundation-history__card-head--single {
        justify-content: flex-end;
    }

    .foundation-history__chairman {
        display: flex;
    }

    .foundation-history__chairman strong {
        font-size: 21px;
    }

    .foundation-history__chairman span {
        display: inline;
        margin-top: 0;
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .foundation-history__timeline {
        padding-left: 38px;
    }

    .foundation-history__timeline::before {
        left: 14px;
    }

    .foundation-history__year {
        min-width: 136px;
    }

    .foundation-history__card-head {
        display: grid;
    }

    .foundation-history__card-head--single {
        justify-content: start;
    }

    .foundation-history__chairman {
        display: block;
    }

    .foundation-history__chairman span {
        display: block;
        margin-top: 3px;
    }
}