/* =========================================
   SHARED ARCHIVE DIRECTORY
========================================= */

.archive-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;
}

.archive-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);
}

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

.archive-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);
}

.archive-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);
}

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

.archive-breadcrumb {
    width: min(calc(100% - (var(--page-padding) * 2)), 1200px);
    margin: 34px auto 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    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);
}

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

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

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

/* =========================================
   DIRECTORY SHELL
========================================= */

.archive-list-container {
    width: min(calc(100% - (var(--page-padding) * 2)), 1200px);
    margin: 0 auto;
    padding: 18px 0 clamp(85px, 9vw, 125px);
}

.archive-list-container > h2 {
    margin: 0 0 42px;
    text-align: center;
    font-family: var(--title-font);
    font-size: clamp(31px, 4vw, 46px);
    color: var(--gold-light);
    text-shadow: 0 3px 12px rgba(0,0,0,.42);
}

.archive-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    align-items: stretch;
}

/* =========================================
   RECORD CARD
   Mirrors the light parchment treatment used
   by the Characters directory.
========================================= */

.archive-entry-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    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, box-shadow .28s ease, border-color .28s ease;
}

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

.archive-entry-card:focus-visible {
    outline: 3px solid var(--gold-light);
    outline-offset: 4px;
}

.archive-entry-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 40%, rgba(255,248,220,.72), transparent 42%),
        linear-gradient(145deg, #d9c79a, #cbb37b);
}

.archive-entry-image-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 58px;
    pointer-events: none;
    background: linear-gradient(transparent, rgba(236,217,174,.82));
}

.archive-entry-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform .45s ease;
}

.archive-entry-card:hover .archive-entry-image,
.archive-entry-card:focus-visible .archive-entry-image {
    transform: scale(1.035);
}

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

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

.archive-entry-image-wrap.is-missing .archive-entry-placeholder {
    opacity: 1;
}

.archive-entry-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    padding: 23px 22px 25px;
    text-align: center;
}

/* Hidden/discoverable records sit on the same light parchment cards as public
   records, so their discovery label needs its own high-contrast treatment. */
.archive-secret-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 10px;
    padding: 6px 11px;
    border: 1px solid rgba(198,156,74,.90);
    border-radius: 999px;
    background: linear-gradient(145deg, #101827, #1b2940);
    color: #fff0ad;
    font-family: var(--title-font);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1.25px;
    text-transform: uppercase;
    text-shadow: 0 1px 5px rgba(0,0,0,.65);
    box-shadow: 0 4px 10px rgba(0,0,0,.16);
}

.archive-entry-type {
    display: block;
    margin-bottom: 7px;
    font-family: var(--title-font);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: #8b5d1f;
}

.archive-entry-content h3 {
    margin: 0 0 11px;
    font-family: var(--title-font);
    font-size: clamp(24px, 2.4vw, 30px);
    line-height: 1.2;
    color: #56351a;
}

.archive-entry-content p {
    margin: 0 0 22px;
    flex: 1;
    font-size: 16px;
    line-height: 1.55;
    color: #65513d;
}

.archive-entry-read {
    display: inline-flex;
    align-items: center;
    margin-top: auto;
    color: #936421;
    font-family: var(--title-font);
    font-size: 12px;
    letter-spacing: .6px;
    text-transform: uppercase;
    transition: transform .22s ease, color .22s ease;
}

.archive-entry-card:hover .archive-entry-read,
.archive-entry-card:focus-visible .archive-entry-read {
    transform: translateX(4px);
    color: #6e4518;
}

@media (max-width: 1000px) {
    .archive-entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 700px) {
    .archive-directory-page .wiki-hero {
        padding-inline: 20px;
    }

    .archive-breadcrumb,
    .archive-list-container {
        width: min(100% - 32px, 1200px);
    }

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

    .archive-entry-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}

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