/* ==========================================================================
   diplomatic.wiki - Styles
   Colors: #f8f9fa, #ffffff, #1a1a1a, #1a56db, #e5e7eb, #d1d5db, #6b21a8
   Fonts: Inter (400/600), Source Code Pro (400/500)
   ========================================================================== */

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: #1a1a1a;
    background-color: #f8f9fa;
}

a {
    color: #1a56db;
    text-decoration: underline;
    transition: color 0.15s ease;
}

a:visited {
    color: #6b21a8;
}

a:hover {
    color: #1a56db;
    text-decoration: none;
}

/* ==========================================================================
   HERO / SEARCH SECTION
   ========================================================================== */

#hero {
    background-color: #f8f9fa;
    border-bottom: 1px solid #d1d5db;
    padding: 40px 0 0 0;
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand-icon {
    flex-shrink: 0;
}

.brand-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 36px;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.brand-dot {
    color: #1a56db;
}

.brand-tagline {
    font-size: 15px;
    color: #555;
    margin-bottom: 24px;
}

/* Search */
.search-container {
    display: flex;
    max-width: 600px;
    margin: 0 auto 24px auto;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: #ffffff;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: #1a56db;
}

.search-btn {
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    background-color: #1a56db;
    color: #ffffff;
    border: 1px solid #1a56db;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-btn:hover {
    background-color: #1545b5;
}

/* Category Navigation */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    border-bottom: none;
}

.cat-link {
    display: inline-block;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.cat-link:visited {
    color: #1a1a1a;
}

.cat-link:hover {
    color: #1a56db;
    border-bottom-color: #1a56db;
}

.cat-link.active {
    color: #1a56db;
    border-bottom-color: #1a56db;
}

/* ==========================================================================
   MAIN LAYOUT
   ========================================================================== */

#main-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 0;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

#sidebar {
    position: sticky;
    top: 0;
    width: 240px;
    min-width: 240px;
    max-height: 100vh;
    overflow-y: auto;
    padding: 24px 16px 24px 0;
}

.toc-box {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    padding: 0;
}

.toc-header {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    padding: 10px 14px;
    background-color: #e5e7eb;
    border-bottom: 1px solid #d1d5db;
    border-radius: 4px 4px 0 0;
}

.toc-list {
    list-style: none;
    padding: 10px 14px;
}

.toc-item {
    margin-bottom: 4px;
}

.toc-link {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: #1a56db;
    text-decoration: none;
    padding: 3px 8px;
    border-left: 3px solid transparent;
    border-radius: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.toc-link:visited {
    color: #1a56db;
}

.toc-link:hover {
    background-color: #f8f9fa;
    color: #1a56db;
}

.toc-item.active > .toc-link {
    border-left-color: #1a56db;
    background-color: #f0f4ff;
    color: #1a56db;
    font-weight: 600;
}

.toc-sublist {
    list-style: none;
    padding-left: 16px;
    margin-top: 2px;
}

.toc-subitem {
    margin-bottom: 2px;
}

.toc-subitem .toc-link {
    font-size: 12px;
    padding: 2px 8px;
}

/* ==========================================================================
   CONTENT AREA
   ========================================================================== */

#content {
    flex: 1;
    min-width: 0;
    padding: 24px 0 40px 24px;
    border-left: 1px solid #d1d5db;
}

/* Breadcrumbs */
.breadcrumb {
    font-size: 13px;
    margin-bottom: 16px;
    color: #555;
}

.breadcrumb a {
    font-size: 13px;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 6px;
    color: #999;
}

.breadcrumb-current {
    color: #1a1a1a;
}

/* Article */
.article-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 32px;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.2;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 8px;
}

.article-subtitle {
    font-size: 13px;
    color: #777;
    margin-bottom: 24px;
    font-style: italic;
}

/* Sections */
.section-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 24px;
    color: #1a1a1a;
    margin-top: 32px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.3;
}

.subsection-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #1a1a1a;
    margin-top: 24px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.edit-link {
    font-size: 12px;
    font-weight: 400;
    color: #999;
    text-decoration: none;
    margin-left: 8px;
}

.edit-link:visited {
    color: #999;
}

.edit-link:hover {
    color: #1a56db;
}

/* Article content */
#article p {
    margin-bottom: 16px;
}

.xref {
    color: #1a56db;
    text-decoration: none;
}

.xref:visited {
    color: #6b21a8;
}

.xref:hover {
    text-decoration: underline;
}

.ref-mark {
    font-family: 'Source Code Pro', monospace;
    font-size: 11px;
    color: #1a56db;
    vertical-align: super;
    line-height: 0;
    cursor: pointer;
}

.article-list {
    margin: 0 0 16px 24px;
    padding: 0;
}

.article-list li {
    margin-bottom: 10px;
    line-height: 1.7;
}

/* ==========================================================================
   INFOBOX
   ========================================================================== */

.infobox {
    border: 1px solid #d1d5db;
    width: 280px;
    float: right;
    margin: 0 0 16px 20px;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
}

.infobox-header {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    padding: 10px 14px;
    background-color: #e5e7eb;
    color: #1a1a1a;
    border-bottom: 1px solid #d1d5db;
}

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

.infobox-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.infobox-table td {
    padding: 7px 12px;
    font-size: 14px;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.5;
}

.infobox-label {
    font-weight: 600;
    color: #1a1a1a;
    width: 100px;
    white-space: nowrap;
}

.infobox-value {
    color: #333;
}

/* ==========================================================================
   INSTITUTIONS GRID
   ========================================================================== */

.institutions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.institution-card {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 16px;
    background: #ffffff;
}

.institution-card h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.institution-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* ==========================================================================
   DATA TABLE
   ========================================================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.data-table thead th {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
    background-color: #e5e7eb;
    color: #1a1a1a;
    text-align: left;
    border: 1px solid #d1d5db;
}

.data-table tbody td {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    vertical-align: top;
    line-height: 1.5;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.code-ref {
    font-family: 'Source Code Pro', monospace;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
}

/* ==========================================================================
   REFERENCES
   ========================================================================== */

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

.references-list li {
    padding: 6px 0;
    font-size: 14px;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
}

.ref-number {
    font-family: 'Source Code Pro', monospace;
    font-size: 12px;
    font-weight: 500;
    color: #1a56db;
    margin-right: 8px;
}

/* ==========================================================================
   SEE ALSO
   ========================================================================== */

.see-also-list {
    list-style: none;
    padding: 0;
    margin: 0;
    column-count: 2;
    column-gap: 24px;
}

.see-also-list li {
    padding: 4px 0;
    font-size: 15px;
}

.see-also-list li::before {
    content: "\2022";
    color: #d1d5db;
    margin-right: 8px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

#footer {
    margin-top: 40px;
    padding: 24px 0;
    border-top: 1px solid #d1d5db;
    font-size: 13px;
    color: #777;
}

.footer-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-label {
    font-weight: 600;
    color: #1a1a1a;
}

.category-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e5e7eb;
    color: #1a1a1a;
    font-size: 12px;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.15s ease;
}

.category-tag:visited {
    color: #1a1a1a;
}

.category-tag:hover {
    background-color: #d1d5db;
}

.footer-meta {
    margin-bottom: 16px;
}

.footer-meta p {
    margin-bottom: 4px;
}

.footer-links {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.footer-links a {
    font-size: 13px;
    color: #1a56db;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 12px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    #main-layout {
        flex-direction: column;
    }

    #sidebar {
        position: static;
        width: 100%;
        min-width: 100%;
        max-height: none;
        padding: 16px 0;
        border-bottom: 1px solid #d1d5db;
    }

    #content {
        border-left: none;
        padding-left: 0;
    }

    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 20px 0;
    }

    .institutions-grid {
        grid-template-columns: 1fr;
    }

    .see-also-list {
        column-count: 1;
    }
}

@media (max-width: 600px) {
    .brand-name {
        font-size: 28px;
    }

    .article-title {
        font-size: 26px;
    }

    .section-heading {
        font-size: 20px;
    }

    .search-container {
        flex-direction: column;
        gap: 8px;
    }

    .search-input {
        border-right: 1px solid #d1d5db;
        border-radius: 4px;
    }

    .search-btn {
        border-radius: 4px;
    }

    .category-nav {
        gap: 0;
    }

    .cat-link {
        padding: 8px 12px;
        font-size: 13px;
    }
}
