html {
    scroll-behavior: smooth;
}

#main-content:target h1 {
     animation: flash-bg 2s;

}

@keyframes flash-bg {
  from { background: var(--ocm-hash-flash);}
  to   { background: transparent; }
}

/* ── Color variables ── */
:root {
    color-scheme: light;

    --color-primary: #2e6da4;
    --color-primary-hover: #245269;
    --color-text-muted: #6b6b6b;
    --color-success: #2e7d32;

    /* Semantic tokens */
    --ocm-bg: #fff;
    --ocm-text: #333;
    --ocm-text-secondary: #555;
    --ocm-link: #2e6da4;
    --ocm-link-hover: #245269;
    --ocm-link-hover-bg: rgba(255,255,225,.3);
    --ocm-border: #ddd;
    --ocm-border-light: #eee;
    --ocm-border-heavy: #e3e3e3;

    /* Surfaces */
    --ocm-surface: #fff;
    --ocm-surface-raised: #f5f5f5;
    --ocm-surface-hover: #f9f9f9;
    --ocm-surface-active: lightyellow;

    /* Info palette */
    --ocm-info-text: #31708f;
    --ocm-info-bg: #d9edf7;
    --ocm-info-border: #bce8f1;
    --ocm-info-hover-bg: #214A5E;

    /* Bootstrap text utilities */
    --ocm-text-success: #3c763d;
    --ocm-text-success-hover: #2b542c;

    /* Breadcrumb */
    --ocm-breadcrumb-separator: #ccc;

    /* Callouts */
    --ocm-callout-border: #eee;
    --ocm-callout-code-bg: #fff;
    --ocm-callout-danger-bg: #fcf2f2;
    --ocm-callout-danger-border: #dFb5b4;
    --ocm-callout-danger-text: #B94A48;
    --ocm-callout-warning-bg: #fefbed;
    --ocm-callout-warning-border: #f1e7bc;
    --ocm-callout-warning-text: #C09853;
    --ocm-callout-info-bg: #f0f7fd;
    --ocm-callout-info-border: #d0e3f0;
    --ocm-callout-info-text: #3A87AD;

    /* Side sheet */
    --ocm-sheet-bg: #fff;
    --ocm-sheet-border: #ddd;
    --ocm-sheet-header-border: #eee;
    --ocm-sheet-shadow: rgba(0,0,0,0.15);
    --ocm-sheet-backdrop: rgba(0,0,0,0.4);
    --ocm-sheet-close-hover: rgba(25,25,25,.1);
    --ocm-sheet-close-active: rgba(25,25,25,.25);

    /* Misc */
    --ocm-permalink-color: #999;
    --ocm-permalink-hover: #337ab7;
    --ocm-toast-bg: #333;
    --ocm-toast-text: #fff;
    --ocm-hash-flash: lightyellow;
    --ocm-heading-small: #545454;
    --ocm-classified-row-border: #f0f0f0;
    --ocm-classified-narrower-border: #eee;
    --ocm-classified-narrower-row-border: #f5f5f5;
    --ocm-classified-narrower-text: #555;
    --ocm-raquo-color: #999;
    --ocm-loading-color: #999;
    --ocm-pdf-heading: #333;
    --ocm-pdf-border-accent: #337ab7;

    /* Form controls */
    --ocm-input-bg: #fff;
    --ocm-input-text: #555;
    --ocm-input-border: #ccc;

    /* Chrome (navbar + footer) */
    --ocm-chrome-bg: #222;
    --ocm-chrome-border: #080808;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --color-primary: #6db3f2;
    --color-primary-hover: #8cc8ff;
    --color-text-muted: #9a9a9a;
    --color-success: #66bb6a;

    --ocm-bg: #1a1a2e;
    --ocm-text: #e0e0e0;
    --ocm-text-secondary: #b0b0b0;
    --ocm-link: #6db3f2;
    --ocm-link-hover: #8cc8ff;
    --ocm-link-hover-bg: rgba(100,100,150,.15);
    --ocm-border: #3a3a5c;
    --ocm-border-light: #2e2e4a;
    --ocm-border-heavy: #3a3a5c;

    --ocm-surface: #22223a;
    --ocm-surface-raised: #2a2a44;
    --ocm-surface-hover: #2e2e4a;
    --ocm-surface-active: #33335a;

    --ocm-info-text: #7ec8e3;
    --ocm-info-bg: #1a2f3d;
    --ocm-info-border: #2a4a5c;
    --ocm-info-hover-bg: #1a3a50;

    --ocm-text-success: #81c784;
    --ocm-text-success-hover: #a5d6a7;
    --ocm-breadcrumb-separator: #666;

    --ocm-callout-border: #3a3a5c;
    --ocm-callout-code-bg: #2a2a44;
    --ocm-callout-danger-bg: #3d1f1f;
    --ocm-callout-danger-border: #6b3a3a;
    --ocm-callout-danger-text: #f28b8b;
    --ocm-callout-warning-bg: #3d3520;
    --ocm-callout-warning-border: #6b5c3a;
    --ocm-callout-warning-text: #f2d68b;
    --ocm-callout-info-bg: #1a2a3d;
    --ocm-callout-info-border: #2a4a6b;
    --ocm-callout-info-text: #7ec8e3;

    --ocm-sheet-bg: #22223a;
    --ocm-sheet-border: #3a3a5c;
    --ocm-sheet-header-border: #2e2e4a;
    --ocm-sheet-shadow: rgba(0,0,0,0.4);
    --ocm-sheet-backdrop: rgba(0,0,0,0.6);
    --ocm-sheet-close-hover: rgba(255,255,255,.1);
    --ocm-sheet-close-active: rgba(255,255,255,.2);

    --ocm-permalink-color: #888;
    --ocm-permalink-hover: #6db3f2;
    --ocm-toast-bg: #444;
    --ocm-toast-text: #e0e0e0;
    --ocm-hash-flash: #33335a;
    --ocm-heading-small: #b0b0b0;
    --ocm-classified-row-border: #2e2e4a;
    --ocm-classified-narrower-border: #3a3a5c;
    --ocm-classified-narrower-row-border: #2e2e4a;
    --ocm-classified-narrower-text: #b0b0b0;
    --ocm-raquo-color: #777;
    --ocm-loading-color: #777;
    --ocm-pdf-heading: #e0e0e0;
    --ocm-pdf-border-accent: #6db3f2;

    --ocm-input-bg: #2a2a44;
    --ocm-input-text: #e0e0e0;
    --ocm-input-border: #3a3a5c;

    --ocm-chrome-bg: #16162a;
    --ocm-chrome-border: #0e0e1e;
}

/* Apply color variables to base elements */
a { color: var(--ocm-link); }
a:hover, a:focus { color: var(--ocm-link-hover); background-color: var(--ocm-link-hover-bg); }
a:active { background-color: var(--ocm-surface-active); }
.navbar a:active { background-color: transparent; }

.skip-link:focus {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    padding: 0.75em 1.5em;
    background: var(--ocm-callout-info-bg,#fff);
    color: var(--ocm-link);
    font-size: 1.6em;
    text-decoration: underline;
    border: 3px solid var(--ocm-callout-info-bg);
}

.skip-link:hover {
    color: var(--ocm-link--hover);
    background: var(--ocm-surface-hover);
    border: 3px solid var(--ocm-link);
}

.skip-link:active { 
    color: var(--ocm-link-hover);
    border: 3px solid var(--ocm-link);
    background: lightyellow;
}

/* ── WCAG 1.4.3 contrast fixes ── */

/* Fix 1: breadcrumb active text */
.breadcrumb > .active { color: var(--color-text-muted); }

/* Fix 2: badge — white text on background */
.badge { background-color: var(--color-text-muted); }

/* Fix 3: success label — white text on green */
.label-success { background-color: var(--color-success); }

/* Fix 5: WCAG 1.4.1 — underline links inline with surrounding text */
#f4 a, a.underline { text-decoration: underline; }

#f4 .label { color: var(--ocm-bg); }
/* Breadcrumbs */
nav[aria-label="Breadcrumb"] {
    margin-bottom: 0;
}

nav[aria-label="Breadcrumb"] .breadcrumb {
    margin-bottom: 0;
    font-size: 0.85em;
    background-color: var(--ocm-surface-raised);
    color: var(--ocm-text-secondary);
}

nav[aria-label="Breadcrum"] .breadcrumb > li + li::before {
    color: var(--ocm-breadcrumb-separator);
}


/* Navbar search — reduce input width on smaller viewports */
@media (min-width: 768px) and (max-width: 991px) {
    .navbar-form .form-control {
        width: 100px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .navbar-form .form-control {
        width: 140px;
    }
}

/* Navbar chrome */
.navbar-inverse {
    background-color: var(--ocm-chrome-bg);
}



span[role="banner"] .navbar-brand { padding: 0; }
span[role="banner"] .navbar-brand svg { margin-top: 3.5px; }
 span[role="banner"] a svg path { fill: #9d9d9d; stroke: none; stroke-width: 0; transition: all ease 0.45s; }
span[role="banner"] a:focus svg path, span[role="banner"] a:hover svg path { fill: #fff;  transition: all ease 0.3s; }
span[role="banner"] a:focus svg , span[role="banner"] a:hover  svg { background: var(--ocm-chrome-border);  transition: all ease 0.3s; }
span[role="banner"] a:active svg path { fill: var(--ocm-chrome-bg); stroke-width: 1; stroke: lightyellow; }
/* span[role="banner"] a svg path { fill: #fff; stroke: none; stroke-width: 0; transition: all ease 0.45s; }
span[role="banner"] a:focus svg path, span[role="banner"] a:hover svg path { fill: none; stroke: #00ffdf; stroke-width: 1; transition: all ease 0.3s; }
span[role="banner"] a:active svg path { fill: none; stroke-width: 2; }
*/

/* Navbar flex layout — DOM order = visual order = tab order (WCAG 2.4.3)
   Selector must match Bootstrap's .navbar-collapse.collapse specificity. */
@media (min-width: 768px) {
    .navbar-collapse.collapse {
        display: flex !important;
        align-items: stretch;
        justify-content: flex-end;
        padding: 0;
    }
    .navbar-collapse::before,
    .navbar-collapse::after {
        display: none;
    }
    .navbar-collapse .navbar-right {
        float: none !important;
    }
    .navbar-collapse .navbar-nav {
        float: none;
        display: flex;
        margin: 0;
    }
    .navbar-collapse .navbar-nav > li {
        float: none;
    }
    .navbar-collapse .navbar-form {
        float: none !important;
        display: flex;
        align-items: center;
        margin: 0;
        padding: 0 8px;
        border: 0;
        box-shadow: none;
    }

    .navbar-inverse form button { 
        margin-left: 6px;
    }

    .navbar-inverse button:hover,
    .navbar-inverse button:focus {
        background: var(--ocm-chrome-border);
        border-radius: 15%;
        transition: all ease .3s;
    }
    .navbar-inverse button:active {
        background: var(--ocm-chrome-border);
        border-radius: 15%;
        transition: all ease .3s;
    }
    .navbar-inverse button:active span { 
        color: lightyellow;
    }
}

/* Active nav tab highlight */
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
    background-color: #080808;
}
.navbar-inverse .navbar-nav > .active > a {
    border-bottom: 3px solid var(--color-primary);
}

.navbar-inverse .navbar-nav > li >  a {
    border-bottom: 3px solid transparent;
    transition: all ease .3s;
}

.navbar-inverse .navbar-nav > li >  a:hover,
.navbar-inverse .navbar-nav > li >  a:focus {
    border-bottom: 3px solid var(--ocm-surface-hover);
    background-color: var(--ocm-chrome-border);
    transition: all ease .3s;
}

.navbar-inverse .navbar-nav > li >  a:active {
    color: lightyellow;
    border-bottom: 3px solid lightyellow;
    background-color: #080808;
    transition: all ease .3s;
}

#pagination .pagination {margin-top: 25px; display: block;}
#pagination { margin-bottom: 25px;}
#documentsList { list-style: none;}
#documentsList li { padding-bottom: 1rem; }
#documentsList a { display: block; }

.xsmall { font-size: 45%; }

.nolist { list-style: none; }

hr.flush-bottom { margin-bottom: 1px; }

/* Term heading group */
.term-hgroup {
    display: flex;
    align-items: center;
    gap: 0.6em;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
}

.term-hgroup h1 {
    margin: 0;
}

.term-avatar {
    flex-shrink: 0;
}

.term-avatar text {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.08em;
}

.term-permalink {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--ocm-permalink-color);
    font-size: 0.7em;
    align-self: center;
}

.term-permalink:hover,
.term-permalink:focus {
    color: var(--ocm-permalink-hover);
}

.term-permalink-toast {
    font-size: 0.75em;
    color: var(--ocm-toast-text);
    background: var(--ocm-toast-bg);
    padding: 0.25em 0.75em;
    border-radius: 3px;
    white-space: nowrap;
    animation: fadeInToast 0.2s ease-out;
}

@keyframes fadeInToast {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

#term-dropdown {font-size: 30px;}

#hierarchy a.list-group-item {color: var(--ocm-info-text);}
#hierarchy a.list-group-item:hover .raquo:after { content: "»"; }

/* Hierarchy disclosure */
.hierarchy-group {
    margin-bottom: 0;
}

.hierarchy-header h2 {
    margin: 0;
    font-size: 18px;
}

.hierarchy-header h2 a {
    color: var(--ocm-link-hover);
    text-decoration: none;
}

.hierarchy-header h2 a:hover .hierarchy-term,
.hierarchy-header h2 a:focus .hierarchy-term {
    text-decoration: underline;
}

.hierarchy-header h2 a:active {
    outline: 2px solid var(--ocm-info-text);
    outline-offset: 2px;
    background-color: var(--ocm-info-bg);
    border-radius: 2px;
}

#results-per-page {margin-top: 1em; }
abbr[title] {
    text-decoration: none;
}

dl { margin-left: 1em; }
dt {margin-top: .5em; }

/* PDF download hero */
.pdf-hero {
    background-color: var(--ocm-surface-raised);
    border: 1px solid var(--ocm-border-heavy);
    border-left: 4px solid var(--ocm-pdf-border-accent);
    border-radius: 4px;
    padding: 1.5em 2em;
    margin-bottom: 2em;
}

.pdf-hero h3 {
    margin-top: 0;
    color: var(--ocm-pdf-heading);
}

.pdf-hero p {
    font-size: 0.95em;
    color: var(--ocm-text-secondary);
    line-height: 1.7;
    margin-bottom: 0;
}

.pdf-hero .btn span:last-child { margin-left: 1em; }

.pdf-hero-action {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991px) {
    .pdf-hero-action {
        margin-top: 1em;
        justify-content: flex-start;
    }
}

/* Base styles (regardless of theme) */
.bs-callout {
    margin: 20px 0;
    padding: 15px 30px 15px 15px;
    border-left: 5px solid var(--ocm-callout-border);
    max-width: 64ch;
}

.bs-callout h4 {
    margin-top: 0;
}

.bs-callout p:last-child {
    margin-bottom: 0;
}

.bs-callout code,
.bs-callout .highlight {
    background-color: var(--ocm-callout-code-bg);
}

/* Themes for different contexts */
.bs-callout-danger {
    background-color: var(--ocm-callout-danger-bg);
    border-color: var(--ocm-callout-danger-border);
}

.bs-callout-warning {
    background-color: var(--ocm-callout-warning-bg);
    border-color: var(--ocm-callout-warning-border);
}

.bs-callout-info {
    background-color: var(--ocm-callout-info-bg);
    border-color: var(--ocm-callout-info-border);
}

.bs-callout-danger h4,
.bs-callout-danger a.alert-link {
    color: var(--ocm-callout-danger-text);
}

.bs-callout-warning h4,
.bs-callout-warning a.alert-link {
    color: var(--ocm-callout-warning-text);
}

.bs-callout-info h4,
.bs-callout-info a.alert-link {
    color: var(--ocm-callout-info-text);
}

.bs-callout a.alert-link {
    font-weight: bold;
}

/* Sticky footer layout */
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--ocm-bg);
    color: var(--ocm-text);
}

#content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

#content > div {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

#main-content {
    flex: 1 0 auto;
}

/* Footer */
#f4 {
    flex-shrink: 0;
    margin-top: 3em;
    padding: 2.5em 0 1.5em;
    background-color: var(--ocm-chrome-bg);
    border-top: 3px solid var(--ocm-chrome-border);
    color: #9d9d9d;
}

#f4 h2 {
    color: #fff;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #333;
}

#f4 h2:first-child {
    margin-top: 0;
}

#f4 p {
    font-size: 0.85em;
    line-height: 1.7;
    color: #bbb;
}

#f4 li {
    font-size: 0.9em;
    line-height: 1.6;
}

.footer-db-list li {
    padding: 0.25em 0;
}

#f4 a {
    color: #8cb4d5;
    padding: 0 .2em;
}

#f4 a:hover,
#f4 a:focus {
    color: #fff;
    text-decoration: underline;
}

#f4 a:active {
    background-color: #000;
}

#f4 address {
    font-style: normal;
    margin-bottom: 0.5em;
}

.open-access-chip {
    font-size: 0.7em;
    vertical-align: middle;
    letter-spacing: 0.04em;
}

#stickers {
    margin-top: 1.5em;
    padding-top: 0.5em;
}

#stickers a {
    display: inline-block;
    margin-right: 3em;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: .2em;
}

#stickers a:hover,
#stickers a:focus {
    opacity: 1;
    text-decoration: none;
    background-color: transparent;
}

#stickers img {
    width: 28px;
    height: 28px;
}

.footer-nav {
    margin-top: 1em;
    font-size: 0.85em;
}


.footer-nav a + a {
    margin-left: 1.25em;
}

@media (max-width: 991px) {
    .footer-nav {
        margin-bottom: 1.5em;
    }
}

.footer-nav a {
    color: #8cb4d5;
    text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus {
    color: #fff;
    text-decoration: underline;
}

.hash-flash {
    background-color: var(--ocm-hash-flash);
}

.footer-bottom {
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid #333;
    text-align: center;
}

#f4 .copyright {
    color: #bbb;
    font-size: 0.8em;
}

/* Side sheet dialog */
.side-sheet {
    position: fixed;
    inset: 0 0 0 auto;
    height: 100%;
    max-height: 100vh;
    width: 100%;
    max-width: 420px;
    margin: 0;
    border: none;
    border-left: 1px solid var(--ocm-sheet-border);
    box-shadow: -4px 0 12px var(--ocm-sheet-shadow);
    padding: 0;
    background-color: var(--ocm-sheet-bg);
    color: var(--ocm-text);
    animation: slideInRight 0.25s ease-out;
}

.side-sheet::backdrop {
    background: var(--ocm-sheet-backdrop);
    animation: fadeIn 0.2s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.side-sheet-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.side-sheet-header {
    position: sticky;
    top: 0;
    background: var(--ocm-sheet-bg);
    border-bottom: 1px solid var(--ocm-sheet-header-border);
    padding: 0.75em 1.25em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.side-sheet-header .close {
    color: var(--ocm-text);
    font-size: 1.5em;
    opacity: 0.6;
    display: inline-flex;
    height: 44px;
    width: 44px;
    justify-content: center;
    align-items: center;
    text-shadow: unset;
}

.side-sheet-header .close:hover,
.side-sheet-header .close:focus {
    opacity: 1;
    border-radius: 50%;
    background-color: var(--ocm-sheet-close-hover);
}

.side-sheet-header .close:active {
    background-color: var(--ocm-sheet-close-active);
}

.side-sheet-body {
    padding: 1em 1.25em;
    overflow-y: auto;
    flex: 1;
}

.side-sheet-body .bs-callout {
    max-width: none;
}

.side-sheet-body h2 {
    font-size: 1.4em;
    margin-top: 0;
}

@media (max-width: 480px) {
    .side-sheet {
        max-width: 100%;
    }
}

/* Classified display (Major Subjects) */
.classified-display {
    margin-top: 1em;
}

.classified-group {
    margin-bottom: 2px;
}

.classified-group-header {
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    padding: 10px 15px;
    background: var(--ocm-info-bg);
    border: 1px solid var(--ocm-info-border);
    border-radius: 0;
    cursor: pointer;
    font-size: inherit;
    text-align: left;
    color: var(--ocm-info-text);
}

.classified-group-header .badge {
    margin-left: 0.5em;
    background: var(--ocm-surface);
    color: var(--ocm-text);
}

.classified-group-header:hover,
.classified-group-header:focus {
    background: var(--ocm-info-hover-bg);
    color: #fff;
}

.classified-group-header:focus {
    outline: 2px solid var(--ocm-info-text);
    outline-offset: -2px;
}

.classified-group-header .chevron {
    flex-shrink: 0;
    width: 1em;
    text-align: center;
    font-size: 0.8em;
}

.classified-group-header .notation {
    font-weight: bold;
    min-width: 2.5em;
}

.classified-group-header .group-label {
    flex: 1;
}

.classified-members {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 3px solid var(--ocm-info-bg);
    margin-left: 15px;
}

.classified-term-row {
    display: flex;
    align-items: center;
    padding: 5px 10px 5px 8px;
    border-bottom: 1px solid var(--ocm-classified-row-border);
}

.classified-term-row:hover {
    background: var(--ocm-surface-hover);
}

.chevron-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.75em;
    color: var(--ocm-info-text);
    flex-shrink: 0;
    width: 2em;
    text-align: center;
}

.chevron-btn:hover,
.chevron-btn:focus {
    color: color-mix(in oklab, var(--ocm-surface) 20%, var(--ocm-info-text));
}

.chevron-btn:focus {
    outline: 2px solid var(--ocm-info-text);
    outline-offset: 1px;
}

.chevron-spacer {
    display: inline-block;
    width: 2em;
    flex-shrink: 0;
}

.classified-term-row .term-link {
    flex: 1;
    color: var(--ocm-info-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.classified-term-row a.term-link:hover {
    background: transparent;
}

.classified-term-row .term-link:hover .term-name {
    text-decoration: underline;
}

.classified-badge {
    margin-left: 0.5em;
    flex-shrink: 0;
    background: var(--ocm-surface-raised);
    color: var(--ocm-text);
}

.classified-term-row .raquo:after {
    content: "";
}

.classified-term-row:hover .raquo:after {
    content: "\00bb";
    color: var(--ocm-raquo-color);
}

.classified-narrower {
    list-style: none;
    padding: 0;
    margin: 0 0 0 2em;
    border-left: 2px solid var(--ocm-classified-narrower-border);
}

.classified-narrower li {
    padding: 4px 10px;
    border-bottom: 1px solid var(--ocm-classified-narrower-row-border);
}

.classified-narrower li:hover {
    background: var(--ocm-surface-hover);
}

.classified-narrower li:active {
    background: var(--ocm-hash-flash);
}

.classified-narrower a {
    color: var(--ocm-classified-narrower-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
}


.classified-narrower a:hover {
    color: var(--ocm-info-text);
    background: transparent;
}

.classified-narrower a:hover .term-name {
    text-decoration: underline;
}

.classified-narrower .raquo {
    margin-left: auto;
}

.classified-narrower .raquo:after {
    content: "";
}

.classified-narrower a:hover .raquo:after {
    content: "\00bb";
    color: var(--ocm-raquo-color);
}

.classified-loading {
    padding: 10px 15px 10px 30px;
    color: var(--ocm-loading-color);
}

.scope-note h2, .history-note h2 { font-size: 18px; margin-top: 0; margin-bottom: 5px; }

h1 small { color: var(--ocm-heading-small); }

.exports ul { margin-left: 4px; }
.exports h3 { font-size: 18px; font-weight: unset; display: inline; font-family: 'EB Garamond',serif; }

/* ── Theme toggle button ── */
.navbar .glyphicon-adjust {
    color: #9d9d9d;
    font-size: 16px;
}

.navbar button:hover .glyphicon-adjust,
.navbar button:focus .glyphicon-adjust {
    color: #fff;
}

/* ── Bootstrap 3 theme-aware overrides ──
   These use CSS variables so both themes work automatically.
   Same specificity as Bootstrap but loaded after, so they win. */

body h1, body h2, body h3, body h4, body h5, body h6 {
    color: var(--ocm-text);
}
body h1 {
    font-size: 24px;
}

body hr {
    border-top-color: var(--ocm-border);
}

body .close {
    color: var(--ocm-text);
    text-shadow: none;
}

.form-control {
    background-color: var(--ocm-input-bg);
    color: var(--ocm-input-text);
    border-color: var(--ocm-input-border);
}

#main-content .text-success {
    color: var(--ocm-text-success);
}

#main-content a.text-success:hover,
a.text-success:focus {
    color: var(--ocm-text-success-hover);
}

#main-content .pagination > li > a,
#main-content .pagination > li > span {
    color: var(--ocm-link);
    background-color: var(--ocm-surface);
    border-color: var(--ocm-border);
}

#main-content .pagination > li > a:hover,
#main-content .pagination > li > span:hover,
#main-content .pagination > li > a:focus,
#main-content .pagination > li > span:focus {
    color: var(--ocm-link-hover);
    background-color: var(--ocm-surface-hover);
    border-color: var(--ocm-border);
}

#main-content .pagination > .active > a,
#main-content .pagination > .active > span,
#main-content .pagination > .active > a:hover,
#main-content .pagination > .active > span:hover,
#main-content .pagination > .active > a:focus,
#main-content .pagination > .active > span:focus {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

#main-content .pagination > .disabled > a,
#main-content .pagination > .disabled > span,
#main-content .pagination > .disabled > a:hover,
#main-content .pagination > .disabled > span:hover,
#main-content .pagination > .disabled > a:focus,
#main-content .pagination > .disabled > span:focus {
    background-color: var(--ocm-surface-raised);
    border-color: var(--ocm-border);
    color: var(--color-text-muted);
}

#main-content .list-group-item {
    background-color: var(--ocm-surface);
    border-color: var(--ocm-border);
    color: var(--ocm-text);
}

#main-content .list-group-item-info {
    color: var(--ocm-info-text);
    background-color: var(--ocm-info-bg);
}

#main-content a.list-group-item-info,
#main-content button.list-group-item-info {
    color: var(--ocm-info-text);
}

#main-content a.list-group-item-info:hover,
#main-content button.list-group-item-info:hover,
#main-content a.list-group-item-info:focus,
#main-content button.list-group-item-info:focus {
    color: var(--ocm-info-text);
    background-color: var(--ocm-info-hover-bg);
}

#main-content a.list-group-item:hover,
#main-content a.list-group-item:focus {
    background-color: var(--ocm-surface-hover);
}


#main-content .well {
    background-color: var(--ocm-surface-raised);
    border-color: var(--ocm-border);
}

#main-content .dropdown-menu {
    background-color: var(--ocm-surface);
    border-color: var(--ocm-border);
}

#main-content .dropdown-menu > li > a {
    color: var(--ocm-text);
}

#main-content .dropdown-menu > li > a:hover,
#main-content .dropdown-menu > li > a:focus {
    background-color: var(--ocm-surface-hover);
    color: var(--ocm-text);
}

/* ── Theme selector dropdown (navbar) ── */
.theme-toggle .dropdown-menu {
    min-width: 200px;
    background-color: var(--ocm-surface);
    border-color: var(--ocm-border);
}

.theme-toggle .dropdown-menu > li > a {
    color: var(--ocm-text);
    padding: 6px 15px;
}

.theme-toggle .dropdown-menu > li > a:hover,
.theme-toggle .dropdown-menu > li > a:focus {
    background-color: var(--ocm-surface-hover);
    color: var(--ocm-text);
}

.theme-toggle .dropdown-menu > .active > a,
.theme-toggle .dropdown-menu > .active > a:hover,
.theme-toggle .dropdown-menu > .active > a:focus {
    background-color: var(--ocm-surface-raised);
    color: var(--ocm-text);
}

.theme-toggle .dropdown-menu .glyphicon-ok {
    color: var(--color-primary);
    margin-right: 4px;
}

/* ── 404 / Not Found ── */
.not-found {
    text-align: center;
    padding: 2.5rem 1rem 4rem;
    max-width: 64rem;
}

.giraffe {
    display: block;
    width: 160px;
    height: auto;
}

.not-found-giraffe {
    margin: 0 auto 0.5rem;
    /* a gentle, whimsical sway */
    transform-origin: 50% 90%;
    animation: giraffe-sway 5s ease-in-out infinite;
}

@keyframes giraffe-sway {
    0%, 100% { transform: rotate(-2deg); }
    50%      { transform: rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
    .not-found-giraffe { animation: none; }
}

.not-found-code {
    margin: 0;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    color: var(--color-primary);
}

.not-found h1 {
    margin-top: 0.5rem;
}

.not-found .lead {
    color: var(--ocm-text-secondary);
}

.not-found-actions {
    margin-top: 1.5rem;
}

/* excerpt card — a real eHRAF passage that "wandered off", too */
.excerpt {
    margin: 1.75rem 0 0;
    padding: 1.25rem 1.5rem;
    text-align: left;
    background: var(--ocm-surface-raised);
    border: 1px solid var(--ocm-border);
    border-radius: 8px;
}

.excerpt-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.owc-avatar { flex-shrink: 0; }

.owc-avatar text {
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.excerpt-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.excerpt-title {
    font-style: italic;
    font-weight: 600;
    color: var(--ocm-text);
}

.excerpt-author {
    font-size: 0.875em;
    color: var(--ocm-text-secondary);
}

/* two columns: passage on the left, applied OCM subjects on the right
   (always two columns, mirroring eHRAF) */
.excerpt-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.excerpt-text {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 0.95em;
    color: var(--ocm-text-secondary);
}

.excerpt-text p { margin: 0 0 0.75rem; }

.excerpt-text footer { text-align: right; }
/* drop Bootstrap's blockquote-footer em-dash before the permalink */
.excerpt-text footer::before { content: none; }

.excerpt-permalink { font-size: 0.85em; }

.excerpt-mark {
    background: var(--ocm-surface-active);
    color: var(--ocm-text);
    padding: 0 3px;
    border-radius: 3px;
    font-weight: 600;
}

.excerpt-ocms {
    flex: 0 0 21rem;
    list-style: none;
    margin: 0;
    padding: 0 0 0 1.5rem;
    border-left: 1px solid var(--ocm-border);
    font-size: 0.9em;
}

.excerpt-ocms li {
    margin-bottom: 0.45rem;
    line-height: 1.3;
}

.excerpt-ocms a {
    text-decoration: none;
    border-bottom: 1px dotted transparent;
}

.excerpt-ocms a:hover,
.excerpt-ocms a:focus {
    border-bottom-color: currentColor;
    background: transparent;
}

.excerpt-ocms .ocm-id {
    margin-right: 0.6em;
    font-family: 'Courier New', Courier, monospace;
    color: var(--ocm-text-secondary);
}

/* Stay two columns on mobile, but collapse the OCM column to just the id,
   right-aligned (the term names are hidden for space). */
@media (max-width: 600px) {
    .excerpt-body { gap: 1rem; }
    .excerpt-ocms {
        flex: 0 0 auto;
        padding-left: 0.75rem;
        text-align: right;
    }
    .excerpt-ocms .ocm-term { display: none; }
    .excerpt-ocms .ocm-id { margin-right: 0; }
}

