h1,h2,h3,h4,h5,h6, .title {
     font-family: "Inter";
}

.main-header__site-title img {
    max-height: 85px;
}

/* ============================================================
   PUO — terminology site stylesheet

   0. Tokens
   1. Header + page shell
   2. Browse layout (facets + results)
   3. Facet sidebar
   4. Browse controls (pagination + sorting)
   5. Results table — desktop
   6. Results table — tablet + phone
   7. Item (term) page
   8. Search form
   9. Footer + utilities
   ============================================================ */


/* --- 0. TOKENS ------------------------------------------- */

:root {
    --puo-navy: #0F204B;
    --puo-navy-hover: #1A3A8A;
    --puo-line: #E3E6EC;
    --puo-line-soft: #F0F2F5;
    --puo-soft: #F7F8FA;
    --puo-ink: #24282F;
    --puo-muted: #5C6472;
    --puo-radius: 8px;
    --puo-gap: 28px;
    --puo-sidebar: 280px;

    /* Height of the fixed site header. Only used to stop the sticky
       sidebar sliding under it — raise it if that happens. */
    --puo-header: 165px;
}


/* --- 1. HEADER + PAGE SHELL ------------------------------ */

#main-content.container,
#container {
    width: min(96%, 1500px) !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

/* Trim the fixed header so it steals less of the viewport */
.main-header__top-bar,
.main-header__main-bar {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    min-height: 0 !important;
}

header.main-header .main-header__site-title a {
    font-size: 2rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
}

/* Advanced search duplicates the facet search; removing it (rather than
   hiding it) also shortens the header bar. */
.main-header__advanced-search {
    display: none !important;
}

/* Keyboard focus stays visible everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(15, 32, 75, 0.35);
    outline-offset: 2px;
}


/* --- 2. BROWSE LAYOUT ------------------------------------ */

.faceted-browse-page #container {
    display: grid !important;
    grid-template-columns: var(--puo-sidebar) minmax(0, 1fr);
    gap: var(--puo-gap);
    align-items: start;
}

.faceted-browse-page #section-sidebar {
    display: block !important;
    position: sticky !important;
    top: calc(var(--puo-header) + 16px);
    width: auto !important;
    margin: 0 !important;
    padding: 20px !important;
    background: var(--puo-soft);
    border: 1px solid var(--puo-line);
    border-radius: var(--puo-radius);
    box-sizing: border-box;
}

/* minmax(0, 1fr) above + this stops a wide table blowing out the grid */
.faceted-browse-page #section-content {
    min-width: 0;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: auto;          /* safety net only; the table now fits */
    -webkit-overflow-scrolling: touch;
}

#section-content::-webkit-scrollbar { height: 10px; }
#section-content::-webkit-scrollbar-thumb { background: var(--puo-navy); border-radius: 10px; }
#section-content::-webkit-scrollbar-track { background: var(--puo-line-soft); }


/* --- 3. FACET SIDEBAR ------------------------------------ */

.facets-container,
.facets-container .facet {
    border: 0;
    margin: 0;
    padding: 0;
}

.facets-container > legend {
    display: none !important;
}

.facets-container .facet + .facet {
    margin-top: 18px;
}

/* Generic — the old CSS targeted facet 54, but this page uses 51 */
.facets-container .facet legend {
    display: block;
    float: none !important;
    padding: 0;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--puo-navy);
}

.facets-container .facet input[type="text"],
.facets-container .facet input.value,
.facets-container .facet select {
    width: 100% !important;
    height: 46px;
    padding: 0 12px;
    font-size: 1rem;
    color: var(--puo-ink);
    background: #fff;
    border: 2px solid var(--puo-navy);
    border-radius: 6px;
    box-sizing: border-box;
}

.facets-container .select-list label {
    display: block;
    padding: 3px 0;
    font-size: 0.95rem;
}

/* Modal chrome is unused now that the sidebar is always visible */
#section-sidebar-modal-toggle,
#section-sidebar-modal-close,
.tablesaw-bar,
.tablesaw-advance,
.tablesaw-nav-btn,
.browse-controls .permalink.button {
    display: none !important;
}


/* --- 4. BROWSE CONTROLS ---------------------------------- */

.browse-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--puo-line);
}

#section-content > .browse-controls:last-child {
    margin: 18px 0 0;
    padding: 14px 0 0;
    border-bottom: 0;
    border-top: 1px solid var(--puo-line);
}

.browse-controls .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin: 0;
}

.browse-controls .row-count {
    font-size: 0.95rem;
    color: var(--puo-muted);
}

.browse-controls .pager-wrapper,
.browse-controls form.pager,
.browse-controls form.sorting {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.browse-controls form.pager label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.95rem;
    color: var(--puo-muted);
}

.browse-controls input[type="text"] {
    width: 60px;
    height: 36px;
    padding: 0 6px;
    text-align: center;
    border: 1px solid var(--puo-line);
    border-radius: 4px;
    box-sizing: border-box;
}

.browse-controls select {
    height: 36px;
    padding: 0 8px;
    background: #fff;
    border: 1px solid var(--puo-line);
    border-radius: 4px;
    box-sizing: border-box;
}

.browse-controls button,
.browse-controls input[type="submit"],
.browse-controls .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 14px;
    font-weight: 600;
    color: #fff;
    background: var(--puo-navy);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.browse-controls button:hover,
.browse-controls input[type="submit"]:hover,
.browse-controls .button:hover {
    background: var(--puo-navy-hover);
}

.browse-controls .prev,
.browse-controls .next {
    width: 36px;
    padding: 0;
}

.browse-controls .disabled {
    opacity: 0.35;
    cursor: default;
}


/* --- 5. RESULTS TABLE — DESKTOP -------------------------- */

table.faceted-results {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;   /* long definitions wrap instead of scrolling */
    border-collapse: collapse !important;
    font-size: 1rem;
}

table.faceted-results thead { display: table-header-group !important; }
table.faceted-results tbody { display: table-row-group !important; }
table.faceted-results tr    { display: table-row !important; }

/* display:table-cell also overrides tablesaw's .tablesaw-swipe-cellhidden */
table.faceted-results th,
table.faceted-results td {
    display: table-cell !important;
    min-width: 0 !important;
    padding: 14px 16px !important;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--puo-line);
    overflow-wrap: break-word;
}

table.faceted-results th {
    font-weight: 700;
    color: #fff;
    background: var(--puo-navy);
    border-bottom: 0;
    white-space: nowrap;
}

table.faceted-results th:first-child { border-radius: var(--puo-radius) 0 0 0; }
table.faceted-results th:last-child  { border-radius: 0 var(--puo-radius) 0 0; }

table.faceted-results tbody tr:nth-child(even) { background: var(--puo-soft); }
table.faceted-results tbody tr:hover           { background: #EDF1F8; }

/* Column widths: definitions get the room, translations stay readable */
table.faceted-results th:nth-child(1),
table.faceted-results td:nth-child(1) { width: 20%; }
table.faceted-results th:nth-child(2),
table.faceted-results td:nth-child(2) { width: 40%; }
table.faceted-results th:nth-child(3),
table.faceted-results td:nth-child(3),
table.faceted-results th:nth-child(4),
table.faceted-results td:nth-child(4) { width: 20%; }

table.faceted-results td:first-child {
    font-weight: 600;
    color: var(--puo-navy);
}

/* Kill tablesaw's stacked-cell labels on desktop */
table.faceted-results td::before { content: none !important; }
.tablesaw-cell-label { display: none !important; }


/* --- 6. RESULTS TABLE — TABLET + PHONE ------------------- */

/* Tablet: sidebar moves above the results, table stays a table */
@media screen and (max-width: 1024px) {
    .faceted-browse-page #container {
        display: block !important;
    }

    .faceted-browse-page #section-sidebar {
        position: static !important;
        width: 100% !important;
        margin: 0 0 22px !important;
    }

    #main-content {
        overflow-x: hidden;
    }
}

/* Phone: each row becomes a stacked record with its own field labels */
@media screen and (max-width: 860px) {
    table.faceted-results,
    table.faceted-results tbody,
    table.faceted-results tr,
    table.faceted-results td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    table.faceted-results thead {
        display: none !important;
    }

    table.faceted-results tbody tr {
        margin-bottom: 14px;
        padding: 0;
        background: #fff !important;
        border: 1px solid var(--puo-line);
        border-left: 4px solid var(--puo-navy);
        border-radius: 6px;
    }

    table.faceted-results td {
        padding: 12px 16px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--puo-line-soft) !important;
    }

    table.faceted-results tr td:last-child {
        border-bottom: 0 !important;
    }

    table.faceted-results td::before {
        display: block;
        margin-bottom: 3px;
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--puo-muted);
    }

    /* Column order on the terminology tables:
       English | Definition | Sesotho | Afrikaans */
    table.faceted-results td:nth-child(1)::before { content: "English" !important; }
    table.faceted-results td:nth-child(2)::before { content: "Definition" !important; }
    table.faceted-results td:nth-child(3)::before { content: "Sesotho" !important; }
    table.faceted-results td:nth-child(4)::before { content: "Afrikaans" !important; }

    table.faceted-results td:first-child {
        font-size: 1.15rem;
        background: var(--puo-soft);
        border-radius: 0 6px 0 0;
    }

    .browse-controls {
        justify-content: flex-start;
    }

    .browse-controls form.sorting select {
        flex: 1 1 140px;
    }
}


/* --- 7.1 PAGE SHELL -------------------------------------- */
 
/* A single record has no reason to run to 1500px. */
body.item.resource.show #main-content.container {
    width: min(94%, 940px) !important;
}
 
 
/* --- 7.2 HEADWORD ---------------------------------------- */
 
body.item.resource.show #main-content h1 {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding-bottom: 12px;
    font-size: clamp(1.9rem, 4.5vw, 2.5rem) !important;
    line-height: 1.15;
    color: var(--puo-navy);
    text-align: left !important;
    border-bottom: 3px solid var(--puo-navy);
}
 
body.item.resource.show #main-content h1 .title {
    display: inline-block !important;
    text-align: left !important;
}
 
 
/* --- 7.3 RECORD CARD ------------------------------------- */
 
.item.resource.show .metadata {
    margin: 24px 0 0 !important;
    margin-left: 0 !important;
    padding: 26px 30px !important;
    background: #fff;
    border: 1px solid var(--puo-line);
    border-radius: var(--puo-radius);
    box-sizing: border-box;
}
 
.item.resource.show .metadata dl {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}
 
 
/* --- 7.4 PROPERTY ROWS ----------------------------------- */
 
/* Label left, value right on desktop; stacks on phones (7.8). */
.item.resource.show .metadata .property {
    display: grid !important;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 4px 26px;
    width: 100% !important;
    margin: 0 !important;
    padding: 18px 0;
    text-align: left !important;
    border-bottom: 1px solid var(--puo-line-soft);
}
 
.item.resource.show .metadata dl:last-child .property:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}
 
.item.resource.show .metadata dt {
    display: block;
    grid-column: 1;
    width: auto !important;
    margin: 0 !important;
    padding-top: 3px;
    font-size: 0.88rem !important;
    font-weight: 600;
    line-height: 1.4;
    color: var(--puo-navy) !important;
    text-align: left !important;
    border: 0 !important;
}
 
.item.resource.show .metadata dd {
    grid-column: 2;
    width: auto !important;
    max-width: 66ch;
    margin: 0 !important;
    padding-left: 0 !important;
    font-size: 1.05rem !important;
    line-height: 1.6;
    color: var(--puo-ink);
    text-align: left !important;
}
 
/* Second and later values of the same property */
.item.resource.show .metadata dd + dd {
    margin-top: 8px !important;
}
 
/* The RDF term after each label — useful when editing, noise for
   readers. Comment this out if you want (puo:definition) visible. */
.item.resource.show .metadata dt .field-term {
    display: none !important;
}
 
 
/* --- 7.5 DEFINITION -------------------------------------- */
 
/* The definition is always the second property in the template, and
   it is the reason the page exists — so it gets the serif face and a
   larger size. Row 1 (English Term) repeats the headword, so its
   value is toned down instead. */
.item.resource.show .metadata dl:not(.item-sets) .property:nth-child(2) dd {
    font-family: "Noto Serif", Georgia, serif;
    font-size: 1.2rem !important;
    line-height: 1.7;
}
 
.item.resource.show .metadata dl:not(.item-sets) .property:first-child dd {
    color: var(--puo-muted);
}
 
/* Or hide the repeated headword row completely — uncomment: */
/*
.item.resource.show .metadata dl:not(.item-sets) .property:first-child {
    display: none !important;
}
*/
 
 
/* --- 7.6 ITEM SETS ROW ----------------------------------- */
 
/* Two links, so let them sit side by side rather than stacking. */
.item.resource.show .metadata dl.item-sets .property {
    padding-top: 0;
}
 
.item.resource.show .metadata dl.item-sets dd.value {
    display: inline-block !important;
    margin: 0 6px 6px 0 !important;
    padding: 0;
    border: 0 !important;
}
 
 
/* --- 7.7 LINKED VALUES ----------------------------------- */
 
/* Item sets, Subject Field and Subtopic all point at collections —
   show them as tappable pills so they read as navigation, not text. */
.item.resource.show .metadata dl.item-sets dd.value a,
.item.resource.show .metadata dd.value.resource .resource-link {
    display: inline-block;
    padding: 5px 13px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--puo-navy);
    background: #EDF1F8;
    border: 1px solid #D6DEEE;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
 
.item.resource.show .metadata dl.item-sets dd.value a:hover,
.item.resource.show .metadata dd.value.resource .resource-link:hover {
    color: #fff;
    background: var(--puo-navy);
    border-color: var(--puo-navy);
}
 
 
/* --- 7.8 PHONE ------------------------------------------- */
 
@media screen and (max-width: 700px) {
    body.item.resource.show #main-content.container {
        width: 94% !important;
    }
 
    .item.resource.show .metadata {
        padding: 18px 18px !important;
    }
 
    .item.resource.show .metadata .property {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px 0;
    }
 
    .item.resource.show .metadata dt,
    .item.resource.show .metadata dd {
        grid-column: 1;
    }
 
    .item.resource.show .metadata dt {
        padding-top: 0;
        margin-bottom: 4px !important;
    }
 
    .item.resource.show .metadata dl:not(.item-sets) .property:nth-child(2) dd {
        font-size: 1.1rem !important;
    }
}
 
 
/* --- 7.9 PAGE NOISE -------------------------------------- */
 
/* "Part of <the same term>" links the item to itself, and the view
   counter is not something a reader needs. Delete either rule to
   bring them back. */
body.item.resource.show .media-parent-item,
body.item.resource.show .statistics-stat {
    display: none !important;
}
 
 
/* --- 7.10 PRINT ------------------------------------------ */
 
/* Terminology records get printed and pasted into documents. */
@media print {
    #user-bar,
    .main-header,
    .main-footer,
    .menu-drawer,
    #skipnav {
        display: none !important;
    }
 
    body.item.resource.show {
        padding-top: 0 !important;
    }
 
    body.item.resource.show #main-content.container {
        width: 100% !important;
    }
 
    .item.resource.show .metadata {
        padding: 0 !important;
        border: 0 !important;
    }
 
    .item.resource.show .metadata .property {
        break-inside: avoid;
    }
 
    .item.resource.show .metadata dl.item-sets dd.value a,
    .item.resource.show .metadata dd.value.resource .resource-link {
        padding: 0;
        background: none;
        border: 0;
    }
}


/* --- 8. SEARCH FORM -------------------------------------- */

.block-searchForm {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 20px 0;
}

#search-form {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

#search-form input[type="text"] {
    flex: 1;
    height: 46px;
    margin: 0;
    padding: 0 15px;
    border: 2px solid var(--puo-navy);
    border-right: none;
    border-radius: 4px 0 0 4px;
    box-sizing: border-box;
}

#search-form button,
#search-form .button {
    height: 46px;
    margin: 0;
    padding: 0 20px;
    font-weight: bold;
    color: #fff;
    background: var(--puo-navy);
    border: 2px solid var(--puo-navy);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.15s ease;
}

#search-form button:hover,
#search-form .button:hover {
    background: var(--puo-navy-hover);
}

.page.site-page-search .block-html,
.page.site-page-search .site-page-pagination {
    text-align: center !important;
}


/* --- 9. FOOTER + UTILITIES ------------------------------- */

.contact-title {
    color: #fff;
}

.main-footer .navigation li {
    display: inline-block !important;
}

.main-footer .navigation li a {
    padding: 0 15px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}