:root {
    --main-disabled: #A3CF74;
    --main-color: #74AA00;
    --primary-color: #74AA00;
    --main-highlight: #4c7a00;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    font-family: system-ui, -apple-system, "Segoe UI", "Liberation Sans", sans-serif;
    color: #222;
}

#top {
    background-color: var(--main-color);
}

#navigation {
    list-style-type: none;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    background-color: var(--main-color);
    max-width: 45em;
}

#navigation li {
    float: left;
}

#navigation li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

#navigation li a:hover {
    background-color: var(--main-highlight);
}

#content {
    max-width: 45em;
    margin: 1.5rem auto;
    background: #fff;
    padding: 1.25rem 1.5rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--main-color);
    box-sizing: border-box;
    line-height: 1.5;
}

#content h1,
#content h2,
#content h3 {
    color: #222;
}

#content h1 {
    margin-top: 0;
}

#content h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

#content nav.toc {
    margin: 1rem 0 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #f6f8fa;
    border-radius: 6px;
    border-left: 3px solid var(--main-color);
}

#content h2 .jump-toc {
    float: right;
    margin-left: 0.75rem;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: inherit;
    text-decoration: none;
    color: #6a737d;
}

#content h2 .jump-toc:hover {
    color: var(--main-color);
    text-decoration: none;
}

#content h2::after {
    content: "";
    display: table;
    clear: both;
}

a {
    color: var(--main-color);
}

a:hover {
    color: var(--main-highlight);
}

#navigation li a:hover {
    color: white;
}

#footer {
    max-width: 45em;
    margin: 1rem auto 2rem;
    text-align: center;
    color: #555;
}

blockquote {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0.85rem 1.15rem 0.95rem;
    margin: 1.15rem 0;
    border-left: 4px solid var(--main-color);
    box-sizing: border-box;
    color: #2a2a2a;
    font-size: 0.97em;
    line-height: 1.5;
}

blockquote p {
    margin: 0.55em 0;
}

blockquote p:first-child {
    margin-top: 0;
}

blockquote p:last-child {
    margin-bottom: 0;
}

table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    display: table;
    margin-left: auto;
    margin-right: auto;
    overflow-x: auto;
    white-space: normal;
    text-align: left;
}

th, td {
    border: 1px solid #d0d7de;
    padding: 8px;
    text-align: left;
}

/* School-use + Lemmy step tables: slightly smaller so wide columns fit better. */
#content #specific-comparisons + table,
#content #hour-one-school-run-lemmy ~ table {
    font-size: 0.88em;
}

#content #specific-comparisons + table th,
#content #specific-comparisons + table td,
#content #hour-one-school-run-lemmy ~ table th,
#content #hour-one-school-run-lemmy ~ table td {
    padding: 6px 7px;
}

/* Sources bibliography: modestly smaller. */
#content #sources + ul {
    font-size: 0.92em;
    line-height: 1.45;
}

th {
    background-color: #f6f8fa;
    font-weight: bold;
    color: #222;
}

tr:nth-child(even) {
    background-color: #f6f8fa;
}

.logo {
    margin-top: 10px;
}

#dossiers {
    line-height: 1.7;
}

#content img {
    max-width: 100%;
    height: auto;
}

/* Generic thumbs: list rows + any table cell (comparison headers included). */
#content li img,
#content table img {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    display: block;
    float: none;
    position: static;
}

/* Wide comparison matrices (Continuity-style): logos in <th> stay thumb-sized
   and columns do not stack text under giant SVGs. */
#content table th img,
#content thead img {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.25rem;
    float: none;
    position: static;
}

#content table th {
    vertical-align: bottom;
    max-width: 5.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    word-break: break-word;
    white-space: normal;
    padding: 0.35rem 0.4rem;
}


/* ngi0-landing parity: sm-project-table overrides global table { display:block }. */
#content .sm-project-table {
    display: table;
    width: 100%;
    max-width: 45em;
    white-space: normal;
    overflow: visible;
    border-collapse: collapse;
    margin: 0.5rem 0 1.25rem;
}

#content .sm-project-table td {
    border: none;
    border-bottom: 1px solid #eaeef2;
    padding: 0.65rem 0.75rem 0.65rem 0;
    vertical-align: top;
    background: transparent;
}

#content .sm-project-table tr:nth-child(even) {
    background: transparent;
}

#content .sm-project-table .sm-project-logo-cell {
    width: 80px;
    text-align: center;
    padding-right: 0.75rem;
}

#content .sm-project-table img {
    margin: 0 auto;
}

/* CommonMark logo rows: flex (logo | title). Keep nowrap so title does not
   slip under the thumb and collide with following prose. */
#content ul > li:has(> img:first-child),
#content ul > li:has(> p:first-child > img:first-child),
#content ul > li:has(> a:first-child > img),
#content ul > li:has(> p:first-child > a:first-child > img) {
    list-style: none;
    margin-bottom: 1.25rem;
    padding-left: 0;
    overflow: auto;
}

#content ul > li > p:first-child:has(> img:first-child),
#content ul > li > p:first-child:has(> a:first-child > img),
#content ul > li:has(> img:first-child),
#content ul > li:has(> a:first-child > img) {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.75rem 12px;
}

#content ul > li > img:first-child,
#content ul > li > p:first-child > img:first-child,
#content ul > li > a:first-child > img,
#content ul > li > p:first-child > a:first-child > img {
    flex: 0 0 64px;
    margin: 0;
}

#content ul > li > a:first-child:has(> img),
#content ul > li > p:first-child > a:first-child:has(> img) {
    flex: 0 0 64px;
    line-height: 0;
}

#content ul > li > p:first-child:has(> a:first-child > img) > a:not(:has(> img)),
#content ul > li > a:not(:has(> img)) {
    flex: 1 1 auto;
    min-width: 0;
}

/* ngi0-landing DossierThemeTabs (dossiers.ngi-0.eu/sm) */
.dossier-theme-tabs {
    background-color: #fff;
    border-bottom: 1px solid #d0d7de;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    margin: -1.25rem -1.5rem 1.25rem;
}

.dossier-theme-tabs-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 45em;
    margin: 0 auto;
    padding: 0 0.25rem;
    box-sizing: border-box;
}

.dossier-theme-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 0.9rem;
    text-decoration: none;
    color: #24292f;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}

.dossier-theme-tab:hover {
    color: var(--main-highlight);
    background-color: #f6f8fa;
    text-decoration: none;
}

.dossier-theme-tab-active {
    color: var(--main-highlight);
    border-bottom-color: var(--main-color);
    font-weight: 600;
}

.dossier-theme-tab:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: -2px;
}

@media (max-width: 40em) {
    .dossier-theme-tabs {
        margin: -1rem -1rem 1rem;
    }
    .dossier-theme-tabs-inner {
        padding: 0;
        gap: 0;
    }
    .dossier-theme-tab {
        padding: 0.55rem 0.65rem;
        font-size: 0.85rem;
    }
}

/* Legacy alias */
.dossier-views-nav,
.sm-views-nav {
    margin: 0 0 1rem;
    padding: 0.55rem 0.85rem;
    background: #f6f8fa;
    border-radius: 6px;
    border-left: 3px solid var(--main-color, #74AA00);
    font-size: 0.95rem;
}
.sm-projects-grid {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 1rem;
}
.sm-projects-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    padding: 1rem 0.75rem;
    text-align: center;
    text-decoration: none;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    color: inherit;
    min-height: 8.5rem;
    box-sizing: border-box;
}
.sm-projects-card:hover {
    border-color: var(--main-color, #74AA00);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
    text-decoration: none;
}
.sm-projects-card img {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    flex: 0 0 auto;
}
.sm-projects-card span {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.25;
}

/* SM attribute badges on project detail (decentralized / UI / audience). */
.sm-attr-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sm-attr-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    border-radius: 999px;
    border: 1px solid #d0d7de;
    background: #f6f8fa;
    color: #24292f;
    white-space: nowrap;
}

.sm-attr-badge--decentralized {
    background: #eef6e0;
    border-color: var(--main-disabled, #A3CF74);
    color: var(--main-highlight, #4c7a00);
}

.sm-attr-badge--interface {
    background: #e8f0fe;
    border-color: #a8c7fa;
    color: #174ea6;
}

.sm-attr-badge--audience {
    background: #f3e8fd;
    border-color: #d4a8f0;
    color: #681da8;
}

.sm-attr-badge--platform {
    background: #e7f5ee;
    border-color: #96d4b0;
    color: #0f5132;
}

.sm-attr-badge--support {
    background: #fff4e5;
    border-color: #f0c36d;
    color: #8a5a00;
}
