@font-face {
  font-family: Amiri;
  font-style: normal;
  font-weight: 400;
  src:url("/fonts/Amiri-Regular.woff2") format("woff2");
  
}

@font-face {
  font-family: Amiri;
  font-style: normal;
  font-weight: 700;
  src:url("/fonts/Amiri-Bold.woff2") format("woff2");
}

@font-face {
  font-family: Amiri;
  font-style: italic;
  font-weight: 400;
  src:url("/fonts/Amiri-Italic.woff2") format("woff2");
}

@font-face {
  font-family: Amiri;
  font-style: italic;
  font-weight: 700;
  src:url("/fonts/Amiri-BoldItalic.woff2") format("woff2");
}

@font-face {
  font-family: Amiri;
  font-style: normal;
  font-weight: 400;
  src:url("/fonts/Amiri-Quran.woff2") format("woff2");
  unicode-range: U+FB50-FDFF, U+FE70-FEFF;
  }
  

@font-face {
	font-family: Libertinus;
	font-style: normal;
	font-weight: normal;
	src: url("/fonts/LibertinusSerif-Regular.woff2") format("woff2");
}

@font-face {
	font-family: Libertinus;
	font-style: italic;
	src: url("/fonts/LibertinusSerif-Italic.woff2") format("woff2");
}

@font-face {
	font-family: Libertinus;
	font-weight: bold;
	src: url("/fonts/LibertinusSerif-Bold.woff2") format("woff2");
}

@font-face {
	font-family: Libertinus;
	font-weight: bold;
	font-style: italic;
	src: url("/fonts/LibertinusSerif-BoldItalic.woff2") format("woff2");
}


:lang(ar), [lang="ar"], [lang="ara"], [dir="rtl"] {
    font-family: Amiri, Libertinus, "Scheherazade New", "Noto Naskh Arabic", serif;
    direction: rtl;
    font-style: normal !important;
    line-height: 1.9;
}



html {
  font-variant-numeric: proportional-nums;
  font-feature-settings: "pnum" 1; /* fallback */
}

body {
	font-family: Libertinus, serif;
	font-size: 19px !important; /* or your preferred static base */
}

h6 {
	font-size: 1em;
	font-weight: bold;
}

.prev_next .arrowright {
  order: 3;  }

/* ——— “Text” section (PAL-style paragraphs) ——— */
#text { margin: 2rem 0; }                    /* (de-duplicate; keep one) */
#text h2, #text > p > b { margin: 0 0 .75rem; }
.text-para { margin: 0 0 1rem; line-height: 1.9; }
.text-para bdo { unicode-bidi: isolate; }    /* keep LTR label tidy in RTL */

/* Small caps for [Label] */
.sc, small-caps { font-variant-caps: small-caps; letter-spacing: .02em; }

.title-xlc, .tei-foreign {
  font-style: italic !important;
  font-family: inherit;
}

.qref, .pagina, .supplied {
  color: var(--editorcolor);
  display: inline; 
  white-space: normal;
  font-size: 0.75em;

font-family:
    Amiri,
        system-ui,
            "Geeza Pro",

    "Scheherazade New",
    "Arial Unicode MS",
    "Noto Naskh Arabic",
    sans-serif;
}

.pagina.current {
  color: grey;   /* shrink */
  
}

/* Minimal, encyclopedia-style block quote */
blockquote {
  margin: 0.75rem 0;
  padding-left: 1rem; /* visual indent */
  font-size: 0.9em;
}



a.comment-link {
  color: black !important;
  }

#filter_card > table > tbody > tr[data-column_rank="_"] > th:first-child {
	letter-spacing: normal;
}

#filter_card > table > tbody > tr > th > small {
	display: none;
	position: absolute;
	text-align: start;
	top: 90%;
	white-space: pre-wrap;
	width: 10em;
	z-index: 2;
}
#filter_card > table > tbody > tr > th:hover > small,
#filter_card > table > tbody > tr > th:focus > small {
	display: initial;
	background: #ecf3fe;
}

#filter_card > table > tbody > tr > th > small.card {
	background-color: #ffffff; /* ensure white */
	box-shadow: 0 0 3px 0 #b0c0e0;
	z-index: 3;
	width: 16em;           /* wider than the default */
	white-space: pre-wrap; /* allows wrapping inside the box */
}


h1.has-card,
h2.has-card,
sup.has-card {
  position: relative;
  text-decoration: underline dotted #cc0000;
}

h1 > .card.hover,
h2 > .card.hover,
sup > .card.hover {
  display: none;
  position: absolute;
  background-color: #fff;
  box-shadow: 0 0 3px 0 #b0c0e0;
  padding: 0.5em 0.7em;
  border-radius: 4px;
  z-index: 10;  
}

h1 > .card.hover,
h2 > .card.hover {
  top: 1.4em;
  left: 0;  
  width: 22em;
}


h1:hover > .card.hover,
h1:focus > .card.hover,
h2:hover > .card.hover,
h2:focus > .card.hover
 {
  display: block;
}


/* Locus: fixed width, no wrapping */
table.parts th.locus,
table.witnesses th.date{
  width: 6em;
  white-space: nowrap;
}

/* Title: flexible width, allow wrapping */
table.parts td.title,
table.witnesses td.title,
table.witnesses td.ms{
  width: auto;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

table.witnesses {
  border-collapse: separate;
  border-spacing: 0 0.6em;   /* vertical gap only */
}


table.parts {
  border-collapse: separate;
  border-spacing: 0 0.4em;   /* vertical gap only */
}



/* Copy: fixed width, no wrapping 
table.parts td.copy {
  width: 4em;
  white-space: nowrap;
} */


cite {
	font-style: italic;
}
:is(cite, i) > :is(cite, i),
cite.parttitle {
	font-style: normal;
}

/* Make inputs in admin forms full width of their table cell */
.form_admin table input[type="text"],
.form_admin table input[type="password"] {
  width: 95%;        /* nearly full width, with some padding */
  box-sizing: border-box;
  text-align: left;  /* align text to the left */
}

nav.extra ul {
  list-style: none;   /* removes bullet points */
  padding: 0;
  margin: 0;
}

nav.extra li {
  display: inline;    /* force inline rather than block */
}

nav.extra li + li::before {
  content: " · ";     /* nbsp + interpunct + space */
}

.divider {
  border-top: 1px solid var(--fadecolor);
  margin: 2em 0;   /* space above & below */
}

.toc_entry_main {
	font-size: 1.0em;
	font-weight: bold;
}
.toc_entry_minor {
	padding-left: 4%;
}
.toc_entry_minor[dir="rtl"] {
	padding-right: 4%;
}

.transcription {
  background-color: #fdfaf3;   /* light parchment tone */
  border: 1px solid #e0d8c7;  /* soft frame */
  border-radius: 3px;          /* slightly softened corners */
}

.transcription > details > nav {
	display: table;
	font-size: 0.9em;
}
.transcription > div:first-of-type {
	border-bottom: 1.2px solid #b0c0e0;
	border-top: 1.2px solid #b0c0e0;
	margin-bottom: 1em;
	padding: 0.4em 0 0.4em 0;
}
.transcription > header {
	margin: 0 0 2em 0;
}

.transcription > section .note > a::before,
.transcription > section .note > small::before,
.transcription > section :empty,
.transcription > section [data-by="hg"] {
	color: var(--editorcolor);
	
}
.transcription details {
	margin: 0.4em 0;
}
.transcription details > .citebox {
	margin-top: 0.35em;
}

.ed-punct { color: var(--editorcolor); }

.centerblock { text-align:center; display:block;
font-size:1.2em;
margin-top: 0.5em;
margin-bottom: 0.5em;
}

.transcription > section .r-title,
.transcription > section .r-2title { text-align:center; display:block;
font-weight: bold;
margin-left: 2em;
margin-right: 2em;
margin-top: 0.5em;
margin-bottom: 0.5em;
}

.transcription > section .r-title { text-align:center; display:block;
font-size: 2em;
}

.transcription > section .r-2title { text-align:center; display:block;
font-size: 1.5em;
}

.transcription > section .r-subtitle
{ text-align:center;
display:block;
font-size: 1.2em;
margin-left: 2em;
margin-right: 2em;
margin-top: 0.5em;
margin-bottom: 0.5em;
}

.editorial { color: var(--editorcolor);}
.overline {text-decoration: overline;}

.verse {
  display: block;
  text-align: right;   /* keeps Arabic flow natural */
  width: 80%;          /* adjust until it looks nicely centred */
  margin: 0 auto;      /* centres the block itself */
}
  
.lb-marker{
  color: var(--editorcolor);
  opacity: 0.9;
  margin: 0 0.25ch;           /* tiny breathing room */
  white-space: nowrap;        /* never wraps on the bar */
}

/* Browsers treat “float: left” as ‘float: right’ with “position: absolute” in RTL text. Thus: */
a[title="Link"]:empty:dir(rtl)::before {
	position: relative;
}

/* Make the marker box small & tidy; no underline on hover */
.note > a {
  display: inline-flex;
  padding: 0em 0em;
  border: none;
  vertical-align: 0.55em;
}


/* Popup box: keep it neat & small (you already have most of this) */
.note > small {
  background: #fdfaf3; 
  font-size: 0.75rem;
  clear: right;
  break-inside: avoid;
  /* ⟵ key change: avoid overlap with earlier margin floats */
}


/* Have marker & popup glow together (you already have this pattern) */
.note:hover > a {
  box-shadow: 0px 3px 8px 3px #66afff;  /* long-ish blur, reduced thickness */
  z-index: 2;
}.note:hover > small { box-shadow: 0 0 6px 2px #66afff; z-index: 2; }

/* Kill global link underlines for this marker only */
.note > a:hover,
.note > a:focus { border-bottom: none !important; }



/* === Tighten inline spacing in RTL transcription text ===
. */
.transcription p[dir="rtl"] .note {
  margin-right: 0ch;
}

/* 2) Give poems a little breathing room, left & right */
.transcription lg {
  display: block;
  margin-block: 0.75em;             /* space above/below the whole poem */
  margin-inline: 1.25em;            /* “inset” the poem from page edges */
}

.citebox_add_credit {
	color: var(--fadecolor);
	font-size: 0.9em;
	margin-top: 0.2em;
	padding: 0.4em 15px;
}

/* === Shared Break + Wrap Settings === */
.index table td, .index table th {
  white-space: normal;
  overflow-wrap: break-word;  /* not "anywhere" — better aesthetics */
  word-break: normal;
}


/* === Italicise Titles === */
.works-table td:nth-child(4),
.msTexts-table td:nth-child(1),
.oyWorks-table td:nth-child(2) {
  font-style: italic;
}

/* === Right-align Arabic titles === */
.works-table td:nth-child(5) {
  direction: rtl;
  text-align: right;
}

/* === Column widths === */
/* Works Table */
.works-table td:nth-child(1),
.works-table th:nth-child(1),
.works-table td:nth-child(2),
.works-table th:nth-child(2),
.works-table td:nth-child(3),
.works-table th:nth-child(3) {
  width: 6%;
}
.works-table td:nth-child(4),
.works-table th:nth-child(4) {
  width: 24%;
}
.works-table td:nth-child(5),
.works-table th:nth-child(5) {
  width: 18%;
}
.works-table td:nth-child(6),
.works-table th:nth-child(6),
.works-table td:nth-child(7),
.works-table th:nth-child(7) {
  width: 10%;
}


/* MS Texts Table */
.msTexts-table td:nth-child(1),
.msTexts-table th:nth-child(1) {
  width: 24%;
}
.msTexts-table td:nth-child(2),
.msTexts-table th:nth-child(2) {
  width: 26%;
}
.msTexts-table td:nth-child(3),
.msTexts-table th:nth-child(3) {
  width: 8%;
}
.msTexts-table td:nth-child(4),
.msTexts-table th:nth-child(4) {
  width: 6%;
}
.msTexts-table td:nth-child(5),
.msTexts-table th:nth-child(5) {
  width: 16%;
}
.msTexts-table td:nth-child(6),
.msTexts-table th:nth-child(6) {
  width: 10%;
}

/* OyWorks Table (Osman Yahia RG) - New Layout */

/* Very Narrow Columns: fihrist, ijaza, mss_no */
.oyWorks-table td:nth-child(3),
.oyWorks-table th:nth-child(3),
.oyWorks-table td:nth-child(4),
.oyWorks-table th:nth-child(4),
.oyWorks-table td:nth-child(5),
.oyWorks-table th:nth-child(5) {
    width: 3%;
    word-wrap: break-word;
    overflow-wrap: anywhere;

}

/* Narrow Columns: rg_decimal, mias_class, mias_altrg */
.oyWorks-table td:nth-child(1),
.oyWorks-table th:nth-child(1),
.oyWorks-table td:nth-child(6),
.oyWorks-table th:nth-child(6),
.oyWorks-table td:nth-child(7),
.oyWorks-table th:nth-child(7) {
    width: 6%;
    word-wrap: break-word;
    overflow-wrap: anywhere;

}

/* Medium Columns: virtual_title, item_notes, further_notes */
.oyWorks-table td:nth-child(2),
.oyWorks-table th:nth-child(2),
.oyWorks-table td:nth-child(8),
.oyWorks-table th:nth-child(8)
 {
    width: 12%;
    word-wrap: break-word;
    overflow-wrap: anywhere;

    
}

/* Wide Columns: mias_comments, mias_description */
.oyWorks-table td:nth-child(10),
.oyWorks-table th:nth-child(10),
.oyWorks-table td:nth-child(9),
.oyWorks-table th:nth-child(9) {
    width: 18%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.oyWorks-table td:nth-child(11),
.oyWorks-table th:nth-child(11) {
    width: 19%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Pubs Table 
.pubs-table td:nth-child(1),
.pubs-table th:nth-child(1),
.pubs-table td:nth-child(2),
.pubs-table th:nth-child(2),
.pubs-table td:nth-child(3),
.pubs-table th:nth-child(3) {
  width: 6%;
} */
.pub-table td:nth-child(1),
.pub-table th:nth-child(1) {
  width: 50%;
}

/* Standardise filter menu column widths across all pages */
#filter_card > table td:nth-child(1),
#filter_card > table th:nth-child(1) {
  width: 8em; /* First column — adjust as needed */
}

#filter_card > table td:nth-child(2),
#filter_card > table th:nth-child(2) {
  width: 12em; /* Second column — adjust as needed */
}

#filter_card > table td:nth-child(6),
#filter_card > table th:nth-child(6) {
  width: 12em; /* Sixth column — dropdowns or similar */
}


/*  WORK PAGES */
.summary {
  margin-top: 0.4em; 
}


/* Layout for the action row (Contents + Cite) */
#page-toc .toc-actions {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
}

/* Reset counters */
#page-toc-list {
  margin: .5rem 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: item;
}

/* Top-level list items */
#page-toc-list > li {
  margin: .25rem 0;
  counter-increment: item;
}

/* Number before each top-level link */
#page-toc-list > li > a::before {
  content: counter(item) ". ";
}

/* Nested lists */
#page-toc-list ul {
  margin: .25rem 0 .25rem 1.5rem;
  padding-left: 0;
  list-style: none;
  counter-reset: subitem;
}

/* Second-level items */
#page-toc-list ul > li {
  counter-increment: subitem;
}

/* Number format for second-level: 1.1, 1.2, etc. */
#page-toc-list ul > li > a::before {
  content: counter(item) "." counter(subitem) " ";
  font-weight: normal;
}

/* Links inside ToC */
#page-toc-list a {
  text-decoration: none;
}

#back-to-top {
  position: fixed;
  bottom: 1.4em;   /* distance from bottom */
  right: 1.5em;    /* distance from right */
}

.citebox, .ms-gallery, .toc-list {
    border-top: none;
    border-bottom: none;
    color: var(--fadecolor);
    font-size: 0.9em;
    margin-top: 1em;
    padding: 0em 0em;
    text-align: start;
}

.ms-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.wpimg {
  display: flex;
  flex-direction: column; 
  text-align: center;
  min-width: 0;
}

.wpimg img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #c8ccd1;
  padding: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  border-radius: 2px;
}
/* 
.wpimg figcaption {
  margin-top: auto;              
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--fadecolor);
  font-size: 0.9em;
  margin-top: 0.4rem;
} */

.wpimg figcaption {
  margin-top: auto;          /* sticks to bottom */
  display: block;            /* ensure it’s a block */
  align-self: stretch;       /* occupy full card width */
  float: none;               /* just in case something global sets floats */
  white-space: normal;       /* prevent no-wrap inheritance */
  word-break: break-word;    /* long strings wrap instead of pushing layout */
}

/* Overlay */
#lb-overlay[hidden] { display: none !important; }
#lb-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: grid;
  /* three layers: edge controls, centered dialog, edge controls on top */
  grid-template-areas: "stack";
  background: rgba(0,0,0,.78);
}

/* Centered dialog box */
#lb-dialog {
  grid-area: stack;
  margin: auto;                            /* centers in viewport */
  max-width: 92vw; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: #111; color: #eee; border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}

/* Image area */
#lb-media { display: flex; align-items: center; justify-content: center; padding: .5rem; }
#lb-media img {
  display: block;
  max-width: 90vw;
  /* Leave room for caption so it doesn't get pushed out */
  max-height: calc(92vh - 90px); /* adjust caption allowance if needed */
  height: auto; width: auto;
  background: #fff; border: 1px solid #c8ccd1; padding: 2px; border-radius: 2px;
}

/* Caption (always visible) */
#lb-caption {
  padding: 0 0.9rem 0.9rem 0.9rem;
  font-size: .95rem; line-height: 1.35;
  color: #f2f2f2;
  text-align: center;
}

/* Light buttons (independent of your .key styles) */
.lb-btn {
  background: #fff;
  color: #111;
  border: 1px solid #cfd6df;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  border-radius: 999px;
  padding: .4rem .65rem;
  font: inherit;
  cursor: pointer;
  opacity: .95;
}
.lb-btn:hover { opacity: 1; }
.lb-btn:focus { outline: 2px solid #66afff; outline-offset: 2px; }

/* Edge positions (fixed against the overlay, not the dialog) */
#lb-prev, #lb-next, #lb-close {
  position: fixed; z-index: 1001;         /* above dialog */
}

/* Center-left / center-right */
#lb-prev  { left: 12px;  top: 50%; transform: translateY(-50%); }
#lb-next  { right: 12px; top: 50%; transform: translateY(-50%); }

/* Close: top-right */
#lb-close { right: 12px; top: 12px; }


/* Separator before notes */
.notes-sep {
  border: none;
  border-top: 1px solid #b0c0e0; /* subtle blue-grey line */
  margin: 2.5em 0 1.5em 0;       /* good breathing space */
}

/* TRANSCRIPTION TEST */
.fn-mark .fn-jump {
  display: inline-flex;
  vertical-align: 0em;
  line-height: 1;
  padding: 0;
  border: none;
  color: var(--editorcolor);
  text-decoration: none;
}

.fn-jump {
  color: var(--editorcolor);
  text-decoration: none;
  border: none;
  display: inline-flex;
  vertical-align: 0em;
  transition: box-shadow 0.25s ease;
}

/* Hover / focus: glow instead of underline */
.fn-jump:hover,
.fn-jump:focus {
  box-shadow: 0 0 6px 2px #66afff;   /* your standard glow */
  border-bottom: none !important;
  outline: none;
}

/* Optional: when hovering over note itself, glow the marker too */
.fn:hover .fn-jump {
  box-shadow: 0 0 6px 2px #66afff;
}

.fn:target .fn-n a {
  box-shadow: 0 0 6px 2px #66afff;  /* same glow language */
  outline: none;
}

.fn-body {
  font-size: 0.8em;
  }
  
.fn-body .fn-n {
  display: inline-flex;
  font-size: 1em;
  vertical-align: 0em;
  line-height: 1;
  margin-inline-start: .35ch;
  color: var(--editorcolor);
}
.fn-body .fn-n a {
  color: inherit;
  text-decoration: none;
  border: none;
}
.fn-body .fn-n a:hover,
.fn-body .fn-n a:focus
{
  box-shadow: 0 0 6px 2px #66afff;  /* same glow language */
  outline: none;
}

.fn, .fn-jump {
    scroll-margin-top: 7rem;
}

/* Persistent selection glow on the *anchors only* */
.fn-jump.is-selected,
.fn-body .fn-n a.is-selected {
  box-shadow: 0 0 6px 2px #66afff;
}

/* Kill the native OL bullets/numbers (Chrome/Safari/Firefox/Edge) */
.fn-list { list-style: none; padding: 0; margin: 0; }
.fn-list > li { list-style: none; }                 /* extra belt */
.fn-list > li::marker { content: ""; }   

/* Hover preview card for in-text note markers */
.fn-hover-card {
  position: absolute;
  z-index: 1000;
  background: #fdfaf3;                
  border: none;
  box-shadow: 0 0 3px 0 #b0c0e0;
  padding: 6px 8px;
  max-width: 34ch;
  transform: translateY(6px);
  font-family: Amiri, Libertinus, "Scheherazade New", "Noto Naskh Arabic", serif;
  font-size: 0.8em;
  line-height: 1.9;
  direction: rtl;
}
.fn-hover-card[hidden] { display: none !important; }

html { scroll-behavior: smooth; }


