/* The site as an app: footer entry, the /app help page, and the offline page (which loads only this file). */

/* Footer: a quiet link to /app, and the install button the browser makes possible (shown by pwa.js). */
.public-archive .footer-app { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem .9rem; margin:.9rem 0 0; font-size:.9rem; }
.public-archive .footer-app a { text-decoration:underline; text-underline-offset:.2em; }
.public-archive .pwa-install { font:inherit; font-size:.85rem; padding:.3rem .8rem; border:1px solid #668a7e; border-radius:999px; background:transparent; color:#f7f8f7; cursor:pointer; }
.public-archive .pwa-install:hover, .public-archive .pwa-install:focus-visible { border-color:#d6bd94; color:#d6bd94; }
.pwa-install[hidden], .pwa-button[hidden] { display:none !important; }
html.is-app .public-archive .footer-app { display:none; }

/* /app help page */
.pwa-help-head { display:flex; align-items:center; gap:1.1rem; }
.pwa-help-head h1 { margin:0; }
.pwa-help-head .kicker { margin:0 0 .2rem; }
.pwa-help-icon { width:5rem; height:5rem; border-radius:1.2rem; border:1px solid var(--line, #dde4de); box-shadow:0 2px 10px rgba(25,45,52,.08); flex:none; }
.pwa-help-lead { color:var(--petrol-deep, #263e37); }
.pwa-steps { padding-inline-start:1.4rem; }
.pwa-steps li { margin:.35rem 0; }
.pwa-button { font:inherit; font-weight:600; padding:.6rem 1.3rem; border:0; border-radius:999px; background:#1D4D50; color:#fff; cursor:pointer; }
.pwa-button:hover, .pwa-button:focus-visible { background:#263e37; }
.pwa-help-install { margin:1.2rem 0; }

/* Offline page (standalone: no other stylesheet is loaded there). */
.pwa-offline-page { margin:0; min-height:100vh; background:#F7F8F7; color:#293733;
  font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height:1.7; }
.pwa-offline { box-sizing:border-box; max-width:36rem; margin:0 auto; padding:3rem 1.25rem 4rem; text-align:start; }
.pwa-offline-logo { display:block; width:4.5rem; height:auto; margin:0 0 1.2rem; }
.pwa-offline-name { margin:0; color:#78603d; font-weight:600; letter-spacing:.02em; }
.pwa-offline h1 { margin:.2rem 0 .6rem; font-size:1.6rem; line-height:1.4; color:#263e37; font-weight:600; }
.pwa-offline h2 { margin:2rem 0 .5rem; font-size:1.05rem; color:#263e37; font-weight:600; }
.pwa-offline-list { margin:0; padding:0; list-style:none; border-top:1px solid #dde4de; }
.pwa-offline-list li { border-bottom:1px solid #dde4de; }
.pwa-offline-list a { display:block; padding:.65rem .1rem; color:#1D4D50; text-decoration:none; }
.pwa-offline-list a:hover, .pwa-offline-list a:focus-visible { text-decoration:underline; }
.pwa-offline-empty { color:#596861; }
.pwa-offline [hidden] { display:none !important; }

/* Font faces for the offline page only (the site's own pages get them from site.css). */
@font-face { font-family:"IBM Plex Sans Arabic"; font-weight:400; font-display:swap; src:url("/static/fonts/plex-arabic-400.woff2") format("woff2"); unicode-range:U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family:"IBM Plex Sans Arabic"; font-weight:400; font-display:swap; src:url("/static/fonts/plex-latin-400.woff2") format("woff2"); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family:"IBM Plex Sans Arabic"; font-weight:600; font-display:swap; src:url("/static/fonts/plex-arabic-600.woff2") format("woff2"); unicode-range:U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family:"IBM Plex Sans Arabic"; font-weight:600; font-display:swap; src:url("/static/fonts/plex-latin-600.woff2") format("woff2"); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122; }

/* Header «التطبيق / App» pill + «تثبيت / Install» button next to Live (includes/app_pill.html), in the desktop nav
   row and the phone shortcuts row. In a browser tab: phone icon + "App" (link to /<lang>/app), then the small install
   button. In the installed app: bell + "Notifications" (swapped here before the first paint by the display-mode
   query; html.is-app from pwa.js covers iOS), hidden there when notifications are switched off on the server; the
   install button is never shown there. Brand teal #1D4D50 with copper #C89B76. */
.public-archive .app-pill{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;box-sizing:border-box;min-block-size:2.4rem;padding:.2rem .9rem;border:1px solid #C89B76;border-radius:999px;background:#fff;color:#1D4D50;font-size:.94rem;font-weight:600;line-height:1.2;text-decoration:none;white-space:nowrap}
.public-archive .app-pill:is(:hover,:focus-visible){background:#f8f1ea;border-color:#b5835c;color:#163d40}
.public-archive :is(.app-pill,.app-install-btn):focus-visible{outline:2px solid #315f51;outline-offset:2px}
.public-archive .app-pill-icon{display:block;inline-size:1.2rem;block-size:1.2rem;flex:none}
.public-archive .app-pill-bell,.public-archive .app-pill-notify{display:none}
.public-archive :is(.app-pill,.app-install-btn,[data-app-install])[hidden],.public-archive .mast-menu .nav-entry[hidden]{display:none!important}
/* The install button: a compact copper chip, clearly secondary to the pill. */
.public-archive .app-install-btn{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-block-size:1.9rem;padding:.1rem .6rem;border:0;border-radius:999px;background:#f4ebe1;color:#7a4f2e;font-size:.82rem;font-weight:600;line-height:1.2;text-decoration:none;white-space:nowrap;cursor:pointer}
.public-archive .app-install-btn:is(:hover,:focus-visible){background:#ead9c6;color:#5c3a1f}
html.is-app .public-archive .app-pill-phone,html.is-app .public-archive .app-pill-install{display:none}
html.is-app .public-archive .app-pill-bell{display:block}
html.is-app .public-archive .app-pill-notify{display:inline}
html.is-app .public-archive .app-pill[data-push-off]{display:none}
html.is-app .public-archive .app-install-btn{display:none}
html.is-app .public-archive .mast-menu .nav-entry[data-destination="app-install"]{display:none}
@media (display-mode:standalone){
 .public-archive .app-pill-phone,.public-archive .app-pill-install{display:none}
 .public-archive .app-pill-bell{display:block}
 .public-archive .app-pill-notify{display:inline}
 .public-archive .app-pill[data-push-off]{display:none}
 .public-archive .app-install-btn{display:none}
 .public-archive .mast-menu .nav-entry[data-destination="app-install"]{display:none}
}
/* Desktop nav row: the entry keeps the row height (3rem) and centres pill + button; no hover card behind it. */
.public-archive .mast-nav .nav-entry.nav-entry-app{display:flex;align-items:center;gap:.4rem;padding-inline:.2rem}
.public-archive .mast-nav .nav-entry.nav-entry-app:is(:hover,:focus-within){background:transparent;box-shadow:none}
/* Phone shortcuts row (under 900 px): Explore / Articles / Glossary / Live / App icon / «تثبيت» on one line each
   (measured at 360 and 390 px, Arabic, English, German). Slightly smaller type; the three text entries take their
   natural width; the pill and the button never grow. */
.public-archive .mast-shortcuts:has(.app-pill){gap:.1rem;padding-inline:.2rem}
.public-archive .mast-shortcuts:has(.app-pill) :is(a,button){font-size:.8rem;padding-inline:.15rem}
.public-archive .mast-shortcuts:has(.app-pill) :is(a,button):not(.mast-live,.app-pill,.app-install-btn){flex:1 1 auto}
.public-archive .mast-shortcuts:has(.app-pill) .mast-live{padding-inline:.35rem;gap:.3rem}
.public-archive .mast-shortcuts a.app-pill{flex:0 0 auto;align-self:center;min-block-size:2.3rem;padding:.15rem .5rem;gap:.25rem;font-size:.84rem;line-height:1.2;color:#1D4D50;border-radius:999px;background:#fff}
.public-archive .mast-shortcuts a.app-pill:is(:hover,:focus-visible){background:#f8f1ea;color:#163d40}
.public-archive .mast-shortcuts .app-pill-icon{inline-size:1.1rem;block-size:1.1rem}
.public-archive .mast-shortcuts a.app-install-btn{flex:0 0 auto;align-self:center;display:inline-flex;min-block-size:1.9rem;padding:.1rem .3rem;font-size:.74rem;line-height:1.2;color:#7a4f2e;background:#f4ebe1;border-radius:999px;text-align:center}
.public-archive .mast-shortcuts a.app-install-btn:is(:hover,:focus-visible){background:#ead9c6;color:#5c3a1f}
/* On phones (owner, 13 Nov) the pill is the phone icon only, at every width, in a tab and in the installed app (bell);
   the label stays as visually hidden text for screen readers (it is the link's name). «تثبيت» keeps its word. */
.public-archive .mast-shortcuts a.app-pill{padding-inline:.45rem;min-inline-size:2.3rem}
.public-archive .mast-shortcuts .app-pill-label{position:absolute;inline-size:1px;block-size:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
/* Small phones (under 380 px, e.g. 360 px): a little tighter still, so German («Installieren») fits too. */
@media (max-width:379px){
 .public-archive .mast-shortcuts:has(.app-pill){gap:.05rem;padding-inline:.15rem}
 .public-archive .mast-shortcuts:has(.app-pill) :is(a,button){font-size:.76rem;padding-inline:.1rem}
 .public-archive .mast-shortcuts:has(.app-pill) .mast-live{padding-inline:.25rem;gap:.25rem}
 .public-archive .mast-shortcuts a.app-pill{padding-inline:.3rem;min-inline-size:2.1rem;min-block-size:2.1rem}
 .public-archive .mast-shortcuts a.app-install-btn{font-size:.7rem;padding-inline:.25rem}
}
/* ☰ menu: «ثبّت التطبيق» and «التنبيهات» under the sections. */
.public-archive .mast-menu .nav-app-list{margin-block-start:.5rem;border-block-start:2px solid #e8dccd}
.public-archive .mast-menu .nav-app-list .nav-icon{color:#1D4D50}
/* /<lang>/app: the header links land below the sticky header. */
.public-archive .pwa-help :is(#install,#notifications){scroll-margin-top:calc(var(--header, 6rem) + 1rem)}

/* Offline reading (17 Nov 2026). The installed app's top-bar button «تصفّح بدون إنترنت» (base.html, after the
   search): second header row beside the search on phones, between the search and the language menu on wide
   screens; inside the app only, whether notifications are on or not. Once a language is downloaded
   (offline-entry.js sets data-ready) it reads «مكتبتي بدون إنترنت» with a book icon, same colours, and opens the
   offline library. */
.public-archive .app-offline-btn{display:none}
.public-archive .app-offline-btn .app-offline-ready,.public-archive .app-offline-btn[data-ready] .app-offline-get{display:none}
.public-archive .app-offline-btn[data-ready] svg.app-offline-ready{display:block}
.public-archive .app-offline-btn[data-ready] span.app-offline-ready{display:inline}
.public-archive .app-offline-btn svg{inline-size:1.15rem;block-size:1.15rem;flex:none;fill:none;stroke:#E8C7A6;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.public-archive .app-offline-btn:is(:hover,:focus-visible){background:#163d40;color:#fff}
.public-archive .app-offline-btn:focus-visible{outline:2px solid #C89B76;outline-offset:2px}
html.is-app .public-archive .mast-top.has-offline-btn .app-offline-btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;box-sizing:border-box;min-block-size:2.8rem;padding:.3rem .85rem;border-radius:999px;background:#1D4D50;color:#fff;font-size:.82rem;font-weight:600;line-height:1.2;text-decoration:none;white-space:nowrap;box-shadow:0 2px 8px rgba(29,77,80,.22)}
@media (display-mode:standalone){
 .public-archive .mast-top.has-offline-btn .app-offline-btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;box-sizing:border-box;min-block-size:2.8rem;padding:.3rem .85rem;border-radius:999px;background:#1D4D50;color:#fff;font-size:.82rem;font-weight:600;line-height:1.2;text-decoration:none;white-space:nowrap;box-shadow:0 2px 8px rgba(29,77,80,.22)}
}
@media (max-width:899px){
 html.is-app .public-archive .mast-top.has-offline-btn .mast-search{grid-column:1/2}
 html.is-app .public-archive .mast-top.has-offline-btn .app-offline-btn{grid-column:2/4;grid-row:2;justify-self:stretch;margin-block-start:.45rem}
}
@media (max-width:899px) and (display-mode:standalone){
 .public-archive .mast-top.has-offline-btn .mast-search{grid-column:1/2}
 .public-archive .mast-top.has-offline-btn .app-offline-btn{grid-column:2/4;grid-row:2;justify-self:stretch;margin-block-start:.45rem}
}
@media (min-width:900px){
 html.is-app .public-archive .mast-top.has-offline-btn{grid-template-columns:minmax(14rem,1fr) minmax(16rem,28rem) auto auto;gap:1.2rem}
 html.is-app .public-archive .mast-top.has-offline-btn .app-offline-btn{grid-column:3;grid-row:1}
 html.is-app .public-archive .mast-top.has-offline-btn>.language-switch{grid-column:4}
}
@media (min-width:900px) and (display-mode:standalone){
 .public-archive .mast-top.has-offline-btn{grid-template-columns:minmax(14rem,1fr) minmax(16rem,28rem) auto auto;gap:1.2rem}
 .public-archive .mast-top.has-offline-btn .app-offline-btn{grid-column:3;grid-row:1}
 .public-archive .mast-top.has-offline-btn>.language-switch{grid-column:4}
}
/* Home page card «اقرأ الأرشيف بدون إنترنت» (includes/offline_card.html, shown by offline-entry.js): a light strip
   in a browser tab, a real card inside the app. */
.public-archive .ila-offline-card{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1rem;box-sizing:border-box;inline-size:min(72rem,calc(100% - 2rem));margin:1rem auto 0;padding:.75rem 1rem;border:1px solid var(--line,#dde4de);border-inline-start:3px solid #1D4D50;border-radius:6px;background:#fff;color:#293733}
.public-archive .ila-offline-card[hidden]{display:none!important}
.public-archive .ila-offline-card-icon{flex:none;inline-size:1.8rem;block-size:1.8rem;fill:none;stroke:#1D4D50;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.public-archive .ila-offline-card-text{flex:1 1 14rem;min-inline-size:0}
.public-archive .ila-offline-card h2{margin:0;font-size:1rem;line-height:1.45;color:#1D4D50}
.public-archive .ila-offline-card p{margin:.15rem 0 0;font-size:.88rem;line-height:1.6}
.public-archive .ila-offline-card .ila-offline-card-size{color:#596861;font-variant-numeric:tabular-nums}
.public-archive .ila-offline-card .ila-offline-card-buttons{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .6rem;margin:0}
.public-archive .ila-offline-card-go{display:inline-flex;align-items:center;min-block-size:2.4rem;padding:.25rem 1.2rem;border-radius:999px;background:#1D4D50;color:#fff;font-weight:600;text-decoration:none}
.public-archive .ila-offline-card-go:is(:hover,:focus-visible){background:#163d40;color:#fff}
.public-archive .ila-offline-card-later{font:inherit;font-size:.85rem;padding:.35rem .6rem;border:0;background:transparent;color:#596861;cursor:pointer;text-decoration:underline;text-underline-offset:.2em}
html.is-app .public-archive .ila-offline-card{inline-size:calc(100% - 1.6rem);margin:.9rem auto 0;padding:1.05rem 1.1rem;border:0;border-radius:16px;background:linear-gradient(135deg,#1D4D50 0%,#163d40 100%);color:#f7f8f7;box-shadow:0 8px 22px rgba(22,61,64,.28)}
html.is-app .public-archive .ila-offline-card h2{color:#fff;font-size:1.12rem}
html.is-app .public-archive .ila-offline-card-icon{inline-size:2.5rem;block-size:2.5rem;stroke:#E8C7A6}
html.is-app .public-archive .ila-offline-card .ila-offline-card-size{color:#E8C7A6}
html.is-app .public-archive .ila-offline-card-go{background:#C89B76;color:#163d40;min-block-size:2.6rem;padding-inline:1.5rem}
html.is-app .public-archive .ila-offline-card-go:is(:hover,:focus-visible){background:#E8C7A6;color:#163d40}
html.is-app .public-archive .ila-offline-card-later{color:#dfe7e3}
/* Inside the installed app (17 Nov 2026, light native touches; the pages themselves look the same):
   no grey/blue flash on taps, a soft cross-fade between pages (browsers that support it, and only when the reader
   has not asked for less motion), and a thin bar while the next page loads (app-nav.js). */
html.is-app{-webkit-tap-highlight-color:transparent}
@media (display-mode:standalone){html{-webkit-tap-highlight-color:transparent}}
@media (display-mode:standalone) and (prefers-reduced-motion:no-preference){@view-transition{navigation:auto}}
.app-loading{position:fixed;inset-block-start:0;inset-inline:0;z-index:1000;block-size:3px;pointer-events:none;opacity:0;background:linear-gradient(90deg,#1D4D50,#C89B76);transform:scaleX(0);transform-origin:0 50%}
html[dir="rtl"] .app-loading{transform-origin:100% 50%;background:linear-gradient(270deg,#1D4D50,#C89B76)}
.app-loading.is-loading{opacity:1;animation:app-loading 9s cubic-bezier(.08,.6,.2,1) forwards}
@keyframes app-loading{0%{transform:scaleX(0)}12%{transform:scaleX(.45)}100%{transform:scaleX(.92)}}
@media (prefers-reduced-motion:reduce){.app-loading.is-loading{animation:none;transform:scaleX(.6)}}
/* The official profiles as one row of small round icons (includes/social.html; owner, 17 Nov 2026), in the footer
   and on pages that list them, website and app alike. Site colours: teal icon, copper ring; filled copper on hover
   and focus, with a clear outline for the keyboard. Wraps on narrow phones; the row follows the page direction. */
.public-archive .social.social-icons{display:flex;flex-wrap:wrap;align-items:center;gap:.55rem;margin:.9rem 0 0;padding:0;list-style:none}
.public-archive .social.social-icons li{margin:0;padding:0}
.public-archive .social.social-icons a{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;inline-size:2.5rem;block-size:2.5rem;padding:0;border:1px solid #C89B76;border-radius:50%;background:transparent;color:#1D4D50;text-decoration:none;transition:background-color .15s ease,color .15s ease,border-color .15s ease}
.public-archive .social.social-icons svg{inline-size:1.15rem;block-size:1.15rem;flex:none;fill:currentColor}
.public-archive .social.social-icons a:is(:hover,:focus-visible){background:#C89B76;border-color:#C89B76;color:#163d40}
.public-archive .social.social-icons a:focus-visible{outline:2px solid #1D4D50;outline-offset:3px}
.public-archive .site-footer .social.social-icons a{color:#f1f5f2;border-color:rgba(200,155,118,.75)}
.public-archive .site-footer .social.social-icons a:is(:hover,:focus-visible){background:#C89B76;border-color:#C89B76;color:#163d40}
.public-archive .site-footer .social.social-icons a:focus-visible{outline-color:#E8C7A6}
html[data-theme="dark"] .public-archive .social.social-icons a{color:#9ccbbd}
html[data-theme="dark"] .public-archive .site-footer .social.social-icons a{color:#f1f5f2}
@media (prefers-reduced-motion:reduce){.public-archive .social.social-icons a{transition:none}}
/* Phones (the eight icons need ~24rem in one row): two even rows of four, same 40 px targets. */
@media (max-width:29.5rem){.public-archive .social.social-icons{display:grid;grid-template-columns:repeat(4,2.5rem);gap:.7rem 1rem;justify-content:start}}
/* Offline card moved under the opening message of the home page (offline-entry.js, browser tabs only). */
.public-archive .ila-offline-card.is-after-welcome{inline-size:auto;margin:1rem 0 1.4rem}
