/* AminoWiki - Wikipedia-style CSS (Vanilla, no framework) */

:root {
    --wiki-blue: #3366cc;
    --wiki-blue-hover: #2a4b8d;
    --wiki-red: #cc3333;
    --wiki-green: #14866d;
    --wiki-border: #a2a9b1;
    --wiki-bg: #f8f9fa;
    --wiki-bg-light: #eaecf0;
    --wiki-text: #202122;
    --wiki-text-light: #54595d;
    --content-width: 960px;
    --sidebar-width: 200px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Lato, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--wiki-text);
    background: #fff;
}

a {
    color: var(--wiki-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #795cb2;
}

a.new-article {
    color: var(--wiki-red);
}

/* Header */
.wiki-header {
    background: var(--wiki-bg);
    border-bottom: 1px solid var(--wiki-border);
    padding: 0.5rem 1rem;
}

.wiki-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wiki-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--wiki-text);
}

.wiki-logo:hover {
    text-decoration: none;
}

.wiki-logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--wiki-blue), var(--wiki-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 1.25rem;
}

.wiki-logo-text {
    font-size: 1.5rem;
    font-weight: 600;
}

.wiki-logo-tagline {
    font-size: 0.75rem;
    color: var(--wiki-text-light);
}

.wiki-search {
    display: flex;
    gap: 0.5rem;
}

.wiki-search input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--wiki-border);
    border-radius: 2px;
    font-size: 14px;
    width: 250px;
}

.wiki-search button {
    padding: 0.5rem 1rem;
    background: var(--wiki-bg);
    border: 1px solid var(--wiki-border);
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
}

.wiki-search button:hover {
    background: var(--wiki-bg-light);
}

/* Main Layout */
.wiki-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    min-height: calc(100vh - 150px);
}

/* Sidebar */
.wiki-sidebar {
    width: var(--sidebar-width);
    background: var(--wiki-bg);
    border-right: 1px solid var(--wiki-border);
    padding: 1rem 0;
    flex-shrink: 0;
}

.wiki-sidebar-section {
    margin-bottom: 1.5rem;
}

.wiki-sidebar-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wiki-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wiki-sidebar-nav {
    list-style: none;
}

.wiki-sidebar-nav li a {
    display: block;
    padding: 0.35rem 1rem;
    font-size: 0.875rem;
    color: var(--wiki-blue);
}

.wiki-sidebar-nav li a:hover {
    background: var(--wiki-bg-light);
}

/* Content */
.wiki-content {
    flex: 1;
    padding: 1rem 1.5rem;
    max-width: calc(100% - var(--sidebar-width));
}

/* Article Header */
.wiki-article-header {
    border-bottom: 1px solid var(--wiki-border);
    padding-bottom: 0.25rem;
    margin-bottom: 1rem;
}

.wiki-article-title {
    font-size: 1.8rem;
    font-weight: normal;
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    color: var(--wiki-text);
    line-height: 1.3;
}

/* Table of Contents */
.wiki-toc {
    background: var(--wiki-bg);
    border: 1px solid var(--wiki-border);
    padding: 1rem;
    display: inline-block;
    margin: 1rem 0;
    min-width: 200px;
}

.wiki-toc-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
}

.wiki-toc ol {
    margin-left: 1.5rem;
}

.wiki-toc li {
    margin: 0.25rem 0;
}

.wiki-toc a {
    font-size: 0.9rem;
}

/* Article Content */
.wiki-article {
    line-height: 1.65;
}

.wiki-article p {
    margin-bottom: 0.75rem;
}

.wiki-article h2 {
    font-size: 1.5rem;
    font-weight: normal;
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    border-bottom: 1px solid var(--wiki-border);
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0.25rem;
}

.wiki-article h3 {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 1.25rem 0 0.5rem 0;
}

.wiki-article h4 {
    font-size: 1rem;
    font-weight: bold;
    margin: 1rem 0 0.5rem 0;
}

.wiki-article ul, .wiki-article ol {
    margin: 0.5rem 0 0.75rem 1.6rem;
}

.wiki-article li {
    margin: 0.25rem 0;
}

/* Infobox */
.wiki-infobox {
    float: right;
    clear: right;
    width: 280px;
    margin: 0 0 1rem 1rem;
    border: 1px solid var(--wiki-border);
    background: var(--wiki-bg);
    font-size: 0.875rem;
}

.wiki-infobox-title {
    background: var(--wiki-blue);
    color: #fff;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.wiki-infobox-image {
    text-align: center;
    padding: 0.75rem;
    background: #fff;
}

.wiki-infobox-image img {
    max-width: 100%;
    height: auto;
}

.wiki-infobox table {
    width: 100%;
    border-collapse: collapse;
}

.wiki-infobox th, .wiki-infobox td {
    padding: 0.35rem 0.5rem;
    border-top: 1px solid var(--wiki-border);
    text-align: left;
    vertical-align: top;
}

.wiki-infobox th {
    background: var(--wiki-bg-light);
    width: 40%;
    font-weight: 600;
}

/* Notice Boxes */
.wiki-notice {
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-left: 4px solid;
    background: var(--wiki-bg);
}

.wiki-notice-info {
    border-color: var(--wiki-blue);
}

.wiki-notice-warning {
    border-color: #fc3;
    background: #fef6e7;
}

.wiki-notice-medical {
    border-color: var(--wiki-red);
    background: #fef2f2;
}

/* Tables */
.wiki-table {
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.wiki-table th, .wiki-table td {
    border: 1px solid var(--wiki-border);
    padding: 0.4rem 0.6rem;
    text-align: left;
}

.wiki-table th {
    background: var(--wiki-bg-light);
    font-weight: 600;
}

.wiki-table tr:nth-child(even) {
    background: var(--wiki-bg);
}

/* Categories */
.wiki-categories {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--wiki-border);
    font-size: 0.875rem;
}

.wiki-categories-title {
    font-weight: 600;
    margin-right: 0.5rem;
}

.wiki-categories a {
    margin-right: 0.5rem;
}

/* Footer */
.wiki-footer {
    background: var(--wiki-bg);
    border-top: 1px solid var(--wiki-border);
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--wiki-text-light);
}

.wiki-footer-links {
    margin-bottom: 0.5rem;
}

.wiki-footer-links a {
    margin: 0 0.75rem;
}

/* Homepage specific */
.wiki-welcome {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f5f0 100%);
    border: 1px solid var(--wiki-border);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.wiki-welcome h1 {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 2rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.wiki-welcome p {
    color: var(--wiki-text-light);
    margin: 0;
}

.wiki-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.wiki-portal {
    background: var(--wiki-bg);
    border: 1px solid var(--wiki-border);
    border-radius: 4px;
    padding: 1rem;
}

.wiki-portal-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--wiki-text);
    border-bottom: 2px solid var(--wiki-blue);
    padding-bottom: 0.35rem;
}

.wiki-portal ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wiki-portal li {
    padding: 0.25rem 0;
    border-bottom: 1px dotted var(--wiki-border);
}

.wiki-portal li:last-child {
    border-bottom: none;
}

.wiki-article-list {
    columns: 2;
    column-gap: 2rem;
}

.wiki-article-list li {
    break-inside: avoid;
}

/* Responsive */
@media (max-width: 768px) {
    .wiki-container {
        flex-direction: column;
    }

    .wiki-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--wiki-border);
    }

    .wiki-content {
        max-width: 100%;
    }

    .wiki-infobox {
        float: none;
        width: 100%;
        margin: 1rem 0;
    }

    .wiki-search input {
        width: 150px;
    }

    .wiki-header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .wiki-article-list {
        columns: 1;
    }
}

/* Print styles */
@media print {
    .wiki-sidebar, .wiki-header, .wiki-footer, .wiki-search {
        display: none;
    }

    .wiki-content {
        max-width: 100%;
    }
}
