.tmf-lore {
    --lore-accent: #f05454;
    --lore-accent-bright: #ff6b60;
    --lore-surface: #242424;
    --lore-surface-raised: #2e2e2e;
    --lore-border: rgba(240, 84, 84, 0.35);
    --lore-muted: #aaa;
    color: #dcdcdc;
}

.tmf-lore *,
.tmf-lore *::before,
.tmf-lore *::after {
    box-sizing: border-box;
}

.tmf-lore [hidden] {
    display: none !important;
}

.tmf-lore a:focus-visible,
.tmf-lore button:focus-visible,
.tmf-lore input:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.tmf-lore__local-nav {
    display: flex;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 6px;
    margin: -5px 0 30px;
    padding: 8px;
    border: 1px solid #3b3b3b;
    border-radius: 8px;
    background: #202020;
    background-image: none;
    box-shadow: none;
    scrollbar-width: thin;
}

.tmf-lore__local-nav a {
    flex: 0 0 auto;
    margin: 0;
    padding: 9px 14px;
    border-radius: 5px;
    color: #cfcfcf;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.tmf-lore__local-nav a:hover,
.tmf-lore__local-nav a.is-active {
    background: var(--lore-accent);
    color: #fff;
    transform: none;
}

.tmf-lore__hero,
.tmf-lore__detail-hero {
    position: relative;
    display: flex;
    min-height: 340px;
    overflow: hidden;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 40px;
    border: 2px solid var(--lore-accent);
    background-position: center;
    background-size: cover;
    text-align: left;
}

.tmf-lore__hero {
    background-image:
        linear-gradient(90deg, rgba(13, 13, 13, 0.9) 0%, rgba(13, 13, 13, 0.52) 58%, rgba(13, 13, 13, 0.7) 100%),
        url('/assets/images/lorewalkers/lorewalkers-hero.webp');
}

.tmf-lore__hero h1,
.tmf-lore__detail-hero h1 {
    max-width: 780px;
    margin: 0 0 10px;
    font-size: clamp(2.3rem, 6vw, 4.5rem);
    line-height: 0.98;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.95);
}

.tmf-lore__hero > p:not(.tmf-lore__eyebrow),
.tmf-lore__detail-hero > p:not(.tmf-lore__eyebrow) {
    max-width: 700px;
    margin: 0;
    font-size: 1.16rem;
    line-height: 1.65;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

.tmf-lore__detail-hero > p.tmf-lore__hero-summary {
    display: -webkit-box;
    max-height: 6.6em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.tmf-lore__eyebrow,
.tmf-lore__meta {
    margin: 0 0 10px;
    color: var(--lore-accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.tmf-lore__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.tmf-lore .button--secondary {
    border: 1px solid #777;
    background: rgba(20, 20, 20, 0.78);
}

.tmf-lore .button--secondary:hover {
    border-color: var(--lore-accent);
    background: #333;
}

.tmf-lore__lead {
    padding: 4px 0 8px;
}

.tmf-lore__lead > p:not(.tmf-lore__eyebrow),
.tmf-lore__page-heading p,
.tmf-lore__story p,
.tmf-lore__plane-card p,
.tmf-lore__coming p,
.tmf-lore__prose p,
.tmf-lore__timeline-item p,
.tmf-lore__character-card p,
.tmf-lore__identity-hero p,
.tmf-lore__sources p {
    line-height: 1.7;
}

.tmf-lore__lead > p:not(.tmf-lore__eyebrow),
.tmf-lore__page-heading > p:not(.tmf-lore__eyebrow) {
    max-width: 850px;
    font-size: 1.08rem;
}

.tmf-lore__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 28px 0 0;
}

.tmf-lore__stats > div {
    padding: 18px;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    background: #222;
}

.tmf-lore__stats dt {
    color: var(--lore-accent);
    font-size: 1.85rem;
    font-weight: 700;
}

.tmf-lore__stats dd {
    margin: 4px 0 0;
    color: var(--lore-muted);
}

.tmf-lore__page-heading {
    width: auto;
    height: auto;
    max-width: 900px;
    padding: 24px 0 10px;
}

.tmf-lore__page-heading h1,
.tmf-lore__identity-hero h1 {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(2.25rem, 6vw, 4rem);
    line-height: 1.05;
}

.tmf-lore__section {
    margin-top: 48px;
}

.tmf-lore__section-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 20px;
}

.tmf-lore__section-heading h2,
.tmf-lore__section-heading p {
    margin-bottom: 0;
}

.tmf-lore__section-heading h2 {
    min-width: min(520px, 100%);
}

.tmf-lore__text-link,
.tmf-lore__card-link,
.tmf-lore__timeline-item a,
.tmf-lore__sources a {
    color: var(--lore-accent);
    font-weight: 700;
    text-decoration: none;
}

.tmf-lore__text-link:hover,
.tmf-lore__card-link:hover,
.tmf-lore__timeline-item a:hover,
.tmf-lore__sources a:hover {
    color: #fff;
    text-decoration: underline;
}

.tmf-lore__story-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tmf-lore .content-card {
    min-width: 0;
    border: 1px solid transparent;
    transform: none;
}

.tmf-lore .content-card:hover {
    border-color: var(--lore-border);
    box-shadow: 0 9px 24px rgba(0, 0, 0, 0.58);
    transform: translateY(-4px);
}

.tmf-lore__story-image {
    display: block;
    height: 190px;
    background-position: center;
    background-size: cover;
}

.tmf-lore .card-header h3 {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    margin: 0;
    padding: 7px 11px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 1.35rem;
}

.tmf-lore__story .card-body,
.tmf-lore__plane-card .card-body,
.tmf-lore__character-card .card-body {
    justify-content: flex-start;
}

.tmf-lore__story .card-body > p:not(.tmf-lore__meta),
.tmf-lore__plane-card .card-body > p:not(.tmf-lore__meta) {
    margin-top: 0;
}

.tmf-lore__card-link {
    display: inline-block;
    margin-top: auto;
    padding-top: 18px;
}

.tmf-lore__status {
    display: inline-block;
    margin-top: 12px;
    color: var(--lore-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.tmf-lore__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tmf-lore__tags span {
    padding: 5px 8px;
    border: 1px solid #454545;
    border-radius: 999px;
    color: #bbb;
    font-size: 0.78rem;
}

.tmf-lore__plane-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tmf-lore__plane-grid--library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tmf-lore__plane-card h3,
.tmf-lore__character-card h3,
.tmf-lore__connection-grid h3,
.tmf-lore__chapter h3,
.tmf-lore__timeline-item h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 1.35rem;
}

.tmf-lore__profile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.tmf-lore__profile-card {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 16px;
    color: inherit;
    text-decoration: none;
}

.tmf-lore__profile-card strong,
.tmf-lore__profile-card small {
    display: block;
}

.tmf-lore__profile-card strong {
    margin-bottom: 4px;
    color: #fff;
}

.tmf-lore__profile-card small {
    color: var(--lore-muted);
    line-height: 1.35;
}

.tmf-lore__monogram,
.tmf-lore__plane-sigil {
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    place-items: center;
    border: 1px solid var(--lore-accent);
    border-radius: 50%;
    background: rgba(240, 84, 84, 0.12);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
}

.tmf-lore__coming,
.tmf-lore__roadmap {
    margin-top: 48px;
}

.tmf-lore__coming:hover,
.tmf-lore__roadmap:hover,
.tmf-lore__aside:hover {
    border-color: transparent;
    transform: none;
}

.tmf-lore__coming .card-body {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: center;
}

.tmf-lore__coming .card-body > div:first-child {
    flex: 1;
}

.tmf-lore__coming h2,
.tmf-lore__roadmap h2,
.tmf-lore__aside h2 {
    margin-top: 0;
}

.tmf-lore__coming p:last-child,
.tmf-lore__roadmap p:last-child {
    margin-bottom: 0;
}

.tmf-lore__search {
    margin-bottom: 22px;
}

.tmf-lore__search label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 700;
}

.tmf-lore__search input {
    width: min(100%, 620px);
    padding: 12px 14px;
    border: 1px solid #4b4b4b;
    border-radius: 6px;
    background: #181818;
    color: #fff;
    font: inherit;
}

.tmf-lore__search input::placeholder {
    color: #8d8d8d;
}

.tmf-lore__result-count {
    color: var(--lore-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.tmf-lore__no-results,
.tmf-lore__notice {
    padding: 22px;
    border: 1px dashed #555;
    border-radius: 8px;
    color: var(--lore-muted);
    text-align: center;
}

.tmf-lore__character-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.tmf-lore__character-top {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 20px 20px 0;
}

.tmf-lore__character-top .tmf-lore__meta {
    margin-bottom: 5px;
}

.tmf-lore__subtitle {
    margin: 0;
    color: var(--lore-muted);
}

.tmf-lore__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    background: none;
    background-image: none;
    box-shadow: none;
    color: #999;
    font-size: 0.85rem;
}

.tmf-lore__breadcrumbs a {
    margin: 0;
    color: var(--lore-accent);
    font-size: inherit;
    font-weight: 700;
}

.tmf-lore__breadcrumbs a:hover {
    color: #fff;
    transform: none;
}

.tmf-lore__detail-hero {
    min-height: 315px;
}

.tmf-lore__reading-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(250px, 0.7fr);
    gap: 28px;
    align-items: start;
    margin-top: 35px;
}

.tmf-lore__prose h2 {
    margin-top: 0;
}

.tmf-lore__prose p {
    font-size: 1.04rem;
}

.tmf-lore__aside .card-body {
    display: block;
}

.tmf-lore__aside ol,
.tmf-lore__feature-list {
    margin: 0;
    padding-left: 20px;
}

.tmf-lore__aside li,
.tmf-lore__feature-list li {
    margin: 10px 0;
    line-height: 1.5;
}

.tmf-lore__aside a:not(.button) {
    color: var(--lore-accent);
    text-decoration: none;
}

.tmf-lore__chapters,
.tmf-lore__timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tmf-lore__chapters {
    display: grid;
    gap: 18px;
}

.tmf-lore__chapter {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
}

.tmf-lore__chapter-number {
    display: grid;
    place-items: start center;
    padding-top: 22px;
    border-right: 1px solid #454545;
    color: var(--lore-accent);
    font-size: 1.4rem;
    font-weight: 700;
}

.tmf-lore__chapter-summary {
    color: #fff;
    font-size: 1.06rem;
    font-weight: 700;
}

.tmf-lore__connection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.tmf-lore__link-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tmf-lore__link-list li + li {
    border-top: 1px solid #414141;
}

.tmf-lore__link-list a {
    display: block;
    padding: 12px 0;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.tmf-lore__link-list a:hover {
    color: var(--lore-accent);
}

.tmf-lore__link-list span {
    display: block;
    margin-top: 3px;
    color: var(--lore-muted);
    font-size: 0.82rem;
    font-weight: 400;
}

.tmf-lore__sources {
    margin-top: 45px;
    padding: 22px;
    border: 1px solid #414141;
    border-radius: 8px;
    background: #202020;
}

.tmf-lore__sources h2 {
    margin-top: 0;
    font-size: 1.45rem;
}

.tmf-lore__sources ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 15px 0 0;
    padding-left: 20px;
}

.tmf-lore__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
}

.tmf-lore__filters button {
    padding: 9px 13px;
    border: 1px solid #555;
    border-radius: 999px;
    background: #202020;
    color: #ddd;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
}

.tmf-lore__filters button:hover,
.tmf-lore__filters button.is-active {
    border-color: var(--lore-accent);
    background: var(--lore-accent);
    color: #fff;
}

.tmf-lore__timeline {
    position: relative;
}

.tmf-lore__timeline::before {
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 25px;
    width: 2px;
    background: linear-gradient(var(--lore-accent), #555);
    content: '';
}

.tmf-lore__timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 20px;
    padding: 0 0 28px;
}

.tmf-lore__timeline-item:last-child {
    padding-bottom: 0;
}

.tmf-lore__timeline-marker,
.tmf-lore__timeline-item::before {
    position: relative;
    z-index: 1;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 2px solid var(--lore-accent);
    border-radius: 50%;
    background: #252525;
    color: #fff;
    font-weight: 700;
}

.tmf-lore__timeline-item:not(:has(.tmf-lore__timeline-marker))::before {
    content: '';
}

.tmf-lore__timeline-item > div:last-child {
    padding: 15px 18px;
    border: 1px solid #414141;
    border-radius: 8px;
    background: #242424;
}

.tmf-lore__timeline-item p:last-of-type {
    margin-bottom: 6px;
}

.tmf-lore__timeline--preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.tmf-lore__timeline--preview::before {
    display: none;
}

.tmf-lore__timeline--preview .tmf-lore__timeline-item {
    display: block;
    padding: 20px;
    border: 1px solid #414141;
    border-radius: 8px;
    background: #242424;
}

.tmf-lore__timeline--preview .tmf-lore__timeline-item::before {
    display: none;
}

.tmf-lore__timeline--preview .tmf-lore__timeline-item > div:last-child {
    padding: 0;
    border: 0;
    background: transparent;
}

.tmf-lore__identity-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    min-height: 245px;
    padding: 34px;
    border: 1px solid var(--lore-border);
    border-radius: 10px;
    background:
        radial-gradient(circle at 12% 50%, rgba(240, 84, 84, 0.2), transparent 35%),
        linear-gradient(135deg, #272727, #1b1b1b);
}

.tmf-lore__identity-hero > div {
    max-width: 800px;
}

.tmf-lore__monogram--large,
.tmf-lore__plane-sigil {
    width: 115px;
    height: 115px;
    flex-basis: 115px;
    font-size: 3.2rem;
}

.tmf-lore__identity-subtitle {
    margin: -4px 0 12px;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}

.tmf-lore__identity-hero--plane {
    background:
        radial-gradient(circle at 12% 50%, rgba(240, 84, 84, 0.14), transparent 35%),
        linear-gradient(145deg, #292929, #171717);
}

.tmf-lore__plane-sigil {
    border-radius: 18px;
}

.tmf-lore__facts {
    margin: 0;
}

.tmf-lore__facts > div {
    padding: 10px 0;
    border-bottom: 1px solid #424242;
}

.tmf-lore__facts dt {
    color: var(--lore-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.tmf-lore__facts dd {
    margin: 4px 0 0;
    color: #fff;
    font-weight: 700;
}

.tmf-lore__moment-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.tmf-lore__moment-list li {
    min-width: 0;
    padding: 15px;
    border-top: 2px solid var(--lore-accent);
    background: #242424;
    line-height: 1.45;
}

.tmf-lore__moment-list span {
    display: block;
    margin-bottom: 10px;
    color: var(--lore-accent);
    font-weight: 700;
}

.tmf-lore__empty {
    margin-top: 25px;
}

@media (max-width: 950px) {
    .tmf-lore__story-grid,
    .tmf-lore__character-grid {
        grid-template-columns: 1fr;
    }

    .tmf-lore__story {
        display: grid;
        grid-template-columns: minmax(210px, 0.72fr) minmax(0, 1.28fr);
    }

    .tmf-lore__story-image {
        height: 100%;
        min-height: 210px;
    }

    .tmf-lore__profile-grid,
    .tmf-lore__plane-grid,
    .tmf-lore__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tmf-lore__moment-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .tmf-lore__hero,
    .tmf-lore__detail-hero {
        min-height: 300px;
        padding: 28px 20px;
    }

    .tmf-lore__detail-hero > p.tmf-lore__hero-summary {
        max-height: 7.75em;
        font-size: 1rem;
        line-height: 1.55;
        -webkit-line-clamp: 5;
        line-clamp: 5;
    }

    .tmf-lore__section-heading,
    .tmf-lore__coming .card-body {
        align-items: flex-start;
        flex-direction: column;
    }

    .tmf-lore__story {
        display: flex;
    }

    .tmf-lore__story-image {
        height: 165px;
        min-height: 0;
    }

    .tmf-lore__plane-grid,
    .tmf-lore__profile-grid,
    .tmf-lore__stats,
    .tmf-lore__timeline--preview,
    .tmf-lore__connection-grid,
    .tmf-lore__reading-layout {
        grid-template-columns: 1fr;
    }

    .tmf-lore__chapter {
        grid-template-columns: 55px minmax(0, 1fr);
    }

    .tmf-lore__chapter-number {
        font-size: 1rem;
    }

    .tmf-lore__identity-hero {
        grid-template-columns: 1fr;
        padding: 25px;
    }

    .tmf-lore__monogram--large,
    .tmf-lore__plane-sigil {
        width: 82px;
        height: 82px;
        font-size: 2.2rem;
    }

    .tmf-lore__moment-list {
        grid-template-columns: 1fr;
    }

    .tmf-lore__sources ul {
        display: block;
    }

    .tmf-lore__sources li + li {
        margin-top: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tmf-lore .content-card,
    .tmf-lore .button,
    .tmf-lore a {
        transition: none;
    }
}