/* Khalwati R23 — one header + one footer for every public page. Same palette, Tajawal everywhere. */
@font-face{font-family:'Tajawal';font-style:normal;font-weight:500;font-display:swap;src:url('/khalwati-public-assets/v23/tajawal-arabic-500-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:700;font-display:swap;src:url('/khalwati-public-assets/v23/tajawal-arabic-700-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:800;font-display:swap;src:url('/khalwati-public-assets/v23/tajawal-arabic-800-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFC}

:root{
  --kh23-green:#07583d;--kh23-deep:#073f34;--kh23-gold:#c99a37;--kh23-gold-soft:rgba(201,154,55,.28);
  --kh23-paper:#fffdf8;--kh23-cream:#fbf6e9;--kh23-ink:#23302b;--kh23-muted:#6b7069;
  --kh23-font:'Tajawal',system-ui,-apple-system,'Segoe UI',Tahoma,sans-serif;--kh23-max:1200px;--kh23-h:64px;
}
html body{font-family:var(--kh23-font)}

/* The old drawers/menus belong to the replaced headers. */
html body #drawer,html body .drawer-backdrop{display:none!important}

/* ---------- header ---------- */
html body .kh23-header{
  position:sticky;top:0;z-index:80;margin:0;padding:env(safe-area-inset-top) 0 0;
  background:rgba(251,246,233,.92);-webkit-backdrop-filter:saturate(1.2) blur(14px);backdrop-filter:saturate(1.2) blur(14px);
  border-bottom:1px solid var(--kh23-gold-soft);font-family:var(--kh23-font);direction:rtl;
}
html body .kh23-bar{
  box-sizing:border-box;max-width:var(--kh23-max);height:var(--kh23-h);margin:0 auto;padding:0 16px;
  display:flex;align-items:center;gap:12px;
}
html body .kh23-brand{display:inline-flex;align-items:center;gap:10px;color:var(--kh23-deep);text-decoration:none;flex:0 1 auto;min-width:0}
html body .kh23-brand img{width:40px;height:40px;border-radius:50%;flex:0 0 40px;box-shadow:0 0 0 1px var(--kh23-gold-soft)}
html body .kh23-brand span{font-weight:800;font-size:17px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

html body .kh23-nav{display:flex;align-items:center;gap:2px;margin-inline-start:auto;flex-wrap:nowrap}
html body .kh23-nav a,html body .kh23-panel a{
  position:relative;display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 12px;border-radius:10px;
  color:var(--kh23-ink);text-decoration:none;font-weight:500;font-size:15px;white-space:nowrap;
  transition:background-color .15s ease,color .15s ease;
}
html body .kh23-nav a:hover{background:rgba(7,88,61,.07);color:var(--kh23-green)}
html body .kh23-nav a[aria-current="page"]{color:var(--kh23-green);font-weight:700}
html body .kh23-nav a[aria-current="page"]::after{content:"";position:absolute;inset-inline:12px;bottom:4px;height:2px;border-radius:2px;background:var(--kh23-gold)}
html body .kh23-live i{width:8px;height:8px;border-radius:50%;background:#c63b2f;box-shadow:0 0 0 0 rgba(198,59,47,.5);animation:kh23-pulse 2.2s infinite}
@keyframes kh23-pulse{0%{box-shadow:0 0 0 0 rgba(198,59,47,.45)}70%{box-shadow:0 0 0 7px rgba(198,59,47,0)}100%{box-shadow:0 0 0 0 rgba(198,59,47,0)}}

/* R25: "مشايخ الطريقة" — gold pill next to the account button */
html body .kh23-sheikhs{
  flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;height:42px;padding:0 14px;border-radius:999px;text-decoration:none;
  background:linear-gradient(180deg,#f6dfa3,#d9ae4f);color:#3d2b05;font-weight:800;font-size:14.5px;white-space:nowrap;
  border:1px solid #c99a37;box-shadow:0 4px 12px rgba(201,154,55,.28);
}
html body .kh23-sheikhs svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
html body .kh23-sheikhs:hover{filter:brightness(1.04)}
html body .kh23-sheikhs[aria-current="page"]{background:var(--kh23-green);color:#fff;border-color:var(--kh23-green);box-shadow:none}
html body .kh23-panel a.kh23-gold{background:linear-gradient(180deg,#f6dfa3,#e3bd66);color:#3d2b05;font-weight:700}
html body .kh23-account,html body .kh23-menu>summary{
  flex:0 0 auto;display:inline-grid;place-items:center;width:42px;height:42px;border-radius:12px;
  border:1px solid var(--kh23-gold-soft);background:var(--kh23-paper);color:var(--kh23-green);cursor:pointer;
}
html body .kh23-account:hover,html body .kh23-menu>summary:hover{border-color:var(--kh23-gold)}
html body .kh23-account[aria-current="page"]{background:var(--kh23-green);color:#fff;border-color:var(--kh23-green)}
html body .kh23-account svg,html body .kh23-menu>summary svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}

html body .kh23-menu{position:static;display:none}
html body .kh23-menu>summary{list-style:none}
html body .kh23-menu>summary::-webkit-details-marker{display:none}
html body .kh23-menu[open]>summary{background:var(--kh23-green);color:#fff;border-color:var(--kh23-green)}
html body .kh23-panel{
  position:absolute;inset-inline:0;top:100%;box-sizing:border-box;padding:10px 16px 16px;
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;
  background:var(--kh23-paper);border-bottom:1px solid var(--kh23-gold-soft);box-shadow:0 18px 30px rgba(7,63,52,.12);
}
html body .kh23-panel a{min-height:46px;background:var(--kh23-cream);font-size:16px;justify-content:flex-start}
html body .kh23-panel a[aria-current="page"]{background:var(--kh23-green);color:#fff;font-weight:700}
html body .kh23-panel a.kh23-sub{background:transparent;border:1px solid var(--kh23-gold-soft)}

:where(html body) a.kh23-brand:focus-visible,html body .kh23-header a:focus-visible,html body .kh23-menu>summary:focus-visible,html body .kh23-footer a:focus-visible{outline:2px solid var(--kh23-gold);outline-offset:2px}

/* tablets/phones: short brand + account + menu */
@media (max-width:1020px){
  html body .kh23-nav{display:none}
  html body .kh23-sheikhs{margin-inline-start:auto}
  html body .kh23-menu{display:block}
}
@media (max-width:1180px) and (min-width:1021px){html body .kh23-nav a{padding:0 9px;font-size:14.5px}}
@media (max-width:560px){html body .kh23-sheikhs{width:42px;padding:0;justify-content:center}html body .kh23-sheikhs span{display:none}}
@media (max-width:440px){
  html body .kh23-bar{gap:8px;padding:0 12px}
  html body .kh23-brand{gap:8px}
  html body .kh23-brand img{width:36px;height:36px;flex-basis:36px}
  html body .kh23-brand span{font-size:14.5px}
  html body .kh23-account,html body .kh23-menu>summary,html body .kh23-sheikhs{width:40px;height:40px}
}
@media (max-width:380px){
  html body .kh23-brand span{font-size:15px}
  html body .kh23-panel{grid-template-columns:1fr}
}

/* ---------- footer ---------- */
html body .kh23-footer{
  margin:48px 0 0;padding:0 0 env(safe-area-inset-bottom);background:var(--kh23-deep);color:#e9efe9;
  font-family:var(--kh23-font);direction:rtl;border-top:3px solid var(--kh23-gold);
}
html body .kh23-foot{
  box-sizing:border-box;max-width:var(--kh23-max);margin:0 auto;padding:22px 16px;
  display:flex;align-items:center;gap:12px 24px;flex-wrap:wrap;
}
html body .kh23-footer .kh23-brand{color:#fff}
html body .kh23-footer .kh23-brand img{width:32px;height:32px;flex-basis:32px;box-shadow:none}
html body .kh23-footer .kh23-brand span{font-size:15px}
html body .kh23-foot-links{display:flex;flex-wrap:wrap;gap:4px 18px;margin-inline-start:auto}
html body .kh23-foot-links a{color:#e9efe9;text-decoration:none;font-size:14px;min-height:36px;display:inline-flex;align-items:center}
html body .kh23-foot-links a:hover,html body .kh23-foot-links a[aria-current="page"]{color:#f1d38f}
html body .kh23-copy{color:rgba(233,239,233,.7);font-size:13px}
@media (max-width:700px){
  html body .kh23-foot{flex-direction:column;text-align:center;gap:8px;padding:20px 16px}
  html body .kh23-foot-links{margin:0;justify-content:center}
}

/* old footers that some page scripts still create are hidden; the new one is the only footer */
html body .site-footer,html body .v9-footer{display:none!important}

@media (prefers-reduced-motion:reduce){html body .kh23-live i{animation:none}}
@media print{html body .kh23-header,html body .kh23-footer{display:none}}

/* R25: sheikh cards on the entry page open their biography */
html body .v9-sheikh-card{position:relative;cursor:pointer}
html body .kh25-sk-link{position:absolute;inset:0;z-index:2;border-radius:inherit}
html body .kh25-sk-link:focus-visible{outline:2px solid var(--kh23-gold);outline-offset:3px}
html body .v9-sheikh-card:hover{transform:translateY(-2px);transition:transform .18s ease}
