/* =====================================================
   sbom.wiki — Encyclopedia stylesheet
   Palette: #ffffff #f5f5f5 #fafafa #e8e8e8 #ddd
            #222222 #333333 #1a73e8
   Fonts: Libre Baskerville, Open Sans, Ubuntu Mono
   ===================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #ffffff;
    color: #222222;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* -------------------------------------------------------
   Site Header
------------------------------------------------------- */
.wiki-site-header {
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-logo {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: #222222;
    text-decoration: none;
    white-space: nowrap;
}

.site-logo:hover {
    color: #1a73e8;
}

.site-tagline {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
    border-left: 1px solid #ddd;
    padding-left: 12px;
}

.site-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.site-nav a {
    color: #333333;
    text-decoration: none;
    font-size: 0.825rem;
    padding: 4px 8px;
    border-radius: 3px;
}

.site-nav a:hover {
    background: #f5f5f5;
    color: #1a73e8;
}

.site-search {
    margin-left: auto;
    display: flex;
    gap: 6px;
    align-items: center;
}

.search-input {
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 14px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.825rem;
    color: #222222;
    background: #fafafa;
    width: 220px;
    outline: none;
}

.search-input:focus {
    border-color: #1a73e8;
    background: #ffffff;
}

.search-btn {
    background: #1a73e8;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.825rem;
    cursor: pointer;
}

.search-btn:hover {
    background: #1558b0;
}

/* -------------------------------------------------------
   Breadcrumb
------------------------------------------------------- */
.breadcrumb-bar {
    background: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
}

.breadcrumb-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 7px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.breadcrumb {
    font-size: 0.8rem;
    color: #666;
}

.breadcrumb a {
    color: #1a73e8;
    text-decoration: none;
}

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

.bc-sep {
    margin: 0 5px;
    color: #aaa;
}

.bc-current {
    color: #333333;
    font-weight: 600;
}

.article-actions {
    display: flex;
    gap: 2px;
}

.action-link {
    font-size: 0.8rem;
    color: #1a73e8;
    text-decoration: none;
    padding: 3px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #ffffff;
}

.action-link:hover {
    background: #f5f5f5;
}

/* -------------------------------------------------------
   Three-Column Wiki Layout
   grid: 200px (TOC) | 1fr (article) | 180px (related)
------------------------------------------------------- */
.wiki-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 40px;
    display: grid;
    grid-template-columns: 200px 1fr 180px;
    grid-template-areas: "toc article related";
    gap: 32px;
    align-items: start;
}

/* -------------------------------------------------------
   Left Column: Table of Contents
------------------------------------------------------- */
.toc-column {
    grid-area: toc;
    position: sticky;
    top: 76px;
    align-self: start;
}

.toc-box {
    border: 1px solid #ddd;
    background: #fafafa;
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 6px;
    border-bottom: 1px solid #e8e8e8;
    background: #f5f5f5;
}

.toc-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #222222;
}

.toc-toggle {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: #1a73e8;
    cursor: pointer;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
}

.toc-toggle:hover {
    text-decoration: underline;
}

.toc-list {
    list-style: none;
    padding: 8px 10px 10px;
    counter-reset: toc-counter;
}

.toc-list.hidden {
    display: none;
}

.toc-list li {
    margin-bottom: 3px;
    counter-increment: toc-counter;
    font-size: 0.825rem;
}

.toc-list li::before {
    content: counter(toc-counter) ". ";
    color: #666;
    font-size: 0.75rem;
}

.toc-list a {
    color: #1a73e8;
    text-decoration: none;
}

.toc-list a:hover {
    text-decoration: underline;
}

.toc-list a.toc-active {
    font-weight: 600;
    color: #1558b0;
}

/* Sub-items in TOC */
.toc-sublist {
    list-style: none;
    padding-left: 14px;
    margin-top: 2px;
    counter-reset: toc-sub-counter;
}

.toc-sublist li {
    counter-increment: toc-sub-counter;
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.toc-sublist li::before {
    content: none;
}

.toc-sublist a {
    color: #1a73e8;
    text-decoration: none;
}

.toc-sublist a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------
   Center Column: Article Body
------------------------------------------------------- */
.article-body {
    grid-area: article;
    min-width: 0;
}

.article-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: #222222;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.article-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 16px;
    font-style: italic;
}

.article-lead {
    margin-bottom: 12px;
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* -------------------------------------------------------
   Infobox (right-floated)
------------------------------------------------------- */
.infobox {
    float: right;
    width: 300px;
    margin: 0 0 1.25rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.85rem;
    clear: right;
}

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

.infobox-header {
    background: #e8e8e8;
    padding: 8px 12px;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-align: center;
    color: #222222;
    border-bottom: 1px solid #ddd;
}

.infobox-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    line-height: 1.5;
}

.infobox-table tr:last-child td {
    border-bottom: none;
}

.infobox-table tr:nth-child(odd) td {
    background: #ffffff;
}

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

.infobox-label {
    font-weight: 600;
    color: #333333;
    white-space: nowrap;
    width: 38%;
    font-size: 0.8rem;
}

/* -------------------------------------------------------
   Article Sections and Headings
------------------------------------------------------- */
.article-section {
    margin-bottom: 28px;
    clear: none;
}

.article-section:last-child {
    margin-bottom: 0;
}

.article-body h2 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #222222;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 5px;
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.article-body h3 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1rem;
    color: #333333;
    margin: 16px 0 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.article-body h2 .edit-link,
.article-body h3 .edit-link {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.7rem;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 400;
    border: 1px solid #ddd;
    padding: 1px 5px;
    border-radius: 2px;
    background: #ffffff;
    margin-left: 2px;
}

.article-body h2 .edit-link:hover,
.article-body h3 .edit-link:hover {
    background: #f5f5f5;
    border-color: #1a73e8;
}

/* -------------------------------------------------------
   Body Text
------------------------------------------------------- */
.article-body p {
    margin-bottom: 12px;
    color: #222222;
}

.article-body ul,
.article-body ol {
    padding-left: 24px;
    margin-bottom: 12px;
    color: #222222;
}

.article-body li {
    margin-bottom: 5px;
    line-height: 1.6;
}

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

/* -------------------------------------------------------
   Inline Article Links
------------------------------------------------------- */
.article-link {
    color: #1a73e8;
    text-decoration: none;
    border-bottom: 1px solid #b3d1f7;
}

.article-link:hover {
    text-decoration: none;
    border-bottom-color: #1a73e8;
    background: #f0f7ff;
}

.article-body a:not(.edit-link):not(.article-link):not(.ext-link) {
    color: #1a73e8;
    text-decoration: none;
    border-bottom: 1px solid #b3d1f7;
}

.article-body a:not(.edit-link):not(.article-link):not(.ext-link):hover {
    border-bottom-color: #1a73e8;
}

.ext-link {
    color: #1a73e8;
    text-decoration: none;
}

.ext-link:hover {
    text-decoration: underline;
}

.ext-link::after {
    content: " ↗";
    font-size: 0.7em;
    color: #888;
}

/* -------------------------------------------------------
   Superscript References
------------------------------------------------------- */
.ref {
    font-size: 0.7rem;
    vertical-align: super;
    line-height: 0;
    font-family: 'Open Sans', sans-serif;
}

.ref a {
    color: #1a73e8;
    text-decoration: none;
    border-bottom: none !important;
}

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

/* -------------------------------------------------------
   Data Tables
------------------------------------------------------- */
.wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.wiki-table thead th {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 7px 10px;
    text-align: left;
    font-weight: 600;
    color: #333333;
    font-family: 'Open Sans', sans-serif;
}

.wiki-table tbody td {
    border: 1px solid #e8e8e8;
    padding: 6px 10px;
    vertical-align: top;
    color: #222222;
}

.wiki-table tbody tr:nth-child(even) td {
    background: #fafafa;
}

.wiki-table code {
    font-family: 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    background: #f5f5f5;
    padding: 1px 4px;
    border-radius: 2px;
    border: 1px solid #e8e8e8;
}

/* -------------------------------------------------------
   Tabbed Content Areas
------------------------------------------------------- */
.tab-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 12px 0 16px;
    overflow: hidden;
}

.tab-bar {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    border-right: 1px solid #e8e8e8;
    padding: 8px 14px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.825rem;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #eeeeee;
    color: #222222;
}

.tab-btn.active {
    background: #ffffff;
    color: #1a73e8;
    font-weight: 600;
    border-bottom: 2px solid #1a73e8;
    margin-bottom: -1px;
}

.tab-panel {
    padding: 16px;
    display: none;
    background: #ffffff;
}

.tab-panel.active {
    display: block;
}

.tab-panel p {
    margin-bottom: 10px;
}

.tab-panel p:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------------
   Code Blocks
------------------------------------------------------- */
pre {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 12px 0;
}

pre code {
    font-family: 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: #333333;
    background: none;
    border: none;
    padding: 0;
    line-height: 1.6;
}

code {
    font-family: 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    background: #f5f5f5;
    padding: 1px 4px;
    border-radius: 2px;
    border: 1px solid #e8e8e8;
    color: #333333;
}

/* -------------------------------------------------------
   See Also List
------------------------------------------------------- */
.see-also-list {
    columns: 2;
    column-gap: 32px;
    list-style: none;
    padding: 0;
}

.see-also-list li {
    margin-bottom: 5px;
    font-size: 0.9rem;
    break-inside: avoid;
}

.see-also-list li::before {
    content: "· ";
    color: #aaa;
}

/* -------------------------------------------------------
   References Section
------------------------------------------------------- */
.references-section {
    border-top: 1px solid #e8e8e8;
    padding-top: 16px;
}

.references-list {
    padding-left: 24px;
    font-size: 0.82rem;
    color: #444;
    line-height: 1.6;
}

.references-list li {
    margin-bottom: 6px;
}

/* -------------------------------------------------------
   Right Column: Related Articles
------------------------------------------------------- */
.related-column {
    grid-area: related;
    position: sticky;
    top: 76px;
    align-self: start;
}

.related-box {
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.related-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.78rem;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 7px 10px 6px;
    background: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
}

.related-list {
    list-style: none;
    padding: 8px 10px;
}

.related-list li {
    margin-bottom: 5px;
}

.related-list a {
    color: #1a73e8;
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.4;
    display: block;
}

.related-list a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------
   Link Tooltip
------------------------------------------------------- */
.link-tooltip {
    position: fixed;
    display: none;
    max-width: 320px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 0.825rem;
    line-height: 1.5;
    color: #333333;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    z-index: 1000;
    pointer-events: none;
}

.link-tooltip.visible {
    display: block;
}

.tooltip-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #222222;
    margin-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}

/* -------------------------------------------------------
   Wiki Footer
------------------------------------------------------- */
.wiki-footer {
    background: #f5f5f5;
    border-top: 1px solid #e8e8e8;
    padding: 20px 24px;
    margin-top: 16px;
}

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

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.8rem;
    color: #1a73e8;
    text-decoration: none;
}

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

.footer-copy {
    font-size: 0.75rem;
    color: #888;
}

.footer-copy a {
    color: #1a73e8;
    text-decoration: none;
}

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

/* -------------------------------------------------------
   Responsive: Single Column on Mobile
------------------------------------------------------- */
@media (max-width: 1024px) {
    .wiki-layout {
        grid-template-columns: 180px 1fr;
        grid-template-areas:
            "toc article"
            "toc related";
    }

    .related-column {
        grid-area: related;
        position: static;
    }

    .see-also-list {
        columns: 1;
    }
}

@media (max-width: 768px) {
    .wiki-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "toc"
            "article"
            "related";
        padding: 16px;
        gap: 20px;
    }

    .toc-column {
        position: static;
    }

    .related-column {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .related-box {
        margin-bottom: 0;
    }

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

    .site-nav {
        display: none;
    }

    .search-input {
        width: 140px;
    }

    .site-tagline {
        display: none;
    }
}

@media (max-width: 480px) {
    .related-column {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: 1.4rem;
    }

    .site-search {
        display: none;
    }
}
