/* Lesson, lessons index, About and Privacy pages.
   Loaded after style.css + fixes.css, so it reuses the homepage colour tokens. */
.inner-page{background:var(--bg-cream);background-image:var(--pattern-overlay);min-height:100vh;display:flex;flex-direction:column}
.inner-page main{flex:1}
.page-wrap{width:min(100% - 2rem,920px);margin:0 auto;padding:2rem 0 3.5rem}
.page-wrap.wide{width:min(100% - 2rem,1120px)}

.crumbs{font-size:.85rem;color:var(--text-muted);margin-bottom:1.25rem;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.crumbs a{color:var(--primary);text-decoration:none;font-weight:600}
.crumbs a:hover{text-decoration:underline}

.lesson-hero{background:var(--bg-surface);border:1px solid var(--border-color);border-radius:var(--radius-lg);padding:2rem;box-shadow:var(--shadow-md);margin-bottom:1.5rem}
.lesson-kicker{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.9rem}
.chip{display:inline-flex;align-items:center;font-size:.75rem;font-weight:700;letter-spacing:.02em;padding:.3rem .7rem;border-radius:var(--radius-full);background:var(--badge-bg);color:var(--primary)}
.chip.gold{background:var(--accent-soft);color:var(--accent-hover)}
[data-theme="dark"] .chip{color:var(--accent)}
.lesson-hero h1{font-size:clamp(1.65rem,4.2vw,2.4rem);line-height:1.25;color:var(--text-main);margin:0 0 .25rem}
.lesson-hero .title-ur{display:block;font-family:var(--font-ur);font-size:1.5rem;color:var(--accent);line-height:2.6;margin:.1rem 0 .2rem}
.lesson-hero p.lead{font-size:1.05rem;line-height:1.85;color:var(--text-muted);margin:0}

.block{background:var(--bg-surface);border:1px solid var(--border-color);border-radius:var(--radius-lg);padding:1.6rem;box-shadow:var(--shadow-sm);margin-bottom:1.25rem}
.block h2{font-size:1.3rem;margin:0 0 .5rem;color:var(--text-main)}
.block > p{line-height:1.85;color:var(--text-muted);margin:.25rem 0 1rem}
.block p.inline-ur-line{font-family:var(--font-ur);font-size:1.25rem;line-height:2.8;color:var(--text-main)}

.item-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.9rem}
.item-grid.wide-items{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.item{border:1px solid var(--border-color);border-radius:var(--radius-md);padding:.9rem 1rem 1rem;background:var(--bg-card);display:flex;flex-direction:column;gap:.15rem;min-width:0;position:relative}
.item .ur{font-family:var(--font-ur);font-size:1.75rem;line-height:2.6;color:var(--primary);direction:rtl;text-align:right;padding-bottom:.35rem;overflow-wrap:anywhere}
[data-theme="dark"] .item .ur{color:var(--accent)}
.item.sentence .ur{font-size:1.4rem;line-height:2.7}
.item .roman{font-weight:700;color:var(--text-main);font-size:.95rem}
.item .en{color:var(--text-muted);font-size:.9rem;line-height:1.55}
.item .note{color:var(--text-muted);font-size:.8rem;line-height:1.5;margin-top:.3rem;border-top:1px dashed var(--border-color);padding-top:.4rem}
.item .ex{margin-top:.35rem;display:flex;flex-direction:column}
.item .ex .ur{font-size:1.35rem;line-height:2.6;padding-bottom:.2rem}
.play{position:absolute;top:.6rem;left:.6rem;width:34px;height:34px;border-radius:50%;border:1px solid var(--border-color);background:var(--bg-surface);color:var(--primary);cursor:pointer;display:grid;place-items:center;font-size:.85rem}
.play:hover{border-color:var(--accent)}
.play[data-playing="true"]{background:var(--accent);color:#1f2937;border-color:var(--accent)}

.table-wrap{overflow-x:auto}
table.forms{width:100%;border-collapse:collapse;font-size:.95rem}
table.forms th,table.forms td{border-bottom:1px solid var(--border-color);padding:.55rem .6rem;text-align:left;vertical-align:middle}
table.forms td.ur{font-family:var(--font-ur);font-size:1.35rem;line-height:2.6;direction:rtl;text-align:right;color:var(--primary)}

.tips{background:var(--accent-soft);border:1px solid var(--accent-glow);border-radius:var(--radius-lg);padding:1.25rem 1.5rem;margin-bottom:1.25rem}
.tips h2{font-size:1.1rem;margin:0 0 .5rem}
.tips ul{margin:0;padding-left:1.2rem;line-height:1.85}

.quiz-q{border:1px solid var(--border-color);border-radius:var(--radius-md);padding:1rem 1.1rem;margin-bottom:.9rem;background:var(--bg-card)}
.quiz-q h3{font-size:1rem;margin:0 0 .6rem;line-height:1.6}
.quiz-q h3 .ur{font-family:var(--font-ur);font-size:1.3rem;line-height:2.6;color:var(--primary)}
.quiz-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.5rem}
.quiz-options button{font:inherit;text-align:left;padding:.65rem .85rem;border-radius:var(--radius-sm);border:1px solid var(--border-color);background:var(--bg-surface);color:var(--text-main);cursor:pointer;line-height:1.5}
.quiz-options button:hover:not(:disabled){border-color:var(--accent)}
.quiz-options button .ur{font-family:var(--font-ur);font-size:1.25rem;line-height:2.5}
.quiz-options button.correct{border-color:#15803d;background:rgba(21,128,61,.12)}
.quiz-options button.wrong{border-color:#b91c1c;background:rgba(185,28,28,.1)}
.quiz-feedback{font-size:.9rem;margin-top:.6rem;line-height:1.6;min-height:1.2rem}
.quiz-score{font-weight:700;margin-top:.5rem}

.lesson-actions{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:space-between;margin:1.5rem 0}
.lesson-actions .btn{text-decoration:none}
.done-note{font-size:.9rem;color:var(--text-muted)}
.pager{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:1rem}
.pager a,.pager span{display:block;padding:1rem 1.2rem;border:1px solid var(--border-color);border-radius:var(--radius-md);background:var(--bg-surface);text-decoration:none;color:var(--text-main);line-height:1.5;min-width:0}
.pager a:hover{border-color:var(--accent)}
.pager small{display:block;color:var(--text-muted);font-size:.78rem;margin-bottom:.15rem}
.pager .next{text-align:right}
.pager span{opacity:.65}

.tool-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:.9rem}
.tool-links a{display:block;padding:1rem 1.15rem;border:1px solid var(--border-color);border-radius:var(--radius-md);text-decoration:none;color:var(--text-main);background:var(--bg-card);line-height:1.55}
.tool-links a strong{display:block;color:var(--primary)}
.tool-links a span{color:var(--text-muted);font-size:.88rem}

/* Lessons index */
.module{margin-bottom:2rem;scroll-margin-top:90px}
.module-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:.75rem}
.module-head h2{font-size:1.4rem;margin:0}
.module-head .ur{font-family:var(--font-ur);color:var(--accent);font-size:1.15rem;line-height:2.5}
.lesson-list{list-style:none;margin:0;padding:0;display:grid;gap:.6rem}
.lesson-list li a,.lesson-list li .soon{display:flex;align-items:center;gap:.9rem;padding:.85rem 1rem;border:1px solid var(--border-color);border-radius:var(--radius-md);background:var(--bg-surface);text-decoration:none;color:var(--text-main);line-height:1.45}
.lesson-list li a:hover{border-color:var(--accent);box-shadow:var(--shadow-sm)}
.lesson-list .num{flex:0 0 2.2rem;height:2.2rem;border-radius:50%;display:grid;place-items:center;background:var(--badge-bg);color:var(--primary);font-weight:800;font-size:.85rem}
.lesson-list .t{flex:1;min-width:0}
.lesson-list .t small{display:block;color:var(--text-muted);font-size:.82rem}
.lesson-list .soon{opacity:.6;border-style:dashed}
.lesson-list .tick{font-size:.8rem;font-weight:700;color:#15803d;white-space:nowrap}
.latest{margin:1.25rem auto 0;max-width:760px;text-align:left}
.latest h3{font-size:.85rem;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin:0 0 .5rem;text-align:center}

.prose{line-height:1.9;color:var(--text-main)}
.prose h2{font-size:1.2rem;margin:1.5rem 0 .4rem}
.prose p,.prose li{color:var(--text-muted)}
.prose a{color:var(--primary)}

.inner-footer{border-top:1px solid var(--border-color);background:var(--bg-surface);padding:1.4rem 1rem;text-align:center;font-size:.85rem;color:var(--text-muted);line-height:1.9}
.inner-footer a{color:var(--primary);text-decoration:none;margin:0 .35rem;white-space:nowrap}

.inner-header{background:var(--bg-surface);border-bottom:1px solid var(--border-color);position:sticky;top:0;z-index:40}
.inner-header .bar{width:min(100% - 2rem,1120px);margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:68px}
.inner-header nav{display:flex;gap:1.1rem;flex-wrap:wrap;justify-content:flex-end;align-items:center}
.inner-header nav a{color:var(--text-muted);text-decoration:none;font-size:.88rem;font-weight:600}
.inner-header nav a:hover,.inner-header nav a[aria-current]{color:var(--primary)}
.inner-header .brand-logo{text-decoration:none}

@media(max-width:640px){
  .page-wrap{width:calc(100% - 2rem);padding-top:1.25rem}
  .lesson-hero,.block{padding:1.2rem}
  .inner-header nav a.hide-sm{display:none}
  .pager{grid-template-columns:1fr}
  .pager .next{text-align:left}
  .item-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .item-grid.wide-items{grid-template-columns:1fr}
  .item .ur{font-size:1.5rem}
}
@media(max-width:360px){.item-grid{grid-template-columns:1fr}}

/* Urdu words inside English sentences */
.inline-ur{font-family:var(--font-ur);font-size:1.18em;line-height:1;unicode-bidi:isolate;direction:rtl}
.item.letter .ur.glyph{font-size:2.6rem;line-height:2.3;text-align:center;padding-bottom:.6rem}
table.forms td.ur{text-align:right;padding-left:1.5rem}
table.forms th.ur-h{text-align:right}
table.forms td.ur + td{width:auto}

/* Urdu reading order: cards flow right to left */
.item-grid{direction:rtl}.item-grid>*{direction:ltr}

/* room for tall Nastaliq words inside English sentences */
.prose p,.prose li,.block > p,.tips li,.lesson-hero p.lead{line-height:2.25}
