/* ══════════════════════════════════════════════════════════════
   Lore Wiki Styles — Pax Dei Archives
   Design language matches quests.html
   ══════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────── */
.lore-wiki-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 70vh;
}

@media (min-width: 1024px) {
    .lore-wiki-container {
        flex-direction: row;
        border: 1px solid #374151;
        border-radius: 1rem;
        overflow: hidden;
        background: #1f2937;
        box-shadow: 0 25px 50px -14px rgba(0, 0, 0, 0.5);
    }
}

/* ── Sidebar ────────────────────────────────────────────────── */
.lore-sidebar-wrapper {
    flex: 0 0 280px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid #374151;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    overflow: hidden;
}

@media (max-width: 1023px) {
    .lore-sidebar-wrapper {
        border: 1px solid #374151;
        border-radius: 0.75rem;
        margin-bottom: 1rem;
        max-height: 40vh;
    }
}

.lore-sidebar-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #374151;
}

.lore-sidebar-section:last-child {
    border-bottom: none;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #1f2937;
}

.lore-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #FFD700;
    margin-bottom: 0.75rem;
}

.lore-sidebar-wrapper ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lore-sidebar-wrapper ul li {
    margin-bottom: 2px;
}

.lore-sidebar-wrapper ul li a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #9CA3AF;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.lore-sidebar-wrapper ul li a:hover {
    background-color: #374151;
    color: #E5E7EB;
}

.lore-sidebar-wrapper ul li a.active-lore-category {
    background-color: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    border-left-color: #FFD700;
    font-weight: 600;
}

.lore-sidebar-wrapper ul li a.active-lore-item {
    background-color: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    border-left-color: #FFD700;
    font-weight: 600;
}

/* ── Main Content Area ──────────────────────────────────────── */
.lore-main-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom right, #1f2937, #111827);
    overflow: hidden;
}

@media (max-width: 1023px) {
    .lore-main-content-area {
        border: 1px solid #374151;
        border-radius: 0.75rem;
        min-height: 50vh;
    }
}

/* ── Breadcrumbs ────────────────────────────────────────────── */
.lore-breadcrumbs {
    padding: 0.75rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #374151;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lore-breadcrumbs a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.15s;
}

.lore-breadcrumbs a:hover {
    color: #FFD700;
}

.lore-breadcrumbs .separator {
    color: #4B5563;
}

.lore-breadcrumbs .current {
    color: #E5E7EB;
}

/* ── Content Scroll Area ────────────────────────────────────── */
.lore-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #1f2937;
}

/* ── Article Header ─────────────────────────────────────────── */
.lore-article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #374151;
}

.lore-article-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.lore-article-header .lore-article-category {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #FFD700;
}

/* ── Infobox (wiki-style metadata card) ─────────────────────── */
.lore-infobox {
    float: right;
    width: 280px;
    margin: 0 0 1.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    overflow: hidden;
}

.lore-infobox-title {
    padding: 0.75rem 1rem;
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 1px solid #374151;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #FFD700;
    text-align: center;
}

.lore-infobox-row {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
    display: flex;
    gap: 0.75rem;
    font-size: 14px;
}

.lore-infobox-row:last-child {
    border-bottom: none;
}

.lore-infobox-label {
    flex: 0 0 90px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding-top: 2px;
}

.lore-infobox-value {
    flex: 1;
    color: #E5E7EB;
}

.lore-infobox-value ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lore-infobox-value ul li {
    margin-bottom: 0.2rem;
    font-size: 14px;
    line-height: 1.4;
}

.lore-infobox-value a {
    color: #63B3ED;
    text-decoration: none;
    transition: color 0.15s;
}

.lore-infobox-value a:hover {
    color: #FFD700;
    text-decoration: underline;
}

.lore-infobox-value p {
    margin: 0;
}

@media (max-width: 768px) {
    .lore-infobox {
        float: none;
        width: 100%;
        margin: 0 0 1.5rem 0;
    }
}

/* ── Article Body Typography ────────────────────────────────── */
.lore-article-body {
    font-size: 15px;
    line-height: 1.85;
    color: #D1D5DB;
    overflow: hidden;
}

.lore-article-body p {
    margin-bottom: 1.25rem;
}

.lore-article-body h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #374151;
}

.lore-article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #F3F4F6;
    margin: 1.75rem 0 0.75rem;
}

.lore-article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #E5E7EB;
    margin: 1.5rem 0 0.75rem;
}

.lore-article-body h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #D1D5DB;
    margin: 1.25rem 0 0.5rem;
}

.lore-article-body h5,
.lore-article-body h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #9CA3AF;
    margin: 1rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lore-article-body ul,
.lore-article-body ol {
    margin: 1rem 0 1.25rem 1.5rem;
    color: #D1D5DB;
}

.lore-article-body ul li {
    list-style-type: disc;
    margin-bottom: 0.4rem;
}

.lore-article-body ol li {
    list-style-type: decimal;
    margin-bottom: 0.4rem;
}

.lore-article-body a {
    color: #63B3ED;
    text-decoration: underline;
    text-decoration-color: rgba(99, 179, 237, 0.3);
    transition: text-decoration-color 0.15s;
}

.lore-article-body a:hover {
    text-decoration-color: #63B3ED;
}

.lore-article-body strong {
    color: #FFD700;
    font-weight: 600;
}

.lore-article-body em {
    color: #E5E7EB;
}

.lore-article-body hr {
    border: none;
    border-top: 1px solid #374151;
    margin: 2rem 0;
}

.lore-article-body code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #FCD34D;
}

.lore-article-body sup {
    color: #FCD34D;
    font-size: 11px;
    font-weight: 600;
}

/* ── Blockquotes ────────────────────────────────────────────── */
.lore-article-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #FFD700;
    background: rgba(255, 215, 0, 0.03);
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #E5E7EB;
    line-height: 1.75;
    overflow: hidden;
}

.lore-article-body blockquote p {
    margin-bottom: 0.5rem;
}

.lore-article-body blockquote p:last-child {
    margin-bottom: 0;
}

.lore-article-body blockquote footer,
.lore-article-body blockquote cite {
    display: block;
    text-align: right;
    font-size: 0.85em;
    color: #9CA3AF;
    margin-top: 0.75rem;
    font-style: normal;
}

/* ── Sources & Research Footer ──────────────────────────────── */
.lore-article-footer {
    clear: both;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #374151;
}

.lore-article-footer h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6B7280;
    margin-bottom: 1rem;
}

.lore-article-footer .footer-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(55, 65, 81, 0.5);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 14px;
    line-height: 1.7;
    color: #9CA3AF;
}

.lore-article-footer .footer-section strong {
    color: #D1D5DB;
}

.lore-article-footer .footer-section a {
    color: #63B3ED;
    text-decoration: underline;
    word-break: break-all;
}

/* ── Cross References / See Also ────────────────────────────── */
.lore-see-also {
    clear: both;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #374151;
}

.lore-see-also h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6B7280;
    margin-bottom: 0.75rem;
}

.lore-see-also-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lore-see-also-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #374151;
    border-radius: 9999px;
    color: #9CA3AF;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}

.lore-see-also-link:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    color: #FFD700;
}

.lore-see-also-link i {
    font-size: 10px;
}

/* ── Category Landing Page ──────────────────────────────────── */
.lore-category-landing h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.lore-category-count {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 1.5rem;
}

.lore-entry-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .lore-entry-cards {
        grid-template-columns: 1fr 1fr;
    }
}

.lore-entry-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: block;
}

.lore-entry-card:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-1px);
}

.lore-entry-card h5 {
    font-size: 16px;
    font-weight: 600;
    color: #E5E7EB;
    margin-bottom: 0.25rem;
}

.lore-entry-card:hover h5 {
    color: #FFD700;
}

.lore-entry-card .entry-preview {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lore-entry-card .entry-meta {
    font-size: 11px;
    color: #4B5563;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Home / Category Selection Cards ────────────────────────── */
.lore-home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 2rem;
}

.lore-home-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.lore-home-card:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.lore-home-card i {
    font-size: 2rem;
    color: #DAA520;
    margin-bottom: 0.75rem;
    display: block;
}

.lore-home-card:hover i {
    color: #FFD700;
}

.lore-home-card h5 {
    font-size: 16px;
    font-weight: 600;
    color: #E5E7EB;
    margin: 0;
}

.lore-home-card:hover h5 {
    color: #FFFFFF;
}

.lore-home-card .card-count {
    font-size: 14px;
    color: #6B7280;
    margin-top: 0.25rem;
}

/* ── Loading / Empty States ─────────────────────────────────── */
.lore-loading-indicator,
.lore-no-content-message {
    text-align: center;
    color: #6B7280;
    padding: 3rem 2rem;
    font-size: 16px;
}

.lore-loading-indicator i {
    display: block;
    font-size: 2rem;
    color: #FFD700;
    margin-bottom: 1rem;
}

/* ── Small Category Nav Bar ─────────────────────────────────── */
.lore-category-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 2rem;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid #374151;
}

.lore-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #374151;
    border-radius: 9999px;
    color: #9CA3AF;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}

.lore-category-pill:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    color: #FFD700;
}

.lore-category-pill.active {
    background: #FFD700;
    border-color: #FFD700;
    color: #000;
    font-weight: 700;
}

.lore-category-pill i {
    font-size: 11px;
}

/* ── Top Bar (category pills + search) ─────────────────────────── */
.lore-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #374151;
    background: rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
}

.lore-topbar .lore-category-bar {
    flex: 1;
    min-width: 0;
    padding: 0;
    border-bottom: none;
    background: none;
    flex-wrap: wrap;
}

/* ── Search Wrapper ──────────────────────────────────────── */
.lore-search-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 220px;
}

.lore-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
    font-size: 12px;
    pointer-events: none;
}

.lore-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
    border-radius: 6px;
    color: #E5E7EB;
    font-size: 15px;
    padding: 7px 10px 7px 32px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lore-search-input::placeholder {
    color: #4B5563;
}

.lore-search-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.15);
}

/* ── Search Results Dropdown ────────────────────────────── */
.lore-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 400px;
    width: max-content;
    max-width: 600px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
}

.lore-search-results.active {
    display: block;
}

.lore-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #D1D5DB;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid #374151;
    transition: background 0.1s;
}

.lore-search-result-item:last-child {
    border-bottom: none;
}

.lore-search-result-item:hover {
    background: rgba(255, 215, 0, 0.08);
    color: #FFD700;
}

.lore-search-result-icon {
    font-size: 11px;
    color: #6B7280;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.lore-search-result-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.lore-search-result-title mark {
    background: transparent;
    color: #FFD700;
    font-weight: 600;
}

.lore-search-result-category {
    font-size: 13px;
    color: #4B5563;
    flex-shrink: 0;
}

.lore-search-no-results {
    padding: 12px 14px;
    color: #4B5563;
    font-size: 15px;
    text-align: center;
}

/* ── Lore Pagination ─────────────────────────────────────────── */
.lore-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.lore-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 6px;
    color: #9CA3AF;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.lore-page-btn:hover:not(:disabled):not(.active) {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.35);
    color: #FFD700;
}

.lore-page-btn.active {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.5);
    color: #FFD700;
    font-weight: 600;
    cursor: default;
}

.lore-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lore-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: #4B5563;
    font-size: 13px;
    user-select: none;
}
