:root {
    --ink:       #0f0e0c;
    --deep:      #12151f;
    --lapis:     #1a2340;
    --lapis-mid: #243057;
    --gold:      #c9a84c;
    --gold-light:#e8c97a;
    --gold-pale: #f5e9c8;
    --sand:      #f7f1e3;
    --stone:     #e8dfc8;
    --text:      #2a2420;
    --muted:     #6b6458;
    --border:    #d4c9b0;
}

*,
::before,
::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background-color: var(--sand);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    line-height: inherit;
}

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
}

hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
}

ol,
ul,
menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

a {
    color: inherit;
    text-decoration: inherit;
}

button,
input,
optgroup,
select,
textarea {
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}

button,
select {
    text-transform: none;
}

button,
input[type='button'],
input[type='reset'],
input[type='submit'] {
    -webkit-appearance: button;
    background-color: transparent;
    background-image: none;
}

button,
[role='button'] {
    cursor: pointer;
}

:disabled {
    cursor: default;
}

fieldset {
    margin: 0;
    padding: 0;
}

legend {
    padding: 0;
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    opacity: 1;
    color: #9ca3af;
}

table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    display: block;
    vertical-align: middle;
}

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

[hidden]:not([hidden='until-found']) {
    display: none;
}

.collection-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: start;
}

.collection-result-count-wrap {
    display: flex;
    align-items: center;
    height: 46px;
}

.collection-search-suggestions {
    margin-bottom: 1.25rem;
}

.collection-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.essays-filter-form,
.bibliography-filter-form {
    margin-bottom: 2rem;
}

.essays-filter-row,
.bibliography-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.essays-search-wrap,
.bibliography-search-wrap {
    flex: 1;
    min-width: 200px;
}

.essays-search-bar,
.bibliography-search-bar {
    max-width: 400px;
}

.essays-filter-actions,
.bibliography-filter-actions {
    align-self: flex-end;
    padding-bottom: 0.1rem;
}

.essays-results-layout {
    width: 100%;
}

.bibliography-results-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.bibliography-results-sidebar {
    position: sticky;
    top: 1rem;
}

.artifact-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.artifact-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.font-display { font-family: 'Cinzel', serif; }
.font-serif   { font-family: 'Cormorant Garamond', serif; }

/* Navbar */
.navbar {
    background-color: var(--deep);
    border-bottom: 1px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: relative;
}

.navbar-brand {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-menu-toggle {
    display: none;
    width: 38px;
    height: 34px;
    border: 1px solid rgba(201, 168, 76, 0.35);
    background: rgba(201, 168, 76, 0.06);
    border-radius: 3px;
    padding: 0.45rem 0.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.25rem;
}

.navbar-menu-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--gold-light);
}

.navbar-brand .brand-mark {
    width: 28px;
    height: 28px;
    background: var(--gold);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav a {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c8cdd8;
    text-decoration: none;
    padding: 0.5rem 0.875rem;
    border-radius: 2px;
    transition: color 0.2s, background 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.3em;
    cursor: pointer;
}

.nav-dropdown-toggle::after {
    content: '▾';
    font-size: 0.6rem;
    line-height: 1;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 10rem;
    background: transparent;
    border: 0;
    border-radius: 2px;
    list-style: none;
    margin: 0;
    padding: 0.25rem 0 0;
    z-index: 1000;
}

.nav-dropdown-menu li a {
    display: block;
    padding: 0.45rem 1rem;
    border-radius: 0;
    background: #1a1a2e;
    border-right: 1px solid rgba(201, 168, 76, 0.25);
    border-left: 1px solid rgba(201, 168, 76, 0.25);
}

.navbar-nav .nav-dropdown-menu li a:hover,
.navbar-nav .nav-dropdown-menu li a.active {
    background: #24243d;
}

.nav-dropdown-menu li:first-child a {
    border-top: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 2px 2px 0 0;
}

.nav-dropdown-menu li:last-child a {
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 0 0 2px 2px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}

.culture-ribbon {
    background: rgba(212, 175, 55, 0.12);
    border-bottom: 1px solid var(--gold);
}

.culture-ribbon-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.45rem 2rem;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--gold);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.culture-ribbon-inner select {
    max-width: 100%;
    padding: 0.3rem 1.75rem 0.3rem 0.5rem;
    border: 1px solid var(--gold);
    border-radius: 3px;
    background: transparent;
    color: var(--gold);
    font: inherit;
    cursor: pointer;
}

/* Calendar toggle */
.cal-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 3px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    color: inherit;
}

.cal-toggle .cal-option {
    position: relative;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: #747986;
    opacity: 0.75;
    transition: color 0.2s, opacity 0.2s, text-shadow 0.2s;
}

.cal-toggle .cal-option.active {
    color: var(--gold-light);
    font-weight: 600;
    opacity: 1;
    text-shadow: 0 0 8px rgba(232, 201, 122, 0.28);
}

.cal-toggle .cal-option::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 0.65rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(201, 168, 76, 0.35);
    border-radius: 3px;
    background: var(--deep);
    color: white;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.2;
    text-transform: none;
    text-shadow: none;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.12s ease,
        visibility 0s linear 0.12s;
}

.cal-toggle .cal-option:hover::after {
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.12s ease 0.25s,
        visibility 0s linear 0.25s;
}

.cal-toggle:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

.cal-switch {
    width: 32px;
    height: 16px;
    background: var(--lapis-mid);
    border-radius: 8px;
    position: relative;
    transition: background 0.2s;
}

.cal-switch.hijri { background: var(--gold); }

.cal-switch::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.cal-switch.hijri::after { transform: translateX(16px); }

/* Page container */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page header */
.page-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--lapis);
    letter-spacing: 0.06em;
    margin: 0 0 0.25rem 0;
}

.page-header p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.125rem;
    color: var(--muted);
    margin: 0;
}

/* Search bar */
.search-bar {
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    padding: 0.75rem 0;
    background: transparent;
}

.search-bar input::placeholder { color: #aaa; }

.search-icon {
    color: var(--muted);
    flex-shrink: 0;
}

/* Filter pills */
.filter-section label {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 0.5rem;
}

.filter-select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.5rem 0.75rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.875rem;
    color: var(--text);
    background: white;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6458' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.filter-select:focus { border-color: var(--gold); }

/* Artifact grid */
.artifact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Artifact card */
.artifact-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    display: block;
}

.artifact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--gold);
}

.artifact-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: contain;
    background: var(--stone);
    display: flex;
    align-items: center;
    justify-content: center;
}

.artifact-card-image.no-image {
    background: linear-gradient(135deg, var(--lapis) 0%, var(--lapis-mid) 100%);
}

.artifact-card-image.no-image svg {
    opacity: 0.15;
}

.artifact-card-body {
    padding: 0.9rem 1.05rem 1rem;
}

.artifact-card-category {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.375rem;
}

.artifact-card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--lapis);
    line-height: 1.3;
    margin-bottom: 0.375rem;
}

.artifact-card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.artifact-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

@media (max-width: 1024px) {
    .artifact-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 640px) {
    .artifact-grid {
        grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
        gap: 1rem;
    }

    .artifact-card-body {
        padding: 0.875rem 1rem 1rem;
    }

    .artifact-card-title {
        font-size: 1.05rem;
    }
}

/* Result count */
.result-count {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--muted);
}

/* Informational pages */
.information-page {
    max-width: 850px;
}

.information-card {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: 0 6px 6px 0;
    padding: 2rem;
}

.information-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lapis);
    margin-bottom: 0.75rem;
}

.information-card p,
.information-rich-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text);
}

.information-introduction {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--muted);
}

.information-rich-text > :first-child,
.information-introduction > :first-child {
    margin-top: 0;
}

.information-rich-text > :last-child,
.information-introduction > :last-child {
    margin-bottom: 0;
}

.information-sections {
    display: grid;
    gap: 1.5rem;
}

.placeholder-form {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.placeholder-form label {
    display: grid;
    gap: 0.4rem;
    color: var(--text);
    font-weight: 500;
}

.placeholder-form input,
.placeholder-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #f3f0e9;
    padding: 0.7rem 0.8rem;
    color: var(--muted);
}

.placeholder-form textarea {
    min-height: 9rem;
    resize: vertical;
}

.placeholder-form button {
    justify-self: start;
    border-radius: 4px;
    background: var(--lapis);
    color: #fff;
    padding: 0.7rem 1.25rem;
    opacity: 0.55;
    cursor: not-allowed;
}

.form-status-note {
    color: var(--muted);
    font-size: 0.95rem;
    font-style: italic;
}

/* Citizen Historians */
.citizen-historians-page {
    max-width: 1200px;
}

.citizen-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.citizen-form-card {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: 6px;
    padding: 2rem;
}

.citizen-form-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    color: var(--lapis);
    margin-bottom: 0.75rem;
}

.citizen-form-card > p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.08rem;
    line-height: 1.6;
}

.citizen-form-card form {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.citizen-form-field label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-weight: 500;
}

.citizen-form-field input,
.citizen-form-field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    padding: 0.65rem 0.75rem;
}

.citizen-form-field input:focus,
.citizen-form-field textarea:focus {
    border-color: var(--gold);
    outline: 2px solid rgba(201, 168, 76, 0.25);
    outline-offset: 1px;
}

.citizen-form-card button {
    justify-self: start;
    border-radius: 4px;
    background: var(--lapis);
    color: #fff;
    cursor: pointer;
    padding: 0.7rem 1.25rem;
}

.citizen-form-card button:hover,
.citizen-form-card button:focus-visible {
    background: var(--lapis-mid);
}

.citizen-follow-up {
    margin-top: 1.5rem;
    color: var(--muted);
    font-style: italic;
}

.citizen-form-help {
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.submission-errors {
    margin-top: 0.35rem;
    color: #9f2d20;
    font-size: 0.9rem;
}

.submission-errors ul {
    list-style: disc;
    padding-left: 1.25rem;
}

.submission-success {
    margin-bottom: 1.5rem;
    border: 1px solid #6c8f62;
    border-radius: 4px;
    background: #edf5e9;
    padding: 1rem 1.25rem;
    color: #31552c;
}

/* Videos */
.video-list-page,
.video-detail-page {
    max-width: 1200px;
}

.video-filter-form {
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: rgba(255,255,255,0.5);
    padding: 1rem;
}

.video-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: end;
}

.video-filter-grid label > span {
    display: block;
    margin-bottom: 0.35rem;
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.video-filter-grid select,
.video-filter-grid input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: #fff;
    padding: 0.55rem 0.7rem;
}

.video-search-field {
    grid-column: span 2;
}

.video-filter-actions {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.video-filter-actions button {
    border-radius: 3px;
    background: var(--lapis);
    color: #fff;
    cursor: pointer;
    padding: 0.6rem 1rem;
}

.video-filter-actions a {
    color: var(--lapis);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.4rem;
}

.video-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
}

.video-card-image {
    position: relative;
    display: flex;
    aspect-ratio: 16 / 9;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--deep);
}

.video-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s;
}

.video-card-image:hover img {
    transform: scale(1.025);
}

.video-card-placeholder {
    color: var(--gold);
    font-size: 2.2rem;
}

.video-duration {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    border-radius: 3px;
    background: rgba(15,14,12,0.85);
    color: #fff;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

.video-card-body {
    padding: 1.1rem;
}

.video-card-type {
    margin-bottom: 0.4rem;
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.video-card h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--lapis);
}

.video-card h2 a:hover,
.video-card h2 a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.video-card-body p {
    margin-top: 0.65rem;
    line-height: 1.55;
    color: var(--muted);
}

.video-card-body .video-card-presenter {
    margin-top: 0.35rem;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

.related-videos-section {
    max-width: 800px;
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.related-video-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-video-list li {
    padding: 0.4rem 0;
}

.related-video-list a {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: var(--lapis);
}

.related-video-list a:hover,
.related-video-list a:focus-visible {
    color: var(--gold-dark);
}

.related-video-meta {
    display: block;
    margin-top: 0.1rem;
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.video-breadcrumb {
    margin-bottom: 2rem;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.video-breadcrumb span {
    margin-left: 0.5rem;
}

.video-breadcrumb a:hover,
.video-breadcrumb a:focus-visible {
    color: var(--lapis);
    text-decoration: underline;
}

.video-detail-header {
    max-width: 900px;
    margin-bottom: 1.5rem;
}

.video-detail-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.6rem;
    font-weight: 500;
    line-height: 1.15;
    color: var(--lapis);
}

.video-detail-meta {
    margin-top: 0.75rem;
    color: var(--muted);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

.video-detail-summary {
    margin-top: 1rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    line-height: 1.65;
}

.video-player-shell {
    position: relative;
    display: flex;
    aspect-ratio: 16 / 9;
    max-width: 1000px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--gold);
    border-radius: 6px;
    background: var(--deep);
}

.video-player-shell img,
.video-player-shell iframe {
    width: 100%;
    height: 100%;
}

.video-player-shell img {
    object-fit: cover;
    opacity: 0.78;
}

.video-player-shell iframe {
    border: 0;
}

.video-play-button {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--gold);
    border-radius: 4px;
    background: rgba(18,21,31,0.94);
    color: #fff;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
}

.video-play-button:hover,
.video-play-button:focus-visible {
    background: var(--lapis-mid);
}

.video-privacy-note {
    max-width: 1000px;
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.video-detail-section {
    max-width: 1000px;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.video-detail-section > h2 {
    margin-bottom: 1rem;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.rich-text-content,
.video-preformatted {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    line-height: 1.75;
}

.video-metadata {
    display: grid;
    gap: 1rem;
}

.video-metadata div {
    display: grid;
    grid-template-columns: minmax(8rem, 0.25fr) 1fr;
    gap: 1rem;
}

.video-metadata dt,
.video-related-grid h3 {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.video-metadata a,
.video-related-grid a,
.video-back-link a {
    color: var(--lapis);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.video-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.5rem;
}

.video-related-grid ul {
    margin-top: 0.65rem;
}

.video-related-grid li {
    margin-bottom: 0.4rem;
}

.video-back-link {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

/* Footer */
.site-footer {
    background: var(--deep);
    border-top: 1px solid var(--gold);
    margin-top: 4rem;
    padding: 2rem;
}

.site-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.site-footer-title {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.site-footer-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    font-style: italic;
    color: #6b7280;
}

.site-footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    max-width: 30rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    text-align: right;
}

.site-footer-links a {
    color: #9ca3af;
}

.site-footer-links a:hover,
.site-footer-links a:focus-visible {
    color: var(--gold-light);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}

.empty-state h3 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--lapis);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
}

/* Decorative cuneiform pattern */
.cuneiform-divider {
    text-align: center;
    color: var(--border);
    font-size: 1.25rem;
    letter-spacing: 0.5em;
    margin: 0.5rem 0;
    user-select: none;
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline-block;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.artifact-card {
    animation: fadeIn 0.3s ease both;
}

/* Event marker - inline display */
.event-marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 10;
    text-align: center;
}

.event-card {
    background: rgba(26,35,64,0.9);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 3px;
    padding: 0.4rem 0.5rem;
    width: 80px;
    transition: all 0.2s;
}

.event-marker:hover .event-card {
    border-color: var(--gold);
    background: rgba(26,35,64,0.98);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.event-card .ec-title {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--gold);
    line-height: 1.2;
    word-break: break-word;
}

.event-card .ec-year {
    font-family: 'Cinzel', serif;
    font-size: 0.58rem;
    color: rgba(255,255,255,0.75);
    margin-top: 0.2rem;
}

.event-dot {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    margin: 0 auto 0.3rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 6px rgba(201,168,76,0.4);
}

.event-marker:hover .event-dot {
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(201,168,76,0.8);
}

/* Description popup - shows on hover and click */
.event-desc-popup {
    position: fixed;
    background: rgba(26,35,64,0.95);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 3px;
    padding: 1rem;
    width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.event-desc-popup.visible {
    opacity: 1;
    pointer-events: auto;
}

.event-marker:hover .event-desc-popup {
    opacity: 1;
    pointer-events: none;
}

.event-desc-popup .ec-title {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.event-desc-popup .ec-year {
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.5rem;
}

.event-desc-popup .ec-desc {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.5;
}

.event-desc-popup .ec-close {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.event-desc-popup .ec-close:hover {
    color: rgba(255,255,255,0.7);
}

@media (max-width: 1000px) {
    .navbar-inner {
        min-height: 64px;
        height: auto;
        padding: 0.5rem 1rem;
    }

    .navbar-brand {
        font-size: 0.82rem;
        letter-spacing: 0.04em;
        line-height: 1.2;
        max-width: calc(100% - 52px);
        white-space: normal;
    }

    .navbar-brand .brand-mark {
        width: 22px;
        height: 22px;
    }

    .navbar-menu-toggle {
        display: flex;
        flex-shrink: 0;
    }

    .navbar-actions {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(18, 21, 31, 0.99);
        border-top: 1px solid rgba(201, 168, 76, 0.2);
        border-bottom: 1px solid rgba(201, 168, 76, 0.2);
        padding: 0.65rem 1rem 0.85rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .navbar-actions.open {
        display: flex;
    }

    .navbar-nav {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
    }

    .navbar-nav a {
        display: block;
        font-size: 0.64rem;
        padding: 0.55rem 0.7rem;
    }

    .nav-dropdown-menu {
        position: static;
        display: block;
        margin: 0.25rem 0 0;
        background: transparent;
        border: none;
        min-width: 0;
        padding: 0 0 0 0.75rem;
    }

    .nav-dropdown-menu li a {
        padding: 0.45rem 0.7rem;
    }

    .cal-toggle {
        align-self: flex-start;
    }

    .culture-ribbon-inner {
        padding: 0.4rem 1rem;
        font-size: 0.76rem;
    }
}

@media (max-width: 900px) {
    .page-container {
        padding: 1.5rem 1.25rem;
    }

    .page-header h1 {
        font-size: 1.45rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .citizen-form-grid {
        grid-template-columns: 1fr;
    }

    .video-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .video-detail-header h1 {
        font-size: 2.15rem;
    }

    .collection-search-row {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .collection-result-count-wrap {
        height: auto;
    }

    .collection-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bibliography-results-layout,
    .artifact-detail-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .bibliography-results-sidebar {
        position: static;
        top: auto;
    }
}

@media (max-width: 640px) {
    .page-container {
        padding: 1.2rem 1rem;
    }

    .information-card {
        padding: 1.4rem;
    }

    .site-footer {
        padding: 1.5rem 1rem;
    }

    .site-footer-inner {
        padding: 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer-links {
        align-items: flex-start;
        text-align: left;
    }

    .video-filter-grid {
        grid-template-columns: 1fr;
    }

    .video-search-field,
    .video-filter-actions {
        grid-column: auto;
    }

    .video-metadata div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .collection-filter-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .filter-section label {
        font-size: 0.62rem;
    }

    .filter-select {
        font-size: 1rem;
        padding: 0.62rem 0.85rem;
        background-position: right 0.85rem center;
    }

    .essays-search-bar,
    .bibliography-search-bar {
        max-width: none;
    }

    .essays-filter-actions,
    .bibliography-filter-actions {
        width: 100%;
        padding-bottom: 0;
    }
}