/* v137 «السيرة» (cat.php, layout story): hero, sticky reading bar, numbered station index, a timeline that fills as you read */
html { scroll-behavior: smooth; }
.lay-story .list-head .lh-title { display: none; }
.lay-story .list-head { justify-content: flex-end; }
.bio2 { --bio-fs: 18px; position: relative; width: 100%; max-width: 820px; min-width: 0; margin: 6px auto 0; }
.bio2 *, .bio2 *::before { box-sizing: border-box; }
.bio2 [id] { scroll-margin-top: calc(var(--head-h, 70px) + 70px); }

/* hero */
.bio-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; text-align: center; gap: 8px;
  padding: 40px 22px 32px; border-radius: 26px; color: #fff;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(214,178,106,.28), transparent 70%), radial-gradient(ellipse 90% 90% at 80% 100%, #1d3264 0%, #101c3e 55%, #0b1022 100%);
  box-shadow: 0 24px 50px rgba(11,16,34,.28); }
.bio-hero::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(214,178,106,.45); border-radius: 18px; pointer-events: none; z-index: -1; }
.bio-hero::after { content: ""; position: absolute; inset: 15px; border: 1px solid rgba(214,178,106,.15); border-radius: 14px; pointer-events: none; z-index: -1; }
.bh-orn { position: absolute; inset: -40% -10% auto; height: 120%; z-index: -1; opacity: .08;
  background: repeating-conic-gradient(from 0deg at 50% 50%, #d6b26a 0 3deg, transparent 3deg 15deg); mask: radial-gradient(circle at 50% 30%, #000 0 30%, transparent 62%); -webkit-mask: radial-gradient(circle at 50% 30%, #000 0 30%, transparent 62%); }
.bh-pic { width: 118px; height: 118px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; background: #13234a;
  box-shadow: 0 0 0 3px #0b1022, 0 0 0 5px #d6b26a, 0 0 34px rgba(214,178,106,.45); margin-bottom: 6px; }
.bh-eye { font: 700 13px/1.6 "Cairo", sans-serif; color: #e2c68a; letter-spacing: .02em; }
.bh-name { margin: 0; font-family: "Amiri", serif; font-weight: 700; font-size: clamp(25px, 5.4vw, 38px); line-height: 1.55; color: transparent;
  background: linear-gradient(100deg, #b98b3c 0%, #f3dc9f 30%, #fff6dc 45%, #e2bd6b 60%, #b98b3c 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; }
.bh-sub { margin: 0; max-width: 560px; font-size: 15px; line-height: 1.95; color: #c3c9e8; }
.bh-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0 4px; }
.bh-stats span { display: grid; min-width: 104px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(214,178,106,.28); font-size: 12.5px; color: #aab2d6; }
.bh-stats b { font: 800 20px/1.4 "Cairo", sans-serif; color: #f1d595; font-variant-numeric: tabular-nums; }
.bh-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.bh-btns a { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px; font: 700 15px "Cairo", sans-serif; text-decoration: none; transition: transform .25s, box-shadow .25s, background .25s; }
.bh-go { color: #0b1022; background: linear-gradient(135deg, #f3dc9f, #d6b26a); box-shadow: 0 8px 22px rgba(214,178,106,.35); }
.bh-alt { color: #f1e2bd; border: 1px solid rgba(214,178,106,.55); }
.bh-btns a:hover, .bh-btns a:focus-visible { transform: translateY(-2px); outline: none; }
.bh-alt:hover { background: rgba(214,178,106,.14); }

.bio-admin { margin: 14px 0 0; font-size: 13px; line-height: 1.9; opacity: .75; }
.bio-admin a { color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }

/* sticky reading bar */
.bio-bar { position: sticky; top: calc(var(--head-h, 0px) + 8px); z-index: 30; margin: 18px 0 0; border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--surface, #fff) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transform: translateZ(0);
  border: 1px solid var(--line); box-shadow: 0 10px 26px rgba(19,35,74,.10); transition: box-shadow .3s; }
.bb-in { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; }
.bb-now { display: grid; min-width: 0; line-height: 1.5; }
.bb-now small { font-size: 11.5px; color: var(--gold); font-weight: 700; }
.bb-now b { font-family: "Amiri", serif; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .25s; }
.bb-now b.sw { opacity: 0; }
.bb-tools { flex: none; display: flex; gap: 6px; }
.bb-tools button, .bb-tools a { width: 38px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit;
  font: 800 13px "Cairo", sans-serif; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s; }
.bb-tools button:hover, .bb-tools a:hover { background: rgba(214,178,106,.16); border-color: var(--gold); }
.bb-prog { display: block; height: 3px; width: 100%; background: linear-gradient(90deg, #d6b26a, #f3dc9f); transform-origin: right; transform: scaleX(var(--p, 0)); transition: transform .15s linear; }
[dir="ltr"] .bb-prog { transform-origin: left; }

/* station index */
.bio-index { margin: 22px 0 34px; }
.bio-index > b { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-family: "Amiri", serif; font-size: 22px; color: var(--gold); }
.bio-index > b::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); opacity: .6; }
[dir="rtl"] .bio-index > b::after { background: linear-gradient(270deg, var(--gold), transparent); }
.bio-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.bio-chips a { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: inherit; text-decoration: none; font-size: 14px; line-height: 1.6; transition: border-color .25s, transform .25s, background .25s, box-shadow .25s; }
.bio-chips a i { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font: 700 14px "Amiri", serif; font-style: normal; color: var(--gold); border: 1px solid var(--gold); transition: background .25s, color .25s; }
.bio-chips a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bio-chips a:hover, .bio-chips a:focus-visible { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(19,35,74,.08); outline: none; }
.bio-chips a.on { border-color: var(--gold); background: rgba(214,178,106,.12); }
.bio-chips a.on i, .bio-chips a.done i { background: var(--gold); color: #0b1022; }

/* timeline */
.bio-line { list-style: none; margin: 0; padding: 0; padding-inline-start: 50px; position: relative; }
.bio-line::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 15px; width: 2px; background: var(--line); border-radius: 2px; }
.bio-fill { position: absolute; top: 0; bottom: 0; inset-inline-start: 15px; width: 2px; pointer-events: none; }
.bio-fill i { position: absolute; top: 0; inset-inline: 0; height: 100%; border-radius: 2px; background: linear-gradient(180deg, #f3dc9f, #d6b26a 60%, #b98b3c); transform-origin: top; transform: scaleY(var(--f, 0));
  box-shadow: 0 0 10px rgba(214,178,106,.6); }
.bio-yr { position: relative; margin: 38px 0 14px; }
.bio-fill + .bio-yr { margin-top: 0; }
.bio-yr span { display: inline-block; font-family: "Amiri", serif; font-weight: 700; font-size: 30px; line-height: 1.3; color: var(--gold); padding: 2px 16px; border-radius: 999px; background: rgba(214,178,106,.10); border: 1px solid rgba(214,178,106,.4); }
.bio-yr::before { content: ""; position: absolute; top: 50%; inset-inline-start: -44px; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px var(--bg), 0 0 18px rgba(214,178,106,.55); }
.bio-st { position: relative; margin: 0 0 28px; }
.bio-dot { position: absolute; top: 34px; inset-inline-start: -41px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); box-shadow: 0 0 0 4px var(--bg); transition: border-color .4s, background .4s, box-shadow .4s, transform .4s; }
.bio-st.passed .bio-dot { border-color: var(--gold); background: var(--gold); }
.bio-st.on .bio-dot { border-color: var(--gold); background: var(--surface); transform: scale(1.35); box-shadow: 0 0 0 4px var(--bg), 0 0 0 9px rgba(214,178,106,.25); }

/* station card */
.bio-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px 30px 18px; box-shadow: 0 12px 32px rgba(19,35,74,.07); transition: box-shadow .4s, border-color .4s; }
.bio-card::before { content: ""; position: absolute; top: -1px; inset-inline: 28px; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, transparent, #d6b26a, transparent); }
.bio-st.on .bio-card { border-color: rgba(214,178,106,.55); box-shadow: 0 18px 44px rgba(19,35,74,.12); }
.bio-hd { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; }
.bio-num { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; font-family: "Amiri", serif; font-weight: 700; font-size: 21px; color: #0b1022;
  background: radial-gradient(circle at 35% 30%, #fff6dc, #e2bd6b 55%, #b98b3c); box-shadow: 0 6px 14px rgba(185,139,60,.35), inset 0 0 0 2px rgba(255,255,255,.35); }
.bio-hd h3 { margin: 0; font-family: "Amiri", serif; font-size: clamp(22px, 2.6vw, 29px); line-height: 1.55; }
.bio-img { margin: 14px 0 20px; padding: 6px; border: 1px solid rgba(214,178,106,.6); border-radius: 16px; background: var(--surface); overflow: hidden; }
.bio-img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 11px; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.bio-st.on .bio-img img { transform: scale(1.02); }
a.bio-soon { display: block; margin: 14px 0 18px; padding: 10px 14px; border: 1.5px dashed var(--gold); border-radius: 12px; text-align: center; color: inherit; text-decoration: none; font-weight: 800; font-size: 14px; }
a.bio-soon small { font-weight: 400; opacity: .7; }
.bio-txt .prose { font-size: var(--bio-fs); line-height: 2.15; text-align: justify; text-justify: inter-word; transition: font-size .2s; }
.bio-txt .prose p { margin: 0 0 14px; }
.bio-txt .prose ul { list-style: none; margin: 16px 0 4px; padding: 0; display: grid; gap: 10px; }
.bio-txt .prose li { position: relative; margin: 0; padding: 12px 16px; padding-inline-start: 42px; border: 1px solid var(--line); border-radius: 14px; background: rgba(214,178,106,.07); font-size: calc(var(--bio-fs) - 1.5px); line-height: 1.95; text-align: start; }
.bio-txt .prose li::before { content: "◆"; position: absolute; top: 13px; inset-inline-start: 16px; font-size: 12px; line-height: 2.2; color: var(--gold); }
.bio-txt .prose li b { display: block; margin-bottom: 2px; font-weight: 900; font-size: calc(var(--bio-fs) - .5px); color: var(--ink, #000); }
.bio-ft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.bio-share { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; font: 700 13px "Cairo", sans-serif; cursor: pointer; transition: border-color .2s, background .2s; }
.bio-share svg { width: 16px; height: 16px; color: var(--gold); }
.bio-share:hover { border-color: var(--gold); background: rgba(214,178,106,.1); }
.bio-next { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center; max-width: 60%; padding: 6px 14px; border-radius: 12px; color: inherit; text-decoration: none; text-align: end; transition: background .2s; }
.bio-next small { grid-column: 1; font-size: 11.5px; color: var(--gold); font-weight: 700; }
.bio-next b { grid-column: 1; font-family: "Amiri", serif; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bio-next span { grid-column: 2; grid-row: 1 / 3; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); transition: transform .3s; }
.bio-next:hover { background: rgba(214,178,106,.08); } .bio-next:hover span { transform: translateY(3px); }

.bio-end { display: grid; justify-items: center; gap: 6px; margin: 40px 0 10px; padding: 26px 18px; text-align: center; border-radius: 20px; border: 1px solid rgba(214,178,106,.4); background: rgba(214,178,106,.06); }
.be-orn { font-size: 26px; color: var(--gold); letter-spacing: 8px; }
.bio-end p { margin: 0; font-family: "Amiri", serif; font-size: 20px; line-height: 1.9; }
.bio-end a { font-size: 14px; font-weight: 700; color: var(--gold); text-decoration: none; }
.bio-toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 90; padding: 10px 18px; border-radius: 999px; background: #0b1022; color: #f1e2bd; font: 700 14px "Cairo", sans-serif; box-shadow: 0 10px 26px rgba(0,0,0,.3); }

:root[data-theme="dark"] .bio-txt .prose li b { color: inherit; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bio-txt .prose li b { color: inherit; } }

/* motion */
@media (prefers-reduced-motion: no-preference) {
  .bh-pic { animation: bhIn 1s cubic-bezier(.2,.7,.2,1) both; }
  .bio-hero > :not(.bh-orn):not(.bh-pic) { animation: bhUp .9s cubic-bezier(.2,.7,.2,1) both; }
  .bio-hero > .bh-eye { animation-delay: .1s } .bio-hero > .bh-name { animation-delay: .18s, .18s } .bio-hero > .bh-sub { animation-delay: .26s } .bio-hero > .bh-stats { animation-delay: .34s } .bio-hero > .bh-btns { animation-delay: .42s }
  .bh-name { animation: goldShine 7s linear infinite; }
  .bh-orn { animation: bhSpin 90s linear infinite; will-change: transform; }
  .bh-go span { display: inline-block; animation: bhBob 1.8s ease-in-out infinite; }
  @keyframes bhIn { from { opacity: 0; transform: scale(.85); } }
  @keyframes bhUp { from { opacity: 0; transform: translateY(14px); } }
  @keyframes bhSpin { to { transform: rotate(360deg); } }
  @keyframes bhBob { 50% { transform: translateY(3px); } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .bio-fill i { transition: none; } }

@media (max-width: 820px) {
  .bio-hero { padding: 32px 16px 26px; border-radius: 22px; }
  .bh-pic { width: 98px; height: 98px; }
  .bh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .bh-stats span { min-width: 0; padding: 8px 6px; font-size: 11.5px; }
  .bh-stats b { font-size: 16px; white-space: nowrap; }
  .bio-chips { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-snap-type: x proximity; margin-inline: -4px; padding: 2px 4px 8px; }
  .bio-chips::-webkit-scrollbar { display: none; }
  .bio-chips a { flex: none; max-width: 230px; scroll-snap-align: start; }
  .bio-line { padding-inline-start: 36px; }
  .bio-line::before, .bio-fill { inset-inline-start: 9px; }
  .bio-yr::before { inset-inline-start: -36px; width: 18px; height: 18px; margin-top: -9px; }
  .bio-yr span { font-size: 25px; }
  .bio-dot { inset-inline-start: -33px; top: 30px; }
  .bio-card { padding: 20px 16px 14px; border-radius: 16px; }
  .bio-num { width: 44px; height: 44px; font-size: 18px; }
  .bio2 { --bio-fs: 16.5px; }
  .bio-ft { flex-wrap: nowrap; }
  .bio-share { flex: none; padding: 9px; } .bio-share span { display: none; } .bio-share svg { width: 18px; height: 18px; }
  .bio-next { flex: 1; min-width: 0; max-width: none; padding-inline: 8px; }
  .bio-next small { white-space: nowrap; }
}

/* v141: smoother, with every effect kept. Off-screen stations are not laid out until they come near; the hero's endless
   animations pause while the hero is off screen (bio.js adds .bh-off); the blurred bar sits on its own GPU layer. */
.bio-st { content-visibility: auto; contain-intrinsic-size: auto 520px; }
.bb-prog, .bio-fill i { will-change: transform; }
.bio-hero.bh-off *, .bio-hero.bh-off *::before, .bio-hero.bh-off *::after { animation-play-state: paused !important; }

/* v278.301: the «تقرأ الآن» bar is solid (the text no longer shows through it — phones have no blur since v278.297),
   numbered lists in a station keep their number inside the box instead of a «1.» hanging outside next to the ◆ */
.bio-bar { background: var(--surface, #fff); }
.bio-txt .prose ol { list-style: none; margin: 16px 0 4px; padding: 0; display: grid; gap: 10px; counter-reset: bli; }
.bio-txt .prose ol > li { counter-increment: bli; padding-inline-start: 48px; }
.bio-txt .prose ol > li::before { content: counter(bli); top: 13px; inset-inline-start: 12px; width: 26px; height: 26px; display: grid; place-items: center; border: 1.5px solid var(--gold); border-radius: 50%; font: 800 12.5px/1 "Cairo", sans-serif; color: var(--gold); }
:lang(ar) .bio-txt .prose ol > li::before, :lang(fa) .bio-txt .prose ol > li::before, :lang(ur) .bio-txt .prose ol > li::before { content: counter(bli, arabic-indic); }
.bio-txt .prose li > ul, .bio-txt .prose li > ol { margin-top: 8px; }
