/* Pathan Tayar Dhamma E-Library
   Layout: dark page with a centred column; a black top bar with a square logo
   block and search; a grey menu bar with icons; a photo hero with caption panel.

   Palette: the robe and bowl of a Burmese bhikkhu
     Robe Burgundy   #5A2420   logo block, buttons
     Robe Fold       #3D1714   button hover
     Robe Sunlit     #7E3A2E   links on light grounds
     Robe Faded      #A4675A   links on dark grounds
     Thabeik Black   #1E1A19   page, top bar, dark sections
     Lacquer Sheen   #4F4846   muted text
     Lacquer Lid     #2E2826   menu bar, footer
*/

/* ---------- Fonts (stored with the site) ---------- */
@font-face { font-family: "Noto Sans"; src: url("../fonts/noto-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Noto Sans"; src: url("../fonts/noto-sans-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0100-02BA, U+0304, U+0308, U+0323, U+1E00-1E9F; }
@font-face { font-family: "Noto Sans"; src: url("../fonts/noto-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Noto Sans"; src: url("../fonts/noto-sans-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap;
  unicode-range: U+0100-02BA, U+0304, U+0308, U+0323, U+1E00-1E9F; }
/* Logo lettering: EB Garamond */
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0100-02BA, U+0304, U+0308, U+0323, U+1E00-1E9F; }

:root {
  --robe: #5a2420;
  --robe-fold: #3d1714;
  --robe-sunlit: #7e3a2e;
  --robe-faded: #a4675a;
  --thabeik: #1e1a19;
  --sheen: #4f4846;
  --lid: #2e2826;
  --robe-tint: #f4efec;
  --robe-tint-2: #e8ddd9;
  --line: rgba(30, 26, 25, 0.14);
  --sans: "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --box: 1500px;
  --top-h: 64px;
  --nav-h: 56px;
}

/* Overall size: the whole site is shown at 80% on computer screens */
@media (min-width: 901px) { html { zoom: 0.8; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 140px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--thabeik);
  background: var(--thabeik);
}
img { max-width: 100%; display: block; }
a { color: var(--robe-sunlit); }
a:hover { color: var(--robe); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; background: #fff; padding: 8px; z-index: 100; }
.box { width: 100%; max-width: var(--box); margin: 0 auto; position: relative; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; }
.hdr-top { background: var(--thabeik); height: var(--top-h); }
.hdr-top .box { height: 100%; display: flex; align-items: center; gap: 24px; padding: 0 16px 0 170px; }
.logo-block {
  position: absolute;
  left: 0;
  top: 0;
  width: 150px;
  height: calc(var(--top-h) + var(--nav-h));
  background: var(--robe);
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "EB Garamond", Garamond, Georgia, serif;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0.02em;
  z-index: 2;
}
.logo-block span + span { margin-top: 6px; }
.logo-block:hover { color: #fff; background: var(--robe-fold); }
.site-title { color: #fff; text-decoration: none; font-size: 1.7rem; white-space: nowrap; }
.site-title:hover { color: #fff; }
.hdr-search { margin-left: auto; display: flex; height: 44px; width: min(440px, 40vw); border: 1px solid #6e6562; }
.hdr-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  padding: 0 14px;
}
.hdr-search input::placeholder { color: #a39b98; }
.hdr-search input:focus { outline: 2px solid var(--robe-faded); outline-offset: -2px; }
.hdr-search button { width: 48px; border: 0; border-left: 1px solid #6e6562; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.hdr-search button:hover { background: var(--lid); }
.hdr-search svg { width: 22px; height: 22px; }

.main-nav { background: var(--lid); height: var(--nav-h); }
.main-nav .box { height: 100%; padding-left: 170px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > .box > ul { display: flex; align-items: center; height: 100%; gap: 8px; }
.main-nav li { position: relative; }
.main-nav a, .main-nav button.drop {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--nav-h);
  padding: 0 16px;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font: inherit;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  background: none;
  border: 0;
  cursor: pointer;
}
.main-nav a:hover, .main-nav button.drop:hover, .main-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.08); color: #fff; }
.main-nav svg { width: 24px; height: 24px; flex: none; }
.main-nav .sub {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 260px;
  background: var(--lid);
  border-top: 2px solid var(--robe-faded);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 60;
}
.main-nav .sub a { height: auto; padding: 12px 18px; text-transform: none; font-size: 0.98rem; letter-spacing: 0; }
.main-nav li.open > .sub { display: block; }
@media (hover: hover) and (min-width: 901px) { .main-nav li:hover > .sub { display: block; } }
.nav-search { display: none; }
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 1px solid #6e6562; padding: 8px 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; }

@media (max-width: 900px) {
  html { scroll-padding-top: 80px; }
  .hdr-top .box { padding-left: 80px; }
  .logo-block { width: 64px; height: var(--top-h); font-size: 0.82rem; }
  .logo-block span + span { margin-top: 3px; }
  .site-title { font-size: 1.2rem; }
  .hdr-search { display: none; }
  .nav-toggle { display: block; }
  .main-nav { display: none; height: auto; }
  .main-nav.open { display: block; }
  .main-nav .box { padding-left: 0; }
  .main-nav > .box > ul { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0 12px; }
  .main-nav a, .main-nav button.drop { width: 100%; height: 50px; }
  .main-nav .sub { position: static; box-shadow: none; border-top: 0; background: rgba(0, 0, 0, 0.2); }
  .main-nav .sub a { padding-left: 50px; }
  .nav-search { display: block; padding: 8px 16px 0; }
  .nav-search .hdr-search { display: flex; width: 100%; margin: 0; }
}

/* ---------- Main column ---------- */
main { flex: 1 0 auto; width: 100%; max-width: var(--box); margin: 0 auto; background: var(--robe-tint); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1.3;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--robe); color: #fff; }
.btn-primary:hover { background: var(--robe-fold); color: #fff; }

/* ---------- Home: hero ---------- */
.hero-media { position: relative; aspect-ratio: 16 / 6.6; background: var(--lid) center / cover no-repeat; }
.hero-caption { background: var(--robe-tint-2); padding: 44px 110px 50px; }
.hero-kicker { font-size: 0.95rem !important; text-transform: uppercase; letter-spacing: 0.06em; color: var(--robe-sunlit); margin-bottom: 8px !important; }
.hero-caption h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 700; margin-bottom: 18px; }
/* Featured article title: a link that underlines only while hovered, like the Featured cards. */
.hero-title, .hero-title:hover { color: inherit; text-decoration: none; }
.hero-title:hover, .hero-title:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.hero-caption p { font-size: 1.35rem; margin-bottom: 26px; max-width: 900px; }

/* ---------- Home: featured ---------- */
.dark-band { background: var(--thabeik); color: #fff; padding: 44px 110px 56px; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 26px; }
.band-head h2 { font-size: 2.1rem; font-weight: 700; margin: 0; }
.band-head a { color: var(--robe-faded); font-size: 1.3rem; text-decoration: none; }
.band-head a:hover { color: var(--robe-tint-2); text-decoration: underline; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.feature { color: #fff; text-decoration: none; display: block; }
.feature-img { aspect-ratio: 16 / 10; background: var(--lid) center / cover no-repeat; margin-bottom: 14px; }
.feature h3 { font-size: 1.3rem; font-weight: 700; margin: 0 0 6px; }
.feature p { color: #cfc6c3; margin: 0; }
.feature:hover h3 { text-decoration: underline; }
.feature-img-plain { display: grid; place-items: center; background: linear-gradient(135deg, var(--robe-fold), var(--robe)); color: rgba(255, 255, 255, 0.85); }
.feature-img-plain .ico { width: 54px; height: 54px; }
.feature:hover { color: #fff; }

/* ---------- Home: text band ---------- */
.text-band { padding: 56px 110px 64px; }
.text-band h2 { font-size: 2.1rem; font-weight: 700; margin-bottom: 18px; }
.text-band p { font-size: 1.12rem; line-height: 1.75; max-width: 820px; }
.text-band .quote { font-size: 1.35rem; margin: 6px 0 4px; }
.text-band .quote span { display: block; color: var(--robe-sunlit); }
.text-band .cite { color: var(--sheen); font-size: 0.95rem; margin-bottom: 22px; }

@media (max-width: 900px) {
  .hero-media { aspect-ratio: 16 / 9; }
  .hero-caption, .dark-band, .text-band { padding-left: 22px; padding-right: 22px; }
  .hero-caption p { font-size: 1.15rem; }
  .feature-grid { grid-template-columns: 1fr; gap: 30px; }
}

/* ---------- Inner pages ---------- */
.section { padding: 48px 0 64px; }
.wrap { max-width: 1300px; margin: 0 auto; padding: 0 40px; }
.section h2 { font-size: 2rem; font-weight: 700; }
.small { font-size: 0.92rem; }
.muted { color: var(--sheen); }
@media (max-width: 600px) { .wrap { padding: 0 20px; } }

/* Article page */
.page { max-width: 760px; margin: 0 auto; padding: 56px 40px 72px; }
.page-img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; margin-bottom: 32px; }
.page h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 700; margin: 0 0 6px; }
.page-sub { font-style: italic; color: var(--sheen); font-size: 1.15rem; margin: 0 0 28px; }
.page p { font-size: 1.1rem; line-height: 1.8; margin: 0 0 1.2em; }
.page-file { margin-top: 32px !important; }
@media (max-width: 600px) { .page { padding: 40px 20px 56px; } }


/* Library page */
.lib-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.lib-head .count { font-size: 0.9rem; color: var(--sheen); text-align: right; min-width: 80px; }
.search {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 12px 14px;
  border: 1px solid #c9bdb8;
  border-radius: 2px;
  background: #fff;
  margin: 10px 0 16px;
}
.search:focus { outline: 2px solid var(--robe); outline-offset: 1px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { font: inherit; font-size: 0.92rem; padding: 6px 14px; border-radius: 2px; border: 1px solid #c9bdb8; background: #fff; color: var(--thabeik); cursor: pointer; }
.chip.active { background: var(--robe); color: #fff; border-color: var(--robe); }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.letters a, .letters span { display: inline-block; min-width: 32px; text-align: center; padding: 4px 6px; background: #fff; font-size: 0.9rem; font-weight: 700; text-decoration: none; }
.letters span { color: #cbbfba; font-weight: 400; }
.letter-head { color: var(--robe); font-size: 1.4rem; margin: 28px 0 14px; }
.empty { padding: 30px 0; color: var(--sheen); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }
.card { background: #fff; padding: 18px; border-top: 3px solid var(--robe); display: flex; flex-direction: column; }
.card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.card .tag { font-size: 0.8rem; color: var(--sheen); margin-bottom: 4px; }
.card .meta { font-size: 0.88rem; color: var(--sheen); font-style: italic; margin-bottom: 8px; }
.card p { font-size: 0.95rem; margin: 0; }
[hidden] { display: none !important; }

/* FAQ */
.faq { max-width: 860px; }
.faq details { background: #fff; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 20px; font-size: 1.1rem; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; display: inline-block; width: 22px; color: var(--robe); }
.faq details[open] summary::before { content: "\2212"; }
.faq details > div { padding: 0 20px 16px 42px; }

/* Governance */
.gv { max-width: 680px; text-align: center; }
.gv p { font-size: 1.1rem; line-height: 1.75; }

/* ---------- Footer ---------- */
.site-footer { background: var(--lid); color: #ddd3cf; font-size: 0.97rem; }
.ft-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2.4fr); gap: 56px; padding: 56px 40px 48px; }
.ft-brand .logo { color: #fff; text-decoration: none; display: inline-block; line-height: 1; }
.ft-brand .logo-mark {
  width: 120px;
  height: 120px;
  background: var(--robe);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "EB Garamond", Garamond, Georgia, serif;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}
.ft-brand .logo-mark span + span { margin-top: 6px; }
.ft-brand .logo:hover .logo-mark { background: var(--robe-fold); }
.ft-brand .logo-tag { display: block; margin-top: 12px; color: #cfc6c3; }
.ft-brand p { margin: 18px 0 0; color: #cfc6c3; max-width: 300px; }
.ft-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 32px; }
.ft-col h3 { font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.ft-col ul { list-style: none; margin: 0; padding: 0; }
.ft-col li { padding: 4px 0; }
.ft-col a { color: #ddd3cf; text-decoration: none; }
.ft-col a:hover { color: #fff; text-decoration: underline; }
.ft-bar { background: var(--thabeik); font-size: 0.88rem; color: #b3aaa6; }
.ft-bar-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 40px; }
.ft-top { color: #ddd3cf; text-decoration: none; }
.ft-top:hover { color: #fff; text-decoration: underline; }
@media (max-width: 860px) { .ft-main { grid-template-columns: 1fr; gap: 36px; padding: 44px 20px 40px; } .ft-bar-inner { padding: 16px 20px; } }

/* ---------- Content ground: darker shades of Lacquer Lid ----------
   Darker than the menu bar and footer (#2E2826), with light text throughout:
     Lid shade 20%  #25201e   page background
     Lid shade 42%  #1b1716   panels, cards, inputs, the Featured band */
:root { --lid-d20: #25201e; --lid-d42: #1b1716; }
main { background: var(--lid-d20); color: #ece4e1; }
main h1, main h2, main h3 { color: #fff; }
main a { color: #d39a8b; }
main a:hover { color: #fff; }
main .btn-primary, main .btn-primary:hover { color: #fff; }
.muted, .lib-head .count, .page-sub, .text-band .cite, .card .tag, .card .meta { color: #b9afab; }

/* home */
.hero-media { background-color: var(--lid-d42); }
.hero-caption { background: var(--lid-d20); }
.hero-kicker { color: #d39a8b; }
.dark-band { background: var(--lid-d42); color: #fff; }
.band-head a { color: #d39a8b; }
.band-head a:hover { color: #fff; }
.feature, .feature:hover { color: #fff; }
.feature p { color: #cfc6c3; }
.feature-img { background-color: var(--lid-d20); }
.text-band { background: var(--lid-d20); }
.text-band .quote span { color: #d39a8b; }

/* library */
.search { background: var(--lid-d42); border-color: #5a524f; color: #fff; }
.search::placeholder { color: #9c9390; }
.search:focus { outline-color: var(--robe-faded); }
.chip { background: var(--lid-d42); border-color: #5a524f; color: #ece4e1; }
.chip.active { background: var(--robe); border-color: var(--robe); color: #fff; }
/* Section chips are checkboxes: a tick shows which sections are included. */
.chip-check { display: inline-flex; align-items: center; gap: 6px; }
.chip-tick { width: 14px; height: 14px; flex: none; opacity: 0; margin-inline-start: -4px; transition: opacity 0.15s ease; }
.chip-check.active .chip-tick { opacity: 1; }
.chip-check:not(.active) { opacity: 0.75; }
.chip-check:not(.active):hover { opacity: 1; }
.letters a { background: var(--lid-d42); color: #d39a8b; }
.letters span { background: var(--lid-d42); color: #5a524f; }
.letter-head { color: #d39a8b !important; }
.card { background: var(--lid-d42); border-top-color: var(--robe-faded); }
.card p { color: #ddd3cf; }

/* faq */
.faq details { background: var(--lid-d42); }
.faq summary { color: #fff; }
.faq summary::before { color: #d39a8b; }

/* ---------- Language link and chooser ---------- */
.lang-link {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: #d39a8b;
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 6px 4px;
  white-space: nowrap;
}
.lang-link svg { width: 24px; height: 24px; color: #fff; }
.lang-link:hover span { text-decoration: underline; color: #fff; }
.lang-link + .hdr-search { margin-left: 8px; }
.lang-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 8, 8, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lang-box { background: var(--lid); color: #fff; width: min(420px, 100%); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.lang-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.lang-head h2 { font-size: 1.25rem; margin: 0; color: #fff; }
.lang-close { background: none; border: 0; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.lang-list { list-style: none; margin: 0; padding: 8px 0; }
.lang-list button {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: #ece4e1;
  font: inherit;
  font-size: 1.1rem;
  padding: 12px 22px;
  cursor: pointer;
}
.lang-list button:hover, .lang-list button:focus-visible { background: rgba(255, 255, 255, 0.08); color: #fff; outline: none; }
.lang-list button.active { color: #fff; font-weight: 700; box-shadow: inset 4px 0 0 var(--robe-faded); }
@media (max-width: 900px) {
  .lang-link { font-size: 0.95rem; gap: 6px; }
  .lang-link svg { width: 20px; height: 20px; }
  .nav-toggle { margin-left: 8px; }
}
@media (max-width: 420px) { .lang-link span { display: none; } }

/* ---------- Right-to-left languages (Urdu, Arabic) ---------- */
html.rtl body { font-family: "Noto Sans", "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif; }
html.rtl [lang="pi"] { unicode-bidi: isolate; }
[dir="rtl"] .defs-n, [dir="rtl"] .faq details > div { text-align: right; }
[dir="rtl"] .faq details > div { padding: 0 42px 16px 20px; }
[dir="rtl"] .card { text-align: right; }

/* Urdu: Nastaliq script */
@font-face { font-family: "Noto Nastaliq Urdu"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/noto-nastaliq-urdu-arabic-400-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Nastaliq Urdu"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/noto-nastaliq-urdu-arabic-700-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
html[lang="ur"] body, [lang="ur"] { font-family: "Noto Sans", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif; }
html[lang="ur"] body { line-height: 2.1; }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3 { line-height: 1.9; }
html[lang="ur"] .main-nav, html[lang="ur"] .lang-link, html[lang="ur"] .hdr-search input { line-height: 1.8; }

/* ---------- Dropdown panels (Library, Buddha's Teachings, Charity) ---------- */
.main-nav { position: relative; }
.main-nav li.mega { position: static; }
.main-nav button.drop .chev { width: 16px; height: 16px; margin-left: -2px; opacity: 0.7; transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
.main-nav li.mega.open > button.drop { background: rgba(255, 255, 255, 0.1); }
.main-nav li.mega.open > button.drop .chev { transform: rotate(180deg); }
.main-nav li.mega.current > button.drop { box-shadow: inset 0 -3px 0 var(--robe-faded); }

.mega-panel {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 60;
  background: var(--lid);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.55);
  visibility: hidden;
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transform: translateY(-6px);
  transition: clip-path 0.38s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.38s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s ease, visibility 0s linear 0.38s;
}
.main-nav li.mega.open > .mega-panel {
  visibility: visible; opacity: 1; clip-path: inset(0 0 -60px 0); transform: none;
  transition: clip-path 0.42s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.42s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s ease, visibility 0s;
}
.mega-inner { display: grid; grid-template-columns: 230px 1fr; gap: 40px; padding: 30px 32px 34px 202px; }
.mega-name { margin: 0 0 8px; color: #fff; font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.mega-text { margin: 0; color: #b9afab; font-size: 0.95rem; line-height: 1.55; }
.mega-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.mega-list li {
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.main-nav li.mega.open .mega-list li { opacity: 1; transform: none; transition-delay: calc(0.06s + var(--i, 0) * 0.035s); }
.main-nav .mega-item {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  height: 100%; min-height: 84px;
  padding: 14px 16px 14px 18px;
  background: rgba(255, 255, 255, 0.035);
  border-radius: 2px;
  text-transform: none; letter-spacing: 0;
  overflow: hidden;
  transition: background 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.main-nav .mega-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--robe-faded); transform: scaleY(0); transform-origin: top;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.main-nav .mega-item:hover, .main-nav .mega-item:focus-visible { background: rgba(255, 255, 255, 0.085); transform: translateY(-2px); }
.main-nav .mega-item:hover::before, .main-nav .mega-item:focus-visible::before, .main-nav .mega-item[aria-current="page"]::before { transform: scaleY(1); }
.main-nav .mega-item[aria-current="page"] { background: rgba(255, 255, 255, 0.07); }
.mi-kicker { color: #d39a8b; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.mi-title { color: #fff; font-size: 1.04rem; font-weight: 700; line-height: 1.3; }
.mi-sub { color: #b9afab; font-size: 0.88rem; line-height: 1.45; }
.mega-panel[dir="rtl"] .mega-inner { padding: 30px 202px 34px 32px; }
.mega-panel[dir="rtl"] .mega-item { text-align: right; padding: 14px 18px 14px 16px; }
.mega-panel[dir="rtl"] .mega-item { align-items: flex-start; }
.mega-panel[dir="rtl"] .mega-item::before { left: auto; right: 0; }
@media (prefers-reduced-motion: reduce) {
  .mega-panel, .mega-list li, .main-nav .mega-item, .main-nav .mega-item::before, .main-nav button.drop .chev { transition: none !important; }
}
@media (max-width: 900px) {
  .main-nav .mega-panel { position: static; box-shadow: none; border-top: 0; background: rgba(0, 0, 0, 0.18); display: none; clip-path: none; transform: none; }
  .main-nav li.mega.open > .mega-panel { display: block; }
  .mega-inner, .mega-panel[dir="rtl"] .mega-inner { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px 18px; }
  .mega-intro { display: none; }
  .mega-list { grid-template-columns: 1fr 1fr; gap: 8px; }
  .main-nav .mega-item { min-height: 0; padding: 12px 14px; }
  .main-nav .mega-item:hover { transform: none; }
}
@media (max-width: 520px) { .mega-list { grid-template-columns: 1fr; } }
/* panel layout: heading row, then one horizontal row of items */
.mega-inner, .mega-panel[dir="rtl"] .mega-inner { display: block; padding: 22px 32px 28px; }
.mega-intro { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.mega-name { margin: 0; font-size: 1.15rem; }
.mega-text { font-size: 0.92rem; }
.mega-list {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(148px, 1fr);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #5a514e transparent;
  padding-bottom: 4px;
}
.mega-list li { scroll-snap-align: start; }
.main-nav .mega-item { min-height: 92px; }
.ft-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; }
@media (max-width: 900px) {
  .mega-list { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr 1fr; overflow: visible; }
  .ft-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .mega-list { grid-template-columns: 1fr; } }
.mega-list { grid-auto-columns: minmax(0, 1fr); overflow-x: visible; }
.main-nav .mega-item { padding: 14px 14px 14px 16px; }
.mi-title { font-size: 0.98rem; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .mega-inner, .mega-panel[dir="rtl"] .mega-inner { padding: 10px 16px 16px; }
  .mega-intro { display: none; }
  .mega-list { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .main-nav .mega-item { min-height: 0; padding: 12px 14px; }
}
@media (max-width: 520px) { .mega-list { grid-template-columns: 1fr; } }
.mi-title { overflow-wrap: normal; hyphens: manual; }
.mega-item:not(:has(.mi-sub)) { min-height: 64px; justify-content: center; }

/* ---------- Article body (from markdown) and download button ---------- */
.page-body h2 { font-size: 1.5rem; margin: 1.6em 0 0.5em; color: #fff; }
.page-body h3, .page-body h4 { font-size: 1.2rem; margin: 1.4em 0 0.4em; color: #fff; }
.page-body ul, .page-body ol { font-size: 1.1rem; line-height: 1.8; margin: 0 0 1.2em; padding-inline-start: 1.4em; }
.page-body blockquote { margin: 0 0 1.2em; padding: 4px 0 4px 20px; border-left: 3px solid var(--robe-faded); }
[dir="rtl"] .page-body blockquote { padding: 4px 20px 4px 0; border-left: 0; border-right: 3px solid var(--robe-faded); }
.page-body blockquote p { font-style: italic; margin: 0; }
.page-body img { max-width: 100%; height: auto; margin: 0.4em 0 1.2em; }
.page-body hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); margin: 2em 0; }
.dl { display: flex; align-items: center; gap: 14px; margin-top: 36px; }
.dl-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px 13px 20px;
  background: var(--robe); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.02rem; letter-spacing: 0.02em;
  border: 1px solid var(--robe-sunlit);
  transition: background 0.2s ease;
}
.dl-btn:hover { background: var(--robe-sunlit); color: #fff; }
.dl-btn svg { width: 20px; height: 20px; flex: none; }
.dl-info { display: flex; flex-direction: column; line-height: 1.3; }
.dl-type { color: #fff; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; }
.dl-size { color: #b9afab; font-size: 0.82rem; }
.page-gap { height: 22px; }

/* ---------- Audio and video players (media articles and markdown) ---------- */
.md-media { margin: 0 0 32px; }
.page-body .md-media { margin: 0.6em 0 1.6em; }
.md-media video, .md-video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid rgba(255, 255, 255, 0.1); }
.md-video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.md-audio { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 16px 18px; background: var(--lid); border: 1px solid rgba(255, 255, 255, 0.1); border-inline-start: 3px solid var(--robe-faded); }
.md-media-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; background: var(--robe); color: #fff; }
.md-media-ico .ico { width: 24px; height: 24px; }
.md-audio audio { flex: 1 1 260px; min-width: 0; height: 44px; color-scheme: dark; }
.md-media figcaption { flex-basis: 100%; margin-top: 8px; color: #b9afab; font-size: 0.92rem; font-style: italic; }
.md-audio figcaption { margin-top: 0; }

/* ---------- Icons in dropdown cards ---------- */
.main-nav .mega-item.has-ico { padding-top: 14px; }
.mi-ico { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 6px; border-radius: 2px; background: rgba(164, 103, 90, 0.16); color: #e2a999; transition: background 0.25s ease, color 0.25s ease; }
.mi-ico .ico { width: 20px; height: 20px; }
.main-nav .mega-item:hover .mi-ico, .main-nav .mega-item:focus-visible .mi-ico { background: var(--robe); color: #fff; }
.mega-item:not(:has(.mi-sub)).has-ico { flex-direction: row; align-items: center; gap: 12px; }
.mega-item:not(:has(.mi-sub)).has-ico .mi-ico { margin-bottom: 0; }
@media (max-width: 900px) { .mi-ico { width: 30px; height: 30px; } }

/* ---------- Pages from the pages folder ---------- */
.page.cpage { max-width: 1180px; padding-top: 0; }
.cpage-hero { position: relative; margin: 0 -40px 40px; min-height: 340px; display: flex; align-items: flex-end; overflow: hidden; background: var(--lid-d42); }
.cpage-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cpage-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27, 23, 22, 0.15) 0%, rgba(27, 23, 22, 0.55) 55%, rgba(27, 23, 22, 0.95) 100%); }
.cpage-hero-text { position: relative; z-index: 1; padding: 0 40px 34px; }
.cpage-hero h1 { margin: 0; color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.cpage-hero .page-sub { margin: 8px 0 0; color: #e7dcd8; }
.cpage-ico { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px; background: var(--robe); color: #fff; }
.cpage-ico .ico { width: 26px; height: 26px; }
.cpage .page-body { max-width: 760px; margin: 0 auto; }
.cpage .page-body > p:first-child { font-size: 1.28rem; line-height: 1.65; color: #f1e9e6; }
.cpage .page-body h2 { position: relative; margin-top: 2.2em; padding-top: 1.1em; border-top: 1px solid rgba(255, 255, 255, 0.1); }
@media (max-width: 600px) { .cpage-hero { margin: 0 -20px 28px; min-height: 240px; } .cpage-hero-text { padding: 0 20px 24px; } }
/* Blog articles: the same photo header as the charity pages; the text keeps the usual article width. */
.page.blog { max-width: 1180px; padding-top: 0; }
.page.blog .page-body, .page.blog .dl { max-width: 760px; margin-inline: auto; }
.page.blog .cpage-hero h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
/* Search page: the same photo header as the charity pages, flush under the menu. */
.section.lib-section { padding-top: 0; }
.lib-hero { margin-bottom: 28px; }
.lib-hero .lib-hero-img { transition: opacity 0.45s ease; }
.lib-hero .lib-hero-img.fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .lib-hero .lib-hero-img { transition: none; } }
.lib-hero h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 700; }
.lib-section .lib-head p { margin-top: 0; }

/* cards block */
.md-cards { list-style: none; padding: 0 !important; margin: 8px 0 1.8em !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.md-card { display: flex; flex-direction: column; gap: 8px; padding: 20px 18px; background: var(--lid-d42); border-top: 2px solid var(--robe-faded); font-size: 1rem; line-height: 1.45; }
.md-card-ico { display: grid; place-items: center; width: 40px; height: 40px; background: rgba(164, 103, 90, 0.16); color: #e2a999; }
.md-card-ico .ico { width: 22px; height: 22px; }
.md-card-title { color: #fff; font-weight: 700; }
.md-card-text { color: #b9afab; font-size: 0.93rem; }

/* form block */
.md-form { margin: 18px 0 2em; padding: 28px 28px 24px; background: var(--lid-d42); border-left: 3px solid var(--robe-faded); }
[dir="rtl"] .md-form { border-left: 0; border-right: 3px solid var(--robe-faded); }
.md-form-title { margin: 0 0 6px !important; font-size: 1.2rem; color: #fff; }
.md-form-text { margin: 0 0 18px !important; color: #b9afab; font-size: 0.98rem !important; }
.md-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.md-field { display: flex; flex-direction: column; gap: 6px; }
.md-field.wide { grid-column: 1 / -1; }
.md-field label { font-size: 0.9rem; color: #ddd3cf; }
.md-field .req { color: #d39a8b; }
.md-field input, .md-field textarea {
  font: inherit; font-size: 1rem; color: #fff; background: var(--lid-d20); border: 1px solid #4a423f; border-radius: 0;
  padding: 11px 12px; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.md-field textarea { resize: vertical; min-height: 110px; }
.md-field input:focus, .md-field textarea:focus { outline: none; border-color: var(--robe-faded); box-shadow: 0 0 0 3px rgba(164, 103, 90, 0.25); }
.md-field input:user-invalid, .md-field textarea:user-invalid { border-color: #c46a5a; }
.md-honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.md-form-foot { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.md-form-foot .dl-btn { cursor: pointer; font-family: inherit; }
.md-form-foot .dl-btn[disabled] { opacity: 0.6; cursor: wait; }
.md-form-foot .dl-btn .ico { width: 18px; height: 18px; }
.md-form-status { margin: 0 !important; font-size: 0.95rem !important; color: #b9afab; }
.md-form-status.ok { color: #a9c79a; }
.md-form-status.err { color: #e08b7b; }
@media (max-width: 600px) { .md-form { padding: 22px 18px; } .md-form-grid { grid-template-columns: 1fr; } }
.cpage .page-body h3 { font-size: 1.55rem; margin: 2.2em 0 0.5em; padding-top: 1.1em; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.cpage .page-body h3.md-form-title { font-size: 1.2rem; border: 0; padding: 0; }
.md-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.md-cards { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); } .md-card { padding: 18px 14px; }

/* cards block: a vertical flow with a line linking the icons */
.md-cards {
  position: relative; display: block; margin: 14px 0 2em !important; padding: 6px 0 !important;
  grid-template-columns: none;
}
.md-cards::before {
  content: ""; position: absolute; top: 34px; bottom: 34px; left: 27px; width: 1px;
  background: linear-gradient(180deg, var(--robe-faded), rgba(164, 103, 90, 0.25));
}
[dir="rtl"] .md-cards::before { left: auto; right: 27px; }
.md-card {
  position: relative; display: grid; grid-template-columns: 56px 1fr; column-gap: 20px; align-items: center;
  padding: 14px 0; background: none; border: 0; border-top: 0;
}
.md-card + .md-card .md-card-title { }
.md-card-ico {
  grid-row: 1 / span 2; width: 56px; height: 56px; border-radius: 50%;
  background: var(--lid-d20); border: 1px solid var(--robe-faded); color: #e2a999;
  box-shadow: 0 0 0 6px var(--lid-d20); position: relative; z-index: 1;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.md-card-ico .ico { width: 24px; height: 24px; }
.md-card-title { font-size: 1.12rem; align-self: end; }
.md-card:not(:has(.md-card-text)) .md-card-title { grid-row: 1 / span 2; align-self: center; }
.md-card-text { align-self: start; margin-top: 2px; }
.md-card:hover .md-card-ico { background: var(--robe); color: #fff; transform: scale(1.06); }
.md-card + .md-card::after {
  content: ""; position: absolute; top: 0; left: 76px; right: 0; height: 1px; background: rgba(255, 255, 255, 0.07);
}
[dir="rtl"] .md-card + .md-card::after { left: 0; right: 76px; }
.md-card-ico { box-shadow: none; } .md-card { padding: 18px 0; }
.md-cards::before { width: 2px; left: 27px; background: linear-gradient(180deg, rgba(164, 103, 90, 0.9), rgba(164, 103, 90, 0.35)); } [dir="rtl"] .md-cards::before { right: 27px; left: auto; }

/* ---------- Header: Options + language, with room around them ---------- */
.opt-link, .lang-link {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  background: none; border: 1px solid transparent; color: #e7dcd8; font: inherit; font-size: 1rem;
  cursor: pointer; white-space: nowrap; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.opt-link { margin-left: auto; }
.lang-link { margin-left: 2px; color: #d39a8b; }
.opt-link svg, .lang-link svg { width: 22px; height: 22px; color: #fff; }
.opt-link:hover, .lang-link:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); color: #fff; }
.lang-link:hover span { text-decoration: none; }
.lang-link + .hdr-search { margin-left: 18px; }
.hdr-search { width: min(360px, 30vw); }
@media (max-width: 900px) {
  .opt-link, .lang-link { padding: 0 10px; height: 40px; }
  .opt-link span { display: none; }
}
@media (max-width: 520px) { .lang-link span { display: none; } }

/* ---------- Text size option ---------- */
html.ts-s { font-size: 90%; }
html.ts-l { font-size: 115%; }

/* ---------- Header: Options and language side by side ---------- */
.opt-link, .lang-link { color: #e7dcd8; padding: 0 10px; }
.opt-link { margin-left: auto; }
.lang-link { margin-left: 0; }
.opt-link + .lang-link { border-left: 1px solid rgba(255, 255, 255, 0.14); }
.lang-link + .hdr-search { margin-left: 16px; }

/* ---------- Site Options panel (two panes) ---------- */
.opt-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(10, 8, 8, 0); transition: background 0.22s ease; }
.opt-modal.open { background: rgba(10, 8, 8, 0.66); }
html.opt-lock { overflow: hidden; }
.opt-box {
  width: min(980px, 100%); height: min(640px, calc(100vh - 48px));
  display: grid; grid-template-columns: 270px 1fr;
  background: var(--lid); color: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); overflow: hidden;
  opacity: 0; transform: translateY(14px) scale(0.985); transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.opt-modal.open .opt-box { opacity: 1; transform: none; }
.opt-side { background: var(--lid-d42); padding: 30px 16px; display: flex; flex-direction: column; gap: 6px; }
.opt-side h2 { margin: 0 12px 20px; font-size: 1.4rem; color: #fff; }
.opt-tab { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px; background: none; border: 0; color: #fff; font: inherit; text-align: start; cursor: pointer; transition: background 0.18s ease; }
.opt-tab:hover, .opt-tab:focus-visible { background: rgba(255, 255, 255, 0.05); outline: none; }
.opt-tab.on { background: rgba(255, 255, 255, 0.09); }
.opt-ico { display: grid; place-items: center; width: 42px; height: 42px; flex: none; background: rgba(255, 255, 255, 0.07); color: #fff; }
.opt-ico svg { width: 21px; height: 21px; }
.opt-tab-text { display: flex; flex-direction: column; line-height: 1.35; }
.opt-label { font-weight: 700; font-size: 1.02rem; }
.opt-value { color: #a39b98; font-size: 0.9rem; }
.opt-main { position: relative; overflow-y: auto; padding: 30px 36px 36px; }
.opt-close { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 42px; height: 42px; background: none; border: 0; color: #e7dcd8; cursor: pointer; }
[dir="rtl"] .opt-close { right: auto; left: 18px; }
.opt-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.opt-close svg { width: 22px; height: 22px; }
.opt-view { display: none; animation: optIn 0.28s cubic-bezier(0.2, 0.7, 0.2, 1); }
.opt-view.on { display: block; }
@keyframes optIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.opt-view h3 { margin: 4px 0 20px; font-size: 1.6rem; color: #fff; }
.opt-search { position: relative; margin-bottom: 22px; }
.opt-search svg { position: absolute; top: 50%; left: 16px; width: 20px; height: 20px; transform: translateY(-50%); color: #a39b98; pointer-events: none; }
[dir="rtl"] .opt-search svg { left: auto; right: 16px; }
.opt-search input { width: 100%; height: 54px; padding: 0 18px 0 48px; font: inherit; font-size: 1.08rem; color: #fff; background: var(--lid-d20); border: 1px solid #4a423f; border-radius: 0; }
[dir="rtl"] .opt-search input { padding: 0 48px 0 18px; }
.opt-search input:focus { outline: none; border-color: #8f8582; }
.opt-langs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.opt-langs button, .opt-sizes button {
  position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 18px 18px 16px; background: var(--lid-d20); border: 1px solid rgba(255, 255, 255, 0.06); color: #fff; font: inherit; text-align: start; cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.opt-langs button:hover, .opt-sizes button:hover, .opt-langs button:focus-visible, .opt-sizes button:focus-visible { background: #2a2422; border-color: rgba(255, 255, 255, 0.18); outline: none; transform: translateY(-1px); }
.opt-langs button.active, .opt-sizes button.active { border-color: rgba(255, 255, 255, 0.55); background: #2a2422; }
.ol-native { font-size: 1.25rem; font-weight: 700; }
.ol-local { color: #a39b98; font-size: 0.92rem; }
.ol-check { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; color: #fff; }
[dir="rtl"] .ol-check { right: auto; left: 14px; }
.ol-check svg { width: 20px; height: 20px; display: block; }
.ol-native[lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; line-height: 1.9; font-weight: 400; }
.opt-empty { color: #a39b98; }
.opt-sizes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.opt-sizes button { align-items: center; padding: 30px 18px 22px; gap: 14px; }
.os-sample { font-weight: 700; color: #fff; line-height: 1; height: 64px; display: grid; place-items: center; }
.os-s { font-size: 1.6rem; } .os-m { font-size: 2.3rem; } .os-l { font-size: 3.1rem; }
@media (max-width: 760px) {
  .opt-modal { padding: 0; }
  .opt-box { width: 100%; height: 100%; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .opt-side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 16px 64px 12px 14px; gap: 6px; }
  [dir="rtl"] .opt-side { padding: 16px 14px 12px 64px; }
  .opt-side h2 { width: 100%; margin: 0 4px 8px; font-size: 1.2rem; }
  .opt-tab { width: auto; flex: 1; padding: 8px 10px; }
  .opt-ico { width: 34px; height: 34px; }
  .opt-main { padding: 20px 16px 28px; }
  .opt-close { top: 12px; right: 12px; }
  .opt-view h3 { display: none; }
  .opt-langs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .opt-sizes { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .opt-box, .opt-modal, .opt-view { transition: none !important; animation: none !important; } }

/* ---------- Neutral tones on the newer elements ---------- */
.mi-ico { background: rgba(255, 255, 255, 0.07); color: #fff; }
.main-nav .mega-item:hover .mi-ico, .main-nav .mega-item:focus-visible .mi-ico { background: rgba(255, 255, 255, 0.14); color: #fff; }
.main-nav .mega-item::before { display: none; }
.main-nav .mega-item[aria-current="page"] { background: rgba(255, 255, 255, 0.09); }
.main-nav li.mega.current > button.drop { box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.6); }
.md-cards::before { background: rgba(255, 255, 255, 0.16); }
.md-card-ico { border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.md-card:hover .md-card-ico { background: rgba(255, 255, 255, 0.1); color: #fff; }
.md-form { border-left: 0; }
[dir="rtl"] .md-form { border-right: 0; }
.md-field .req { color: #a39b98; }
.md-field input:focus, .md-field textarea:focus { border-color: #8f8582; box-shadow: none; }
.cpage-ico { background: rgba(255, 255, 255, 0.14); }
.page-body blockquote { border-color: rgba(255, 255, 255, 0.25); }
html[lang="ur"] .opt-tab-text { line-height: 1.9; }
@media (max-width: 760px) {
  .opt-close { position: fixed; top: 10px; right: 10px; z-index: 2; }
  [dir="rtl"] .opt-close { right: auto; left: 10px; }
}

/* ---------- Author: byline on blog articles and the profile page ---------- */
.byline { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; font-size: 1rem; }
.page.blog .byline { max-width: 760px; margin-inline: auto; }
.byline-ico, .profile-ico { flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--robe); color: #fff; }
.byline-ico { width: 34px; height: 34px; }
.byline-ico .ico { width: 19px; height: 19px; }
.byline-ico img, .profile-ico img { width: 100%; height: 100%; object-fit: cover; }
.byline-name, .byline-name:hover { color: #f1e9e6; font-weight: 700; text-decoration: none; }
.byline-name:hover, .byline-name:focus-visible { text-decoration: underline; text-underline-offset: 0.15em; }
.page.author-page { max-width: 1180px; }
.profile { display: flex; align-items: center; gap: 24px; margin-bottom: 26px; }
.profile-ico { width: 96px; height: 96px; }
.profile-ico .ico { width: 52px; height: 52px; }
.profile-kicker { margin: 0 0 4px !important; font-size: 0.85rem !important; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #d39a8b; }
.profile h1 { margin: 0; }
.profile .page-sub { margin: 4px 0 0; }
.profile-bio { max-width: 760px; }
.profile-head { font-size: 1.5rem; margin: 40px 0 18px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.profile-count { font-size: 0.95rem; font-weight: 400; color: #b9afab; margin-inline-start: 6px; }
@media (max-width: 600px) { .profile { gap: 16px; } .profile-ico { width: 72px; height: 72px; } .profile-ico .ico { width: 40px; height: 40px; } }

/* Photo credit in the corner of a blog article's header photo. */
.hero-credit { position: absolute; z-index: 1; right: 12px; top: 10px; padding: 3px 8px; font-size: 0.72rem; color: rgba(255, 255, 255, 0.8); background: rgba(0, 0, 0, 0.4); text-decoration: none; }
a.hero-credit:hover { color: #fff; text-decoration: underline; }
[dir="rtl"] .hero-credit { right: auto; left: 12px; }

/* Library page fills the full width of the site frame */
.lib-section .wrap { max-width: none; padding: 0 88px; }
.lib-section .lib-hero { margin: 0 -88px 32px; }
.lib-section .lib-hero .cpage-hero-text { padding-left: 88px; padding-right: 88px; }
@media (max-width: 900px) {
  .lib-section .wrap { padding: 0 20px; }
  .lib-section .lib-hero { margin: 0 -20px 24px; }
  .lib-section .lib-hero .cpage-hero-text { padding-left: 20px; padding-right: 20px; }
}

/* Small screens: keep Options, language and the menu button inside the header */
@media (max-width: 900px) {
  .hdr-top .box { gap: 4px; padding-right: 10px; }
  .opt-link, .lang-link { padding: 0 8px; height: 40px; }
  .opt-link + .lang-link { border-left: 0; }
  .nav-toggle { margin-left: 6px; }
}
@media (max-width: 480px) {
  .site-title { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .opt-link, .lang-link { padding: 0 6px; }
}
.blog-grid { margin-top: 8px; } .blog-grid .feature h3 { margin-top: 2px; }

/* Blog articles: larger reading text */
.page.blog .page-body, .page.blog .dl, .page.blog .byline { max-width: 860px; }
.page.blog .page-body p, .page.blog .page-body li { font-size: 1.36rem; line-height: 1.85; }
.page.blog .page-body p { margin-bottom: 1.25em; }
.page.blog .page-body ul, .page.blog .page-body ol { font-size: 1.36rem; }
.page.blog .page-body h2 { font-size: 1.9rem; }
.page.blog .page-body h3, .page.blog .page-body h4 { font-size: 1.55rem; }
.page.blog .page-body blockquote p { font-size: 1.36rem; }
html[lang="ur"] .page.blog .page-body p, html[lang="ur"] .page.blog .page-body li { line-height: 2.3; }
@media (max-width: 900px) {
  .page.blog .page-body p, .page.blog .page-body li, .page.blog .page-body ul, .page.blog .page-body ol, .page.blog .page-body blockquote p { font-size: 1.15rem; line-height: 1.8; }
}
