/* Polish layer — loads after redesign.css. Remove its <link> in index.html to go back to the previous look. */
body[data-page]{
  /* 8-point star (khatam) tile, gold on green and green on cream */
  --pat:none;
  --pat-faint:none;
  --orn:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='26' viewBox='0 0 240 26'%3E%3Cdefs%3E%3ClinearGradient id='l' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23c9a24b' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23c9a24b'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='1' x2='0'%3E%3Cstop offset='0' stop-color='%23c9a24b' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23c9a24b'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='6' y='12.2' width='96' height='1.6' fill='url(%23l)'/%3E%3Crect x='138' y='12.2' width='96' height='1.6' fill='url(%23r)'/%3E%3Cg fill='%23c9a24b'%3E%3Cpath d='M120 2l3.8 7.2L131 13l-7.2 3.8L120 24l-3.8-7.2L109 13l7.2-3.8z'/%3E%3Ccircle cx='107' cy='13' r='2'/%3E%3Ccircle cx='133' cy='13' r='2'/%3E%3C/g%3E%3C/svg%3E");
  --glow:radial-gradient(ellipse at 18% 25%,#e6c97a26,transparent 55%),radial-gradient(ellipse at 90% 100%,#e6c97a14,transparent 50%);
  --shadow-h:0 14px 34px #0f3d2e2e;
  scroll-padding-top:5.5rem;
  background:var(--pat-faint) center top/80px 80px,var(--cream);
}
html{scroll-behavior:smooth}
body[data-page] ::selection{background:var(--gold2);color:var(--green)}

/* ---------- header ---------- */
body[data-page] .top{background:var(--pat) center/80px 80px,var(--star),var(--green);box-shadow:0 4px 18px #0b302466;position:sticky;top:0}
body[data-page] .brand{text-shadow:0 1px 8px #0006;letter-spacing:.01em}
body[data-page] nav{border-top-color:#c9a24b55}
body[data-page] nav a{border-radius:6px 6px 0 0}
body[data-page] nav a.on{background:linear-gradient(#e6c97a1c,transparent)}
@media(min-width:1100px){
  body[data-page] .top{flex-wrap:nowrap;padding:.35rem 1.6rem;gap:1.4rem}
  body[data-page] nav{order:0;flex:1 1 auto;border-top:0;margin:0;justify-content:center;flex-wrap:nowrap}
  body[data-page] nav a{padding:.25rem .75rem;font-size:1.02rem}
}

/* ---------- section titles ---------- */
body[data-page] .sec-title{font-size:2rem;margin:2.6rem 0 1.4rem;color:var(--green)}
body[data-page] .sec-title::after{width:240px;height:26px;margin:.1rem auto 0;background:var(--orn) center/240px 26px no-repeat}
body[data-page] .art-title::after{width:240px;height:26px;background:var(--orn) center/240px 26px no-repeat}
body[data-page] .gtitle{border-bottom:0;position:relative;padding-bottom:.5rem}
body[data-page] .gtitle::after{content:'';position:absolute;inset-inline:0;bottom:0;height:2px;background:linear-gradient(90deg,var(--gold),#c9a24b00)}
html[dir=rtl] body[data-page] .gtitle::after{background:linear-gradient(270deg,var(--gold),#c9a24b00)}

/* ---------- hero ---------- */
body[data-page] .hero{background:var(--glow),var(--pat) center/80px 80px,var(--star),var(--green);padding:2.8rem 2.8rem;gap:3rem;border-radius:22px;
  box-shadow:inset 0 0 0 6px var(--green),inset 0 0 0 7px #c9a24b99,inset 0 0 0 11px #0f3d2e,inset 0 0 0 12px #c9a24b44,0 22px 50px #0f3d2e40}
body[data-page] .hero h1{font-size:3.1rem;line-height:1.5;text-shadow:0 2px 14px #0008}
html[lang=en] body[data-page] .hero h1{font-size:3.6rem}
body[data-page] .hero .portrait{box-shadow:0 20px 44px #000a,0 0 70px #c9a24b40;border-width:5px;transition:transform .6s}
body[data-page] .hero .portrait:hover{transform:scale(1.02)}
body[data-page] .tagline{font-size:1.2rem;letter-spacing:.02em}
body[data-page] .hero .btn{background:linear-gradient(180deg,var(--gold2),var(--gold));color:var(--green);box-shadow:0 6px 16px #0006,inset 0 1px 0 #fff7;padding:.2rem 1.8rem}
body[data-page] .hero .btn:hover{background:linear-gradient(180deg,#f2dc9a,var(--gold2));transform:translateY(-2px)}

/* ---------- cards ---------- */
body[data-page] .card{border-radius:14px;box-shadow:0 2px 12px #0f3d2e18}
body[data-page] .card img{transition:transform .6s ease}
body[data-page] .card:hover img{transform:scale(1.06)}
body[data-page] .card>img,body[data-page] .card .art-cover{transform-origin:center}
body[data-page] .card:not(.book):not(.art-card){overflow:hidden}
body[data-page] .card h3{font-size:1.18rem}
body[data-page] .btn{box-shadow:0 3px 10px #0f3d2e33}
body[data-page] .btn:hover{box-shadow:0 8px 18px #0f3d2e44}
body[data-page] .prose{border-radius:16px;box-shadow:0 4px 22px #0f3d2e14;position:relative}
body[data-page] .prose:not(.reading):not(.intro)::before{content:'';position:absolute;inset:6px;border:1px solid #c9a24b55;border-radius:11px;pointer-events:none}

/* ---------- majalis ---------- */
body[data-page] .event{border-radius:12px;padding:.7rem 1.1rem;background:linear-gradient(90deg,var(--card),#fbf5e2);transition:transform .25s,box-shadow .25s}
body[data-page] .event:hover{transform:translateY(-2px)}
body[data-page] .event .d{background:var(--pat) center/60px 60px,var(--star),var(--green);border:1px solid var(--gold);border-radius:10px;min-width:92px;padding:.4rem .6rem;box-shadow:inset 0 1px 0 #fff2}
body[data-page] .event .tm{letter-spacing:.02em}
body[data-page] .event .eb h3{font-size:1.12rem}
body[data-page] .gtitle{font-size:1.5rem;color:var(--green)}

/* ---------- home slider ---------- */
body[data-page] .slider{border-radius:20px;border:2px solid var(--gold);min-height:260px;
  box-shadow:inset 0 0 0 5px var(--green),inset 0 0 0 6px #c9a24b88,0 18px 44px #0f3d2e38}
body[data-page] .slide{background:var(--glow),var(--pat) center/80px 80px,var(--star),var(--green)}
body[data-page] .slide.on{min-height:260px}
body[data-page] .slide h2{font-size:2.2rem;text-shadow:0 2px 12px #0008}
body[data-page] .slide h2::after{content:'';display:block;width:240px;height:26px;margin:.2rem auto 0;background:var(--orn) center/240px 26px no-repeat}
body[data-page] .slide .stext{font-size:1.12rem;color:#f1ecd8}
body[data-page] .sl-btn{border-radius:50%;width:46px;height:46px;border:1.5px solid var(--gold);background:#0b302499;transition:.2s}
body[data-page] .sl-btn:hover{background:var(--gold);color:var(--green)}
body[data-page] .dots button.on::before{width:26px;border-radius:6px;background:var(--gold2)}
body[data-page] .dots button::before{transition:width .3s,background .3s}

/* ---------- gallery / media ---------- */
body[data-page] .gallery button{border-radius:10px;box-shadow:0 2px 10px #0f3d2e22}
body[data-page] .gallery button img{transition:transform .5s}
body[data-page] .gallery button:hover img{transform:scale(1.05)}
body[data-page] .media-item{border-radius:16px}

/* ---------- footer ---------- */
body[data-page] footer{background:var(--pat) center/80px 80px,var(--star),var(--green3);padding-top:2.6rem;margin-top:1rem;overflow:visible}

/* ---------- page entrance ---------- */
@keyframes rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes fade{from{opacity:0}to{opacity:1}}
body[data-page] main>*{animation:rise .6s cubic-bezier(.2,.7,.2,1) both}
body[data-page] main>*:nth-child(2){animation-delay:.08s}
body[data-page] main>*:nth-child(3){animation-delay:.16s}
body[data-page] main>*:nth-child(n+4){animation-delay:.22s}
body[data-page] .grid>*{animation:rise .55s cubic-bezier(.2,.7,.2,1) both}
body[data-page] .grid>*:nth-child(2){animation-delay:.07s}
body[data-page] .grid>*:nth-child(3){animation-delay:.14s}
body[data-page] .grid>*:nth-child(4){animation-delay:.21s}
body[data-page] .grid>*:nth-child(n+5){animation-delay:.28s}
body[data-page] .event{animation:rise .5s cubic-bezier(.2,.7,.2,1) both}
@supports (animation-timeline:view()){
  body[data-page] .home-sec{animation:rise linear both;animation-timeline:view();animation-range:entry 0% entry 35%}
}

@media(max-width:900px){
  body[data-page] .hero{padding:2rem 1.6rem;gap:1.6rem}
  body[data-page] .hero h1{font-size:2.5rem}
}
@media(max-width:800px){
  body[data-page] .hero{padding:1.6rem 1rem;box-shadow:inset 0 0 0 5px var(--green),inset 0 0 0 6px #c9a24b99,0 14px 30px #0f3d2e38}
  body[data-page] .hero h1{font-size:1.95rem}
  html[lang=en] body[data-page] .hero h1{font-size:2.5rem}
  body[data-page] .sec-title{font-size:1.55rem;margin:2rem 0 1rem}
  body[data-page] .slide h2{font-size:1.5rem}
  body[data-page] .slider,body[data-page] .slide.on{min-height:230px}
  body[data-page] .event{padding:.6rem .8rem}
}
@media(prefers-reduced-motion:reduce){
  body[data-page] main>*,body[data-page] .grid>*,body[data-page] .event,body[data-page] .home-sec{animation:none!important}
  body[data-page] .card:hover img,body[data-page] .gallery button:hover img,body[data-page] .hero .portrait:hover{transform:none}
}

/* ---------- reading refinements ---------- */
body[data-page] .bk-flow p,body[data-page] .prose.reading p{text-wrap:pretty}
body[data-page] .bk-flow .bk-title::after{content:'';display:block;height:26px;margin-top:.1em;background:var(--orn) center/240px 26px no-repeat}
body[data-page] .bk-flow .ar,body[data-page] .prose.reading .ar{border-radius:8px}
body[data-page] .bk-flow blockquote,body[data-page] .prose.reading blockquote{border-radius:0 10px 10px 0}
html[dir=rtl] body[data-page] .bk-flow blockquote,html[dir=rtl] body[data-page] .prose.reading blockquote{border-radius:10px 0 0 10px}
body[data-page] .art-progress{height:4px}
body[data-page] .art-progress i{background:linear-gradient(90deg,var(--gold),var(--gold2))}
body[data-page] .bk-bar .ic{transition:background .18s,color .18s,transform .18s}
body[data-page] .bk-bar .ic:hover{transform:translateY(-1px)}

/* ---------- save as PDF / print: the article only, clean page ---------- */
@page{size:A4;margin:18mm 16mm 20mm}
@media print{
  body[data-page]{background:#fff!important;color:#000!important;display:block;font-size:13pt}
  body[data-page] .top,body[data-page] footer,body[data-page] nav,body[data-page] .read-tools,body[data-page] .share-row,
  body[data-page] .art-progress,body[data-page] .bk,body[data-page] .back,body[data-page] .more,body[data-page] .series,
  body[data-page] .skip,body[data-page] .cp,body[data-page] .sec-title,body[data-page] .lightbox{display:none!important}
  body[data-page] main,body[data-page] main>*,body[data-page] .grid>*{animation:none!important;opacity:1!important;transform:none!important}
  body[data-page] main{max-width:none;padding:0}
  body[data-page] .art-wrap{max-width:none}
  body[data-page] .art-title{font-size:23pt;line-height:1.6;margin:0 0 4pt;color:#0f3d2e}
  body[data-page] .art-title::after{height:2px;width:120pt;margin:6pt auto 0;background:#c9a24b}
  body[data-page] .art-meta{margin-bottom:12pt;color:#555}
  body[data-page] .prose.reading{border:0;box-shadow:none;background:none;padding:0}
  body[data-page] .prose.reading p,body[data-page] .prose.reading li{font-size:13.5pt;line-height:2.1;text-align:justify;orphans:3;widows:3}
  body[data-page] .prose.reading .ar{background:none;border-color:#999;font-size:17pt;break-inside:avoid}
  body[data-page] .prose.reading blockquote{background:none;border-inline-start:3px solid #999;break-inside:avoid}
  body[data-page] .prose.reading blockquote::before{color:#666}
  body[data-page] .prose.reading h2,body[data-page] .prose.reading h3{break-after:avoid}
  body[data-page] .art-wrap::after{content:attr(data-url);display:block;direction:ltr;text-align:center;font:9pt 'Lato',sans-serif;color:#666;border-top:1px solid #bbb;margin-top:16pt;padding-top:6pt}
}

/* copy buttons: icon only */
body[data-page] .cp{width:32px;height:32px;padding:0;display:grid;place-items:center;font-size:0;line-height:0}
body[data-page] .cp svg,body[data-page] .bk-sel .bk-ico svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body[data-page] .bk-sel .bk-ico{width:40px;padding:0;display:grid;place-items:center}

/* ---------- PDF download (drawn off-screen, then saved as pages) ---------- */
.pdf-stage{background:#fff;color:#111;font-family:'Amiri','Noto Naskh Arabic',serif;font-size:20px;line-height:2.15;pointer-events:none;direction:inherit}
html[lang=en] .pdf-stage{font-family:'EB Garamond',Georgia,serif;font-size:19px;line-height:1.7}
.pdf-stage .pdf-blk{padding-bottom:12px;background:#fff}
.pdf-stage h1{font-size:34px;line-height:1.7;text-align:center;color:#0f3d2e;margin:0 0 2px;font-weight:700}
.pdf-stage .pdf-meta{text-align:center;color:#666;font-size:15px;line-height:1.8;border-bottom:2px solid #c9a24b;padding-bottom:10px}
.pdf-stage p,.pdf-stage li,.pdf-stage ul,.pdf-stage ol{margin:0;font-size:20px;line-height:2.15;text-align:start}
.pdf-stage ul,.pdf-stage ol{padding-inline-start:28px}
.pdf-stage h2,.pdf-stage h3{margin:6px 0 0;color:#0f3d2e;line-height:1.8}
.pdf-stage .ar{display:block;text-align:center;font-family:'Amiri Quran','Amiri',serif;font-size:26px;line-height:2.4;color:#0f3d2e;background:#f6efd8;border-top:1px solid #c9a24b;border-bottom:1px solid #c9a24b;padding:6px 14px;margin:2px 0}
.pdf-stage .ar em{display:block;font-style:normal;font-family:'Amiri',serif;font-size:15px;color:#8a6a1f;line-height:1.9}
.pdf-stage blockquote{margin:2px 0;padding:4px 14px;border-inline-start:4px solid #c9a24b;background:#f4f0e4}
.pdf-stage blockquote::before{content:'ترجمہ';display:block;font-size:14px;color:#8a6a1f;font-weight:700;line-height:1.7}
.pdf-stage blockquote p{font-size:19px}
.pdf-stage strong{color:#0f3d2e}
#pdfBusy{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:200;background:#0a2a20;color:#e6c97a;border:1.5px solid #c9a24b;border-radius:999px;padding:.5rem 1.4rem;box-shadow:0 8px 22px #0009;font-size:1rem;max-width:92vw;text-align:center}
#pdfBusy[hidden]{display:none}
.pdf-stage .pdf-page{position:relative;overflow:hidden;background:#fff}
.pdf-stage .pdf-wm{position:absolute;left:50%;top:50%;width:900px;margin-left:-450px;text-align:center;white-space:nowrap;
  transform:translateY(-50%) rotate(-30deg);font-size:96px;font-weight:700;color:rgba(15,61,46,.07);line-height:1.6;pointer-events:none;z-index:0}
.pdf-stage .pdf-blk{position:relative;z-index:1;background:transparent}

/* back-to-top button */
#toTop{position:fixed;inset-inline-end:18px;bottom:20px;z-index:40;width:48px;height:48px;border-radius:50%;border:1.5px solid var(--gold);
  background:var(--green);color:var(--gold2);display:grid;place-items:center;cursor:pointer;box-shadow:0 8px 20px #0f3d2e55;
  transition:background .2s,color .2s,transform .2s,opacity .25s}
#toTop[hidden]{display:none}
#toTop svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
#toTop:hover,#toTop:focus-visible{background:var(--gold);color:var(--green);transform:translateY(-2px)}
@media(max-width:800px){#toTop{width:44px;height:44px;inset-inline-end:12px;bottom:14px}}
@media print{#toTop{display:none!important}}

/* bigger tap targets on phones */
body[data-page] .crow a{display:inline-flex;align-items:center;min-height:44px}
body[data-page] .crow{align-items:center}
