/* ElleFar — a cloth-bound scholarly book in the colours of the World Pharmacists Archive and the ElleFar journal:
   midnight navy bookcloth, apothecary gold stamping, parchment and white. Crimson Pro and Jost; Arabic in the academy's Kufi. */
:root {
  --paper: #FFFFFF; --page: #FFFFFF; --ink: #222222; --muted: #6E6958; --line: #E2D9C2; --sage: #F6F2E7;
  --cloth: #020E2C; --cloth-d: #0D1B3E; --gilt: #B68F50; --gilt-d: #7A5A26; --link: #7A5A26; --err: #A3322A; --ok: #1F6B3A;
  --serif: "Crimson Pro", Georgia, serif; --sans: "Jost", "Futura", system-ui, sans-serif;
  --r: 4px; --wrap: 1180px;
}
html[dir="rtl"] { --serif: "Reem Kufi", "Noto Kufi Arabic", sans-serif; --sans: "Noto Kufi Arabic", sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gilt); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.3rem; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { line-height: 1.45; letter-spacing: 0; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.vh, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 20; }
.skip:focus { top: 12px; }
.loading, .empty { color: var(--muted); padding: 48px 0; }
.lede { font-family: var(--serif); font-size: 1.25rem; line-height: 1.6; max-width: 40em; color: #4A4A52; }
html[dir="rtl"] .lede { font-size: 1.2rem; line-height: 1.9; }
.muted { color: var(--muted); }
.prose { max-width: 42em; font-family: var(--serif); font-size: 1.125rem; line-height: 1.75; }
html[dir="rtl"] .prose { font-size: 1.1rem; line-height: 2; }
.prose h2 { font-size: 1.5rem; margin-top: 1.6em; }
.prose ul { padding-inline-start: 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--gilt-d); }

/* header */
.top { background: var(--page); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.wm { font-family: "Crimson Pro", Georgia, serif; font-weight: 500; font-size: 1.6rem; letter-spacing: .01em; }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a { color: var(--ink); text-decoration: none; padding: 10px 12px; font-size: .97rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--cloth); }
.nav a[aria-current] { border-bottom-color: var(--gilt); color: var(--cloth); }
.lang-b { font: inherit; font-size: .95rem; background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px; margin-inline-start: 8px; cursor: pointer; color: var(--ink); }
.lang-b:hover { border-color: var(--cloth); }
.lang-b[lang="ar"] { font-family: "Noto Kufi Arabic", sans-serif; }
.menu-b { display: none; margin-inline-start: auto; font: inherit; background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; align-items: center; gap: 8px; cursor: pointer; color: var(--ink); }
.bars { width: 16px; height: 2px; background: currentColor; position: relative; display: inline-block; }
.bars::before, .bars::after { content: ""; position: absolute; inset-inline: 0; height: 2px; background: currentColor; }
.bars::before { top: -5px; } .bars::after { top: 5px; }
@media (max-width: 900px) {
  .menu-b { display: inline-flex; }
  .nav { display: none; position: absolute; top: 100%; inset-inline: 0; background: var(--page); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 20px 16px; gap: 0; }
  .nav.open { display: flex; }
  .nav a { border-bottom: 1px solid var(--sage); padding: 14px 4px; }
  .nav a[aria-current] { border-bottom-color: var(--sage); border-inline-start: 3px solid var(--gilt); padding-inline-start: 10px; }
  .lang-b { margin: 12px 0 0; align-self: flex-start; }
}

/* bookcloth: the signature surface (linen weave + gold stamping) */
.cloth { background-color: var(--cloth); color: #F6F2E7;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 1px, transparent 1px 3px); }
.stamp { border: 1.5px solid var(--gilt); outline: .5px solid var(--gilt); outline-offset: -6px; }

/* home: the cover */
.hero { padding: 56px 0 64px; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero h1 { max-width: 14em; }
.hero .lede { margin-bottom: 28px; }
.acts { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 1rem var(--sans); padding: 12px 20px; border-radius: var(--r); border: 1px solid var(--cloth); background: var(--cloth); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--cloth-d); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--cloth); }
.btn.ghost:hover { background: var(--sage); }
.btn:disabled { opacity: .6; cursor: progress; }
.cover-big { aspect-ratio: 3 / 4; max-width: 400px; width: 100%; margin-inline-start: auto; border-radius: 3px 8px 8px 3px; box-shadow: inset 10px 0 18px -10px rgba(0,0,0,.45), 0 24px 40px -24px rgba(2,14,44,.55); padding: 26px; display: flex; }
html[dir="rtl"] .cover-big { border-radius: 8px 3px 3px 8px; box-shadow: inset -10px 0 18px -10px rgba(0,0,0,.45), 0 24px 40px -24px rgba(2,14,44,.55); margin-inline-start: 0; margin-inline-end: auto; }
.cover-big .stamp { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 24px; }
.cover-big .stamp img { width: 72px; height: 72px; }
.cover-big .t { font-family: "Crimson Pro", Georgia, serif; font-size: 2.6rem; color: var(--gilt); letter-spacing: .04em; line-height: 1; }
.cover-big .s { font-family: var(--serif); color: #E8E2CF; font-size: 1.05rem; max-width: 15em; line-height: 1.5; }
.cover-big .p { font: 500 .8rem var(--sans); color: var(--gilt); letter-spacing: .12em; margin-top: auto; }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; gap: 36px; } .cover-big { max-width: 300px; margin: 0 auto !important; } .hero { padding-top: 36px; } }

/* sections */
.sec { padding: 56px 0; border-top: 1px solid var(--line); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.sec-h h2 { margin: 0; }
.sec-h a { font-size: .97rem; }

/* contents: who the site is for, set like a book's table of contents */
.toc { list-style: none; margin: 0; padding: 0; max-width: 60em; }
.toc li { border-bottom: 1px solid var(--sage); }
.toc a { display: flex; align-items: baseline; gap: 12px; padding: 18px 0; color: var(--ink); text-decoration: none; }
.toc .k { font-family: var(--serif); font-size: 1.35rem; white-space: nowrap; }
.toc .dots { flex: 1; border-bottom: 2px dotted #CFC4A8; transform: translateY(-5px); min-width: 24px; }
.toc .v { color: var(--muted); text-align: end; max-width: 26em; font-size: .97rem; }
.toc a:hover .k { color: var(--cloth); }
.toc a:hover .dots { border-color: var(--gilt); }
@media (max-width: 700px) { .toc a { flex-direction: column; gap: 4px; } .toc .dots { display: none; } .toc .v { text-align: start; } }

/* commitments */
.vows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 56px; max-width: 64em; }
.vow h3 { padding-top: 14px; border-top: 2px solid var(--gilt); display: inline-block; margin-bottom: .4em; }
.vow p { color: #4A4A52; margin-bottom: .6em; }
@media (max-width: 700px) { .vows { grid-template-columns: 1fr; gap: 28px; } }

/* the shelf: books with their covers (uploaded, or stamped bookcloth) */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 32px 24px; }
.bk { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.bk:hover h3 { color: var(--cloth); text-decoration: underline; text-decoration-thickness: 1px; }
.bk h3 { font-size: 1.08rem; margin: 0; line-height: 1.35; }
.bk .au { font-size: .9rem; color: var(--muted); }
.bk .tag { font-size: .8rem; color: var(--cloth); font-weight: 500; }
.cv { aspect-ratio: 2 / 3; width: 100%; border-radius: 2px 6px 6px 2px; overflow: hidden; box-shadow: inset 7px 0 12px -8px rgba(0,0,0,.45), 0 14px 26px -18px rgba(2,14,44,.6); position: relative; }
.cv:not(.cloth) { background: var(--sage); }
html[dir="rtl"] .cv { border-radius: 6px 2px 2px 6px; }
.cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv.cloth { padding: 10px; display: flex; }
.cv.cloth .stamp { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 10px; gap: 10px; }
.cv .ct { font-family: var(--serif); color: var(--gilt); font-size: 1.02rem; line-height: 1.3; margin-top: 18%; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.cv .ca { color: #E8E2CF; font-size: .72rem; line-height: 1.4; }
.cv .cm { margin-top: auto; width: 26px; height: 26px; }
.cv.lg .ct { font-size: 1.5rem; } .cv.lg .ca { font-size: .9rem; } .cv.lg .cm { width: 40px; height: 40px; }

/* lists: journals, news */
.rows { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.rows > li { padding: 22px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; }
.rows h3 { margin: 0 0 .3em; }
.rows .meta { color: var(--muted); font-size: .92rem; }
.rows .st { font-size: .85rem; font-weight: 500; color: var(--cloth); white-space: nowrap; align-self: start; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; }
.rows .st.prep { color: var(--gilt-d); }
@media (max-width: 640px) { .rows > li { grid-template-columns: 1fr; } .rows .st { justify-self: start; } }
.date { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* page heads */
.ph { padding: 44px 0 28px; }
.ph p { max-width: 44em; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }

/* book page */
.book { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; padding: 40px 0 64px; align-items: start; }
.book .side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 14px; }
.book h1 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); margin-bottom: .2em; }
.book article h2 { margin-top: 1.6em; font-size: 1.6rem; }
.book .sub { font-family: var(--serif); font-size: 1.3rem; color: #4A4A52; margin-bottom: 1em; }
.people { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 6px; }
.people b { font-weight: 500; }
.people small { color: var(--muted); }
.orcid { display: inline-flex; vertical-align: -2px; margin-inline-start: 4px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0 0 28px; padding: 18px 0; border-block: 1px solid var(--line); font-size: .96rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.oa { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 500; font-size: .92rem; }
.oa::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.cite { background: var(--page); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; font-family: var(--serif); font-size: 1.02rem; overflow-wrap: anywhere; }
.cite-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn.sm { padding: 7px 12px; font-size: .9rem; }
.kw { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.kw li { background: var(--sage); border-radius: 99px; padding: 3px 12px; font-size: .9rem; }
.toc-b { font-family: var(--serif); white-space: pre-line; line-height: 1.9; }
@media (max-width: 820px) { .book { grid-template-columns: 1fr; gap: 28px; } .book .side { position: static; max-width: 260px; } }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; align-items: end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 1rem; color: var(--ink); background: var(--page); border: 1px solid #CFC4A8; border-radius: var(--r); padding: 10px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--cloth); }
.filters input[type=search] { min-width: 260px; }

/* steps of publishing a book (a real sequence) */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; max-width: 52em; }
.steps li { counter-increment: s; position: relative; padding: 0 0 26px; padding-inline-start: 56px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--gilt); color: var(--cloth); font: 500 1rem var(--serif); display: grid; place-items: center; background: var(--page); }
.steps li::after { content: ""; position: absolute; inset-inline-start: 17.5px; top: 36px; bottom: 0; border-inline-start: 1px solid var(--line); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 1.15rem; margin: 4px 0 .3em; }
.steps p { margin: 0; color: #4A4A52; }

/* forms */
.form { background: var(--page); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; max-width: 760px; }
.fg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.fg .full { grid-column: 1 / -1; }
.fg label:not(.chk) { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .95rem; }
.fg small { font-weight: 400; color: var(--muted); }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.chk input { margin-top: 5px; width: 18px; height: 18px; }
.out { margin: 14px 0 0; min-height: 1.4em; }
.out.ok { color: var(--ok); } .out.err { color: var(--err); }
.ref { font-weight: 600; font-family: var(--sans); direction: ltr; unicode-bidi: isolate; }
.note { background: var(--sage); border-inline-start: 3px solid var(--gilt); padding: 14px 18px; border-radius: var(--r); max-width: 46em; }
.keep { background: #FFF8E6; border: 1px solid #E6CF95; padding: 16px; border-radius: var(--r); }
.keep dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0 0; }
.keep dd { margin: 0; font-weight: 600; direction: ltr; unicode-bidi: isolate; text-align: start; }
@media (max-width: 640px) { .fg { grid-template-columns: 1fr; } .form { padding: 20px; } }

/* policies */
.pol { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; padding: 36px 0 64px; align-items: start; }
.pol nav { position: sticky; top: 96px; display: flex; flex-direction: column; border-inline-start: 1px solid var(--line); }
.pol nav a { padding: 7px 14px; color: var(--muted); text-decoration: none; font-size: .94rem; margin-inline-start: -1px; border-inline-start: 2px solid transparent; }
.pol nav a:hover { color: var(--ink); }
.pol nav a[aria-current] { color: var(--cloth); border-inline-start-color: var(--gilt); font-weight: 500; }
@media (max-width: 860px) { .pol { grid-template-columns: 1fr; gap: 24px; } .pol nav { position: static; } }
.plist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; max-width: 64em; }
.plist li { border-bottom: 1px solid var(--line); }
.plist a { display: block; padding: 16px 0; font-family: var(--serif); font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.plist a:hover { color: var(--cloth); }
.plist small { display: block; font-family: var(--sans); font-size: .9rem; color: var(--muted); margin-top: 2px; }
@media (max-width: 700px) { .plist { grid-template-columns: 1fr; } }

/* audience pages */
.aud { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; padding-bottom: 64px; }
.aud aside h2 { font-size: 1.2rem; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { border-bottom: 1px solid var(--sage); }
.links a { display: block; padding: 11px 0; }
@media (max-width: 820px) { .aud { grid-template-columns: 1fr; } }

/* board */
.board { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; }
.board li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.board b { font-family: var(--serif); font-weight: 500; font-size: 1.12rem; display: block; }
.board span { color: var(--muted); font-size: .92rem; }
.flag { width: 18px; height: 13.5px; vertical-align: -1px; margin-inline-end: 6px; border-radius: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

/* tracking */
.trk-st { display: inline-block; padding: 4px 12px; border-radius: 99px; color: #fff; font-weight: 500; font-size: .92rem; }
.thread { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.thread li { background: var(--page); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.thread small { color: var(--muted); display: block; margin-bottom: 4px; }

/* off */
.off { text-align: center; padding: 96px 20px; }

/* footer: the back board of the book */
.foot { margin-top: 0; }
.foot { background-color: var(--cloth); color: #E8E2CF; background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px); border-top: 3px solid var(--gilt); }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 40px; padding: 52px 20px 36px; }
.foot .brand { color: var(--gilt); margin-bottom: 14px; }
.foot h2 { font: 500 1rem var(--sans); color: var(--gilt); margin-bottom: 12px; }
.foot a { color: #F6F2E7; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.f-l { display: flex; flex-direction: column; gap: 8px; font-size: .95rem; }
.f-a p { font-size: .95rem; max-width: 26em; }
.f-co { color: #A8A28F; font-size: .88rem !important; }
.f-nr { display: flex; gap: 8px; }
.f-nr input { flex: 1; min-width: 0; background: rgba(255,255,255,.95); border-color: transparent; }
.f-n button { font: 500 .95rem var(--sans); background: var(--gilt); color: var(--cloth-d); border: 0; border-radius: var(--r); padding: 10px 16px; cursor: pointer; }
.f-n button:hover { background: #D4B47E; }
.f-n p { font-size: .92rem; }
.f-n .out.ok { color: #BFE5C8; } .f-n .out.err { color: #FFC9C2; }
.foot-b { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 20px 28px; border-top: 1px solid rgba(182,143,80,.35); font-size: .88rem; color: #A8A28F; }
.foot-b a { margin-inline-start: 18px; }
@media (max-width: 900px) { .foot-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-in { grid-template-columns: 1fr; gap: 28px; } .foot-b a { margin-inline: 0 16px; } }

@media (prefers-reduced-motion: no-preference) {
  .cover-big { animation: open .7s cubic-bezier(.2,.7,.2,1) both; transform-origin: left center; }
  html[dir="rtl"] .cover-big { transform-origin: right center; }
  @keyframes open { from { opacity: 0; transform: perspective(900px) rotateY(-14deg) translateY(8px); } to { opacity: 1; transform: none; } }
}
@media print { .top, .foot, .acts, .cite-acts { display: none; } body { background: #fff; } }

html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .toc .k, html[dir="rtl"] .bk h3 { font-weight: 600; }
html[dir="rtl"] h1 { font-size: clamp(1.9rem, 1.1rem + 2.6vw, 2.9rem); }
html[dir="rtl"] body { line-height: 1.95; font-size: 1rem; }
h1 { font-weight: 300; } .book h1, .ph h1 { font-weight: 400; }
html[dir="rtl"] .lede, html[dir="rtl"] .prose, html[dir="rtl"] .cover-big .s, html[dir="rtl"] .book .sub, html[dir="rtl"] .cite, html[dir="rtl"] .toc-b, html[dir="rtl"] .cv .ct { font-family: "Noto Kufi Arabic", sans-serif; }
html[dir="rtl"] .lede { font-size: 1.1rem; line-height: 2; } html[dir="rtl"] .prose { font-size: 1.02rem; line-height: 2.05; }
