/* Local article reading controls and progress. */
.site-header { position:relative; }
.reading-journey { max-width:760px; }
.reading-return { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding-bottom:22px; margin-bottom:30px; border-bottom:1px solid var(--line); font:12px/1.6 var(--sans); }
.reading-return a { display:inline-flex; align-items:center; min-height:44px; text-underline-offset:5px; }
.reading-return span { color:#586a64; }
.reading-journey h1 { overflow-wrap:anywhere; }
.reading-settings { margin:16px 0 0; }
.reading-settings > summary { width:fit-content; min-height:44px; padding:11px 0; font:12px/1.6 var(--sans); color:var(--wine); cursor:pointer; }
.reading-journey .reader-tools { margin:4px 0 16px; gap:6px; }
.reading-flight {
  --kite-width:46px;
  --kite-height:calc(1.25 * var(--kite-width));
  --kite-top-room:26px;
  --kite-bottom-room:42px;
  --kite-sway-range:2.5px;
  --kite-rise:var(--reading-progress,0);
  --kite-lift:var(--title-lift,0px);
  --kite-descent:var(--reading-descent,0);
  --kite-ceiling:calc(var(--kite-top-room) + .25 * var(--kite-height));
  --kite-launch:clamp(var(--kite-ceiling), calc(var(--title-launch) + .26 * var(--kite-height)), calc(100% - var(--flight-reserve,0px) - var(--kite-bottom-room)));
  --kite-travel:calc(var(--kite-launch) - var(--kite-ceiling));
  --kite-cruise:calc(var(--kite-launch) - var(--kite-rise) * var(--kite-travel) - var(--kite-lift) * (1 - var(--kite-rise)));
  --string-end:calc(100% - var(--string-retraction,0px));
  --kite-landing:calc(var(--string-end) - var(--kite-bottom-room));
  --kite-attachment:clamp(var(--kite-ceiling), calc(var(--kite-cruise) + (var(--kite-landing) - var(--kite-cruise)) * var(--kite-descent)), var(--kite-landing));
  --kite-offset:0px;
  position:fixed;
  top:var(--flight-top);
  bottom:calc(20px + env(safe-area-inset-bottom, 0px));
  right:max(6px,calc((100% - 760px)/2 - 68px));
  width:var(--kite-width);
  pointer-events:none;
  z-index:8;
  opacity:0;
  clip-path:inset(0 -6px var(--string-retraction,0px));
  transition:opacity .28s ease;
}
.reading-flight[hidden] { display:none; }
.reading-flight.is-reading { opacity:1; }
.reading-kite,.reading-kite-string {
  position:absolute;
  width:var(--kite-width);
  top:var(--kite-attachment);
  left:0;
}
.reading-kite {
  height:var(--kite-height);
  transform:translate(var(--kite-offset),-60%) rotate(var(--kite-tilt,0deg));
  transform-origin:50% 60%;
}
.reading-kite svg { display:block; width:100%; height:100%; }
.reading-kite-string {
  height:max(0px,calc(var(--string-end) - var(--kite-attachment)));
}
.reading-kite-string path {
  fill:none;
  stroke:#884332;
  stroke-width:1.1px;
  stroke-dasharray:2px 1.8px;
  stroke-linecap:round;
}
html[data-motion="paused"] .reading-flight { --kite-rise:0; --kite-lift:0px; --kite-descent:0; transition:none; }
html[data-motion="paused"] .reading-kite { transform:translateY(-60%); transition:none; }
@media(prefers-reduced-motion:reduce) {
 .reading-flight { --kite-rise:0; --kite-lift:0px; --kite-descent:0; transition:none; }
 .reading-kite { transform:translateY(-60%); transition:none; }
}
.reading-journey .reader-tools > span { font-size:10px; margin-right:6px; }
.reading-journey .reader-tools button { min-width:44px; }
.reading-journey .article-text { max-width:65ch; margin:24px auto 54px; }
.capture-preformatted { white-space: pre-wrap; }
.reading-journey .article-text.ar { font-size:clamp(26px,2.6vw,32px); line-height:1.95; }
.reading-journey .verse { max-width:580px; padding-right:22px; border-right-width:1px; }
.reading-navigation { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding-top:30px; border-top:1px solid var(--line); margin-top:48px; }
.reading-neighbor { display:flex; flex-direction:column; gap:14px; padding:22px; text-decoration:none; border:1px solid var(--line); background:rgba(255,250,239,.45); color:var(--ink); }
.reading-neighbor:hover { background:#e5e7d9; border-color:var(--ink); }
.reading-neighbor[rel="next"] { grid-column:2; }
.neighbor-label,.neighbor-date { font:11px/1.6 var(--sans); }
.neighbor-label { color:var(--wine); }
.neighbor-title { font:25px/1.5 var(--serif); overflow-wrap:anywhere; }
.neighbor-title[lang="ar"] { font-family:var(--ar); }
.neighbor-date { margin-top:auto; color:#586a64; }
.reading-all { grid-column:1/-1; justify-self:center; padding:14px; min-height:44px; font:12px/1.6 var(--sans); text-underline-offset:5px; }
.reading-journey .source-note { margin-top:32px; }
@media (min-width:601px) and (max-width:900px) {
 .reading-journey { padding-right:28px; }
}
@media(max-width:600px) {
 .reading-journey { padding-right:25px; }
 .reading-flight { --kite-width:30px; --kite-top-room:17px; --kite-bottom-room:29px; --kite-sway-range:1.5px; right:5px; }
 .reading-journey .reader-tools > span { width:100%; }
 .reading-navigation { grid-template-columns:1fr; gap:12px; }
 .reading-neighbor[rel="next"] { grid-column:1; }
 .reading-neighbor { padding:18px; }
 .reading-journey .verse { padding-right:14px; }
}
@media print {
 .reading-return,.reading-navigation,.reading-settings,.reading-flight { display:none!important; }
 .reading-journey { max-width:100%; padding-right:0; }
 .reading-journey .article-text.ar { font-size:17pt; }
}
