/* =========================================
   HISTORY DIRECTORY
========================================= */

.history-directory-page #app {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0%, rgba(244,212,124,.10), transparent 34%),
        linear-gradient(180deg, #101827 0%, #182235 52%, #101827 100%);
    color: #fff;
}

.history-directory-page .wiki-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(72px, 9vw, 112px) var(--page-padding) clamp(48px, 6vw, 72px);
    text-align: center;
    background:
        radial-gradient(circle at 50% 28%, rgba(244,212,124,.16), transparent 36%),
        linear-gradient(145deg, rgba(9,16,28,.98), rgba(25,37,56,.98));
    border-bottom: 3px solid rgba(244,212,124,.72);
    box-shadow: inset 0 -28px 70px rgba(0,0,0,.22);
}

.history-directory-page .wiki-hero::after {
    content: "✦";
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    color: rgba(244,212,124,.42);
    font-size: 22px;
}

.history-directory-page .wiki-hero h1 {
    margin: 0 0 14px;
    font-family: var(--title-font);
    font-size: clamp(44px, 7vw, 76px);
    line-height: 1.05;
    color: var(--gold-light);
    text-shadow: 0 4px 18px rgba(0,0,0,.72), 0 0 26px rgba(244,212,124,.12);
}

.history-directory-page .wiki-hero p {
    width: min(720px, 100%);
    margin: 0 auto;
    font-size: clamp(18px, 2.2vw, 22px);
    line-height: 1.6;
    color: rgba(255,255,255,.88);
}

.history-page {
    width: min(calc(100% - (var(--page-padding) * 2)), 1120px);
    margin: 0 auto;
    padding: 34px 0 clamp(90px, 9vw, 125px);
}

/* =========================================
   BREADCRUMB
========================================= */

.history-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 46px;
    font-family: var(--title-font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .45px;
    color: #fff0ad;
    text-shadow: 0 2px 8px rgba(0,0,0,.55);
}

.history-breadcrumb a {
    color: #f4d47c;
    text-decoration: none;
    transition: color .2s ease, text-shadow .2s ease;
}

.history-breadcrumb a:hover,
.history-breadcrumb a:focus-visible {
    color: #fff7cf;
    text-shadow: 0 0 12px rgba(244,212,124,.32);
}

.history-breadcrumb span {
    opacity: .96;
}

/* =========================================
   INTRODUCTION
========================================= */

.history-introduction {
    max-width: 760px;
    margin: 0 auto 30px;
    text-align: center;
}

.history-introduction h2 {
    margin: 0 0 14px;
    font-family: var(--title-font);
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.15;
    color: var(--gold-light);
    text-shadow: 0 3px 12px rgba(0,0,0,.42);
}

.history-introduction p {
    margin: 0;
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255,255,255,.80);
}

.history-loading {
    text-align: center;
    color: rgba(255,240,173,.82);
}

/* =========================================
   ERAS
========================================= */

.history-era {
    margin: 70px 0 84px;
}

.history-era-heading {
    max-width: 760px;
    margin: 0 auto 34px;
    text-align: center;
}

.history-era-heading h2 {
    margin: 0 0 10px;
    font-family: var(--title-font);
    font-size: clamp(27px, 4vw, 36px);
    color: #fff0ad;
}

.history-era-heading p {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255,255,255,.74);
}

/* =========================================
   TIMELINE
========================================= */

.history-events {
    position: relative;
    display: grid;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 52px;
}

.history-events::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 17px;
    width: 2px;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(244,212,124,.24), #f4d47c, rgba(244,212,124,.24));
    box-shadow: 0 0 13px rgba(244,212,124,.12);
}

/* =========================================
   EVENT CARD
   Light parchment surface against the dark
   archive background, matching Characters.
========================================= */

.history-event-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(190px, 30%) 1fr;
    min-width: 0;
    overflow: visible;
    text-decoration: none;
    color: #3b2618;
    background: linear-gradient(145deg, rgba(255,250,232,.98), rgba(234,213,166,.97));
    border: 2px solid rgba(198,156,74,.82);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
    transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.history-event-card::before {
    content: "";
    position: absolute;
    top: 27px;
    left: -45px;
    width: 20px;
    height: 20px;
    border: 3px solid #101827;
    border-radius: 50%;
    background: #f4d47c;
    box-shadow: 0 0 0 2px rgba(244,212,124,.45), 0 0 13px rgba(244,212,124,.26);
}

.history-event-link:hover,
.history-event-link:focus-visible {
    transform: translateY(-6px);
    border-color: var(--gold-light);
    box-shadow: 0 20px 40px rgba(0,0,0,.34);
}

.history-event-link:focus-visible {
    outline: 3px solid var(--gold-light);
    outline-offset: 4px;
}

.history-event-image-wrap {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    border-radius: 12px 0 0 12px;
    background:
        radial-gradient(circle at 50% 40%, rgba(255,248,220,.72), transparent 42%),
        linear-gradient(145deg, #d9c79a, #cbb37b);
    border-right: 1px solid rgba(139,93,31,.22);
}

.history-event-image-wrap::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    height: 52px;
    pointer-events: none;
    background: linear-gradient(transparent, rgba(236,217,174,.72));
}

.history-event-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 230px;
    display: block;
    object-fit: cover;
    transition: transform .45s ease;
}

.history-event-link:hover .history-event-image,
.history-event-link:focus-visible .history-event-image {
    transform: scale(1.035);
}

.history-event-image-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(123,82,31,.62);
    font-size: 54px;
    text-shadow: 0 2px 14px rgba(255,255,255,.32);
}

.history-event-image-wrap:not(.is-missing) .history-event-image-placeholder {
    opacity: .12;
}

.history-event-image-wrap.is-missing .history-event-image-placeholder {
    opacity: 1;
}

.history-event-content {
    min-width: 0;
    padding: 27px 29px 29px;
}

.history-date {
    display: block;
    margin-bottom: 8px;
    font-family: var(--title-font);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.7px;
    color: #8b5d1f;
}

.history-event-card h3 {
    margin: 0 0 11px;
    font-family: var(--title-font);
    font-size: clamp(23px, 3vw, 29px);
    line-height: 1.2;
    overflow-wrap: anywhere;
    color: #56351a;
}

.history-event-card p {
    margin: 0;
    font-size: 16px;
    line-height: 1.62;
    color: #65513d;
}

.history-marker {
    display: none;
}

@media (max-width: 760px) {
    .history-page {
        width: min(100% - 32px, 1120px);
    }

    .history-breadcrumb {
        font-size: 14px;
    }

    .history-events {
        padding-left: 34px;
    }

    .history-events::before {
        left: 9px;
    }

    .history-event-card {
        grid-template-columns: 1fr;
    }

    .history-event-card::before {
        left: -33px;
    }

    .history-event-image-wrap {
        min-height: 0;
        aspect-ratio: 16 / 9;
        border-radius: 12px 12px 0 0;
        border-right: 0;
        border-bottom: 1px solid rgba(139,93,31,.22);
    }

    .history-event-image {
        min-height: 0;
    }

    .history-event-content {
        padding: 22px 20px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .history-breadcrumb a,
    .history-event-card,
    .history-event-image {
        transition: none;
    }
}
