/* =====================================================================
   AI READER — calm, scholarly reading layer for AnsweringIslam.blog
   Theme: krabi-ai-reader (copy of krabi-10--3---18---3-), 17 Nov 2026
   Tuned to beautifier_v2 markup: h2-h4, blockquote quote cards,
   <small> references, dir="rtl" Arabic/Hebrew, tables, kg-html cards.
   Loaded LAST (after ghost_foot) so it wins over older injected rules.
   ===================================================================== */
:root {
  --r-bg: #f8f6f1;
  --r-surface: #ffffff;
  --r-text: #22201c;
  --r-muted: #5d574e;
  --r-heading: #16233b;
  --r-link: #1a4f8b;
  --r-link-hover: #0f3566;
  --r-border: #e4ded3;
  --r-quote-bg: #f3ede2;
  --r-quote-rule: #a8834a;
  --r-ref: #5a5144;
  --r-code-bg: #efeae1;
  --r-th-bg: #efe9de;
  --r-zebra: #faf8f3;
  --r-serif: "Source Serif 4", "Source Serif Pro", Charter, "Bitstream Charter", "Iowan Old Style", Georgia, Cambria, serif;
  --r-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --r-rtl: "Noto Naskh Arabic", "Amiri", "Noto Serif Hebrew", "SBL Hebrew", "Times New Roman", serif;
}
html.dark-mode {
  --r-bg: #15171b;
  --r-surface: #1c1f25;
  --r-text: #e3dfd7;
  --r-muted: #aaa498;
  --r-heading: #f4f0e8;
  --r-link: #8fbaf0;
  --r-link-hover: #b9d4f7;
  --r-border: #2e3239;
  --r-quote-bg: #22262d;
  --r-quote-rule: #c9a465;
  --r-ref: #b6ae9f;
  --r-code-bg: #262a31;
  --r-th-bg: #262a31;
  --r-zebra: #1f2228;
}

/* ---------- page canvas ---------- */
html body, html.dark-mode body, html.dark-mode .l-viewport {
  background: var(--r-bg) !important;
  color: var(--r-text) !important;
}
html, html.dark-mode { background: var(--r-bg) !important; }

html body .c-post, html.dark-mode body .c-post, html.dark-mode body .c-post__inner,
html.dark-mode body .gh-content > * { background: transparent !important; }
html body .c-content, html body .c-content * { hyphens: manual !important; -webkit-hyphens: manual !important; }
html body .c-content blockquote, html body .c-content blockquote * { overflow-wrap: break-word !important; word-break: normal !important; }

/* ---------- header ---------- */
html body .c-header, html.dark-mode body .c-header,
html.dark-mode body .c-header__inner, html.dark-mode body .c-nav-wrap {
  background: var(--r-surface) !important;
  border-bottom: 1px solid var(--r-border) !important;
  box-shadow: none !important;
}
html.dark-mode body .c-header__inner, html.dark-mode body .c-nav-wrap { border-bottom: 0 !important; }
html body .c-header .c-nav__link {
  font-family: var(--r-sans) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: var(--r-muted) !important;
  letter-spacing: 0 !important;
}
html body .c-header .c-nav__link:hover, html body .c-header .c-nav__link--current {
  color: var(--r-heading) !important;
}
html body .c-nav__dropDown {
  background: var(--r-surface) !important;
  border: 1px solid var(--r-border) !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 30px rgba(20, 20, 30, .10) !important;
}
html.dark-mode body .c-nav__dropDown { box-shadow: 0 10px 30px rgba(0, 0, 0, .45) !important; }
html body .c-nav__dropDown .c-nav__link { color: var(--r-text) !important; background: transparent !important; }

/* topic strip under header */
html body .c-tags-list-wrap, html.dark-mode body .c-tags-list-wrap {
  background: transparent !important;
  border-bottom: 1px solid var(--r-border) !important;
}
html body .c-tags-list__link, html.dark-mode body .c-tags-list__link {
  font-family: var(--r-sans) !important;
  font-size: 13.5px !important;
  color: var(--r-muted) !important;
}
html body .c-tags-list__link:hover, html.dark-mode body .c-tags-list__link:hover { color: var(--r-heading) !important; }

/* ---------- post header ---------- */
html body .c-post-header__title, html.dark-mode body .c-post-header__title {
  font-family: var(--r-serif) !important;
  font-weight: 700 !important;
  font-size: clamp(30px, 4.2vw, 44px) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.01em !important;
  color: var(--r-heading) !important;
  text-wrap: balance;
}
html body .c-post-header__meta, html body .c-post-header__meta * { font-family: var(--r-sans) !important; }

/* ---------- article body ---------- */
html body .c-content, html.dark-mode body .c-content {
  font-family: var(--r-serif) !important;
  font-size: 19px !important;
  line-height: 1.7 !important;
  color: var(--r-text) !important;
  font-size-adjust: none !important;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  hyphens: manual;
}
html body .c-content p, html body .c-content li,
html.dark-mode body .c-content p, html.dark-mode body .c-content li,
html.dark-mode body .c-content span, html.dark-mode body .c-content time {
  font-family: inherit !important;
  font-size: inherit;
  line-height: 1.7 !important;
  color: var(--r-text) !important;
}
html body .c-content p, html body .c-content .kg-card p { margin: 0 0 1.05em !important; }
html body .c-content p + p { margin-top: 0 !important; }
html body .c-content > * + * { margin-top: 0; }
/* paragraphs holding a single link stay normal paragraphs */
html body .c-content.c-content p:has(> a:only-of-type) { display: block !important; margin: 0 0 1.05em !important; }
html body .c-content.c-content p:has(> a:only-of-type)::after { content: none !important; }

/* emphasis — serif bold reads well at 700; 800/900 looked heavy */
html body .c-content strong, html body .c-content b,
html body .c-content blockquote strong, html body .c-content blockquote b,
html.dark-mode body .c-content strong, html.dark-mode body .c-content b {
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  color: inherit !important;
}
html body .c-content em, html body .c-content i { font-weight: inherit !important; font-style: italic !important; }

/* links */
html body .c-content a, html.dark-mode body .c-content a, html body .c-content a.internal-link {
  color: var(--r-link) !important;
  font-weight: inherit !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: .18em !important;
  text-decoration-color: color-mix(in srgb, var(--r-link) 55%, transparent) !important;
  overflow-wrap: anywhere;
}
html body .c-content a:hover, html.dark-mode body .c-content a:hover {
  color: var(--r-link-hover) !important;
  text-decoration-color: currentColor !important;
}

/* headings h2–h4 (beautifier never emits h1 in body) */
html body .c-content :is(h1, h2, h3, h4, h5, h6),
html.dark-mode body .c-content :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--r-sans) !important;
  color: var(--r-heading) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.3 !important;
  margin: 1.9em 0 .55em !important;
  text-wrap: balance;
}
html body .c-content h2 { font-size: 1.45em !important; }
html body .c-content h3 { font-size: 1.2em !important; }
html body .c-content h4 { font-size: 1.02em !important; font-weight: 650 !important; }
html body .c-content h1 { font-size: 1.6em !important; }
html body .c-content :is(h2, h3, h4) + p { margin-top: 0 !important; }

/* lists */
html body .c-content :is(ul, ol) { padding-left: 1.4em !important; margin: 0 0 1.1em !important; }
html body .c-content li { margin: 0 0 .4em !important; }
html body .c-content li::marker { color: var(--r-muted); }

/* ---------- quote cards ---------- */
html body .c-content blockquote,
html body .c-content .kg-card.kg-blockquote-card blockquote,
html.dark-mode body .c-content blockquote {
  background: var(--r-quote-bg) !important;
  border: 0 !important;
  border-left: 4px solid var(--r-quote-rule) !important;
  border-radius: 0 8px 8px 0 !important;
  padding: .95em 1.35em !important;
  margin: 1.5em 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  font-family: var(--r-serif) !important;
  font-size: 1em !important;
  font-style: normal !important;
  line-height: 1.65 !important;
  color: var(--r-text) !important;
  box-shadow: none !important;
}
html body .c-content .kg-card.kg-blockquote-card, html.dark-mode body .c-content .kg-card.kg-blockquote-card { margin: 1.5em 0 !important; padding: 0 !important; contain: none !important; background: transparent !important; border: 0 !important; }
html body .c-content .kg-card.kg-blockquote-card blockquote { margin: 0 !important; }
html body .c-content blockquote p, html.dark-mode body .c-content blockquote p {
  margin: 0 0 .7em !important;
  line-height: 1.65 !important;
  color: var(--r-text) !important;
}
html body .c-content blockquote > :last-child, html body .c-content blockquote p:last-child { margin-bottom: 0 !important; }
html body .c-content blockquote blockquote { background: transparent !important; padding: .2em 0 .2em 1em !important; margin: .6em 0 !important; border-left-width: 2px !important; }
/* older posts sometimes wrap quotes in <font color=…>; keep them in palette */
html body .c-content blockquote font[color], html body .c-content font[color] { color: inherit !important; }
html body .c-content font[face] { font-family: inherit !important; }
html body .c-content font[size] { font-size: inherit !important; }

/* ---------- <small> references ---------- */
html body .c-content small, html.dark-mode body .c-content small {
  font-family: var(--r-sans) !important;
  font-size: .78em !important;
  font-weight: 500 !important;
  font-style: normal !important;
  letter-spacing: .01em !important;
  line-height: 1.5 !important;
  color: var(--r-muted) !important;
  opacity: 1 !important;
  white-space: normal !important;
}
html body .c-content blockquote small, html.dark-mode body .c-content blockquote small { color: var(--r-ref) !important; }
/* a reference on its own line inside a quote card */
html body .c-content blockquote p:has(> small:only-child) { margin-top: .55em !important; line-height: 1.4 !important; }
/* list items: keep the site's earlier choice (inline, normal size) but not bold-heavy */
html body .c-content li > small { font-size: .85em !important; font-weight: 500 !important; display: inline !important; }
html body p > small[data-ai-ref] { font-style: italic !important; }

/* ---------- RTL Arabic / Hebrew ---------- */
html body .c-content [dir="rtl"], html body .c-content :lang(ar), html body .c-content :lang(he) {
  font-family: var(--r-rtl) !important;
  font-size: 1.18em !important;
  line-height: 1.95 !important;
  text-align: right !important;
  unicode-bidi: isolate;
  letter-spacing: 0 !important;
  font-weight: 400;
}
html body .c-content [dir="rtl"] [dir="rtl"], html body .c-content [dir="rtl"] :lang(ar) { font-size: 1em !important; }
html body .c-content blockquote[dir="rtl"], html body .c-content [dir="rtl"] blockquote {
  border-left: 0 !important;
  border-right: 4px solid var(--r-quote-rule) !important;
  border-radius: 8px 0 0 8px !important;
}
html body .c-content [dir="rtl"] small { font-family: var(--r-sans) !important; }

/* ---------- tables ---------- */
html body .c-content table, html.dark-mode body .c-content table {
  border-collapse: collapse !important;
  font-family: var(--r-serif) !important;
  font-size: .9em !important;
  line-height: 1.5 !important;
  background: var(--r-surface) !important;
  color: var(--r-text) !important;
  border: 1px solid var(--r-border) !important;
}
html body .c-content :is(th, td), html.dark-mode body .c-content :is(th, td) {
  border: 1px solid var(--r-border) !important;
  padding: .5em .7em !important;
  vertical-align: top !important;
  color: var(--r-text) !important;
  background: transparent !important;
}
html body .c-content :is(th, td) * { color: inherit !important; }
html body .c-content th, html body .c-content thead td, html.dark-mode body .c-content th {
  background: var(--r-th-bg) !important;
  font-family: var(--r-sans) !important;
  font-weight: 600 !important;
  font-size: .95em !important;
}
html body .c-content tbody tr:nth-child(even) td { background: var(--r-zebra) !important; }
html body .c-content td[bgcolor], html body .c-content tr[bgcolor] td, html body .c-content table[bgcolor] { background: var(--r-surface) !important; }

/* ---------- code, hr, images, cards ---------- */
html body .c-content :not(pre) > code, html.dark-mode body .c-content :not(pre) > code {
  background: var(--r-code-bg) !important;
  color: var(--r-text) !important;
  border-radius: 4px !important;
  padding: .1em .35em !important;
  font-size: .85em !important;
}
html body .c-content pre { background: var(--r-code-bg) !important; color: var(--r-text) !important; border-radius: 8px !important; border: 1px solid var(--r-border) !important; }
html body .c-content hr, html.dark-mode body .c-content hr {
  border: 0 !important;
  border-top: 1px solid var(--r-border) !important;
  width: 40% !important;
  margin: 2.4em auto !important;
}
html body .c-content img { border-radius: 6px; }
html body .c-content figcaption { font-family: var(--r-sans) !important; font-size: .78em !important; color: var(--r-muted) !important; text-align: center; }
html.dark-mode body .c-content .kg-card:not(.kg-blockquote-card):not(.kg-callout-card) { background: transparent !important; color: var(--r-text) !important; }
html body .c-content .kg-callout-card { border-radius: 8px !important; }
html.dark-mode body .c-content .kg-callout-card { background: var(--r-quote-bg) !important; }
html.dark-mode body .c-content .kg-callout-card * { color: var(--r-text) !important; }
/* legacy inline colours from the 2000-era import (e.g. <p style="color:#0000ff">) */
html body .c-content [style*="color"]:not(a) { color: inherit !important; }
html body .c-content [style*="background"] { background: transparent !important; }
html body .c-content center { text-align: inherit; }

/* table of contents */
html body .c-table-of-contents, html.dark-mode body .c-table-of-contents {
  background: var(--r-surface) !important;
  border: 1px solid var(--r-border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
html body .c-table-of-contents, html body .c-table-of-contents * { font-family: var(--r-sans) !important; }
html body .c-table-of-contents__heading { color: var(--r-heading) !important; }
html body .c-table-of-contents a { color: var(--r-link) !important; }

/* ---------- sidebar, cards, archive ---------- */
html body .c-widget > div:not(.c-title-bar):not(.c-subscribe), html.dark-mode body .c-widget > div:not(.c-title-bar):not(.c-subscribe),
html body .c-teaser, html.dark-mode body .c-teaser,
html body .c-post-card, html body .c-story-card__inner, html.dark-mode body .c-story-card__inner {
  background: var(--r-surface) !important;
  border-color: var(--r-border) !important;
  box-shadow: none !important;
}
html body .c-title-bar__title, html.dark-mode body .c-title-bar__title { color: var(--r-muted) !important; font-family: var(--r-sans) !important; letter-spacing: .06em !important; }
html body .c-teaser__title, html body .c-post-card__title, html body .c-post-card__title a {
  font-family: var(--r-serif) !important;
  color: var(--r-heading) !important;
  font-weight: 600 !important;
}
html body .c-post-card__excerpt { color: var(--r-muted) !important; }
html body .c-teaser__date, html body .c-post-card time { color: var(--r-muted) !important; }
html body .c-archive__title, html.dark-mode body .c-archive__title { font-family: var(--r-serif) !important; color: var(--r-heading) !important; }

/* ---------- footer ---------- */
html body .c-footer, html.dark-mode body .c-footer, html.dark-mode body .c-footer__inner {
  background: var(--r-surface) !important;
  border-top: 1px solid var(--r-border) !important;
  color: var(--r-muted) !important;
  font-family: var(--r-sans) !important;
}
html body .c-footer { margin-top: 56px !important; padding-top: 40px !important; padding-bottom: 28px !important; }
html body .c-footer__headline, html.dark-mode body .c-footer__headline {
  font-size: 12px !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  color: var(--r-heading) !important;
  font-weight: 700 !important;
}
html body .c-footer p, html.dark-mode body .c-footer p, html body .c-footer li { color: var(--r-muted) !important; font-size: 14px !important; line-height: 1.6 !important; }
html body .c-footer a, html.dark-mode body .c-footer a { color: var(--r-text) !important; text-decoration: none !important; }
html body .c-footer a:hover { color: var(--r-link) !important; text-decoration: underline !important; }
html body .c-footer .ai-footer-verse {
  font-family: var(--r-serif) !important;
  font-style: italic !important;
  font-size: 15px !important;
  color: var(--r-muted) !important;
  max-width: 620px;
  margin: 8px auto 6px !important;
  text-align: center;
}
html body .c-footer .ai-footer-verse cite { font-style: normal; font-family: var(--r-sans); font-size: 12.5px; letter-spacing: .02em; }
html body .c-footer__copyright, html.dark-mode body .c-footer__copyright { text-align: center; color: var(--r-muted) !important; font-size: 12.5px !important; }
html body .c-footer .ai-footer-bottom { padding-top: 8px; }

/* ---------- mobile ---------- */
@media (max-width: 600px) {
  html body .c-content, html.dark-mode body .c-content { font-size: 18px !important; }
  html body .c-content blockquote { padding: .8em 1em !important; border-radius: 0 6px 6px 0 !important; }
  html body .c-content [dir="rtl"] { font-size: 1.14em !important; }
  html body .c-content table { font-size: .82em !important; }
}
@media print {
  html body .c-content blockquote { background: none !important; }
}

/* Ghost marks a slow server-side {{#get}} with this placeholder; hide it rather than show an error to readers */
html body [data-aborted-get-helper] { display: none !important; }

/* ---------- pass 2: polish after live review ---------- */
/* dark mode: the navy logo disappears on dark — render it light */
html.dark-mode body .c-logo__img { filter: brightness(0) invert(.93) !important; }
/* sun/moon toggle visible in both modes */
html body #ai-dark-toggle, html body #ai-dark-toggle-mobile { color: var(--r-muted) !important; opacity: 1 !important; }
html body #ai-dark-toggle:hover, html body #ai-dark-toggle-mobile:hover { color: var(--r-heading) !important; }
html body #ai-dark-toggle svg, html body #ai-dark-toggle-mobile svg { stroke: currentColor !important; }
/* topic strip: same weight in both modes */
html body .c-tags-list__link, html.dark-mode body .c-tags-list__link { font-weight: 500 !important; }
/* subscribe buttons readable in dark mode (header, sidebar, footer) */
html.dark-mode body .c-subscribe-form__btn, html.dark-mode body .c-nav__item .c-btn:not(.c-btn--outline) {
  background: #1e6aa8 !important; border-color: #1e6aa8 !important; color: #ffffff !important;
}
html.dark-mode body .c-subscribe-form__btn:hover { background: #2a7cc0 !important; }
html.dark-mode body .c-subscribe-form__input { background: var(--r-bg) !important; border-color: var(--r-border) !important; color: var(--r-text) !important; }
/* footer: one divider only */
html body .c-footer__copyright { border-top: 0 !important; margin-top: 4px !important; padding-top: 0 !important; }
html body .c-footer .ai-footer-bottom { border-top: 0 !important; margin-top: 0 !important; }
html body .c-footer__section:not(:last-child) { box-shadow: 0 1px 0 0 var(--r-border) !important; }
html body .c-footer .ai-footer-bottom::before, html body .c-footer .ai-footer-bottom::after { display: none !important; }
/* sidebar + TOC links share the reading palette */
html body .c-widget a:not(.c-btn):not(.c-teaser__title a), html.dark-mode body .c-widget a:not(.c-btn),
html.dark-mode body .c-table-of-contents a { color: var(--r-link) !important; }
html body .c-teaser__title a, html.dark-mode body .c-teaser__title a { color: var(--r-heading) !important; text-decoration: none !important; }
