/* Reading comfort (17 Nov 2026): text size, the «تابع القراءة» card, and the night theme (an option; the switch
   is shown to readers only after the owner approved it). Scripts: prefs.js (in <head>) and reading-prefs.js. */

/* Text size: html[data-text-size] -1..3 enlarges the article text only (the page layout stays as it is). */
html[data-text-size="-1"] .public-archive main .prose { zoom:.9; }
html[data-text-size="1"] .public-archive main .prose { zoom:1.12; }
html[data-text-size="2"] .public-archive main .prose { zoom:1.25; }
html[data-text-size="3"] .public-archive main .prose { zoom:1.4; }

/* The «أ− / أ+» buttons, in the article tools (same look as their neighbours). */
.public-archive .text-size-tool { display:inline-flex; align-items:stretch; gap:0; }
.public-archive .article-tools .text-size-tool button { gap:.1rem; min-inline-size:2.6rem; justify-content:center; font-weight:600; line-height:1; }
.public-archive .article-tools .text-size-tool button + button { border-inline-start:0; }
.public-archive .text-size-letter { font-size:1.05rem; line-height:1; }
.public-archive .text-size-letter.is-small { font-size:.82rem; }
.public-archive .article-tools .text-size-tool button[disabled] { opacity:.45; cursor:default; }

/* «تابع القراءة» on the home page: small, the same in a browser tab and in the app. */
.public-archive .ila-continue-card { display:flex; align-items:center; gap:.75rem; box-sizing:border-box; inline-size:min(72rem,calc(100% - 2rem)); margin:1rem auto 0; padding:.7rem .9rem; border:1px solid var(--line,#dde4de); border-radius:10px; background:#fff; color:#293733; box-shadow:0 2px 10px rgba(25,45,52,.06); }
.public-archive .ila-continue-card[hidden] { display:none !important; }
.public-archive .ila-continue-icon { flex:none; inline-size:1.6rem; block-size:1.6rem; fill:#f4ebe1; stroke:#B57C59; stroke-width:1.6; stroke-linejoin:round; }
.public-archive .ila-continue-text { flex:1 1 auto; min-inline-size:0; }
.public-archive .ila-continue-card p { margin:0; }
.public-archive .ila-continue-kicker { font-size:.8rem; font-weight:600; color:#78603d; }
.public-archive .ila-continue-link { display:block; color:#1D4D50; font-weight:600; line-height:1.45; text-decoration:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.public-archive .ila-continue-link:is(:hover,:focus-visible) { text-decoration:underline; }
.public-archive .ila-continue-progress { font-size:.8rem; color:#596861; }
.public-archive .ila-continue-close { flex:none; display:inline-flex; align-items:center; justify-content:center; inline-size:2.2rem; block-size:2.2rem; border:0; border-radius:999px; background:transparent; color:#596861; cursor:pointer; }
.public-archive .ila-continue-close svg { inline-size:1.15rem; block-size:1.15rem; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.public-archive .ila-continue-close:is(:hover,:focus-visible) { background:#f1f4f2; color:#1D4D50; }
html.is-app .public-archive .ila-continue-card { inline-size:calc(100% - 1.6rem); margin-block-start:.9rem; border-radius:14px; }

/* Night theme (html[data-theme="dark"]): an option the reader turns on; off by default. The site's own colour
   variables are swapped for a dark palette (deep teal-grey paper, light ink, brighter teal and copper), then the
   few places with fixed light colours are covered below. Pictures are only dimmed a little. */
html[data-theme="dark"] { color-scheme:dark; background:#0f1716; }
html[data-theme="dark"] body.public-archive { background:#0f1716; color:#e2e9e5; }
html[data-theme="dark"] .public-archive {
  --paper:#0f1716; --sheet:#16201e; --ivory:#16201e; --ink:#e2e9e5; --ink-soft:#a9b7b0;
  --slate:#9ccbbd; --slate-soft:#9ccbbd; --clay:#d8b682; --clay-deep:#e6cb9a; --copper:#d8b682; --bronze:#d8b682;
  --petrol:#9ccbbd; --petrol-deep:#dcebe5; --accent-wash:#1a2724; --sage-wash:#15211e; --clay-wash:#29231a;
  --object-wash:#1b2321; --catalog-wash:#172326; --mist:#172326; --stone:#9ba7a2; --unproven:#9ba7a2;
  --demo:#ddb56c; --possible:#ddb56c; --line:#283632; --line-strong:#3c4e48; --control-line:#73877f;
  --on-petrol-soft:#dce8e2; --petrol-line:#668a7e; --confirmed:#86d3a6; --support:#86d3a6; --oppose:#f29191;
  --context:#9ccbbd; --navy:#e2e9e5; --brand-emblem-ink:#9ccbbd; --brand-emblem-disc:#d8b682;
  background:var(--paper); color:var(--ink);
}
html[data-theme="dark"] .public-archive main img:not([src$=".svg"]) { filter:brightness(.9) contrast(1.02); }
/* Night theme: surfaces with fixed light colours (found by scanning every page type at phone size). */
html[data-theme="dark"] .public-archive :is(.mast, .mast-top) { background:#131d1b; border-color:var(--line-strong); }
html[data-theme="dark"] .public-archive :is(.mast-shortcuts, .mast-nav) { background:#16231f !important; border-color:var(--line); }
html[data-theme="dark"] .public-archive :is(.nav-panel, .mast-menu > nav, .language-switch > nav, .language-switch summary, .mast-menu summary, .article-share-menu, .term-dialog) { background:#1a2623 !important; color:var(--ink); border-color:var(--line-strong); }
html[data-theme="dark"] .public-archive :is(.nav-panel a, .nav-overview a, .language-switch nav a, .mast-menu nav a) { background:transparent !important; color:var(--ink) !important; }
html[data-theme="dark"] .public-archive :is(.language-switch nav a[aria-current], .nav-panel a:hover, .mast-menu nav a:hover) { background:#22322e !important; }
html[data-theme="dark"] .public-archive .nav-overview strong { color:#e6cb9a !important; }
html[data-theme="dark"] .public-archive .app-pill { background:#1a2623; color:#9ccbbd; }
html[data-theme="dark"] .public-archive .app-install-btn { background:#2d2519; color:#e6cb9a; }
html[data-theme="dark"] .public-archive :is(input, select, textarea) { background:#1a2623 !important; color:var(--ink) !important; border-color:var(--line-strong) !important; }
html[data-theme="dark"] .public-archive :is(input, textarea)::placeholder { color:#8d9c96; }
html[data-theme="dark"] .public-archive .skip { background:#1D4D50; color:#fff; }
html[data-theme="dark"] .public-archive :is(.subject-card, .subject-mini-card, .collection-card, .collection-link, .editorial-lead, .home-search, .discovery-search, .card-visual-info, .auto-image-info, .article-introduction, .related-reading-card, .w-card, .glossary-picture, .journey-grid a, .home-feature-image a, .article-cover a, .ila-continue-card, .ila-offline-card:not(html.is-app *)) { background:#16201e !important; border-color:var(--line) !important; color:var(--ink); }
html[data-theme="dark"] .public-archive :is(.card-visual, .card-visual-label, .collection-picture, .collection-picture span, .related-reading-picture, .catalog-image--original) { background:#1b2522 !important; color:var(--ink) !important; }
html[data-theme="dark"] .public-archive .read-progress { background:#2a3834; }
html[data-theme="dark"] .public-archive .time-bar { background:#3c5a52 !important; }
html[data-theme="dark"] .public-archive :is(.term-reference, .term-link) { background:#1f2d29 !important; }
/* Text with fixed dark colours. */
html[data-theme="dark"] .public-archive :is(h1, h2, h3, h4, .w-title) { color:var(--petrol-deep) !important; }
html[data-theme="dark"] .public-archive :is(.auto-meta, .auto-meta *, .reading-publication, .reading-publication *, .home-eyebrow, .home-method, .subject-count, .subject-count *, .discovery-intro p, .auto-section-heading p, .gateway-subject-filter label, .home-welcome p, .ila-continue-progress, .ila-offline-card-size) { color:#aebcb5 !important; }
html[data-theme="dark"] .public-archive :is(.auto-section-heading a, .ila-continue-link) { color:#9ccbbd !important; }
html[data-theme="dark"] .public-archive :is(.journey-number, .ila-continue-kicker, .kicker) { color:#d8b682 !important; }
/* Buttons that sit on the site teal. */
html[data-theme="dark"] .public-archive :is(a.button, .article-neighbor, .advanced-actions button, .collection-toolbar button, button.quiet, .pwa-button, .ila-offline-card-go) { background:#24504f !important; color:#f2f6f4 !important; border-color:#3e6e6b !important; }
html[data-theme="dark"] .public-archive :is(.subject-card-copy small, .collection-count, .subject-mini-card span, .subject-mini-card small, .home-image-kind, .discovery-search label, .card-visual-label) { color:#aebcb5 !important; }
html[data-theme="dark"] .public-archive :is(.card-visual-info a, .card-visual-info summary, .discovery-search a, .home-search a) { color:#9ccbbd !important; }
html[data-theme="dark"] .public-archive .mast-shortcuts :is(a, button):not(.mast-live, .app-pill, .app-install-btn) { color:#d3e2dc !important; }
html[data-theme="dark"] .public-archive .mast-live { color:#ff9b8e !important; }
/* The night switch in the ☰ menu (shown once the owner approved it). */
.public-archive .nav-app-list button.nav-root { inline-size:100%; border:0; background:transparent; font:inherit; color:inherit; text-align:start; cursor:pointer; }
.public-archive [data-theme-toggle] .theme-state { margin-inline-start:auto; font-size:.8rem; color:var(--ink-soft); }
.public-archive [data-theme-toggle][aria-pressed="true"] .theme-off, .public-archive [data-theme-toggle][aria-pressed="false"] .theme-on { display:none; }
html[data-theme="dark"] .public-archive .mast::before { background:#131d1b; }
html[data-theme="dark"] .public-archive .mast-shortcuts :is(a, button):is([aria-current], .is-current, :hover) { background:#22322e !important; }
html[data-theme="dark"] .public-archive :is(.glossary-search button, .place-index button, .prose form button, .push-buttons .pwa-button, .ila-offline-buttons .pwa-button) { background:#24504f !important; color:#f2f6f4 !important; border-color:#3e6e6b !important; }
html[data-theme="dark"] .public-archive :is(.article-cover img, .catalog-image--original) { background:#1b2522 !important; }
html[data-theme="dark"] .public-archive :is(.push-status p, .ila-offline-status p) { color:#9ccbbd !important; }
html[data-theme="dark"] .public-archive :is([data-push-msg="denied"], [data-push-msg="error"], [data-push-msg="topic"], [data-push-msg="unsupported"], [data-push-msg="unavailable"], [data-offline-msg="space"], [data-offline-msg="error"], [data-offline-msg="pick"], [data-offline-msg="unsupported"], [data-offline-msg="notready"], [data-offline-msg="needonline"]) { color:#f0b48a !important; }
html[data-theme="dark"] .public-archive .live-badge .live-dot { background:#ff9b8e; }
