/* ZohaNur.app — manuscript design system
   Palette carried over from the apps: gold #D4AF37 on dark green #081A0E,
   with a parchment reading surface so long articles read like a page.

   Fonts are self-hosted on purpose. The privacy policy promises that visiting
   this site does not hand your IP address to third parties, and loading fonts
   from a CDN would quietly break that promise. Drop the .woff2 files into
   /assets/fonts/ and the faces below activate; until then the system serif
   fallbacks are used and nothing breaks. */

@font-face { font-family: "EB Garamond"; src: url("/assets/fonts/ebgaramond-500.woff2") format("woff2");
             font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/assets/fonts/ebgaramond-600.woff2") format("woff2");
             font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/sourceserif4-400.woff2") format("woff2");
             font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/sourceserif4-600.woff2") format("woff2");
             font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("/assets/fonts/amiri-regular.woff2") format("woff2");
             font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --ink:        #081A0E;   /* dark green ground */
  --ink-deep:   #04100A;
  --ink-soft:   #12291A;
  --gold:       #D4AF37;
  --gold-dim:   #8C7434;
  --gold-wash:  #F0E6C8;
  --parchment:  #F5F1E6;
  --parchment-2:#EDE7D6;
  --text:       #1B291F;
  --text-mute:  #5C6B60;
  --line:       #DAD1BB;

  --display: "EB Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --body:    "Source Serif 4", Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
  --ui:      "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arabic:  "Amiri", "Scheherazade New", "Traditional Arabic", serif;

  --measure: 68ch;
  --radius: 3px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a { color: #17552F; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold-dim); outline-offset: 3px; border-radius: 2px;
}
.ext { font-size: 0.75em; margin-left: 0.15em; opacity: 0.7; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--gold); padding: 0.6rem 1rem; font-family: var(--ui);
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------------ masthead */

.masthead {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.7rem clamp(1rem, 3vw, 2rem);
  background: var(--ink);
  border-bottom: 1px solid var(--gold-dim);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--gold); text-decoration: none; margin-right: auto;
}
.wordmark .mark { display: inline-flex; }
.wordmark-text {
  font-family: var(--display); font-weight: 600; font-size: 1.4rem;
  letter-spacing: 0.06em; line-height: 1;
}
.top-links { display: flex; gap: 1.4rem; font-family: var(--ui); font-size: 0.875rem; }
.top-links a { color: var(--gold-wash); text-decoration: none; }
.top-links a:hover { color: var(--gold); text-decoration: underline; }
.top-links .give {
  border: 1px solid var(--gold-dim); padding: 0.35rem 0.85rem; border-radius: var(--radius);
  color: var(--gold);
}
.top-links .give:hover { background: var(--gold); color: var(--ink); text-decoration: none; }

.nav-toggle {
  display: none; font-family: var(--ui); font-size: 0.8125rem;
  background: transparent; color: var(--gold-wash);
  border: 1px solid var(--gold-dim); border-radius: var(--radius);
  padding: 0.35rem 0.75rem; cursor: pointer;
}

/* -------------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr) 14rem;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 84rem; margin: 0 auto;
  padding: 2.5rem clamp(1rem, 3vw, 2rem) 4rem;
  align-items: start;
}

.sidenav { position: sticky; top: 4.5rem; font-family: var(--ui); font-size: 0.875rem; }
.sidenav ul { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.sidenav li { margin: 0; }
.sidenav a {
  display: block; padding: 0.28rem 0 0.28rem 0.85rem;
  color: var(--text-mute); text-decoration: none;
  border-left: 2px solid var(--line);
}
.sidenav a:hover { color: var(--ink); border-left-color: var(--gold-dim); }
.sidenav a[aria-current="page"] {
  color: var(--ink); font-weight: 600; border-left-color: var(--gold); background: var(--parchment-2);
}

.nav-label {
  font-family: var(--ui); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-dim); margin: 0 0 0.5rem;
}

.rail { position: sticky; top: 4.5rem; font-family: var(--ui); font-size: 0.8125rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 0.22rem 0; color: var(--text-mute); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.toc .lvl-3 a { padding-left: 0.85rem; font-size: 0.78125rem; }

/* --------------------------------------------------------------- breadcrumbs */

.crumbs {
  font-family: var(--ui); font-size: 0.75rem; letter-spacing: 0.04em;
  color: var(--text-mute); margin-bottom: 1.75rem; text-transform: capitalize;
}
.crumbs a { color: var(--text-mute); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { margin: 0 0.5rem; color: var(--line); }

/* --------------------------------------------------------------------- prose */

.prose { max-width: var(--measure); }

.page-head { margin-bottom: 2.5rem; }
.page-head h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.1rem, 4.4vw, 3rem); line-height: 1.12;
  letter-spacing: -0.005em; margin: 0 0 0.5rem; color: var(--ink);
}
.page-head .arabic {
  font-family: var(--arabic); font-size: 1.6rem; line-height: 2;
  color: var(--gold-dim); margin: 0.4rem 0 0.6rem;
}
.page-head .lede {
  font-size: 1.1875rem; line-height: 1.6; color: var(--text-mute); margin: 0.6rem 0 0;
}

/* Signature: the illumination rule. A double hairline broken by a gold lozenge,
   the way a manuscript separates one section of text from the next. */
.rule { display: flex; align-items: center; gap: 0.75rem; margin: 1.6rem 0 0; }
.rule span { flex: 1; height: 3px; border-top: 1px solid var(--gold-dim); border-bottom: 1px solid var(--gold-dim); }
.rule span:first-child { flex: 0 0 4.5rem; }
.rule i { width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); flex: none; }

.prose h2 {
  font-family: var(--display); font-weight: 600; font-size: 1.75rem; line-height: 1.25;
  color: var(--ink); margin: 3rem 0 0.75rem; padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.prose h3 {
  font-family: var(--display); font-weight: 600; font-size: 1.3125rem;
  color: var(--ink); margin: 2rem 0 0.5rem;
}
.prose h4 {
  font-family: var(--ui); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-dim);
  margin: 1.75rem 0 0.4rem;
}
.prose p { margin: 0 0 1.15rem; }
.prose ul, .prose ol { margin: 0 0 1.25rem; padding-left: 1.35rem; }
.prose li { margin: 0 0 0.45rem; }
.prose li::marker { color: var(--gold-dim); }
.prose strong { font-weight: 600; color: var(--ink); }

.prose blockquote {
  margin: 1.5rem 0; padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 2px solid var(--gold); color: var(--text-mute); font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em; background: var(--parchment-2);
  border: 1px solid var(--line); border-radius: 2px; padding: 0.1em 0.35em;
}
.prose pre {
  background: var(--ink); color: var(--gold-wash);
  padding: 1rem 1.15rem; border-radius: var(--radius); overflow-x: auto;
  font-size: 0.8125rem; line-height: 1.6; margin: 0 0 1.35rem;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

.prose table {
  width: 100%; border-collapse: collapse; margin: 0 0 1.5rem;
  font-size: 0.9375rem; font-family: var(--ui);
}
.prose th, .prose td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; color: var(--ink); border-bottom-color: var(--gold-dim); }

.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.prose h2 .anchor, .prose h3 .anchor {
  margin-left: 0.4rem; color: var(--line); text-decoration: none;
  font-family: var(--ui); font-weight: 400; opacity: 0; transition: opacity 0.15s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus-visible { opacity: 1; }

.updated {
  font-family: var(--ui); font-size: 0.75rem; color: var(--text-mute);
  margin: 3rem 0 0; max-width: var(--measure);
}
.page-help {
  max-width: var(--measure); margin-top: 1rem; padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--ui); font-size: 0.8125rem; color: var(--text-mute);
}
.page-help p { margin: 0; }

/* ---------------------------------------------------------------- home extras */

.is-home .rail { display: none; }
.is-home .layout { grid-template-columns: 16.5rem minmax(0, 1fr); }

/* The framed opening: a manuscript border around the mission statement. */
.frame {
  position: relative; margin: 0 0 2.5rem; padding: 2.25rem clamp(1.25rem, 4vw, 2.75rem);
  background: linear-gradient(var(--parchment-2), var(--parchment));
  border: 1px solid var(--gold-dim); border-radius: var(--radius);
}
.frame::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold);
  opacity: 0.4; border-radius: 2px; pointer-events: none;
}
.frame .arabic {
  font-family: var(--arabic); font-size: 1.75rem; line-height: 2.1;
  color: var(--ink); margin: 0 0 0.75rem; text-align: center;
}
.frame .translit { font-style: italic; color: var(--text-mute); text-align: center; margin: 0 0 0.35rem; }
.frame .source { font-family: var(--ui); font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold-dim); text-align: center; margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.card {
  display: block; padding: 1.1rem 1.25rem; text-decoration: none; color: inherit;
  background: var(--parchment-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.card:hover { border-color: var(--gold-dim); background: #F7F3E4; }
.card strong { display: block; font-family: var(--display); font-size: 1.1875rem; color: var(--ink); margin-bottom: 0.2rem; }
.card span { font-family: var(--ui); font-size: 0.8125rem; color: var(--text-mute); line-height: 1.5; display: block; }

/* -------------------------------------------------------------------- footer */

.footer { background: var(--ink-deep); color: var(--gold-wash); padding: 3rem clamp(1rem, 3vw, 2rem) 2rem; }
.footer-inner {
  max-width: 84rem; margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2.5rem;
}
.footer-name { font-family: var(--display); font-size: 1.5rem; color: var(--gold); margin: 0 0 0.4rem; letter-spacing: 0.05em; }
.footer-note { font-size: 0.9375rem; color: #B9C4BB; margin: 0; max-width: 34ch; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.5rem; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; font-family: var(--ui); font-size: 0.8125rem; }
.footer-cols li { margin: 0 0 0.35rem; }
.footer-cols a { color: #B9C4BB; text-decoration: none; }
.footer-cols a:hover { color: var(--gold); text-decoration: underline; }
.footer .nav-label { color: var(--gold-dim); }
.colophon {
  max-width: 84rem; margin: 2.5rem auto 0; padding-top: 1.25rem;
  border-top: 1px solid #1E3325; font-family: var(--ui); font-size: 0.75rem; color: #6E7D72;
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 62rem) {
  .layout, .is-home .layout { grid-template-columns: 15rem minmax(0, 1fr); }
  .rail { display: none; }
}

@media (max-width: 48rem) {
  .nav-toggle { display: inline-block; }
  .top-links a:not(.give) { display: none; }
  .layout, .is-home .layout { grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; }
  .sidenav {
    display: none; position: static; padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line); margin-bottom: 1.5rem;
  }
  .sidenav.open { display: block; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  body { font-size: 1.0625rem; }
}
