@charset "UTF-8";
:root { --paper:#fffaf0; --ink:#30291f; --muted:#74664f; --blue:#185767; --blue-dark:#123f4b; --gold:#ae8441; --line:#d8c9ac; --serif:Georgia,'Times New Roman',serif; --arabic:'Traditional Arabic','Amiri','Times New Roman',serif; --sans:Arial,Tahoma,sans-serif; color-scheme:light; }
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
/* Plain paper and the two marginal ornaments are display crops of the original photograph. */
body { --ornament-size:clamp(100px,11vw,220px); --manuscript-gutter:calc(var(--ornament-size) + 24px); margin:0; padding:28px var(--manuscript-gutter); color:var(--ink); background-color:#e3cba4; background-image:url('./assets/manuscript-illumination.jpg'); background-position:72% 12%; background-size:max(500vw,1000vh) auto; background-repeat:no-repeat; background-attachment:fixed; font:17px/1.65 var(--serif); }
body::before,body::after { content:''; position:fixed; top:50vh; width:var(--ornament-size); height:var(--ornament-size); border-radius:50%; background-image:url('./assets/manuscript-illumination.jpg'); background-repeat:no-repeat; pointer-events:none; z-index:0; }
body::before { left:calc(max(var(--manuscript-gutter),(100vw - 1440px)/2)/2); transform:translate(-50%,-50%); background-size:980% auto; background-position:4.7% 49.5%; }
body::after { right:calc(max(var(--manuscript-gutter),(100vw - 1440px)/2)/2); transform:translate(50%,-50%); background-size:852% auto; background-position:86.4% 52%; }
a { color:inherit; text-decoration:none; }
a:hover { color:var(--blue); }
button,input,select { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:default; opacity:.45; }
button,a,input,select,summary { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid #2484a0; outline-offset:4px; }
p,h1,h2,h3 { margin-top:0; }
p { margin-bottom:20px; }
img { max-width:100%; }
[hidden] { display:none!important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip-link { position:fixed; inset-block-start:-100px; inset-inline-start:20px; z-index:10; padding:12px 20px; background:var(--paper); }
.skip-link:focus { inset-block-start:10px; }
.page-sheet { position:relative; z-index:1; max-width:1440px; margin:0 auto; min-height:100vh; background:linear-gradient(90deg,#b98c4720,transparent 6%,transparent 94%,#b98c4720),var(--paper); border:1px solid #e2cc9c; box-shadow:0 4px 18px #23160845,0 24px 90px #23160835; }
.topline { display:flex; align-items:center; justify-content:space-between; gap:24px; min-height:68px; padding:14px 32px; border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:12px; font:700 19px/1.4 var(--serif); letter-spacing:2px; color:var(--blue); }
.brand-rule { width:18px; height:18px; border:1px solid var(--gold); transform:rotate(45deg); box-shadow:inset 0 0 0 4px var(--paper); background:var(--blue); }
.brand-caption { border-inline-start:1px solid var(--line); padding-inline-start:13px; letter-spacing:.5px; font:12px/1.5 var(--sans); color:var(--muted); }
#navigation { display:flex; flex-wrap:wrap; align-items:center; gap:23px; font:13px/1.5 var(--sans); }
#navigation a { padding:8px 0; border-bottom:1px solid transparent; }
#navigation a[aria-current] { color:var(--blue); border-color:var(--gold); }
.nav-count { font-size:11px; color:var(--muted); }
.language-button { color:var(--blue); border:1px solid var(--line); background:transparent; padding:6px 12px; min-height:36px; }
/* Fill the page width without enlarging the template's 1500px banner crop. */
.manuscript-banner { position:relative; display:block; width:100%; max-width:1500px; margin-inline:auto; container-type:inline-size; }
.manuscript-panel { display:block; width:100%; height:auto; aspect-ratio:1500/532; overflow:hidden; }
/* Opaque title panels cover the template's raster lettering with crisp live text. */
.banner-titles { position:absolute; inset:0; color:#17130e; text-align:center; }
.banner-titles h1,.banner-titles p { position:absolute; display:flex; align-items:center; justify-content:center; margin:0; padding:.12em .5em; background:var(--paper); }
.banner-titles h1 { left:16%; top:27%; width:68%; min-height:18%; font:700 clamp(14px,2.5cqw,36px)/1.2 var(--serif); }
.banner-titles p { left:25%; top:49%; width:50%; min-height:15%; font:700 clamp(20px,3.3cqw,48px)/1.25 var(--arabic); }
@container(max-width:600px) {
  .banner-titles h1 { left:2%; top:10%; width:96%; min-height:35%; }
  .banner-titles p { left:3%; width:94%; }
}
main { padding:48px 48px 60px; scroll-margin-top:20px; }
main:focus { outline:none; }
.introduction { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:54px; direction:ltr; }
.introduction article { min-width:0; }
.introduction p { text-align:justify; font-size:18px; line-height:1.8; }
.introduction article[lang=ar] { font-family:var(--arabic); }
.introduction article[lang=ar] p { font-size:25px; line-height:1.65; }
.eyebrow { color:var(--muted); text-transform:uppercase; font:12px/1.5 var(--sans); letter-spacing:1.4px; margin:0 0 15px; }
.introduction article[lang=ar] .eyebrow { font:700 20px/1.5 var(--arabic); letter-spacing:0; }
.introduction .contact-line { font-size:15px; text-align:start; line-height:1.7; }
.contact-line a { text-decoration:underline; text-decoration-color:#b7a78c; text-underline-offset:4px; overflow-wrap:anywhere; }
.introduction article[lang=ar] .contact-line { font-size:21px; }
.contact-line span { display:block; }
.contact-line a[dir=ltr] { display:inline-block; font:14px/1.8 var(--sans); }
.abbreviations { margin:12px 0 48px; padding:17px 0 22px; border-block:1px solid var(--line); direction:ltr; }
.abbreviations h2 { display:flex; gap:15px; align-items:baseline; font:13px/1.5 var(--sans); color:var(--muted); margin:0 0 5px; }
.abbreviations h2 span { font:20px/1.5 var(--arabic); }
.abbreviations p { display:inline-block; margin:0; font:22px/1.7 var(--arabic); }
.search-form { background:#efe4d44d; border:1px solid var(--line); padding:22px; margin-bottom:25px; position:relative; }
.search-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; align-items:end; gap:15px; }
label { display:flex; flex-direction:column; gap:6px; min-width:0; font:12px/1.5 var(--sans); color:var(--muted); }
input,select { min-width:0; width:100%; min-height:42px; border:1px solid #b6a88e; border-radius:2px; padding:9px 10px; color:var(--ink); background:#fffdf7; font:14px/1.4 var(--sans); }
input[dir=auto] { font-family:var(--serif); font-size:17px; }
input:focus,select:focus { outline:2px solid #358097; outline-offset:1px; border-color:var(--blue); }
.button { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:42px; padding:10px 17px; border:1px solid var(--blue); border-radius:2px; font:13px/1.4 var(--sans); text-align:center; }
.primary { background:var(--blue); color:#fffaf0; }
.primary:hover { background:var(--blue-dark); color:white; }
.outline { color:var(--blue); background:transparent; }
.outline:hover { background:#e7e4d7; }
.icon { display:inline-block; width:18px; height:18px; vertical-align:middle; flex-shrink:0; }
.advanced { margin-top:15px; font:12px/1.6 var(--sans); color:var(--blue); }
.advanced summary { cursor:pointer; width:max-content; padding:5px 0; }
.advanced-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding-top:16px; }
.advanced-fields>.year-fields { grid-column:1/-1; max-width:360px; }
.year-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.clear-search { display:block; width:max-content; color:var(--muted); font:12px/1.5 var(--sans); text-decoration:underline; text-underline-offset:3px; margin-top:9px; }
.subject-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:52px; }
.subject-columns ul { list-style:none; margin:0; padding:0; }
.subject-columns ul+ul { border-inline-start:1px solid var(--line); padding-inline-start:28px; }
.subject-link { display:grid; grid-template-columns:40px minmax(0,1.15fr) minmax(0,1fr); align-items:center; gap:15px; min-height:83px; padding:14px 0; border-bottom:1px solid #d8c9ac99; }
.subject-columns li:last-child .subject-link { border:0; }
.subject-link:hover { background:#dfd0ad33; }
.subject-link:hover .subject-en,.subject-link:hover .subject-ar { color:var(--blue); }
.subject-icon { width:40px; height:40px; object-fit:contain; flex-shrink:0; }
.subject-en { font:17px/1.5 var(--serif); overflow-wrap:anywhere; }
.subject-ar { font:24px/1.45 var(--arabic); text-align:right; overflow-wrap:anywhere; }
.browse-footer { border-top:1px solid var(--line); margin-top:35px; padding-top:25px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
footer { margin:0 48px; padding:27px 0; border-top:1px solid var(--gold); font:11px/1.8 var(--sans); color:var(--muted); }
footer>div { display:flex; align-items:center; flex-wrap:wrap; gap:16px; }
footer strong { font:700 18px/1.5 var(--serif); color:var(--blue); letter-spacing:1px; }
footer [lang=ar] { font:19px/1.5 var(--arabic); margin-inline-start:auto; }
footer p { margin:14px 0 0; }
footer a { text-decoration:underline; text-underline-offset:3px; }
.footer-separator { margin:0 10px; }
.back-link { display:inline-block; font:13px/1.5 var(--sans); color:var(--blue); text-decoration:underline; text-underline-offset:4px; margin-bottom:28px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:25px; margin-bottom:28px; }
.page-heading h2 { font:400 36px/1.25 var(--serif); margin:0; overflow-wrap:anywhere; }
.parallel-heading { margin:8px 0 0; font:26px/1.4 var(--arabic); color:var(--muted); }
.export-tools { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.export-tools select { width:100px; }
.results-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:28px 0 12px; padding-bottom:18px; border-bottom:2px solid var(--gold); }
.results-toolbar p { font:13px/1.5 var(--sans); margin:0; color:var(--muted); }
.results-toolbar>div { display:flex; gap:16px; }
.results-toolbar label { flex-direction:row; align-items:center; gap:8px; white-space:nowrap; }
.results-toolbar select { width:auto; min-height:36px; padding-block:6px; }
.reference-list { list-style:none; margin:0; padding:0; }
.reference { direction:rtl; display:grid; grid-template-columns:max-content max-content minmax(0,1fr); align-items:start; gap:0 14px; padding:12px 0; border-bottom:1px solid var(--line); }
.reference-leading,.reference-content { display:contents; }
.reference-leading>.icon-button { grid-column:1; grid-row:2 / span 3; align-self:start; }
/* Share the citation's first text baseline, independently of label height or wrapping. */
.reference-number { grid-column:2; grid-row:2; align-self:first baseline; min-width:2.75ch; color:var(--blue); text-align:center; white-space:nowrap; font:700 14px/1.5 var(--sans); font-variant-numeric:tabular-nums; }
.reference-label { grid-column:3; grid-row:1; font:11px/1.5 var(--sans); letter-spacing:.5px; color:var(--muted); margin-bottom:5px; }
.citation { font:19px/1.9 var(--serif); margin:0 0 12px; overflow-wrap:anywhere; }
.citation[lang=ar] { font:24px/1.7 var(--arabic); }
.reference .citation { grid-column:3; grid-row:2; align-self:first baseline; min-width:0; font-size:16px; line-height:1.55; margin-bottom:6px; }
.reference .citation[lang=ar] { font-size:20px; line-height:1.5; }
.citation-author { font-weight:700; }
.citation-title { color:#113f4b; }
.reference-subjects { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px; color:var(--muted); font:12px/1.7 var(--sans); margin-bottom:14px; }
.reference-subjects a { border-bottom:1px solid #bdaa89; }
.reference .reference-subjects { grid-column:3; grid-row:3; min-width:0; font-size:11px; line-height:1.5; margin-bottom:6px; }
html[lang=ar] .reference .reference-subjects { font-size:17px; }
.reference-actions { grid-column:3; grid-row:4; min-width:0; display:flex; align-items:center; flex-wrap:wrap; gap:14px; font:11px/1.5 var(--sans); color:var(--blue); }
.reference-actions a { text-decoration:underline; text-underline-offset:3px; }
.reference-actions button { display:flex; align-items:center; gap:6px; padding:4px 0; color:var(--blue); background:none; border:0; font:inherit; }
.icon-button { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; flex-shrink:0; border:1px solid var(--line); border-radius:2px; background:transparent; color:var(--blue); }
.icon-button:hover,.icon-button.is-saved { background:#e8dcc4; border-color:var(--gold); }
.is-saved svg { fill:#be9c5790; }
.pagination { display:flex; justify-content:center; align-items:center; gap:24px; margin-top:30px; font:13px/1.5 var(--sans); }
.catalogue-pagination { flex-direction:column; gap:14px; }
.pagination-controls { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:14px; }
.page-numbers { display:flex; flex-wrap:wrap; justify-content:center; gap:6px; }
.page-number { display:inline-flex; align-items:center; justify-content:center; min-width:36px; min-height:36px; padding:6px 10px; border:1px solid var(--line); color:var(--blue); font-variant-numeric:tabular-nums; }
.page-number:hover { background:#e7e4d7; border-color:var(--gold); }
.page-number[aria-current=page] { background:var(--blue); border-color:var(--blue); color:var(--paper); font-weight:700; }
.active-filters { display:flex; flex-wrap:wrap; gap:8px; font:12px/1.5 var(--sans); }
.active-filters span { padding:5px 9px; background:#e8dcc4; border:1px solid var(--line); overflow-wrap:anywhere; }
.muted { color:var(--muted); }
.empty-state { text-align:center; padding:60px 20px; }
.empty-state h3 { font-size:25px; margin:18px 0 8px; }
.empty-state p { color:var(--muted); }
.loading { text-align:center; padding:70px 20px; }
.loading p { display:flex; flex-direction:column; gap:10px; margin-top:20px; }
.author-search { display:flex; gap:12px; max-width:600px; margin:30px 0; }
.author-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:40px; }
.author-link { display:flex; align-items:baseline; gap:18px; justify-content:space-between; padding:15px 0; border-bottom:1px solid var(--line); }
.author-link>span:first-child { font:23px/1.6 var(--arabic); overflow-wrap:anywhere; }
.author-link>span:last-child { font:12px/1.5 var(--sans); color:var(--muted); }
dialog { width:min(760px,calc(100% - 32px)); max-height:85vh; padding:30px; border:1px solid var(--gold); border-top:5px solid var(--blue); background:var(--paper); color:var(--ink); box-shadow:0 20px 80px #0005; }
dialog::backdrop { background:#292116aa; }
.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:15px; }
.dialog-heading .eyebrow { margin:0; }
#record-title { font:700 29px/1.65 var(--arabic); }
.dialog-actions { display:flex; flex-wrap:wrap; gap:10px; margin:25px 0; }
.metadata { border-top:1px solid var(--line); padding-top:18px; }
.metadata>div { display:grid; grid-template-columns:140px minmax(0,1fr); gap:20px; padding:9px 0; }
.metadata dt { font:12px/1.6 var(--sans); color:var(--muted); }
.metadata dd { margin:0; font:20px/1.5 var(--arabic); overflow-wrap:anywhere; }
.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); max-width:calc(100% - 32px); padding:14px 22px; color:var(--paper); background:var(--blue-dark); border:1px solid #d0b06a; box-shadow:0 5px 25px #0003; font:14px/1.5 var(--sans); z-index:20; }
html[lang=ar] #navigation,html[lang=ar] .button,html[lang=ar] label,html[lang=ar] .reference-actions { font-family:Tahoma,Arial,sans-serif; }
html[lang=ar] .page-heading h2 { font:700 36px/1.5 var(--arabic); }
html[lang=ar] .parallel-heading { font:19px/1.5 var(--serif); }
html[lang=ar] .reference-subjects { font:20px/1.5 var(--arabic); }
@media(max-width:1100px) {
  body { --ornament-size:clamp(70px,9vw,100px); --manuscript-gutter:calc(var(--ornament-size) + 18px); padding-block:18px; }
  .topline { flex-wrap:wrap; padding-inline:25px; gap:10px 30px; }
  main { padding:35px 30px 45px; }
  .introduction { gap:35px; }
  .subject-columns { gap:28px; }
  .subject-columns ul+ul { padding-inline-start:20px; }
  .subject-link { grid-template-columns:34px minmax(0,1fr); column-gap:12px; row-gap:2px; }
  .subject-icon { width:34px; height:34px; grid-row:span 2; }
  .subject-en,.subject-ar { grid-column:2; }
  .subject-ar { font-size:23px; }
  footer { margin-inline:30px; }
}
@media(max-width:760px) {
  body { padding:10px; }
  body::before,body::after { display:none; }
  .topline { justify-content:center; padding:16px; gap:12px; }
  #navigation { justify-content:center; gap:16px; width:100%; font-size:12px; }
  main { padding:30px 24px 40px; }
  .introduction { grid-template-columns:1fr; gap:20px; }
  .introduction p { font-size:17px; }
  .introduction article[lang=ar] p { font-size:24px; }
  .abbreviations { margin-bottom:35px; }
  .subject-columns { gap:25px; }
  .subject-en { font-size:16px; }
  .subject-ar { font-size:22px; }
  .subject-link { min-height:110px; }
  .browse-footer,.page-heading,.results-toolbar { flex-wrap:wrap; }
  .page-heading h2 { font-size:29px; }
  .search-fields { grid-template-columns:1fr 1fr; }
  .search-fields>.button { justify-self:start; }
  .advanced-fields { grid-template-columns:1fr 1fr; }
  .advanced-fields>label:first-child { grid-column:1/-1; }
  .results-toolbar>div { flex-wrap:wrap; }
  .author-grid { grid-template-columns:1fr; }
  footer { margin-inline:24px; }
  footer [lang=ar] { margin-inline-start:0; }
}
@media(max-width:480px) {
  body { padding:0; }
  .page-sheet { border-inline:0; }
  main { padding:25px 18px 35px; }
  .brand-caption { font-size:11px; }
  #navigation { gap:10px 15px; }
  .subject-columns { grid-template-columns:1fr; gap:0; }
  .subject-columns ul+ul { border:0; padding:0; }
  .subject-columns ul:first-child li:last-child .subject-link { border-bottom:1px solid #d8c9ac99; }
  .subject-link { grid-template-columns:36px minmax(0,1fr) minmax(0,1fr); gap:10px; min-height:90px; }
  .subject-icon { grid-row:auto; width:36px; height:36px; }
  .subject-en { grid-column:2; }
  .subject-ar { grid-column:3; }
  .search-form { padding:17px; }
  .search-fields,.advanced-fields { grid-template-columns:1fr; }
  .export-tools { width:100%; flex-wrap:wrap; }
  .reference { column-gap:10px; }
  .citation[lang=ar] { font-size:23px; }
  .results-toolbar label { flex-wrap:wrap; }
  .pagination { gap:14px; }
  .pagination .button { padding-inline:12px; }
  dialog { padding:20px; }
  .metadata>div { grid-template-columns:1fr; gap:5px; }
  footer { margin-inline:18px; }
  .footer-separator { display:block; visibility:hidden; height:6px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }
@media print {
  body { padding:0; background:white; }
  body::before,body::after { display:none; }
  .page-sheet { max-width:none; border:0; background:white; box-shadow:none; }
  .topline,.manuscript-banner,.search-form,.back-link,.export-tools,.reference-actions,.icon-button,.pagination,.results-toolbar>div,.browse-footer,footer,.toast { display:none!important; }
  main { padding:0; }
  .reference { break-inside:avoid; }
  .subject-columns { grid-template-columns:1fr 1fr; }
  .subject-link { break-inside:avoid; }
}
