/*tvfb2*//*tvfb*//* Ayyuha al-Walad — one page, the house modes of the Quduri / Tuhfa pages (Kort, Lysbilder, Bok) under the book's
   table of contents. One Arabic face everywhere: Amiri (--font-ar), as in al-Quduri and al-Tuhfa. */
#aw-toc [lang="ar"], #aw-toc .ar { font-family: var(--font-ar); }

/* ---------- table of contents (always open) ---------- */
.aw-fihris { margin: 1.2rem 0 1.4rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.aw-fihris-g + .aw-fihris-g { margin-top: .8rem; }
.aw-fihris-gh { display: flex; justify-content: space-between; align-items: baseline; grid-gap: 1rem; gap: 1rem; margin: .2rem 0 .3rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.aw-fihris-gh .ar { order: 2; color: var(--accent); font-weight: 700; font-size: 1.15rem; }
.aw-fihris-gh .no { order: 1; color: var(--muted); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.aw-fihris-list { list-style: none; margin: 0; padding: 0; columns: 2 22rem; grid-column-gap: 1.6rem; column-gap: 1.6rem; }
.aw-fihris-list li { break-inside: avoid; }
.aw-fihris-list a { display: grid; grid-template-columns: auto 1fr 2rem; align-items: center; grid-gap: .6rem; gap: .6rem; padding: .32rem .4rem; border-radius: 8px; color: inherit; text-decoration: none; }
.aw-fihris-list a:hover, .aw-fihris-list a[aria-current="true"] { background: var(--accent-soft); }
.aw-fihris-list .no { grid-column: 1; grid-row: 1; color: var(--muted); font-size: .78rem; white-space: nowrap; font-variant-numeric: lining-nums; }
.aw-fihris-list .ar { grid-column: 2; grid-row: 1; text-align: right; font-size: 1.08rem; line-height: 1.6; }
.aw-fihris-list .aw-rosette, .aw-fihris-list .aw-dot { grid-column: 3; grid-row: 1; justify-self: end; }
.aw-fihris-list .is-pending a { opacity: .55; cursor: default; }
.aw-dot { width: .55rem; height: .55rem; -webkit-margin-start: .7rem; -webkit-margin-end: .7rem; margin-inline: .7rem; border-radius: 50%; background: var(--gold, #c8962e); }

/* ---------- the badge «أيها الولد..» with the advice number (like the printed copy), the old title faded under it ---------- */
.aw-nida-wrap { display: flex; flex-direction: column; align-items: flex-end; margin: .3rem 0 .6rem; }
.aw-nida { display: flex; align-items: center; grid-gap: .55rem; gap: .55rem; padding: .25rem .35rem .25rem 1.1rem;
  border: 1.5px solid var(--gold, #c8962e); border-radius: 999px; background: var(--surface, #fffdf8); box-shadow: var(--shadow); }
.aw-rosette { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  font-family: var(--font-ar); font-weight: 700; font-size: 1.15rem; line-height: 1; color: var(--on-accent, #fff);
  background: radial-gradient(circle, var(--accent, #0f5a43) 0 58%, transparent 59%),
    repeating-conic-gradient(var(--gold, #c8962e) 0 10deg, var(--gold-l, #e6c378) 10deg 20deg);
  border: 2px solid var(--gold, #c8962e); }
.aw-rosette.sm { width: 1.9rem; height: 1.9rem; font-size: .9rem; border-width: 1.5px; }
.aw-nida-t { font-family: var(--font-ar); font-weight: 700; font-size: 1.3rem; color: var(--accent); }
.aw-nida-sub { margin: .2rem .8rem 0 0; font-family: var(--font-ar); font-size: .88rem; color: var(--muted); opacity: .75; text-align: right; }
.aw-unit-t { margin: .2rem 0 .6rem; text-align: center; color: var(--accent); font-family: var(--font-ar); font-weight: 700; font-size: 1.25rem; }

/* ---------- text ---------- */
.aw-md p { margin: .2rem 0 .7rem; font-size: 1.15rem; line-height: 2.1; text-align: justify; overflow-wrap: break-word; }
.aw-md .aw-h { margin: 1rem 0 .4rem; color: var(--accent); font-family: var(--font-ar); }
.aw-md h3.aw-h2 { font-size: 1.3rem; }
.aw-md h4.aw-h3 { font-size: 1.15rem; }
.aw-md .aw-list { margin: .2rem 0 .8rem; -webkit-padding-start: 1.4rem; padding-inline-start: 1.4rem; font-size: 1.12rem; line-height: 2; }
.aw-md blockquote { margin: .6rem 0; padding: .1rem 1rem; border-right: 3px solid var(--gold, #c8962e); border-inline-start: 3px solid var(--gold, #c8962e); background: var(--accent-soft); border-radius: 6px; }
.aw-matn-p { margin: .2rem 0 .8rem; font-family: var(--font-ar); font-size: var(--qd-ar, 1.35rem); line-height: 2.15; text-align: justify; overflow-wrap: break-word; }
.aw-no { margin: -.3rem 0 .9rem; color: var(--muted); font-size: .98rem; line-height: 1.6; }
.aw-pending { padding: .9rem 0; text-align: center; }
.aw-pending-t, .aw-load, .aw-err { margin: .6rem 0; text-align: center; color: var(--muted); }

/* ---------- Kort ---------- */
.aw-cards-g + .aw-cards-g { margin-top: 1.6rem; }
.aw-gh { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 .7rem; font-size: 1rem; }
.aw-gh .ar { order: 2; color: var(--accent); font-size: 1.25rem; }
.aw-gh .no { order: 1; color: var(--muted); font-weight: 500; font-size: .85rem; }
.aw-card .ap-card-top { justify-content: space-between; }
.aw-card-t { margin: .35rem 0 .2rem; text-align: right; color: var(--accent); font-weight: 700; font-size: 1.12rem; line-height: 1.6; }
.aw-card.is-pending { opacity: .55; cursor: default; }
.aw-panel { padding-top: .6rem; }

/* ---------- Lysbilder ---------- */
.aw-slide-body { text-align: right; }
.aw-slide-p { line-height: 2.1; }
.aw-slide-md p { font-size: 1.25rem; }

/* ---------- Bok ---------- */
.aw-book-gh { margin-top: 1.4rem; }
.aw-sec { scroll-margin-top: 5rem; }
.aw-nasiha { padding-top: .6rem; }

@media (max-width: 600px) {
  .aw-fihris { padding: .8rem .7rem; }
  .aw-md p, .aw-md .aw-list { font-size: 1.07rem; }
  .aw-matn-p { font-size: 1.18rem; }
}

/* cards: the Arabic title leads, the Norwegian label stays small */
.aw-card .ap-card-title { font-size: .85rem; font-weight: 500; color: var(--muted); }
.aw-card-t { font-size: 1.3rem; }
.aw-read .ap-read-title { grid-gap: .6rem; gap: .6rem; align-items: center; }
/* slides: the badge sits centred above the paragraph */
.aw-slide-body .aw-nida-wrap { align-items: center; margin-bottom: 1rem; }

/* the contents run right to left, also across the two columns on wide screens */
.aw-fihris-list { direction: rtl; }
.aw-fihris-list a { grid-template-columns: 2rem 1fr auto; }
.aw-fihris-list .aw-rosette, .aw-fihris-list .aw-dot { grid-column: 1; justify-self: center; }
.aw-fihris-list .ar { grid-column: 2; text-align: start; }
.aw-fihris-list .no { grid-column: 3; direction: ltr; }

/* card head: the Norwegian label on the left (read left to right), the Arabic number on the right */
.aw-card .ap-card-top { flex-direction: row-reverse; }
.aw-card .ap-card-title { direction: ltr; text-align: left; }
.aw-gh { direction: ltr; }

/* ---------- the sharh box under each advice (00-1500), on the model of the Quduri reader's folded margin ----------
   One quiet button «الشرح · Forklaring» (Arabic right, Norwegian left), folded; the box opens in place under it. */
.aws-wrap { margin: 1rem 0 .4rem; }
.aws-btn { appearance: none; display: flex; align-items: center; grid-gap: .55rem; gap: .55rem; width: 100%; min-height: 44px; margin: 0;
  padding: .45rem .9rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font: inherit; color: var(--accent);
  background: var(--surface); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); transition: background .15s, border-color .15s; }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .aws-btn { background: var(--surface); } }
.aws-btn:hover { background: var(--accent-soft); border-color: var(--border); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .aws-btn:hover { border-color: var(--border); } }
.aws-btn:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.aws-btn-no { order: 1; font-size: .86rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.aws-btn-sep { order: 2; color: var(--gold, #c8962e); }
.aws-btn-ar { order: 3; font-family: var(--font-ar); font-weight: 700; font-size: 1.15rem; line-height: 1.5; }
.aws-chev { order: 4; -webkit-margin-start: auto; margin-inline-start: auto; width: .55rem; height: .55rem; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.aws-wrap.open .aws-btn { border-radius: 12px 12px 0 0; border-bottom-color: transparent; background: var(--accent-soft); }
.aws-wrap.open .aws-chev { transform: translateY(2px) rotate(-135deg); }
.aws-box { padding: .8rem 1rem 1rem; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 12px 12px; background: var(--surface); }
.aws-box[hidden] { display: none; }

/* level tabs: Arabic name over a small Norwegian one */
.aws-tabs { display: flex; flex-wrap: wrap; grid-gap: 4px; gap: 4px; margin: 0 0 .7rem; padding: 3px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .aws-tabs { background: var(--surface); } }
.aws-tabs button { appearance: none; flex: 1 1 0; min-width: 4.6rem; min-height: 44px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; grid-gap: 1px; gap: 1px; padding: 5px 6px; border: 1px solid transparent; border-radius: 11px; background: transparent;
  color: var(--muted); font: inherit; cursor: pointer; }
.aws-tabs button:hover { color: var(--ink); }
.aws-tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.aws-tabs button:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 1px; }
.aws-tab-ar { font-family: var(--font-ar); font-weight: 700; font-size: 1.02rem; line-height: 1.4; }
.aws-tab-no { font-size: .7rem; line-height: 1.2; opacity: .85; }
.aws-tools { display: flex; flex-direction: column; align-items: center; grid-gap: .55rem; gap: .55rem; margin: 0 0 .8rem; }
.aws-tools .vm-switch { max-width: 34rem; }

/* the text: a source paragraph stays a paragraph, a verse stays verse (its own lines, centred) */
.aws-panel { font-size: 1rem; }
.aws-part { margin: .9rem 0 .3rem; font-family: var(--font-ar); font-size: .9rem; color: var(--gold, #c8962e); text-align: center; }
.aws-part::before, .aws-part::after { content: "—"; margin: 0 .5em; opacity: .6; }
.aws-panel .aws-part:first-child { margin-top: 0; }
.aws-p { margin: .2rem 0 .75rem; font-family: var(--font-ar); font-size: 1.2rem; line-height: 2.1; text-align: justify; overflow-wrap: break-word; color: var(--ink); }
.aws-verse { margin: .4rem auto .9rem; max-width: 36rem; padding: .5rem .9rem; white-space: pre-line; text-align: center;
  font-family: var(--font-ar); font-size: 1.22rem; line-height: 2.1; color: var(--accent);
  border-right: 3px solid var(--gold, #c8962e); border-inline-start: 3px solid var(--gold, #c8962e); background: transparent; background: color-mix(in srgb, var(--gold, #c8962e) 7%, transparent); border-radius: 6px; }
.aws-p-no, .aws-verse-no { margin: .2rem 0 .8rem; font-size: 1rem; line-height: 1.65; color: var(--ink); text-align: left; }
.aws-verse-no { white-space: pre-line; font-style: italic; padding-left: .9rem; border-left: 2px solid var(--gold, #c8962e); }
/* lines: the Norwegian right under its paragraph, quieter */
.aws-lines .aws-p-no, .aws-lines .aws-verse-no { margin-top: -.35rem; color: var(--muted); font-size: .96rem; }
.aws-lines .aws-p-no { padding-left: .8rem; border-left: 3px solid var(--accent-soft); }
.aws-block .aws-no { margin-top: .6rem; padding-top: .9rem; border-top: 1px solid var(--border); }

/* slides: the box scrolls inside the slide */
.qd-slide .aws-wrap { margin-top: .6rem; }
.qd-slide .aws-box { max-height: 60vh; overflow: auto; overscroll-behavior: contain; text-align: start; }

@media (max-width: 600px) {
  .aws-box { padding: .7rem .6rem .8rem; }
  .aws-btn { padding: .4rem .7rem; }
  .aws-tabs button { min-width: 0; padding: 5px 2px; }
  /* four levels do not fit in one row on a phone («Grunnleggende» was cut): two rows of two */
  .aws-tabs:has(> button:nth-child(4)) button { flex: 1 1 calc(50% - 2px); }
  .aws-p { font-size: 1.1rem; }
  .aws-verse { font-size: 1.1rem; padding: .4rem .5rem; }
}
@media print { .aws-btn { display: none; } .aws-wrap:not(.open) { display: none; } }
/* the button: Norwegian at the left edge (after the chevron), Arabic at the right edge */
.aws-chev { order: 0; -webkit-margin-start: .15rem; margin-inline-start: .15rem; }
.aws-btn-sep { display: none; }
.aws-btn-ar { margin-left: auto; }

/* tvfb: flex gap fallback (html.no-flexgap set by compat.js) */
.no-flexgap .aw-fihris-gh > * + * { -webkit-margin-start: 1rem; }
.no-flexgap .aw-nida > * + * { -webkit-margin-start: .55rem; }
.no-flexgap .aws-btn > * + * { -webkit-margin-start: .55rem; }
.no-flexgap /* level tabs: Arabic name over a small Norwegian one */
.aws-tabs > * + * { -webkit-margin-start: 4px; }
.no-flexgap /* level tabs: Arabic name over a small Norwegian one */
.aws-tabs > * { margin-bottom: 4px; }
.no-flexgap .aws-tabs button > * + * { margin-top: 1px; }
.no-flexgap .aws-tools > * + * { margin-top: .55rem; }
