@font-face { font-family: Ruqaa; src: url(fonts/aref-ruqaa-arabic-400-normal.woff2) format("woff2"); font-weight: 400; }
@font-face { font-family: Ruqaa; src: url(fonts/aref-ruqaa-arabic-700-normal.woff2) format("woff2"); font-weight: 700; }
@font-face { font-family: Naskh; src: url(fonts/amiri-arabic-400-normal.woff2) format("woff2"); font-weight: 400; }
@font-face { font-family: Naskh; src: url(fonts/amiri-arabic-700-normal.woff2) format("woff2"); font-weight: 700; }
@font-face { font-family: Plex; src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); font-weight: 400; }
@font-face { font-family: Plex; src: url(fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); font-weight: 500; }
@font-face { font-family: Plex; src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); font-weight: 600; }
@font-face { font-family: Plex; src: url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); font-weight: 700; }
@font-face { font-family: PlexLatin; src: url(fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2"); font-weight: 400; }
@font-face { font-family: PlexLatin; src: url(fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format("woff2"); font-weight: 600 700; }
@font-face { font-family: Display; src: url(fonts/lalezar-arabic-400-normal.woff2) format("woff2"); }

:root {
  --paper: #ffffff;
  --ink: #13221b;
  --soft: #46564e;
  --c1: #1e6b47;
  --c1-tint: #e7f1eb;
  --c3: #1f4e8c;
  --c3-tint: #e6edf7;
  --c2: #a87508;
  --c2-tint: #fbf3dc;
  --pen: #d21f3c;
  --pen-tint: #fdedf0;
  --marker: #ffe45c;
  --band: #123f2c;
  --band-accent: #f6c445;
  --foot: #13221b;
  --rule: #d5ddd8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Plex, PlexLatin, sans-serif; color: var(--ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ---------- viewer chrome (screen only), in the site's theme ---------- */
:root {
  --v-bg: #f7f9ff; --v-rule: #c9d6f2; --v-ink: #141b2d; --v-muted: #5b6478;
  --v-pen: #1f3a93; --v-on-pen: #fff; --v-shadow: rgba(20, 27, 45, .14);
}
:root[data-theme="dark"] {
  --v-bg: #000; --v-rule: #283147; --v-ink: #fff; --v-muted: #9ba4b9;
  --v-pen: #91abff; --v-on-pen: #000; --v-shadow: rgba(0, 0, 0, 0);
}
html, body { background: var(--v-bg); }
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--v-bg); color: var(--v-ink);
  border-bottom: 1px solid var(--v-rule);
}
.bar h1 { font: 400 22px/1.3 Display, Plex, sans-serif; margin-inline-end: auto; }
.bar h1 span { font: 400 13px Plex, sans-serif; color: var(--v-muted); margin-inline-start: 6px; }
.home { display: flex; align-items: center; gap: 6px; font: 400 28px/1 Display, sans-serif; color: var(--v-pen); text-decoration: none; }
.home img { width: 32px; height: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border: 2px solid transparent; border-radius: 12px;
  background: none; color: var(--v-pen); font: 700 15px Plex, sans-serif;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn.ghost { border-color: color-mix(in srgb, var(--v-pen) 20%, transparent); }
.btn.ghost:hover { border-color: var(--v-pen); }
.btn.download { background: var(--v-pen); color: var(--v-on-pen); padding: 10px 22px; font-size: 16px; box-shadow: 0 6px 16px color-mix(in srgb, var(--v-pen) 30%, transparent); }
.btn.download:hover { background: var(--v-ink); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn:focus-visible, .home:focus-visible { outline: 2px solid var(--v-pen); outline-offset: 2px; }
.stage { overflow: auto; padding: 16px; }
.stage.fit { overflow: hidden; }
.frame { transform-origin: top right; margin-inline-start: auto; }
.frame .poster { box-shadow: 0 2px 6px var(--v-shadow), 0 16px 40px var(--v-shadow); }
.end { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 8px 16px 40px; }
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 8px; }
  .bar h1 { font-size: 19px; }
  .bar h1 span { display: block; margin: 0; }
  .bar .cta { display: none; }
  .bar .download { order: 1; flex: 1; }
  .bar #zoom { order: 1; }
}

/* ---------- poster ---------- */
.poster {
  width: 594mm; height: 420mm;
  background: var(--paper);
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-size: 12.1pt; line-height: 1.55;
  overflow: hidden;
  position: relative;
}
.poster::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='190' viewBox='0 0 300 190'%3E%3Cg transform='rotate(-24 150 95)' fill='none' stroke='%2313221b' stroke-width='2.2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M86 64h22l11 11v31a3 3 0 0 1-3 3H86a3 3 0 0 1-3-3V67a3 3 0 0 1 3-3Z'/%3E%3Cpath d='M108 64v11h11'/%3E%3Cpath d='M92 95l5 5 12-15'/%3E%3Ctext x='128' y='95' fill='%2313221b' stroke='none' font-family='Arial,Helvetica,sans-serif' font-weight='700' font-size='19'%3Ewarqa.org%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: 135mm auto;
  opacity: 0.085;
}
.u2 { color: var(--c1); } .u3 { color: var(--c3); } .gr { color: var(--pen); }
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.14em; flex: 0 0 auto; }

/* header band */
.masthead {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12mm;
  padding: 5.5mm 12mm 7mm; background: var(--band); color: #fff;
}
.masthead::before {
  content: ""; position: absolute; width: 150mm; height: 150mm; border-radius: 50%;
  inset-inline-start: 60mm; top: -95mm; background: var(--band-accent); opacity: 0.16;
}
.masthead::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2.6mm;
  background: linear-gradient(to left, var(--c1) 0 22%, var(--c2) 22% 50%, var(--c3) 50% 70%, var(--pen) 70% 100%);
}
.masthead > * { position: relative; }
.masthead .title { font: 700 68pt/0.95 Ruqaa, serif; white-space: nowrap; }
.masthead .title b { color: var(--band-accent); font-weight: 700; }
.masthead .sub { font-size: 16pt; font-weight: 700; }
.masthead .sub .grade { display: block; width: fit-content; margin-bottom: 1.6mm; padding: 0.4mm 4mm 1mm; background: var(--band-accent); color: var(--band); font: 700 27pt/1.25 Plex, sans-serif; }
.masthead .sub small { display: block; font-size: 12.5pt; font-weight: 400; opacity: 0.85; margin-top: 1mm; }
.scope { list-style: none; font-size: 12pt; line-height: 1.85; }
.scope li { display: grid; grid-template-columns: 24mm 1fr; gap: 2mm; }
.scope li b { font-weight: 700; }
.scope .u2 { color: var(--s1, #9fe0b9); } .scope .u3 { color: var(--s3, #aac8f5); } .scope .gr { color: var(--s4, #ffb0bd); }
.brand { display: flex; align-items: center; gap: 3mm; padding: 3mm 4.5mm; background: #fff; color: var(--ink); border-radius: 3mm; }
.brand img { width: 13mm; height: 13mm; }
.brand b { display: block; font: 700 22pt/1 Ruqaa, serif; color: #1f3a93; }
.brand span { font: 600 10.5pt PlexLatin, Plex, sans-serif; direction: ltr; }

/* columns as cards */
.cols { display: grid; grid-template-columns: 122mm 146mm 116mm 1fr; gap: 4.5mm; padding: 4.5mm 7mm; min-height: 0; }
.col { min-height: 0; display: flex; flex-direction: column; gap: 4.5mm; padding: 3.8mm 5mm; border-radius: 4mm; background: var(--t); }
.u2-block { --c: var(--c1); --t: var(--c1-tint); }
.gold-block { --c: var(--c2); --t: var(--c2-tint); }
.u3-block { --c: var(--c3); --t: var(--c3-tint); }
.gr-block { --c: var(--pen); --t: var(--c4-tint, #fff4f6); }

.unit { display: flex; align-items: center; gap: 3mm; padding-bottom: 1.5mm; border-bottom: 0.6mm solid currentColor; }
.unit h2 { font: 700 24.7pt/1.1 Ruqaa, serif; }
.unit .ico { width: 11mm; height: 11mm; stroke-width: 1.8; }
.unit span { font-size: 10.4pt; font-weight: 600; margin-inline-start: auto; }

.lesson h3 { font: 700 16.9pt/1.25 Ruqaa, serif; display: flex; align-items: center; gap: 2.5mm; flex-wrap: wrap; }
.lesson h3 em { font: 600 9.3pt Plex, sans-serif; font-style: normal; padding: 0.5mm 2mm; border-radius: 5mm; background: var(--c); color: #fff; display: inline-flex; align-items: center; gap: 1.2mm; }
.lesson h3 i { font: 400 9.8pt Plex, sans-serif; font-style: normal; color: var(--soft); }
.idea { font-weight: 600; margin-top: 1mm; }
.hl { background: linear-gradient(transparent 52%, var(--marker) 52%, var(--marker) 92%, transparent 92%); padding-inline: 0.6mm; }

ul.pts { list-style: none; margin-top: 1mm; }
ul.pts li { position: relative; padding-inline-start: 4.5mm; }
ul.pts li::before { content: ""; position: absolute; inset-inline-start: 0.4mm; top: 0.55em; width: 2mm; height: 2mm; border-radius: 50%; background: var(--c); }
.sep { color: var(--soft); padding-inline: 1mm; }

.vocab { margin-top: 1.6mm; padding: 1.8mm 2.6mm; font-size: 10.3pt; line-height: 1.7; background: #fff; border-radius: 2.5mm; }
.vocab b { font-weight: 700; color: var(--c); }
.vocab .ant { color: var(--pen); font-weight: 600; }
.vocab .lbl { font: 700 11.5pt Ruqaa, serif; margin-inline-end: 1.5mm; }

/* poem */
.poet { display: grid; grid-template-columns: 1fr auto; gap: 3mm; align-items: end; font-size: 10.3pt; }
.poet b { font: 700 13.1pt Ruqaa, serif; color: var(--c2); }
.verses { background: #fff; padding: 2.6mm 3.5mm; border-radius: 3mm; border: 0.5mm solid color-mix(in srgb, var(--c2) 45%, white); }
.verse { display: grid; grid-template-columns: 5mm 1fr 1fr; column-gap: 10mm; font: 400 13.1pt/1.95 Naskh, serif; }
.verse .n { font: 700 9.8pt/2.3 Plex, sans-serif; color: var(--c2); }
.verse span:nth-child(n+2) { text-align: center; }
.part { font: 700 9.8pt Plex, sans-serif; color: var(--c2); grid-column: 1 / -1; margin-top: 0.6mm; }
.beauty { display: grid; grid-template-columns: auto 1fr; column-gap: 2.5mm; row-gap: 0.7mm; font-size: 10.4pt; line-height: 1.5; }
.beauty dt { font: 700 12.0pt/1.45 Naskh, serif; color: var(--c2); white-space: nowrap; }
.beauty dd b { font-weight: 700; }

/* concepts */
.concept h4 { font: 700 14.7pt/1.3 Ruqaa, serif; color: var(--c); }
.concept { background: #fff; border-radius: 3mm; padding: 2.2mm 3mm; }
table.links { width: 100%; border-collapse: collapse; font-size: 9.8pt; line-height: 1.45; margin-top: 1mm; }
table.links td { padding: 0.9mm 1.4mm; border-bottom: 0.25mm solid var(--rule); vertical-align: top; }
table.links td:first-child { font-weight: 700; white-space: nowrap; color: var(--c); width: 1%; }
table.links tr:last-child td { border-bottom: 0; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm; font-size: 10.1pt; line-height: 1.5; margin-top: 1mm; }
.vs div { padding: 1.4mm 2mm; background: var(--c3-tint); border-radius: 2mm; }
.vs b { display: block; font: 700 12.0pt Ruqaa, serif; color: var(--c3); }

/* red pen */
.pen { color: var(--pen); font-size: 10.3pt; line-height: 1.5; display: grid; grid-template-columns: auto 1fr; gap: 2mm; align-items: start; }
.pen::before { content: "انتبه"; font: 700 13.1pt/1.2 Ruqaa, serif; transform: rotate(-4deg); display: inline-block; border-bottom: 0.4mm solid var(--pen); }
.pen p + p { margin-top: 0.4mm; }
.pen b { font-weight: 700; }

/* grammar */
.gram h3 { font: 700 18.5pt/1.2 Ruqaa, serif; color: var(--ink); display: flex; align-items: baseline; gap: 3mm; }
.gram h3 small { font: 600 9.8pt Plex, sans-serif; color: var(--soft); }

.attach { display: grid; grid-template-columns: auto 2.3fr 1fr 1fr; gap: 1.6mm; margin-top: 1.5mm; font-size: 9.8pt; line-height: 1.5; }
.attach > * { background: #fff; padding: 1.2mm 2mm; }
.attach .q { background: var(--pen); color: #fff; font: 700 12pt/1.3 Ruqaa, serif; display: flex; align-items: center; }
.attach b { display: block; font: 700 12.5pt/1.3 Ruqaa, serif; }
.attach em { font-style: normal; font-weight: 700; color: var(--pen); }
.pron { display: grid; grid-template-columns: 1.05fr 1.6fr 0.75fr; gap: 2mm; margin-top: 1.5mm; font-size: 10.3pt; line-height: 1.5; }
.pron > div { border-top: 0.8mm solid var(--ink); padding-top: 1.2mm; }
.pron h5 { font: 700 12.5pt Ruqaa, serif; margin-bottom: 0.6mm; }
.pron h5 small { font: 600 9.3pt Plex, sans-serif; color: var(--soft); margin-inline-start: 1mm; }
.pron dl { display: grid; grid-template-columns: auto 1fr; column-gap: 2mm; row-gap: 0.5mm; }
.pron dt { font-weight: 700; }
.pron .where { color: var(--soft); font-size: 9.6pt; }
.case { padding: 0.9mm 0; border-bottom: 0.25mm solid var(--rule); }
.case:last-child { border-bottom: 0; }
.case .k { font-weight: 700; }
.case .to { display: block; font-size: 9.7pt; }
.case .to b { color: var(--pen); font-weight: 600; }

.formula { display: flex; align-items: stretch; gap: 1.5mm; margin-top: 1.5mm; }
.formula div { flex: 1; text-align: center; padding: 1.2mm 1mm; font-size: 9.6pt; font-weight: 600; }
.formula div b { display: block; font: 700 18.5pt/1.2 Ruqaa, serif; }
.f-tool { background: var(--ink); color: #fff; }
.f-cond { background: var(--c3-tint); color: var(--c3); }
.f-ans { background: var(--c1-tint); color: var(--c1); }
.formula .plus { flex: 0 0 auto; align-self: center; font: 700 15.3pt Plex, sans-serif; padding: 0; color: var(--soft); }

.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6mm; margin-top: 2mm; }
.tool { padding: 1.4mm 1.8mm 1.6mm; border-top: 1.4mm solid var(--c); background: color-mix(in srgb, var(--c) 7%, white); position: relative; }
.tool .w { font: 700 24.0pt/1.05 Ruqaa, serif; color: var(--c); }
.tool .d { font-size: 9.4pt; font-weight: 700; color: var(--c); }
.tool .ex { font-size: 9.8pt; line-height: 1.45; margin-top: 0.5mm; }
.tool .tag { position: absolute; top: 1.2mm; inset-inline-end: 1.6mm; font-size: 8.5pt; font-weight: 700; color: var(--pen); border: 0.3mm solid var(--pen); padding: 0 1mm; }
.c-aql { --c: #1e6b47; } .c-ghayr { --c: #1f4e8c; } .c-zaman { --c: #a87508; } .c-makan { --c: #8a3fa0; } .c-ay { --c: #13221b; }
.cond { color: var(--c3); font-weight: 700; }
.ans { color: var(--c1); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 1mm 4mm; font-size: 9.4pt; font-weight: 600; margin-top: 1.4mm; }
.legend span::before { content: ""; display: inline-block; width: 3mm; height: 3mm; background: var(--c); margin-inline-end: 1.2mm; vertical-align: -0.4mm; }

.marks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6mm; margin-top: 2mm; font-size: 9.8pt; line-height: 1.45; }
.marks div { border: 0.35mm solid var(--ink); padding: 1.2mm 1.8mm; background: #fff; border-radius: 2.5mm; }
.marks b { display: block; font: 700 13.1pt Ruqaa, serif; }
.marks small { color: var(--soft); font-size: 9.4pt; }

.nonj { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6mm; margin-top: 1.5mm; }
.nonj > div { padding: 1.4mm 1.8mm; border-top: 1.4mm solid var(--ink); background: #fff; font-size: 9.8pt; line-height: 1.45; }
.nonj .w { font: 700 20.7pt/1.05 Ruqaa, serif; }
.nonj .d { font-size: 9.4pt; font-weight: 700; color: var(--soft); }

.imla { padding-top: 3mm; border-top: 0.6mm solid var(--ink); }
.imla-row { display: grid; grid-template-columns: auto 1fr; gap: 8mm; align-items: center; }
.fixes { display: grid; grid-template-columns: repeat(2, auto); gap: 1mm 6mm; justify-content: start; font: 700 13.3pt Naskh, serif; }
.plain { font-size: 10.3pt; line-height: 1.5; }
.steps-note { font-size: 9.7pt; color: var(--soft); margin-top: 0.8mm; }
.imla { font-size: 10.3pt; line-height: 1.55; }
.imla .rows { display: grid; grid-template-columns: auto 1fr; gap: 1mm 2.5mm; margin-top: 1mm; align-items: baseline; }
.imla .big { font: 700 21.8pt/1 Naskh, serif; text-align: center; }
.imla .words { font: 700 14.2pt Naskh, serif; }
.wrong { color: var(--pen); text-decoration: line-through; text-decoration-thickness: 0.35mm; }
.right { color: var(--c1); font-weight: 700; }
ol.steps { list-style: none; counter-reset: s; font-size: 10.1pt; line-height: 1.5; margin-top: 1mm; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 5mm 1fr; }
ol.steps li::before { content: counter(s, arabic-indic); font-weight: 700; color: var(--pen); }

.foot {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10mm;
  padding: 2.5mm 12mm; background: var(--foot); color: #fff; font-size: 12pt;
}
.foot .who { display: flex; align-items: center; gap: 3.5mm; }
.foot .who img { width: 14mm; height: 14mm; background: #fff; border-radius: 2.5mm; padding: 1.2mm; }
.foot .who b { display: block; font: 700 24pt/1 Ruqaa, serif; color: var(--band-accent); }
.foot .who span { font-size: 11pt; opacity: 0.85; }
.foot .wish { font: 700 19pt Ruqaa, serif; color: #fff; text-align: center; }
.foot .reach { list-style: none; display: grid; gap: 0.6mm; font-size: 11pt; line-height: 1.4; }
.foot .reach li { display: flex; align-items: center; gap: 2.5mm; }
.foot .reach .ico { width: 5.5mm; height: 5.5mm; color: var(--band-accent); }
.foot .reach .support { color: var(--band-accent); font-weight: 600; }
.foot .reach bdi { font-family: PlexLatin, Plex, sans-serif; font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.foot .qr { display: flex; align-items: center; gap: 3mm; }
.foot .qr img { width: 21mm; height: 21mm; background: #fff; padding: 1.6mm; border-radius: 2mm; }
.foot .qr span { font-size: 10.5pt; line-height: 1.45; max-width: 34mm; }

@media print {
  @page { size: 594mm 420mm; margin: 0; }
  html, body { background: #fff; }
  .bar, .end { display: none; }
  .frame .poster { box-shadow: none; }
  .stage { padding: 0; overflow: visible; }
  .frame { transform: none !important; width: auto !important; height: auto !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
