/**
 * NESSIA Theme — Main Stylesheet
 *
 * Near Eastern and Semitic Information Archive
 * https://nessia.org
 *
 * Colour Schemes: Manuscript Gold | Lapis Indigo | Desert Sand
 *
 * @package NESSIA
 * @version 1.0.0
 */

/* ==========================================================================
   CSS Custom Properties — Colour Scheme Tokens
   ========================================================================== */

/* Manuscript Gold (Default) */
.nessia-scheme-gold {
    --nessia-primary:        #1a2744;
    --nessia-primary-light:  #243558;
    --nessia-accent:         #c4953a;
    --nessia-accent-light:   #d4ab5a;
    --nessia-accent-dark:    #a07a28;
    --nessia-bg:             #f5f2eb;
    --nessia-bg-alt:         #eae5d9;
    --nessia-surface:        #ffffff;
    --nessia-text:           #2c2c2c;
    --nessia-text-muted:     #6b6b6b;
    --nessia-text-on-dark:   #f0ece4;
    --nessia-border:         #d8d2c4;
    --nessia-border-light:   #e8e3d8;
    --nessia-header-bg:      #1a2744;
    --nessia-nav-bg:         #f5f2eb;
    --nessia-footer-bg:      #1a2744;
    --nessia-link:           #1a5276;
    --nessia-link-hover:     #c4953a;
    --nessia-featured-bg:    #faf7f0;
    --nessia-tag-bg:         #eae5d9;
    --nessia-tag-text:       #5a5242;
}

/* Lapis Indigo */
.nessia-scheme-indigo {
    --nessia-primary:        #0d1b2a;
    --nessia-primary-light:  #1b2d45;
    --nessia-accent:         #3d7a80;
    --nessia-accent-light:   #5a9ea4;
    --nessia-accent-dark:    #2d5e63;
    --nessia-bg:             #f0f4f5;
    --nessia-bg-alt:         #e2e9eb;
    --nessia-surface:        #ffffff;
    --nessia-text:           #1c2833;
    --nessia-text-muted:     #5d6d7e;
    --nessia-text-on-dark:   #e8eef0;
    --nessia-border:         #c8d6db;
    --nessia-border-light:   #dde6ea;
    --nessia-header-bg:      #0d1b2a;
    --nessia-nav-bg:         #f0f4f5;
    --nessia-footer-bg:      #0d1b2a;
    --nessia-link:           #1a5276;
    --nessia-link-hover:     #3d7a80;
    --nessia-featured-bg:    #f5f9fa;
    --nessia-tag-bg:         #e2e9eb;
    --nessia-tag-text:       #3d5a5e;
}

/* Desert Sand */
.nessia-scheme-sand {
    --nessia-primary:        #3b2f2f;
    --nessia-primary-light:  #4e3e3e;
    --nessia-accent:         #b07941;
    --nessia-accent-light:   #c99a5e;
    --nessia-accent-dark:    #8c602f;
    --nessia-bg:             #f7f3ee;
    --nessia-bg-alt:         #ede7dd;
    --nessia-surface:        #ffffff;
    --nessia-text:           #33291e;
    --nessia-text-muted:     #7a6e60;
    --nessia-text-on-dark:   #f0e8dc;
    --nessia-border:         #d9cfc1;
    --nessia-border-light:   #e8e0d3;
    --nessia-header-bg:      #3b2f2f;
    --nessia-nav-bg:         #f7f3ee;
    --nessia-footer-bg:      #3b2f2f;
    --nessia-link:           #6b4226;
    --nessia-link-hover:     #b07941;
    --nessia-featured-bg:    #fcf9f4;
    --nessia-tag-bg:         #ede7dd;
    --nessia-tag-text:       #5e5140;
}


/* ==========================================================================
   Base / Reset
   ========================================================================== */

@media screen {

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

/* ---- Global focus indicator (WCAG 2.4.7) ---- */
/* Strong, visible outline on keyboard focus for ALL interactive elements. */
/* Uses :focus-visible so mouse clicks don't trigger the ring.            */
:focus-visible {
    outline: 2px solid var(--nessia-accent);
    outline-offset: 2px;
}

/* Fallback for browsers that don't support :focus-visible */
:focus:not(:focus-visible) {
    outline: none;
}

/* High-contrast focus ring for elements on dark backgrounds */
header :focus-visible,
footer :focus-visible,
#advanced-form :focus-visible {
    outline-color: var(--nessia-accent-light);
    outline-offset: 2px;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    font-weight: 400;
    color: var(--nessia-text);
    background-color: var(--nessia-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif', 'Georgia', serif;
    font-weight: 700;
    margin: 0 0 0.75em;
    line-height: 1.3;
    color: var(--nessia-primary);
}

h1 {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.375rem;
    font-weight: 700;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8125rem;
}

a {
    color: var(--nessia-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--nessia-link-hover);
    text-decoration: underline;
}

a:focus-visible {
    color: var(--nessia-link-hover);
    text-decoration: underline;
    outline: 2px solid var(--nessia-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

h1 a, h2 a, h3 a {
    text-decoration: none;
}

h1 a:hover, h2 a:hover, h3 a:hover {
    text-decoration: none;
    color: var(--nessia-accent);
}

p, ul, ol, blockquote, pre, table, form, textarea, label, .label, input {
    margin: 0 0 1.5em;
}

ul li {
    list-style-type: disc;
}

/* Reset list styling for navigation contexts */
nav ul li,
.navigation ul li,
.pagination ul li,
#primary-nav ul li,
#bottom-nav ul li,
.secondary-nav ul li,
#sort-links ul li,
.exhibit-section-nav li,
.exhibit-page-nav li,
.items-nav li {
    list-style-type: none;
    list-style: none;
}

blockquote {
    padding: 1.25em 1.5em;
    border-left: 3px solid var(--nessia-accent);
    background: var(--nessia-featured-bg);
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: var(--nessia-text-muted);
}

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

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

caption {
    font-style: italic;
    text-align: left;
    padding: 0.5em 0;
}

th, td {
    padding: 0.625em 1em;
    text-align: left;
}

th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nessia-text-muted);
    border-bottom: 2px solid var(--nessia-accent);
}

td {
    border-bottom: 1px solid var(--nessia-border-light);
}


/* ==========================================================================
   Form Elements
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    padding: 0.5em 0.75em;
    border: 1px solid var(--nessia-border);
    border-radius: 4px;
    background-color: var(--nessia-surface);
    color: var(--nessia-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: var(--nessia-accent);
    box-shadow: 0 0 0 3px rgba(196, 149, 58, 0.35);
    outline: 2px solid var(--nessia-accent);
    outline-offset: -2px;
}

.button,
a.button,
button,
input[type="submit"] {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.625em 1.25em;
    border: none;
    border-radius: 4px;
    background-color: var(--nessia-accent);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.button:hover,
a.button:hover,
button:hover,
input[type="submit"]:hover {
    background-color: var(--nessia-accent-dark);
    text-decoration: none;
    color: #fff;
}

.button:active,
button:active,
input[type="submit"]:active {
    transform: translateY(1px);
}

.button:focus-visible,
a.button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
    outline: 2px solid var(--nessia-accent-light);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(196, 149, 58, 0.3);
}


/* ==========================================================================
   Skip Navigation
   ========================================================================== */

#skipnav {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 10000;
    padding: 0.75em 1.25em;
    background: var(--nessia-primary);
    color: var(--nessia-text-on-dark);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0 0 4px 0;
    transition: top 0.2s ease;
}

#skipnav:focus {
    top: 0;
}

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


/* ==========================================================================
   Layout
   ========================================================================== */

#wrap {
    max-width: 100%;
    overflow: hidden;
    background-color: var(--nessia-bg);
}

#wrap::after {
    content: '';
    display: table;
    clear: both;
}

#content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2em 1.5em 3em;
}

/* Clearfix — ensures floated children (sidebar, items-list) stay inside #content */
#content::after {
    content: '';
    display: table;
    clear: both;
}


/* ==========================================================================
   Header
   ========================================================================== */

header[role="banner"] {
    background-color: var(--nessia-header-bg);
    padding: 1.5em 0;
    transition: padding 0.3s ease;
}

header[role="banner"].nessia-header-compact {
    padding: 0.75em 0;
}

.nessia-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5em;
}

.nessia-brand {
    display: flex;
    align-items: center;
    gap: 1.25em;
    flex: 1;
    min-width: 0;
}

.nessia-logo {
    flex-shrink: 0;
}

.nessia-logo a {
    display: block;
    line-height: 0;
}

.nessia-logo img,
.nessia-default-logo {
    width: 64px;
    height: 64px;
    transition: width 0.3s ease, height 0.3s ease;
}

.nessia-header-compact .nessia-logo img,
.nessia-header-compact .nessia-default-logo {
    width: 44px;
    height: 44px;
}

.nessia-titles {
    min-width: 0;
    overflow: hidden;
}

#site-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2.1vw, 1.45rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#site-title a {
    color: var(--nessia-text-on-dark);
    text-decoration: none;
}

#site-title a:hover {
    color: var(--nessia-accent-light);
    text-decoration: none;
}


/* -- Multilingual Names -- */

.nessia-multilingual-names {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 0.25em;
}

.nessia-lang {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--nessia-accent-light);
    opacity: 0.85;
    display: inline-block;
    white-space: nowrap;
}

.nessia-sep {
    display: inline-block;
    margin: 0 0.6em;
    opacity: 0.75;
    color: var(--nessia-accent-light);
    font-size: 0.75rem;
    line-height: 1.4;
    transform: translateY(-0.05em);
}

.nessia-lang-ar {
    font-family: 'Noto Sans Arabic', 'Traditional Arabic', sans-serif;
    font-weight: 400;
}

.nessia-lang-he {
    font-family: 'Noto Sans Hebrew', 'David', sans-serif;
    font-weight: 400;
}

.nessia-lang-arc {
    font-family: 'Noto Sans Syriac', 'Estrangelo Edessa', serif;
    font-weight: 400;
}


/* -- Tagline -- */

.nessia-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nessia-text-on-dark);
    opacity: 0.6;
    margin: 0.35em 0 0;
}


/* -- Search -- */

#search-container {
    flex-shrink: 0;
    position: relative;
}

#search-container form {
    display: flex;
    align-items: center;
    gap: 0.25em;
    margin: 0;
}

#search-container input,
#search-container button {
    margin: 0 !important;
}


#search-container input[type="text"] {
    width: 200px;
    height: 2.25em !important;
    padding: 0 0.75em !important;
    font-size: 0.8125rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: var(--nessia-text-on-dark);
    transition: all 0.3s ease;
}

#search-container input[type="text"]::placeholder {
    color: rgba(255,255,255,0.4);
}

#search-container input[type="text"]:focus {
    background: rgba(255,255,255,0.15);
    border-color: var(--nessia-accent);
    box-shadow: 0 0 0 3px rgba(212, 171, 90, 0.4);
    outline: 2px solid var(--nessia-accent-light);
    outline-offset: -2px;
    width: 260px;
}

#search-container button,
#search-container input[type="submit"],
#search-container .button {
    box-sizing: border-box;
    height: 2.25em !important;
    padding: 0 0.875em !important;
    font-size: 0.75rem;
    line-height: 1 !important;
    background-color: var(--nessia-accent);
    border: none;
    border-radius: 4px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

#search-container .advanced-toggle {
    box-sizing: border-box;
    margin-left: 0.5rem;
    height: 2.25em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.875em;
    line-height: 1;
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nessia-accent-light);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

#search-container .advanced-toggle:hover,
#search-container .advanced-toggle:focus-visible {
    background: rgba(255,255,255,0.12);
    border-color: var(--nessia-accent);
    color: #fff;
    outline: 2px solid var(--nessia-accent-light);
    outline-offset: 2px;
}

/* Search submit button focus (on dark header background) */
#search-container button:focus-visible,
#search-container input[type="submit"]:focus-visible {
    outline: 2px solid var(--nessia-accent-light);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(212, 171, 90, 0.3);
}

#search-container .advanced-toggle[aria-expanded="true"] {
    background: rgba(255,255,255,0.14);
    border-color: var(--nessia-accent);
    color: #fff;
}

#advanced-form[hidden] {
    display: none !important;
}

#advanced-form {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 380px;
    max-width: 92vw;
    background: var(--nessia-primary-light);
    padding: 1.25rem;
    border-radius: 6px;
    z-index: 2000;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

#advanced-form label,
#advanced-form .label {
    color: var(--nessia-text-on-dark);
    font-size: 0.8125rem;
}

#advanced-form input[type="radio"] {
    margin-right: 0.25em;
}

/* A11y: radio groups restructured into fieldset/legend */
#advanced-form fieldset.nessia-radio-group {
    border: 0;
    padding: 0;
    margin: 0.5em 0;
}

#advanced-form .nessia-radio-label {
    display: inline-block;
    margin-right: 1em;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--nessia-text-on-dark);
}

#advanced-form .nessia-radio-label input[type="radio"] {
    vertical-align: middle;
    margin-right: 0.2em;
}

/* -- Header image (if uploaded) -- */
#header-image {
    max-width: 100%;
}

#header-image img {
    width: 100%;
    height: auto;
    display: block;
}


/* ==========================================================================
   Primary Navigation
   ========================================================================== */

#primary-nav {
    background-color: var(--nessia-nav-bg);
    border-bottom: 1px solid var(--nessia-border);
    position: relative;
    z-index: 100;
}

#primary-nav > ul {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5em;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

#primary-nav li {
    list-style: none;
    position: relative;
}

#primary-nav > ul > li > a {
    display: block;
    padding: 0.75em 1.125em;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nessia-text);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

#primary-nav > ul > li > a:visited {
    color: var(--nessia-text);
}

#primary-nav > ul > li > a:hover {
    color: var(--nessia-accent);
    text-decoration: none;
    border-bottom-color: var(--nessia-accent);
}

#primary-nav .current > a,
.exhibits #primary-nav li.nav-exhibits > a,
.collections #primary-nav li.nav-collections > a,
.items #primary-nav li.nav-items > a,
.about #primary-nav li.nav-about > a {
    color: var(--nessia-accent);
    border-bottom-color: var(--nessia-accent);
}

/* Dropdown / sub-nav */
#primary-nav .sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    min-width: 12em;
    background: var(--nessia-surface);
    border: 1px solid var(--nessia-border);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    list-style: none;
    padding: 0.25em 0;
}

#primary-nav .sub-nav a {
    display: block;
    padding: 0.5em 1em;
    font-size: 0.8125rem;
    color: var(--nessia-text);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: none;
}

#primary-nav .sub-nav a:hover {
    background: var(--nessia-bg-alt);
    color: var(--nessia-accent);
}

#primary-nav .sub-nav a:focus-visible {
    background: var(--nessia-bg-alt);
    color: var(--nessia-accent);
    outline: 2px solid var(--nessia-accent);
    outline-offset: -2px;
}

/* Sub-nav: high-zoom safety (WCAG 2.4.11) — allow scroll if off-screen */
#primary-nav .sub-nav.open {
    display: block;
    max-height: 80vh;
    overflow-y: auto;
}

/* Parent link with expanded sub-nav */
#primary-nav > ul > li > a[aria-expanded="true"] {
    color: var(--nessia-accent);
    border-bottom-color: var(--nessia-accent);
}


/* -- Mobile Nav Toggle -- */

.nessia-nav-toggle {
    display: none;
    position: absolute;
    top: 1em;
    right: 1em;
    z-index: 200;
    padding: 0.5em;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

.nessia-nav-toggle:focus-visible {
    outline: 2px solid var(--nessia-accent-light);
    outline-offset: 2px;
    border-color: var(--nessia-accent);
}

.nessia-hamburger,
.nessia-hamburger::before,
.nessia-hamburger::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--nessia-text-on-dark);
    transition: all 0.25s ease;
    position: relative;
}

.nessia-hamburger::before,
.nessia-hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.nessia-hamburger::before {
    top: -6px;
}

.nessia-hamburger::after {
    top: 6px;
}

.nessia-nav-toggle-active .nessia-hamburger {
    background: transparent;
}

.nessia-nav-toggle-active .nessia-hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nessia-nav-toggle-active .nessia-hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}


/* ==========================================================================
   Content Area
   ========================================================================== */

#content > h1:first-of-type {
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--nessia-accent);
    margin-bottom: 1.25em;
}


/* ==========================================================================
   Homepage Sections
   ========================================================================== */

#home #content > p:first-of-type,
.homepage-text {
    font-family: 'Noto Serif', serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--nessia-text);
    max-width: 48em;
}


/* -- Featured Boxes -- */

#featured-item,
#featured-collection,
#featured-exhibit {
    background: var(--nessia-surface);
    border: 1px solid var(--nessia-border-light);
    border-radius: 6px;
    padding: 1.5em;
    margin-bottom: 1.5em;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

#featured-item:hover,
#featured-collection:hover,
#featured-exhibit:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border-color: var(--nessia-border);
}

#featured-item h2,
#featured-collection h2,
#featured-exhibit h2 {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--nessia-accent);
    margin-bottom: 0.75em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid var(--nessia-border-light);
}

#featured-item h3,
#featured-collection h3,
#featured-exhibit h3 {
    font-family: 'Noto Serif', serif;
    font-size: 1.25rem;
    margin-bottom: 0.5em;
}

#featured-item h3 a,
#featured-collection h3 a,
#featured-exhibit h3 a {
    color: var(--nessia-primary);
}

#featured-item h3 a:hover,
#featured-collection h3 a:hover,
#featured-exhibit h3 a:hover {
    color: var(--nessia-accent);
}

#featured-item p:last-of-type,
#featured-collection p:last-of-type,
#featured-exhibit p:last-of-type {
    margin-bottom: 0;
}

#featured-item img,
#featured-collection img,
#featured-exhibit img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

#featured-item .image,
#featured-collection .image,
#featured-exhibit .image {
    float: left;
    margin: 0 1.25em 0.75em 0;
}

.featured-box {
    background: var(--nessia-featured-bg);
}


/* -- Recent Items -- */

#recent-items {
    margin-top: 1.5em;
}

#recent-items h2 {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--nessia-accent);
    padding-bottom: 0.5em;
    border-bottom: 1px solid var(--nessia-border-light);
    margin-bottom: 1em;
}

#recent-items .item {
    padding-bottom: 1em;
    margin-bottom: 1em;
    border-bottom: 1px solid var(--nessia-border-light);
}

#recent-items .item:last-child {
    border-bottom: 0;
}

#recent-items .item h3 {
    font-size: 1rem;
    margin-bottom: 0.35em;
}

#recent-items .item .item-description {
    font-size: 0.875rem;
    color: var(--nessia-text-muted);
    line-height: 1.5;
}

#recent-items img {
    float: left;
    margin: 0.2em 1em 0.5em 0;
    border-radius: 3px;
    max-height: 60px;
    width: auto;
}


/* ==========================================================================
   Items — Browse
   ========================================================================== */

.items-nav.secondary-nav {
    margin-bottom: 1.25em;
}

.items-nav.secondary-nav ul {
    list-style: none;
    display: flex;
    gap: 0.25em;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--nessia-border);
}

.items-nav.secondary-nav li {
    list-style: none;
}

.items-nav.secondary-nav a {
    display: block;
    padding: 0.5em 1em;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--nessia-text-muted);
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.items-nav.secondary-nav .current a,
.items-nav.secondary-nav a:hover {
    color: var(--nessia-accent);
    border-bottom-color: var(--nessia-accent);
}

#sort-links {
    padding: 0.75em 0 1.25em;
    clear: both;
}

#sort-links .sort-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nessia-text-muted);
    margin-right: 0.5em;
}

#sort-links ul {
    display: inline;
    list-style: none;
    padding: 0;
    margin: 0;
}

#sort-links li {
    display: inline;
    list-style: none;
    margin: 0;
}

#sort-links li::after {
    content: ' · ';
    color: var(--nessia-border);
}

#sort-links li:last-child::after {
    content: '';
}

#sort-links a {
    font-size: 0.8125rem;
    color: var(--nessia-link);
}

#sort-links .sorting,
#sort-links .asc a,
#sort-links .desc a {
    font-weight: 600;
    color: var(--nessia-accent);
}

.items-list .item {
    background: var(--nessia-surface);
    border: 1px solid var(--nessia-border-light);
    border-radius: 6px;
    padding: 1.25em 1.5em;
    margin-bottom: 1em;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.items-list .item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border-color: var(--nessia-border);
}

.items-list .item h2 {
    font-size: 1.125rem;
    margin-bottom: 0.35em;
}

.items-list .item h2 a {
    color: var(--nessia-primary);
}

.items-list .item h2 a:hover {
    color: var(--nessia-accent);
    text-decoration: none;
}

.items-list .item .item-description {
    font-size: 0.9375rem;
    color: var(--nessia-text-muted);
    line-height: 1.6;
    margin-bottom: 0.5em;
}

.items-list .item img {
    float: left;
    margin: 0.25em 1.25em 0.75em 0;
    border-radius: 4px;
    border: 1px solid var(--nessia-border-light);
}

.items-list .tags {
    }

.items-list .tags p {
    font-size: 0.8125rem;
    color: var(--nessia-text-muted);
    margin: 0;
}

.items-list .tags a {
    display: inline-block;
    padding: 0.15em 0.5em;
    background: var(--nessia-tag-bg);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--nessia-tag-text);
    margin: 0.15em 0.15em;
    text-decoration: none;
    transition: background 0.2s ease;
}

.items-list .tags a:hover {
    background: var(--nessia-accent);
    color: #fff;
    text-decoration: none;
}


/* ==========================================================================
   Items — Show
   ========================================================================== */

.items.show .hentry {
    background: var(--nessia-surface);
    border: 1px solid var(--nessia-border-light);
    border-radius: 6px;
    padding: 1.5em 2em;
}

.items.show .hentry .element {
    margin-bottom: 1.5em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid var(--nessia-border-light);
}

.items.show .hentry .element:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.items.show .hentry .element h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nessia-accent);
    margin-bottom: 0.35em;
}

.items.show .hentry .element-text {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--nessia-text);
}

/* -- File Viewer (hero position, below title) -- */

#itemfiles {
    clear: both;
    margin-bottom: 2.5em;
    position: relative;
    background: var(--nessia-primary);
    border-radius: 10px;
    padding: 6px;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.10),
        0 12px 40px rgba(0,0,0,0.08);
}

/* Decorative accent rule along the top */
#itemfiles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2em;
    right: 2em;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--nessia-accent) 15%,
        var(--nessia-accent-light) 50%,
        var(--nessia-accent) 85%,
        transparent 100%
    );
    border-radius: 0 0 2px 2px;
    z-index: 1;
}

/* Inner container clips the viewer corners */
#itemfiles .element-text {
    display: block;
    border-radius: 7px;
    overflow: hidden;
    background: #222;
}

/* Omeka wraps each file output in .item-file */
#itemfiles .item-file {
    width: 100%;
    margin-bottom: 0;
}

/* Embedded viewers */
#itemfiles iframe,
#itemfiles embed,
#itemfiles object {
    width: 100% !important;
    min-height: 82vh;
    height: auto;
    border: 0;
    display: block;
}

#itemfiles img {
    max-width: 100%;
    height: auto;
    display: block;
}

#show-sidebar {
    background: var(--nessia-bg-alt);
    border-radius: 6px;
    padding: 1.25em 1.5em;
    margin-top: 1.5em;
}

#show-sidebar dl {
    margin: 0;
}

#show-sidebar dt {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nessia-accent);
    margin-top: 1em;
}

#show-sidebar dt:first-child {
    margin-top: 0;
}

#show-sidebar dd {
    font-size: 0.875rem;
    color: var(--nessia-text);
    margin: 0.25em 0 0 0;
}

.item-pagination {
    list-style: none;
    display: flex;
    justify-content: space-between;
    padding: 1.5em 0 0;
    margin: 0;
    clear: both;
}

.item-pagination li {
    list-style: none;
}

.item-pagination a {
    display: inline-block;
    padding: 0.5em 1em;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--nessia-link);
    border: 1px solid var(--nessia-border);
    border-radius: 4px;
    text-decoration: none;
}

.item-pagination a:hover {
    border-color: var(--nessia-accent);
    color: var(--nessia-accent);
    text-decoration: none;
}


/* ==========================================================================
   Collections
   ========================================================================== */

.collections.browse .collection {
    background: var(--nessia-surface);
    border: 1px solid var(--nessia-border-light);
    border-radius: 6px;
    padding: 1.25em 1.5em;
    margin-bottom: 1em;
}


/* ==========================================================================
   Exhibits
   ========================================================================== */

/* Exhibit browse secondary nav (Browse All / Browse by Tag) */
.exhibits .secondary-nav ul,
.exhibits nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5em;
    display: flex;
    gap: 0.25em;
    border-bottom: 1px solid var(--nessia-border);
}

.exhibits .secondary-nav li,
.exhibits nav.navigation li {
    list-style: none;
}

.exhibits .secondary-nav a,
.exhibits nav.navigation a {
    display: block;
    padding: 0.5em 1em;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--nessia-text-muted);
    border-bottom: 2px solid transparent;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.exhibits .secondary-nav .current a,
.exhibits .secondary-nav a:hover,
.exhibits nav.navigation .current a,
.exhibits nav.navigation a:hover {
    color: var(--nessia-accent);
    border-bottom-color: var(--nessia-accent);
    text-decoration: none;
}

/* Individual exhibit in browse list */
.exhibits .exhibit {
    background: var(--nessia-surface);
    border: 1px solid var(--nessia-border-light);
    border-radius: 6px;
    padding: 1.25em 1.5em;
    margin-bottom: 1em;
    transition: box-shadow 0.2s ease;
}

.exhibits .exhibit:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.exhibits .exhibit h2,
.exhibits .exhibit h3 {
    margin-bottom: 0.35em;
}

.exhibits .exhibit h2 a,
.exhibits .exhibit h3 a {
    color: var(--nessia-primary);
}

.exhibits .exhibit h2 a:hover,
.exhibits .exhibit h3 a:hover {
    color: var(--nessia-accent);
    text-decoration: none;
}

.exhibits .exhibit .description,
.exhibits .exhibit p,
.exhibit-description {
    font-size: 0.9375rem;
    color: var(--nessia-text);
    line-height: 1.6;
}

.exhibit .tags {
    margin-top: 1em;
}

.exhibit .tags a {
    display: inline-block;
    padding: 0.15em 0.5em;
    background: var(--nessia-tag-bg);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--nessia-tag-text);
}

.exhibit-section-nav,
.exhibit-page-nav {
    list-style: none;
    padding: 0;
}

.exhibit-section-nav a,
.exhibit-page-nav a {
    color: var(--nessia-link);
}

.exhibit-section-nav .current a,
.exhibit-page-nav .current a {
    color: var(--nessia-accent);
    font-weight: 600;
}

#exhibit-pages {
    background: var(--nessia-bg-alt);
    border-radius: 6px;
    padding: 1.25em;
}

#exhibit-pages h4 {
    color: var(--nessia-accent);
}

/* Exhibit show page */
.exhibits.show .exhibit-text,
.exhibits.show .exhibit-item,
.exhibits.show .exhibit .description {
    color: var(--nessia-text);
    line-height: 1.7;
}

.exhibit-block {
    margin-bottom: 2em;
}

.exhibit-block img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}


/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    margin: 1.5em 0;
    clear: both;
}

.pagination ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    padding: 0;
    margin: 0;
}

.pagination li {
    list-style: none;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 0.4em 0.75em;
    font-size: 0.8125rem;
    border: 1px solid var(--nessia-border);
    border-radius: 4px;
    color: var(--nessia-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination li a:hover {
    border-color: var(--nessia-accent);
    color: var(--nessia-accent);
    text-decoration: none;
}

.pagination .pagination_current,
.pagination .current {
    background: var(--nessia-accent);
    color: #fff;
    border-color: var(--nessia-accent);
    font-weight: 600;
}


/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

#content > div:first-child > a,
#content .navigation.breadcrumbs a {
    font-size: 0.8125rem;
    color: var(--nessia-text-muted);
}


/* ==========================================================================
   General Secondary Navigation (all pages)
   ========================================================================== */

.secondary-nav {
    margin-bottom: 1.25em;
}

.secondary-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--nessia-border);
}

.secondary-nav li {
    list-style: none;
}

.secondary-nav a {
    display: block;
    padding: 0.5em 1em;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--nessia-text-muted);
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.secondary-nav .current a,
.secondary-nav a:hover {
    color: var(--nessia-accent);
    border-bottom-color: var(--nessia-accent);
    text-decoration: none;
}


/* ==========================================================================
   Collection Tree
   ========================================================================== */

#collection-tree ul {
    padding-left: 1.5em;
}

#collection-tree li {
    margin-bottom: 0.35em;
}

#collection-tree a {
    color: var(--nessia-link);
    font-size: 1rem;
}

#collection-tree a:hover {
    color: var(--nessia-accent);
}


/* ==========================================================================
   Search Results / Advanced Search
   ========================================================================== */

.search-results .item {
    background: var(--nessia-surface);
    border: 1px solid var(--nessia-border-light);
    border-radius: 6px;
    padding: 1.25em 1.5em;
    margin-bottom: 1em;
}

#search-filters {
    font-size: 0.875rem;
    margin-bottom: 1.5em;
    padding: 0.75em 1em;
    background: var(--nessia-bg-alt);
    border-radius: 4px;
}

#advanced-search-form label,
#advanced-search-form .label {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ==========================================================================
   Output Formats
   ========================================================================== */

#outputs {
    padding: 1em 0 0;
    border-top: 1px solid var(--nessia-border-light);
    margin-top: 1.5em;
    clear: both;
}

#outputs .outputs-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nessia-text-muted);
    margin-right: 0.5em;
}

#outputs a {
    font-size: 0.8125rem;
    margin-right: 0.75em;
}


/* ==========================================================================
   Footer
   ========================================================================== */

footer[role="contentinfo"] {
    background-color: var(--nessia-footer-bg);
    color: var(--nessia-text-on-dark);
    margin-top: 2em;
    clear: both;
}

.nessia-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2em 1.5em;
}

#bottom-nav {
    padding-bottom: 1.5em;
    margin-bottom: 1.5em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#bottom-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    padding: 0;
    margin: 0;
}

#bottom-nav li {
    list-style: none;
}

#bottom-nav a {
    display: block;
    padding: 0.35em 0.875em;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--nessia-text-on-dark);
    opacity: 0.75;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

#bottom-nav a:hover {
    opacity: 1;
    color: var(--nessia-accent-light);
    text-decoration: none;
}

#bottom-nav .current a {
    color: var(--nessia-accent-light);
    opacity: 1;
}

.nessia-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1em;
}

#footer-text {
    font-size: 0.8125rem;
    line-height: 1.6;
    opacity: 0.7;
}

#footer-text p {
    margin-bottom: 0.25em;
}

.nessia-copyright {
    font-size: 0.75rem;
    opacity: 0.6;
}

.nessia-footer-credits {
    font-size: 0.75rem;
    opacity: 0.5;
}

.nessia-footer-credits a {
    color: var(--nessia-accent-light);
}

.nessia-footer-credits p {
    margin: 0;
}


/* ==========================================================================
   Simple Pages Plugin
   ========================================================================== */

.page #content {
    max-width: 48em;
}

.page #content h2 {
    margin-top: 2em;
}


/* ==========================================================================
   Image / Media
   ========================================================================== */

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

.item-img img {
    border-radius: 4px;
    border: 1px solid var(--nessia-border-light);
}


/* ==========================================================================
   Responsive — Tablet (min-width: 768px)
   ========================================================================== */

@media screen and (min-width: 768px) {

    #content {
        padding: 2.5em 2em 4em;
    }

    .nessia-header-inner {
        padding: 0 2em;
    }

    #primary-nav > ul {
        padding: 0 2em;
    }

    .nessia-footer-inner {
        padding: 2.5em 2em;
    }

    #featured-item,
    #featured-collection,
    #featured-exhibit {
        width: 66%;
        float: left;
        margin-right: 2%;
    }

    #recent-items {
        width: 32%;
        display: inline-block;
        padding: 0;
        margin: 0;
    }

    .items.show .hentry {
        width: 66%;
        float: left;
        margin-right: 2%;
    }

    #show-sidebar {
        width: 32%;
        float: right;
        margin: 0;
        clear: none;
    }

    .items.browse .items-list {
        width: 66%;
        float: left;
        margin-right: 2%;
    }

    .items.browse #featured-item {
        width: 32%;
        float: right;
        margin-right: 0;
    }

    .exhibits #content > * {
        /* Only float on show pages; browse pages stay full-width */
    }

    /* Exhibit SHOW — 2-column with sidebar */
    .exhibits.show #content > * {
        width: 66%;
        float: left;
        margin-right: 2%;
    }

    .exhibits #content > h1:first-of-type {
        margin-top: 0;
        width: 100%;
        float: none;
    }

    .exhibits #content > #exhibit-pages {
        width: 32%;
        display: inline-block;
        float: right;
        margin: 0;
    }

    /* Exhibit BROWSE — full width, no float */
    .exhibits.browse #content > * {
        width: 100%;
        float: none;
        margin-right: 0;
    }
}


/* ==========================================================================
   Responsive — Mobile (max-width: 767px)
   ========================================================================== */

@media screen and (max-width: 767px) {

    body {
        font-size: 15px;
    }

    .nessia-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1em;
    }

    .nessia-brand {
        width: 100%;
    }

    #site-title {
        font-size: clamp(0.875rem, 3.8vw, 1.375rem);
    }

    .nessia-multilingual-names {
        gap: 0.15em 0.75em;
    }

    .nessia-lang {
        font-size: 0.6875rem;
    }

    .nessia-tagline {
        font-size: 0.6875rem;
    }

    #itemfiles {
        border-radius: 8px;
        padding: 4px;
        margin-bottom: 1.5em;
    }

    #itemfiles::before {
        left: 1em;
        right: 1em;
    }

    #itemfiles iframe,
    #itemfiles embed,
    #itemfiles object {
        min-height: 60vh;
    }

    #search-container {
        width: 100%;
    }

    #search-container input[type="text"] {
    width: 200px;
    height: 2.25em !important;
    padding: 0 0.75em !important;
    font-size: 0.8125rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: var(--nessia-text-on-dark);
    transition: all 0.3s ease;
}

    #search-container input[type="text"]:focus {
        width: 100%;
    }

    .nessia-nav-toggle {
        display: block;
    }

    #primary-nav {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    #primary-nav.nessia-nav-open {
        max-height: 600px;
    }

    #primary-nav > ul {
        flex-direction: column;
        padding: 0.5em 1em;
    }

    #primary-nav > ul > li > a {
        padding: 0.625em 0.5em;
        border-bottom: 1px solid var(--nessia-border-light);
    }

    #featured-item .image,
    #featured-collection .image,
    #featured-exhibit .image {
        float: none;
        margin: 0 0 0.75em;
    }

    .nessia-footer-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    h1 {
        font-size: 1.375rem;
    }
}

} /* end @media screen */


/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    body {
        font: 12px Georgia, 'Palatino Linotype', 'Book Antiqua', 'Times New Roman', Times, serif;
        color: #000;
        background: #fff;
    }

    #content {
        width: 100%;
        margin: 0;
        float: none;
    }

    h1, #site-title {
        font-size: 16pt;
        font-weight: bold;
    }

    h2 {
        font-size: 14pt;
        font-style: italic;
    }

    h3 {
        font-size: 14pt;
    }

    a:link:after {
        content: " (" attr(href) ") ";
        font-size: 80%;
    }

    #search-container,
    #primary-nav,
    #header-image,
    .navigation,
    .pagination,
    #exhibit-page-navigation,
    .exhibit-section-nav,
    .exhibit-page-nav,
    .nessia-nav-toggle,
    .nessia-multilingual-names {
        display: none;
    }

    blockquote {
        margin: 10pt 0 0 0;
        font-style: italic;
    }
}

.sep { margin:0 .5em; opacity:.75; }
