/* الحصن : thème commun à toutes les pages (couleurs, polices, barre de navigation) */
@import url("https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Noto+Naskh+Arabic:wght@400;600&family=Noto+Sans+Arabic:wght@400;600;700&display=swap");

html:root{
  --h-bg:#f4f6f5; --h-surface:#ffffff; --h-ink:#18221d; --h-muted:#5f6c65; --h-line:#d8dfdb;
  --h-accent:#1f5b4a; --h-soft:#e3eee9; --h-gold:#a27a1f; --h-gold-soft:#f6efdc;
  --h-display:"Amiri","Noto Naskh Arabic",serif; --h-body:"Noto Naskh Arabic","Amiri",serif; --h-ui:"Noto Sans Arabic",system-ui,sans-serif;
}
/* correspondances vers les variables de chaque application (specificite forte pour passer devant leurs blocs sombres) */
html:root:not(#hisn-x){
  /* plateforme Coran */
  --bg:var(--h-bg); --surface:var(--h-surface); --fg:var(--h-ink); --muted:var(--h-muted); --line:var(--h-line);
  --accent:var(--h-accent); --accent-soft:var(--h-soft); --display:var(--h-display); --body:var(--h-body);
  --paper:var(--h-surface); --panel:var(--h-surface); --ink:var(--h-ink); --rule:var(--h-line);
  /* agenda et عمل اليوم والليلة */
  --gold:var(--h-gold); --gold-soft:var(--h-gold-soft);
  --f-display:var(--h-display); --f-body:var(--h-body); --f-ui:var(--h-ui);
}
@media (prefers-color-scheme: dark){
  html:root:not([data-theme="light"]){
    --h-bg:#101613; --h-surface:#17201b; --h-ink:#e3eae6; --h-muted:#97a69e; --h-line:#28332d;
    --h-accent:#7cc4a8; --h-soft:#1c2f28; --h-gold:#d8b45e; --h-gold-soft:#2b2617; color-scheme:dark;
  }
}
html:root[data-theme="dark"]{
  --h-bg:#101613; --h-surface:#17201b; --h-ink:#e3eae6; --h-muted:#97a69e; --h-line:#28332d;
  --h-accent:#7cc4a8; --h-soft:#1c2f28; --h-gold:#d8b45e; --h-gold-soft:#2b2617; color-scheme:dark;
}
/* chercheur de hadiths : son --paper est le fond de page */
html[data-hisn="hadith"]:root:not(#hisn-x){--paper:var(--h-bg); --panel:var(--h-surface)}
html body{background:var(--h-bg);color:var(--h-ink)}

/* barre commune */
.hisn-bar{position:relative;z-index:50;background:var(--h-surface);border-bottom:1px solid var(--h-line);direction:rtl;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.hisn-bar .in{max-width:1100px;margin:0 auto;display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding-block:8px}
.hisn-home{display:inline-flex;align-items:center;gap:8px;text-decoration:none;color:var(--h-accent);border:1px solid var(--h-line);
  border-radius:999px;padding:3px 14px 3px 4px;background:var(--h-bg);font:700 18px/1.4 var(--h-display)}
.hisn-home:hover,.hisn-home:focus-visible{border-color:var(--h-accent);outline:none}
.hisn-home svg{width:30px;height:30px;display:block;border-radius:8px}
.hisn-nav{display:flex;gap:4px;flex-wrap:wrap;margin-inline-start:auto;font:600 14px/1.5 var(--h-ui)}
.hisn-nav a{color:var(--h-muted);text-decoration:none;padding:5px 12px;border-radius:8px}
.hisn-nav a:hover,.hisn-nav a:focus-visible{color:var(--h-accent);background:var(--h-soft);outline:none}
.hisn-nav a[aria-current="page"]{color:var(--h-surface);background:var(--h-accent)}
@media (max-width:640px){.hisn-nav{margin-inline-start:0;width:100%;overflow-x:auto;flex-wrap:nowrap}.hisn-nav a{white-space:nowrap}}

/* compteur en pied de page */
#hisnCount{font:13px var(--h-ui)!important;color:var(--h-muted)!important;text-align:center;padding:16px!important;border-top:1px solid var(--h-line);margin-top:24px}

/* bandeau الحصن toujours visible (06/11/2026) : collé en haut, sur une seule ligne ; l'en-tête de la plateforme Coran passe dessous */
.hisn-bar{position:sticky;top:0}
.hisn-bar .in{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
.hisn-bar .in::-webkit-scrollbar{display:none}
.hisn-home,.hisn-nav a{flex-shrink:0;white-space:nowrap}
.hisn-nav{flex-wrap:nowrap}
body:has(> .hisn-bar) header.top{top:var(--hisn-bar-h,54px)!important}

/* 06/11/2026 : bandeau collé en haut et sur toute la largeur sur toutes les pages (plus d'espace au-dessus, comme sur l'accueil) */
html[data-hisn="hadith"] body{margin:0!important;padding-top:0!important}
html[data-hisn="hadith"] .hisn-bar{margin-bottom:24px}
html[data-hisn="hadith"] .hisn-bar,html[data-hisn="amal"] .hisn-bar,html[data-hisn="madhakira"] .hisn-bar{margin-inline:-16px}

/* plateforme Coran : les bases sur une seule ligne */
html[data-hisn="quran"] .bases{grid-template-columns:none!important;grid-auto-flow:column!important;grid-auto-columns:minmax(0,1fr)!important;gap:10px!important}
@media (max-width:900px){html[data-hisn="quran"] .bases{grid-auto-columns:minmax(150px,1fr)!important;overflow-x:auto;padding-bottom:6px}}
/* plateforme Coran : titre retire de la barre des onglets (il est repris juste en dessous) */
html[data-hisn="quran"] header.top a.brand{display:none!important}
