.ib-history-page {
    --history-ink: #172033;
    --history-muted: #667085;
    --history-line: #d8dee9;
    --history-honor: #b98916;
    --history-person: #1f5b83;
    --history-paper: #f7f3ea;
}

.ib-history-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(72px, 9vw, 132px) 0 64px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(191, 145, 37, .28), transparent 34%),
        linear-gradient(135deg, #111827 0%, #1c2739 56%, #242f3f 100%);
}

.ib-history-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .12;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .15) 1px, transparent 1px);
    background-size: 42px 42px;
}

.ib-history-hero .ib-container {
    position: relative;
    z-index: 1;
}

.ib-history-hero h1 {
    max-width: 820px;
    margin: 12px 0 18px;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 1.15;
}

.ib-history-hero > .ib-container > p {
    max-width: 800px;
    color: rgba(255, 255, 255, .78);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 2;
}

.ib-history-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, .64);
    font-size: 13px;
}

.ib-history-breadcrumb a {
    color: #f0ca68;
    font-weight: 800;
}

.ib-history-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 850px;
    margin: 34px 0 26px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .07);
    backdrop-filter: blur(8px);
}

.ib-history-stats > div {
    padding: 18px 22px;
}

.ib-history-stats > div + div {
    border-right: 1px solid rgba(255, 255, 255, .14);
}

.ib-history-stats strong,
.ib-history-stats span {
    display: block;
}

.ib-history-stats strong {
    color: #f0ca68;
    font-size: 24px;
}

.ib-history-stats span {
    margin-top: 6px;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.ib-history-section {
    background:
        linear-gradient(180deg, #f7f4ed 0, #fff 360px);
}

.ib-history-filter {
    position: relative;
    z-index: 2;
    margin-top: -72px;
    padding: 24px;
    border: 1px solid rgba(23, 32, 51, .08);
    box-shadow: 0 22px 55px rgba(23, 32, 51, .11);
}

.ib-history-filter__grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(170px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.ib-history-filter label {
    display: block;
    margin-bottom: 7px;
    color: var(--history-ink);
    font-size: 13px;
    font-weight: 800;
}

.ib-history-filter input,
.ib-history-filter select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d9dee7;
    border-radius: 11px;
    background: #fff;
}

.ib-history-filter__actions {
    display: flex;
    gap: 8px;
}

.ib-history-periods {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-top: 18px;
    overflow-x: auto;
    border-top: 1px solid #eceff3;
    scrollbar-width: thin;
}

.ib-history-periods a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid #dce1e8;
    border-radius: 999px;
    color: #344054;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
}

.ib-history-periods a.is-active {
    color: #fff;
    border-color: var(--history-ink);
    background: var(--history-ink);
}

.ib-history-periods em {
    min-width: 23px;
    padding: 1px 6px;
    border-radius: 999px;
    color: inherit;
    background: rgba(127, 127, 127, .14);
    font-size: 11px;
    font-style: normal;
    text-align: center;
}

.ib-history-archive-head {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr);
    gap: 32px;
    align-items: end;
    margin: 52px 0 24px;
}

.ib-history-archive-head h2 {
    margin: 7px 0 0;
    color: var(--history-ink);
    font-size: clamp(27px, 4vw, 42px);
}

.ib-history-archive-head p {
    margin: 0;
    color: var(--history-muted);
    line-height: 1.9;
}

.ib-history-period-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ib-history-period-card {
    position: relative;
    display: flex;
    min-height: 280px;
    flex-direction: column;
    padding: 24px;
    overflow: hidden;
    border: 1px solid #e2e7ed;
    border-radius: 20px;
    color: var(--history-ink);
    background:
        radial-gradient(circle at 10% 8%, rgba(185, 137, 22, .12), transparent 30%),
        #fff;
    box-shadow: 0 12px 30px rgba(23, 32, 51, .06);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ib-history-period-card:hover {
    transform: translateY(-4px);
    border-color: rgba(185, 137, 22, .45);
    box-shadow: 0 18px 38px rgba(23, 32, 51, .11);
}

.ib-history-period-card > span {
    color: var(--history-honor);
    font-size: 12px;
    font-weight: 900;
}

.ib-history-period-card h2 {
    margin: 10px 0 3px;
    color: var(--history-ink);
    font-size: 27px;
}

.ib-history-period-card strong {
    color: #475467;
    font-size: 14px;
}

.ib-history-period-card p {
    margin: 18px 0;
    color: var(--history-muted);
    font-size: 13px;
    line-height: 1.9;
}

.ib-history-period-card em {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #edf0f3;
    color: var(--history-ink);
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
}

.ib-history-period-card em i {
    color: var(--history-honor);
    font-size: 20px;
    font-style: normal;
}

.ib-history-result-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin: 52px 0 30px;
}

.ib-history-result-head h2 {
    margin: 7px 0;
    color: var(--history-ink);
    font-size: clamp(27px, 4vw, 44px);
}

.ib-history-result-head p {
    margin: 0;
    color: var(--history-muted);
}

.ib-history-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ib-history-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475467;
    font-size: 13px;
    font-weight: 700;
}

.ib-history-legend span::before {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    content: "";
}

.ib-history-legend .is-honor::before {
    background: var(--history-honor);
}

.ib-history-legend .is-person::before {
    background: var(--history-person);
}

.ib-history-timeline {
    position: relative;
}

.ib-history-timeline::before {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 24px;
    right: 112px;
    width: 2px;
    background: linear-gradient(var(--history-line), #edf0f4);
}

.ib-history-item {
    position: relative;
    display: grid;
    grid-template-columns: 94px 210px minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 26px;
}

.ib-history-item__axis {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 23px;
}

.ib-history-item__axis span {
    color: var(--history-ink);
    font-size: 14px;
    font-weight: 900;
    text-align: left;
}

.ib-history-item__axis i {
    position: absolute;
    top: 25px;
    left: -25px;
    z-index: 2;
    width: 14px;
    height: 14px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--history-honor);
    background: var(--history-honor);
}

.ib-history-item.is-person .ib-history-item__axis i {
    box-shadow: 0 0 0 2px var(--history-person);
    background: var(--history-person);
}

.ib-history-item__media {
    position: relative;
    display: flex;
    min-height: 200px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 18px;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(185, 137, 22, .88), rgba(91, 66, 14, .95));
    background-position: center;
    background-size: cover;
    box-shadow: 0 14px 30px rgba(23, 32, 51, .12);
}

.ib-history-item.is-person .ib-history-item__media {
    background-color: var(--history-person);
    background-image: linear-gradient(155deg, rgba(31, 91, 131, .88), rgba(17, 50, 77, .97));
}

.ib-history-item__media::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(8, 14, 25, .72));
    content: "";
}

.ib-history-item__media > span {
    font-size: 46px;
}

.ib-history-item__media em {
    position: absolute;
    right: 14px;
    bottom: 12px;
    z-index: 1;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.ib-history-item__body {
    padding: 25px 28px;
    border: 1px solid #e4e8ee;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(23, 32, 51, .055);
}

.ib-history-item__body h2 {
    margin: 7px 0 12px;
    font-size: clamp(21px, 3vw, 29px);
    line-height: 1.45;
}

.ib-history-item__body h2 a {
    color: var(--history-ink);
}

.ib-history-item__body > p {
    margin: 16px 0;
    color: var(--history-muted);
    line-height: 1.95;
}

.ib-history-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.ib-history-item__meta span {
    padding: 5px 9px;
    border-radius: 8px;
    color: #475467;
    background: #f2f4f7;
    font-size: 12px;
}

.ib-history-item__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--history-honor);
    font-size: 13px;
    font-weight: 900;
}

.ib-history-item.is-person .ib-history-item__link {
    color: var(--history-person);
}

.ib-history-pagination {
    margin: 34px 0;
}

.ib-history-period-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 26px 0 44px;
}

.ib-history-period-nav a {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px 20px;
    border: 1px solid #e1e6ec;
    border-radius: 15px;
    color: var(--history-ink);
    background: #fff;
}

.ib-history-period-nav a.is-next {
    text-align: left;
}

.ib-history-period-nav span {
    color: var(--history-muted);
    font-size: 12px;
}

.ib-history-period-nav strong {
    font-size: 16px;
}

.ib-history-empty {
    padding: 52px 24px;
    text-align: center;
}

.ib-history-empty > span {
    font-size: 44px;
}

.ib-history-source-note {
    display: grid;
    grid-template-columns: minmax(230px, .8fr) minmax(320px, 1.4fr) auto;
    gap: 28px;
    align-items: center;
    margin-top: 54px;
    padding: 28px;
    border-radius: 22px;
    color: #fff;
    background: var(--history-ink);
}

.ib-history-source-note h2 {
    margin: 6px 0 0;
    color: #fff;
    font-size: 22px;
}

.ib-history-source-note p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
    line-height: 1.9;
}

@media (max-width: 980px) {
    .ib-history-filter__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ib-history-item {
        grid-template-columns: 82px 170px minmax(0, 1fr);
        gap: 18px;
    }

    .ib-history-timeline::before {
        right: 96px;
    }

    .ib-history-source-note {
        grid-template-columns: 1fr;
    }

    .ib-history-period-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .ib-history-hero {
        padding-top: 62px;
    }

    .ib-history-stats {
        grid-template-columns: 1fr;
    }

    .ib-history-stats > div + div {
        border-top: 1px solid rgba(255, 255, 255, .14);
        border-right: 0;
    }

    .ib-history-filter {
        margin-top: -38px;
        padding: 17px;
    }

    .ib-history-filter__grid {
        grid-template-columns: 1fr;
    }

    .ib-history-filter__actions .ib-btn {
        flex: 1;
    }

    .ib-history-archive-head {
        display: block;
        margin-top: 38px;
    }

    .ib-history-archive-head p {
        margin-top: 12px;
    }

    .ib-history-period-grid {
        grid-template-columns: 1fr;
    }

    .ib-history-period-card {
        min-height: 0;
    }

    .ib-history-result-head {
        display: block;
        margin-top: 38px;
    }

    .ib-history-legend {
        margin-top: 14px;
    }

    .ib-history-timeline::before {
        right: 12px;
    }

    .ib-history-item {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
        padding-right: 0;
    }

    .ib-history-item__axis {
        grid-row: 1 / span 2;
        grid-column: 1;
        padding-top: 10px;
    }

    .ib-history-item__axis span {
        position: absolute;
        top: 18px;
        right: 42px;
        z-index: 3;
        min-width: max-content;
        padding: 5px 9px;
        border-radius: 8px;
        color: #fff;
        background: rgba(17, 24, 39, .78);
    }

    .ib-history-item__axis i {
        top: 22px;
        left: 15px;
    }

    .ib-history-item__media {
        grid-column: 2;
        min-height: 190px;
    }

    .ib-history-item__body {
        grid-column: 2;
        padding: 20px;
    }

    .ib-history-period-nav {
        grid-template-columns: 1fr;
    }

    .ib-history-period-nav > span:empty {
        display: none;
    }
}
