/* Global font size reduction */
html {
    font-size: 100%;  /* default is 100% (16px), this brings it to 14px */
}

/* Concept definition — indigo/slate */
.admonition.concept-definition {
    border-left-color: #fff307;
    background-color: #e3eff7;
}
.admonition.concept-definition > .admonition-title {
    background-color: #0d47a1;
    color: #FFFFFF;  
}

/* Property definition — teal */
.admonition.property-definition {
    border-left-color: #b81438;
    background-color: #f3fdf6;
}
.admonition.property-definition > .admonition-title {
    background-color: #097709;
    color: #FFFFFF;
}

/* Relationship definition — amber */
.admonition.relationship-definition {
    border-left-color: #e65100;
    background-color: #fff8e1;
}
.admonition.relationship-definition > .admonition-title {
    background-color: #e68a00;
    color: #FFFFFF;
}

/* Relationship endpoints — two-column flex layout */
.rel-endpoints-grid {
    display: flex;
    gap: 2rem;
}
.rel-endpoints-grid > div {
    flex: 1;
}

/* Relationship endpoint indentation */
.rel-endpoint {
    padding-left: 2em;
}

/* Relationship diagram — scaled down, aspect ratio preserved */
.rel-diagram img {
    display: block;
    width: 40%;
    height: auto;
}

/* Inline page images — cap width, prevent unbounded scaling on wide screens */
main p > img {
    max-width: 1024px;
    width: 100%;
    height: auto;
    display: block;
}

/* Concept name UML box — compact, natural width */
.concept-name-uml {
    margin: 0.25rem 0 0rem;
    padding: 0;
}
.concept-name-uml p {
    margin: 0;
}
.concept-name-uml img {
    height: auto;
    display: block;
}

/* Concept property UML class diagram — rendered at build time by PlantUML (SVG output).
   Use width (not max-width) to force the SVG to fill the container. */
.concept-uml img {
    width: 100%;
    height: auto;
    display: block;
}

/* Domain registry table */
.domain-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin-top: 0.5rem;
}
.domain-table thead tr {
    background-color: #1b3a5c;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.78em;
    letter-spacing: 0.06em;
}
.domain-table th,
.domain-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e8edf2;
}
.domain-table td:nth-child(3) {
    white-space: nowrap;
    width: 6em;
    color: #555;
    font-variant-numeric: tabular-nums;
}
.domain-table th:nth-child(3) {
    white-space: nowrap;
    width: 6em;
    font-variant-numeric: tabular-nums;
}
.domain-table th:nth-child(4),
.domain-table td:nth-child(4) {
    width: 8em;
}
.domain-table tbody tr:hover {
    background-color: #f0f5fb;
}
.domain-table td:nth-child(1) {
    font-weight: 700;
}
.domain-table th:nth-child(6),
.domain-table td:nth-child(6) {
    white-space: nowrap;
    width: 7em;
}
.dl-link {
    display: inline-block;
    font-size: 0.78em;
    font-weight: 600;
    color: #1b3a5c;
    border: 1px solid #c5d5e8;
    border-radius: 4px;
    padding: 1px 6px;
    text-decoration: none;
    margin-right: 2px;
}
.dl-link:hover {
    background-color: #e8f0f8;
    text-decoration: none;
}

.status-active {
    display: inline-block;
    background-color: #e6f4ea;
    color: #1e6e35;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
}
.status-pending {
    display: inline-block;
    background-color: #f1f3f4;
    color: #5f6368;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
}

/* Concept page version footer */
.concept-meta-footer {
    margin-top: 2rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e8edf2;
    font-size: 0.82em;
    color: #666;
}
.concept-meta-footer .sep {
    margin: 0 0.5em;
    color: #bbb;
}
body.theme-dark .concept-meta-footer {
    border-top-color: #2a3a4a;
    color: #999;
}

/* Last updated — make it more readable in the footer */
.text-white-50 small:first-child {
    opacity: 1;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Hide "Created using Sphinx Wagtail Theme..." */
.text-white-50 small:last-child {
    display: none;
}

/* Dark mode (wagtail theme uses body.theme-dark) */
body.theme-dark .admonition.concept-definition {
    border-left-color: #818cf8;
    background-color: #0f1a24;
}
body.theme-dark .admonition.concept-definition > .admonition-title {
    background-color: #82b1ff;
    color: #0b1220;
}

body.theme-dark .admonition.property-definition {
    border-left-color: #2dd4bf;
    background-color: #0e1f14;
}
body.theme-dark .admonition.property-definition > .admonition-title {
    background-color: #5ee38a;
    color: #081b12;
}

body.theme-dark .admonition.relationship-definition {
    border-left-color: #ffb74d;
    background-color: #1a1400;
}
body.theme-dark .admonition.relationship-definition > .admonition-title {
    background-color: #ffb74d;
    color: #1a1000;
}

body.theme-dark .domain-table thead tr {
    background-color: #0d2540;
}
body.theme-dark .domain-table th,
body.theme-dark .domain-table td {
    border-bottom-color: #2a3a4a;
}
body.theme-dark .domain-table td:nth-child(3) {
    color: #aaa;
}
body.theme-dark .domain-table tbody tr:hover {
    background-color: #162333;
}
body.theme-dark .status-active {
    background-color: #0d2e18;
    color: #6fcf97;
}
body.theme-dark .status-pending {
    background-color: #2a2d30;
    color: #9aa0a6;
}
body.theme-dark .dl-link {
    color: #82b1ff;
    border-color: #2a3a4a;
}
body.theme-dark .dl-link:hover {
    background-color: #162333;
}

/* Inline code: theme default is red #d02040 */
code { color: #3c4a5a; }
body.theme-dark code { color: #b5c1ce; }

/* Inline code: one style on every page; border keeps it visible on striped table rows */
code.literal {
    color: #1d2733;
    background-color: #eef1f5;
    border: 1px solid #dde4ec;
    padding: 0 5px;
    border-radius: 4px;
}
body.theme-dark code.literal {
    color: #e3e9f0;
    background-color: #232d39;
    border-color: #2a3a4a;
}

/* Property flag badges (property.md.jinja). <code> so GitHub, which strips class, still shows chips */
div.flags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0.75rem 0;
}
code.f {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border: 0;
    border-radius: 999px;
    white-space: nowrap;
    cursor: help;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
code.f .fas { font-size: 0.9em; }
code.f.id  { background-color: #e3eefb; color: #0d47a1; }
code.f.tp  { background-color: #eceff3; color: #3c4a5a; }
code.f.bh  { background-color: #efe8fb; color: #5b2aa8; }
code.f.ct  { background-color: #fff0dd; color: #9a4a00; }
code.f.dim { background-color: transparent; color: #6b7785; border: 1px solid #d5dce4; font-weight: 500; }
div.flags .sep {
    display: inline-block;
    width: 1px;
    height: 16px;
    margin: 0 4px;
    background-color: #dde4ec;
    font-size: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
/* Pills link to their definition on inngangur/skraning */
a.f-link { text-decoration: none; }
a.f-link code.f { cursor: pointer; }
a.f-link:hover code.f { box-shadow: 0 0 0 1px currentColor; }
body.theme-dark code.f.id  { background-color: #13284a; color: #82b1ff; }
body.theme-dark code.f.tp  { background-color: #232d39; color: #b5c1ce; }
body.theme-dark code.f.bh  { background-color: #2a1f45; color: #c4a6ff; }
body.theme-dark code.f.ct  { background-color: #3a2610; color: #ffb74d; }
body.theme-dark code.f.dim { color: #94a3b4; border-color: #2a3a4a; }
body.theme-dark div.flags .sep { background-color: #2a3a4a; }

/* Property standard info table (property.md.jinja): compact key-value table */
.prop-info table.docutils:not(.field-list) {
    width: auto;
    min-width: 50%;
    font-size: 0.9em;
    border: 1px solid #dde4ec;
}
.prop-info table.docutils:not(.field-list) thead {
    display: none;
}
.prop-info table.docutils:not(.field-list) td {
    padding: 4px 12px;
    border: 1px solid #dde4ec;
    vertical-align: middle;
}
.prop-info table.docutils:not(.field-list) td p {
    margin: 0;
}
.prop-info table.docutils:not(.field-list) tbody tr:nth-of-type(odd) {
    background-color: transparent;
}
.prop-info table.docutils:not(.field-list) td:first-child {
    width: 1%;
    white-space: nowrap;
    background-color: #f3f6fa;
}
.prop-info code.literal {
    font-size: 0.95em;
}
body.theme-dark .prop-info table.docutils:not(.field-list),
body.theme-dark .prop-info table.docutils:not(.field-list) td {
    border-color: #2a3a4a;
}
body.theme-dark .prop-info table.docutils:not(.field-list) td:first-child {
    background-color: #1b2734;
}

/* Relationship kind pill (relationship.md.jinja): as association, wp whole-part, in inheritance, dp dependency/link */
code.f.rk-as { background-color: #e3eefb; color: #0d47a1; }
code.f.rk-wp { background-color: #fff0dd; color: #9a4a00; }
code.f.rk-in { background-color: #efe8fb; color: #5b2aa8; }
code.f.rk-dp { background-color: #eceff3; color: #3c4a5a; }
body.theme-dark code.f.rk-as { background-color: #13284a; color: #82b1ff; }
body.theme-dark code.f.rk-wp { background-color: #3a2610; color: #ffb74d; }
body.theme-dark code.f.rk-in { background-color: #2a1f45; color: #c4a6ff; }
body.theme-dark code.f.rk-dp { background-color: #232d39; color: #b5c1ce; }
