/* Material and depth layer. Structural rules live in base.css. */
:root {
  color-scheme: dark;
  --paper-texture: url('/api/museum/static/decor-archival-paper.e8c212df71db60cf.webp');
  --cloth-texture: url('/api/museum/static/decor-oxblood-bookcloth.4181d575687a9c2a.webp');
}
html { min-width: 320px; scroll-behavior: smooth; }
/* Native controls stay paper-coloured even when the document advertises a handled dark appearance. */
body {
  color-scheme: only light;
  margin: 0;
  min-height: 100vh;
  padding: 28px 24px 65px;
  color: #30291f;
  background-color: #c9bea9;
  background-image:
    radial-gradient(ellipse at 50% 5%, #f9f6e779, #82705824 85%),
    linear-gradient(#cec6b0af, #cec6b0af),
    var(--paper-texture);
  background-size: auto, auto, 600px 600px;
  background-blend-mode: normal, multiply, normal;
  font-family: Georgia, 'Times New Roman', serif;
}
button, select, a { cursor: pointer; }
a { color: #6d3339; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid #702d39;
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  transform: translateY(-180%);
  padding: 12px 18px;
  z-index: 10;
  background: #fff4dc;
}
.skip-link:focus { transform: translateY(0); }
#museum-app .museum-stage { width: 100%; max-width: 1100px; padding: 5px 9px 22px; }
#museum-app .bound-volume {
  padding: 22px 17px 32px 49px;
  border: 1px solid #37171c;
  border-radius: 5px 11px 10px 5px;
  background-color: #622c34;
  background-image:
    linear-gradient(var(--book-angle, 90deg), #17070c62 0, transparent 12px, #fff5d41a 17px, #00000039 30px, transparent 45px),
    linear-gradient(180deg, #ffebc614, transparent 45%, #25091050),
    var(--cloth-texture);
  background-size: 100% 100%, 100% 100%, 340px 340px;
  box-shadow:
    0 2px 0 #9e6f5f,
    0 6px 0 #35171c,
    0 8px 1px #d5bda129,
    calc(4px * var(--book-reflection, 1)) 13px 14px #4d3e3255,
    calc(9px * var(--book-reflection, 1)) 27px 38px #4d3e3250,
    inset 1px 2px 2px #dfad9f55,
    inset -3px -5px 5px #1b090c8c;
}
#museum-app .bound-volume::before {
  inset-inline-start: 29px;
  width: 11px;
  border-inline-start: 1px solid #e1a08c24;
  border-inline-end: 1px solid #1f0b166e;
  background: linear-gradient(var(--book-angle, 90deg), #e9bcab0f, #18050f9e 50%, #fff1bc20);
  box-shadow: -3px 0 5px #19070d24, 3px 0 3px #180b1038;
}
#museum-app .volume-interior { grid-template-columns: minmax(0, 1fr) 150px; }
#museum-app .paper-stack { margin-bottom: 4px; }
#museum-app .paper-stack::before {
  inset-block: 4px -7px;
  inset-inline: 3px -5px;
  border: 1px solid #bda57f;
  background-image:
    linear-gradient(var(--book-angle, 90deg), #8a6e393c, transparent 15%, #dfcbaa59),
    var(--paper-texture);
  background-size: 100% 100%, 410px 410px;
  box-shadow: calc(1px * var(--book-reflection, 1)) 2px 2px #17090e60;
  transform: rotate(calc(.12deg * var(--book-reflection, 1)));
}
#museum-app .paper-stack::after {
  inset-block: 9px -15px;
  inset-inline: 7px -10px;
  border: 1px solid #b29a70;
  background-color: #d6c3a2;
  background-image:
    repeating-linear-gradient(0deg, #f3e4c650 0 1px, #7c623830 1px 2px, transparent 2px 3px),
    var(--paper-texture);
  background-size: 100% 100%, 410px 410px;
  box-shadow: calc(2px * var(--book-reflection, 1)) 5px 5px #16091269;
  transform: rotate(calc(.22deg * var(--book-reflection, 1)));
}
#museum-app .catalogue-leaf {
  padding: 21px 31px 24px 42px;
  border-color: #bfa785;
  background-color: #f0e5cf;
  background-image:
    linear-gradient(90deg, #5b432953 0, #7d614125 9px, #fff8e157 24px, transparent 49px),
    linear-gradient(180deg, #fffbea49 0, #fff5dd30 65%, #b08a4313),
    var(--paper-texture);
  background-size: 100% 100%, 100% 100%, 550px 550px;
  box-shadow:
    calc(-5px * var(--book-reflection, 1)) 0 8px #21110849,
    calc(2px * var(--book-reflection, 1)) 3px 6px #28170c45,
    inset 1px 0 2px #fff7dcca,
    inset -2px 0 4px #a7834c2b;
}
#museum-app .catalogue-leaf::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 14px;
  width: 5px;
  border-inline-start: 1px solid #90724329;
  background: linear-gradient(var(--book-angle, 90deg), #58432322, #fff5d924);
  pointer-events: none;
}
#museum-app .collection-link { font-size: 12px; color: #5e4a35; text-decoration: none; }
#museum-app .collection-link:hover { text-decoration: underline; }
#museum-app .masthead-top { border-bottom-color: #9f835865; padding-bottom: 5px; }
#museum-app .masthead { padding-block: 22px 23px; border-bottom-color: #aa8f678f; }
#museum-app .museum-imprint { color: #794447; }
#museum-app h1 { font-size: 39px; text-shadow: 0 1px 0 #fffae999; }
#museum-app .arabic-title { font-size: 27px; text-shadow: 0 1px 0 #fffae98f; }
#museum-app .museum-intro { margin-top: 12px; }
#museum-app .sector-index { inset-inline-end: -151px; width: 150px; top: 151px; gap: 10px; }
#museum-app .sector-tab {
  min-height: 50px;
  padding: 11px 13px;
  border-color: #ad9168;
  border-radius: 0 5px 5px 0;
  color: #533a2b;
  background-color: #d8c2a0;
  background-image:
    linear-gradient(var(--book-angle, 90deg), #6c4a2896 0, #8a6b4433 8px, transparent 20px),
    linear-gradient(#e9d7b02e, #c79c6640),
    var(--paper-texture);
  background-size: 100% 100%, 100% 100%, 300px 300px;
  background-blend-mode: normal, multiply, multiply;
  box-shadow: 0 1px 0 #fff0c58c inset, calc(1px * var(--book-reflection, 1)) 4px 0 #4a2a2466, calc(3px * var(--book-reflection, 1)) 6px 6px #24081362;
  text-shadow: 0 1px 0 #ffeccc80;
  transition: translate 120ms ease, box-shadow 120ms ease;
}
#museum-app .sector-tab:hover { translate: 2px 0; }
#museum-app .sector-tab[aria-pressed='true'] {
  color: #642b32;
  background-color: #f3e4cc;
  background-image: linear-gradient(var(--book-angle, 90deg), #fff7df88, transparent 40%), var(--paper-texture);
  background-size: 100% 100%, 550px 550px;
  background-blend-mode: normal, normal;
  box-shadow: 0 1px 0 #fff6d49f inset, calc(1px * var(--book-reflection, 1)) 2px 0 #b7a17b, calc(3px * var(--book-reflection, 1)) 5px 6px #230a1559;
}
#museum-app .catalogue-controls { margin-top: 22px; gap: 17px; }
#museum-app input, #museum-app select {
  height: 41px;
  border-color: #ab916c;
  background-color: #f5ecd9;
  background-image: linear-gradient(#fffcf28f, #fffcf28f), var(--paper-texture);
  background-size: 100% 100%, 400px 400px;
  box-shadow: inset 1px 2px 4px #60472e32, 0 1px 0 #fff6d0cc;
}
#museum-app .search-button, #museum-app .secondary-button {
  border-color: #9e7e53;
  background-color: #d7bd93;
  background-image: linear-gradient(#f6e8c668, #9a6e3124), var(--paper-texture);
  background-size: 100% 100%, 350px 350px;
  background-blend-mode: normal, multiply;
  box-shadow: inset 1px 1px 0 #fff4d4b3, inset -1px -1px 0 #8d6e3959, 0 2px 2px #66503726;
}
#museum-app .search-button:active, #museum-app .secondary-button:active {
  box-shadow: inset 1px 2px 3px #6d4c294f;
}
#museum-app .collection-heading { margin-top: 22px; border-bottom-color: #a1896470; }
#museum-app .specimen-grid { column-gap: 22px; row-gap: 25px; }
#museum-app .specimen-link { display: block; text-decoration: none; color: inherit; }
#museum-app .specimen-mount {
  padding: 22px;
  border: 1px solid #d4bd98;
  border-radius: 1px;
  background-color: #f7efdf;
  background-image: linear-gradient(#fffcf392, #fffcf392), var(--paper-texture);
  background-size: 100% 100%, 340px 340px;
  box-shadow:
    inset 1px 1px 0 #fff8e8,
    inset -1px -1px 1px #bda88747,
    0 2px 0 #c5b399,
    2px 5px 7px #6e513a35;
  transition: box-shadow 120ms ease;
}
#museum-app .specimen-link:hover .specimen-mount { box-shadow: inset 1px 1px 0 #fff8e8, 0 2px 0 #c5b399, 3px 6px 10px #60402950; }
#museum-app .specimen-mount::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid #b6a07f3d;
  background-color: #fffbf1;
  background-image: linear-gradient(#fffcf3c2, #fffcf3c2), var(--paper-texture);
  background-size: 100% 100%, 410px 410px;
  box-shadow: 0 1px 3px #5a3e2521;
}
#museum-app .specimen-mount::after {
  inset: 5px;
  background:
    linear-gradient(135deg, #b0956e 0 7px, #ecd8b5 7px 16px, #af967540 16px 18px, transparent 18px) top left,
    linear-gradient(225deg, #b0956e 0 7px, #ecd8b5 7px 16px, #af967540 16px 18px, transparent 18px) top right,
    linear-gradient(45deg, #b0956e 0 7px, #ecd8b5 7px 16px, #af967540 16px 18px, transparent 18px) bottom left,
    linear-gradient(315deg, #b0956e 0 7px, #ecd8b5 7px 16px, #af967540 16px 18px, transparent 18px) bottom right;
  background-repeat: no-repeat;
  background-size: 22px 22px;
  filter: drop-shadow(0 1px 1px #71533035);
}
#museum-app .sample-mark, #museum-app .specimen-mount img { position: relative; z-index: 1; }
#museum-app figcaption { margin-top: 10px; padding-inline: 1px; }
#museum-app .specimen-name { font-size: 14px; }
#museum-app .specimen-date { font-size: 12px; }
#museum-app .catalogue-footer { margin-top: 28px; border-top-color: #a58a6180; font-size: 12px; }
#museum-app .empty-state { min-height: 120px; }
#museum-app .record-view { padding-top: 18px; }
#museum-app .record-return { display: inline-block; padding-block: 10px; margin-bottom: 14px; font-size: 14px; text-underline-offset: 3px; }
#museum-app .record-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; }
#museum-app .record-title { font-size: 26px; margin: 4px 0; }
#museum-app .record-arabic { font: 24px/1.5 'Times New Roman', serif; margin: 5px 0 20px; }
#museum-app .record-meta { margin: 0; }
#museum-app .record-meta > div { padding: 12px 0; border-top: 1px solid #a890695c; }
#museum-app .record-meta dt { font-size: 12px; color: #6a5440; margin-bottom: 4px; }
#museum-app .record-meta dd { margin: 0; font-size: 15px; }
#museum-app .record-note { font: italic 13px/1.65 Georgia, serif; color: #6c5540; padding-top: 12px; }
#museum-app .record-view .sample-mark .mark-word { font-size: 62px; }
#museum-app .record-view .sample-mark .mark-note { font-size: 13px; }
#museum-app .record-view .seal .mark-word { width: 126px; height: 126px; }
#museum-app .record-view .diamond .mark-word { width: 98px; height: 98px; }
#museum-app .record-view .striped::before { width: 105px; height: 76px; background-size: auto; }
#museum-app [dir='rtl'] .bound-volume { padding: 22px 49px 32px 17px; }
#museum-app [dir='rtl'] .catalogue-leaf { padding: 21px 42px 24px 31px; }
#museum-app [dir='rtl'] .sector-tab { border-radius: 5px 0 0 5px; }
#museum-app [dir='rtl'] .sector-tab:hover { translate: -2px 0; }
@media (max-width: 850px) {
  #museum-app .volume-interior { grid-template-columns: minmax(0, 1fr) 132px; }
  #museum-app .sector-index { width: 132px; inset-inline-end: -133px; }
  #museum-app .bound-volume, #museum-app [dir='rtl'] .bound-volume { padding-inline: 38px 15px; }
  #museum-app .bound-volume::before { inset-inline-start: 20px; }
  #museum-app .catalogue-leaf, #museum-app [dir='rtl'] .catalogue-leaf { padding-inline: 30px 22px; }
  #museum-app h1 { font-size: 33px; }
  #museum-app .specimen-grid { gap: 24px 18px; }
}
@media (max-width: 650px) {
  #museum-app .bound-volume, #museum-app [dir='rtl'] .bound-volume { padding: 14px 16px 27px 26px; }
  #museum-app .bound-volume::before { inset-inline-start: 13px; width: 7px; }
  #museum-app .sector-index { position: static; width: 100%; gap: 5px; margin-top: 20px; }
  #museum-app .sector-tab, #museum-app [dir='rtl'] .sector-tab { min-height: 46px; padding: 9px 10px; border-radius: 4px 4px 0 0; }
  #museum-app .sector-tab { background-image: linear-gradient(180deg, #fff0cf30, #8a663922), var(--paper-texture); background-size: 100% 100%, 300px 300px; box-shadow: inset 0 1px 0 #fff2d188, 0 2px 0 #a1855b66, 0 3px 3px #68472b28; }
  #museum-app .sector-tab:hover, #museum-app [dir='rtl'] .sector-tab:hover { translate: 0 -1px; }
  #museum-app .sector-tab[aria-pressed='true'] { box-shadow: inset 0 1px 0 #fffae6, 0 2px 0 #9e82526e, 0 3px 3px #654d2f35; }
  #museum-app .catalogue-leaf, #museum-app [dir='rtl'] .catalogue-leaf { padding: 14px 20px 20px 24px; }
  #museum-app .catalogue-leaf::before { inset-inline-start: 8px; }
  #museum-app .catalogue-controls { margin-top: 20px; }
  #museum-app input, #museum-app select, #museum-app .search-button { min-height: 44px; font-size: 16px; }
  #museum-app .record-layout { gap: 22px; }
  #museum-app .record-view .sample-mark .mark-word { font-size: 40px; }
  #museum-app .record-view .seal .mark-word { width: 92px; height: 92px; }
}
@media (max-width: 460px) {
  #museum-app .bound-volume, #museum-app [dir='rtl'] .bound-volume { padding: 11px 13px 25px 20px; }
  #museum-app .bound-volume::before { inset-inline-start: 8px; }
  #museum-app .catalogue-leaf, #museum-app [dir='rtl'] .catalogue-leaf { padding: 11px 13px 18px 18px; }
  #museum-app .masthead { padding-block: 19px 20px; }
  #museum-app .collection-link { font-size: 11px; }
  #museum-app .masthead-top { align-items: center; }
  #museum-app h1 { font-size: 30px; }
  #museum-app .arabic-title { font-size: 23px; }
  #museum-app .museum-intro { font-size: 13px; }
  #museum-app .sector-tab { flex-basis: 43%; padding-inline: 8px; font-size: 12px; }
  #museum-app .specimen-grid { gap: 22px 13px; }
  #museum-app .specimen-mount { padding: 17px; }
  #museum-app .specimen-mount::before { inset: 9px; }
  #museum-app .specimen-mount::after { inset: 3px; background-size: 20px 20px; }
  #museum-app .specimen-name { font-size: 13px; }
  #museum-app .specimen-date { font-size: 11px; }
  #museum-app .record-layout { grid-template-columns: minmax(0, 1fr); }
  #museum-app .record-mount { max-width: 260px; margin-inline: auto; width: 100%; }
  #museum-app .catalogue-footer { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #museum-app .sector-tab, #museum-app .specimen-mount { transition: none; }
}
