:root {
  --paper: #fbf7f0;
  --paper-2: #f3ece0;
  --ink: #2a2420;
  --ink-soft: #6b6058;
  --rule: #e4d9c8;
  --accent: #7a2e3a;      /* deep maroon */
  --accent-2: #2f5d5a;    /* old teal */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif;
  --wrap: 1120px;
  --narrow: 720px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.65 var(--sans); }
img, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: var(--narrow); }
[lang="ur"], .urdu, .rtl .excerpt { font-family: var(--urdu); }

/* masthead */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 19px var(--serif); }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--paper); font: 600 18px var(--serif); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: 15.5px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); border-color: var(--accent); }
.menu-btn { display: none; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; font: 15px var(--sans); color: var(--ink); }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; padding: 8px 22px 16px; }
  .nav.open { display: flex; }
}

/* hero */
.hero { position: relative; min-height: 440px; display: grid; align-items: end; color: #fff;
  background: linear-gradient(180deg, rgba(20,14,10,.15) 0%, rgba(20,14,10,.7) 100%), var(--hero) center 50% / cover no-repeat; }
.hero-inner { width: 100%; padding-bottom: 64px; padding-top: 80px; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); margin: 0; color: #fff; }
.hero-tag { font: italic 22px var(--serif); margin: 6px 0 0; opacity: .92; }
.hero-urdu { font: 28px/2 var(--urdu); margin: 0; opacity: .9; text-align: left; }

/* section tiles */
.sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: -40px; position: relative; margin-bottom: 64px; }
.tile { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 22px 22px 18px; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 8px 24px -16px rgba(60,40,20,.35); transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(60,40,20,.5); color: var(--ink); }
.tile h2 { margin: 0 0 6px; font-size: 23px; }
.tile p { margin: 0 0 14px; color: var(--ink-soft); font-size: 16px; flex: 1; }
.tile-urdu { display: block; font: 18px/2.1 var(--urdu); color: var(--accent); text-align: right; margin: -6px 0 0; }
.tile-count { font-size: 14.5px; color: var(--accent); font-weight: 600; }
@media (max-width: 900px) { .sections { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sections { grid-template-columns: 1fr; margin-top: -24px; } }

/* cards */
.section-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
.section-head h2 { margin: 0 0 10px; font-size: 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-bottom: 72px; }
.card { background: #fff; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.card-link { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.card-link:hover h3 { color: var(--accent); }
.card-img { aspect-ratio: 16/10; background: var(--paper-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 4px 0 8px; font-size: 21px; }
.card h3[lang="ur"] { font: 600 21px/2 var(--urdu); text-align: right; }
.excerpt { color: var(--ink-soft); font-size: 15.5px; margin: 0 0 12px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card.rtl .excerpt { text-align: right; line-height: 2.1; font-size: 15px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; color: var(--accent-2); font-weight: 600; margin: 0; }
.kicker a { color: inherit; text-decoration: none; }
.byline, .meta { color: var(--ink-soft); font-size: 14.5px; margin: 0; }
.byline a { color: inherit; }

/* page heads + lists */
.page-head { padding: 56px 22px 20px; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); margin: 0 0 10px; }
.page-head p { color: var(--ink-soft); max-width: 680px; }
.urdu-line { font: 20px/2.2 var(--urdu); color: var(--accent) !important; text-align: right; max-width: none !important; }
.year { font-size: 26px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin: 40px 0 6px; }
.list { list-style: none; padding: 0; margin: 0 0 20px; }
.list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--rule); align-items: baseline; }
.list li a { text-decoration: none; color: var(--ink); font-weight: 600; }
.list li.rtl a { font: 600 18px/2 var(--urdu); }
.list li a:hover { color: var(--accent); }
.list .meta { white-space: nowrap; font-size: 14px; }
.surahs { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 72px; }
.surahs li { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 10px 16px; display: flex; flex-direction: column; }
.surahs a { font: 600 21px/2.1 var(--urdu); text-decoration: none; color: var(--ink); }
.surahs .meta { font-family: var(--sans); font-size: 13px; text-align: left; }

/* post */
.post { padding-top: 48px; padding-bottom: 72px; }
.post-head { border-bottom: 1px solid var(--rule); margin-bottom: 30px; padding-bottom: 18px; }
.post-head h1 { font-size: clamp(32px, 5vw, 48px); margin: 8px 0 12px; }
.post-head h1.urdu-title { font: 600 clamp(30px, 4.6vw, 42px)/2 var(--urdu); text-align: right; }
.prose { font-size: 19px; overflow-wrap: break-word; }
.prose.rtl { font-size: 20px; line-height: 2.25; text-align: right; }
.prose.rtl p, .prose.rtl li { text-align: right !important; }
.prose img { border-radius: 6px; display: block; margin: 12px auto; }
.prose figure { margin: 24px 0; }
.prose figcaption { font-size: 14px; color: var(--ink-soft); text-align: center; }
.prose blockquote { border-inline-start: 3px solid var(--accent); margin: 24px 0; padding: 4px 20px; color: var(--ink-soft); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; }
.prose td, .prose th { border: 1px solid var(--rule); padding: 6px 10px; }
.prose audio { width: 100%; }
.prose iframe { max-width: 100%; }
.video { position: relative; aspect-ratio: 16/9; margin: 24px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.playlist { list-style: none; padding: 0; counter-reset: t; }
.playlist li { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; margin: 10px 0; }
.playlist .track { display: block; font-weight: 600; margin-bottom: 6px; font-family: var(--serif); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 24px 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; margin: 0; }
/* WordPress leftovers */
.wp-block-image, .wp-block-cover { margin: 24px 0; }
.has-text-align-center, .aligncenter { text-align: center; }
.has-text-align-right { text-align: right; }
.wp-block-separator { border: 0; border-top: 1px solid var(--rule); }
.kb-row-layout-wrap, .kt-row-column-wrap, .wp-block-kadence-column { display: block; }
.labels { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px; }
.labels span { background: var(--paper-2); border-radius: 999px; padding: 2px 12px; font-size: 14px; color: var(--ink-soft); }
.comments { margin-top: 48px; border-top: 1px solid var(--rule); padding-top: 12px; }
.comments h2 { font-size: 20px; }
.comments blockquote { margin: 14px 0; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; }
.comments blockquote p { margin: 0 0 6px; }
.comments footer { font-size: 14px; color: var(--ink-soft); }
.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 56px; border-top: 1px solid var(--rule); padding-top: 18px; font-size: 15.5px; }
.pager a { text-decoration: none; max-width: 48%; }
.pager .newer { text-align: right; margin-left: auto; }

/* gallery page */
.masonry { columns: 4 240px; column-gap: 10px; margin-bottom: 72px; }
.masonry a { display: block; margin-bottom: 10px; break-inside: avoid; }
.masonry img { width: 100%; display: block; border-radius: 6px; }

/* lightbox */
.lb { position: fixed; inset: 0; background: rgba(15,10,8,.92); display: none; align-items: center; justify-content: center; z-index: 50; }
.lb.open { display: flex; }
.lb img { max-width: 94vw; max-height: 88vh; border-radius: 4px; }
.lb button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; font-size: 28px; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; }
.lb .x { top: 18px; right: 18px; } .lb .prev { left: 18px; } .lb .next { right: 18px; }

/* footer */
.foot { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 28px 0 36px; text-align: center; color: var(--ink-soft); font-size: 15px; }
.foot .urdu { font-size: 22px; line-height: 2.2; color: var(--accent); margin: 0; }
.foot p { margin: 4px 0; }

.page-head .tile-urdu { text-align: left; margin: 0; }
