/* martiallaw.wiki — Encyclopedic Reference Design */

:root {
    --library-dark: #1a1612;
    --deep-brown: #16120e;
    --ink-black: #201c16;
    --antique-brass: #8a7a60;
    --warm-stone: #9a8e78;
    --vellum-cream: #d4c8ae;
    --alert-crimson: #9e3030;
    --reference-blue: #6a8ab0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--library-dark);
    color: var(--vellum-cream);
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    overflow-x: hidden;
    counter-reset: section;
}

/* ====================== TITLE PLATE ====================== */
.title-plate {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--deep-brown);
    padding: 60px 20px;
}

.title-plate-inner {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.wiki-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--vellum-cream);
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.wiki-subtitle {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--antique-brass);
    margin-bottom: 30px;
}

.title-rule {
    width: 80px;
    height: 2px;
    background: var(--antique-brass);
    margin: 0 auto 30px;
}

/* Table of Contents */
.toc {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    border: 1px solid rgba(138, 122, 96, 0.3);
    padding: 20px 24px;
}

.toc-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--vellum-cream);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.toc-list {
    list-style: none;
    counter-reset: toc-counter;
}

.toc-list li {
    counter-increment: toc-counter;
    padding: 4px 0;
}

.toc-list li::before {
    content: counter(toc-counter) ". ";
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--antique-brass);
}

.toc-list a {
    font-family: 'Source Serif 4', serif;
    font-size: 0.9rem;
    color: var(--reference-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.toc-list a:hover {
    border-bottom-color: var(--reference-blue);
}

/* ====================== MAIN CONTENT ====================== */
.wiki-main {
    padding: 60px 20px;
}

.content-column {
    max-width: 720px;
    margin: 0 auto;
}

/* Wiki Sections */
.wiki-section {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.wiki-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: var(--vellum-cream);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.subsection-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    color: var(--vellum-cream);
    margin: 30px 0 12px;
}

.section-rule {
    width: 40px;
    height: 1px;
    background: var(--antique-brass);
    margin-bottom: 24px;
}

.wiki-section p {
    margin-bottom: 16px;
    color: var(--warm-stone);
}

/* Drop Caps */
.drop-cap {
    float: left;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 3.5rem;
    line-height: 0.8;
    color: var(--antique-brass);
    margin-right: 4px;
    margin-bottom: 2px;
}

/* Footnote References */
.footnote-ref {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--reference-blue);
    cursor: pointer;
    vertical-align: super;
    line-height: 0;
    transition: color 0.2s;
}

.footnote-ref:hover {
    color: var(--vellum-cream);
}

/* Wiki Table */
.wiki-table-wrap {
    overflow-x: auto;
    margin: 20px 0;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Source Serif 4', serif;
    font-size: 0.9rem;
}

.wiki-table th {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--vellum-cream);
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--antique-brass);
    letter-spacing: 0.04em;
}

.wiki-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(138, 122, 96, 0.2);
    color: var(--warm-stone);
    vertical-align: top;
}

.wiki-table tbody tr:hover {
    background: rgba(138, 122, 96, 0.05);
}

/* Notes / Footnotes Section */
.footnote-list {
    list-style: none;
    padding: 0;
}

.footnote-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(138, 122, 96, 0.15);
    font-size: 0.85rem;
    color: var(--antique-brass);
    line-height: 1.7;
}

.footnote-item:last-child {
    border-bottom: none;
}

.fn-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--reference-blue);
    flex-shrink: 0;
    min-width: 20px;
}

/* ====================== FOOTER ====================== */
.wiki-footer {
    padding: 40px 20px 60px;
}

.footer-inner {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.footer-rule {
    width: 60px;
    height: 1px;
    background: var(--antique-brass);
    margin: 0 auto 20px;
}

.footer-text {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--antique-brass);
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 600px) {
    .title-plate {
        min-height: auto;
        padding: 40px 16px;
    }

    .toc {
        max-width: 100%;
    }

    .wiki-section {
        margin-bottom: 40px;
    }

    .drop-cap {
        font-size: 2.5rem;
    }

    .wiki-table {
        font-size: 0.8rem;
    }

    .wiki-table th,
    .wiki-table td {
        padding: 8px 10px;
    }
}
