/*
 * IbnAlArabi.com Stage 28 — blue text links on light reading surfaces.
 * Loaded after all earlier stylesheets, including Stage 27.
 * Keep dark masthead, primary navigation, footers, call-to-action buttons,
 * highlighted active tabs and dark hero banners legible.
 * No HTML/PHP content, database logic or existing URLs are changed.
 */
:root {
  --ia28-link: #0755b8;
  --ia28-link-hover: #063a87;
}

/* Ordinary content links, category cards, article indexes and linked headings. */
body.ia-site main a[href],
body.ia-site main a[href]:visited {
  color: var(--ia28-link) !important;
}
body.ia-site main a[href]:hover,
body.ia-site main a[href]:focus-visible {
  color: var(--ia28-link-hover) !important;
}
/* Text links remain visibly identifiable even when not hovered. */
body.ia-site main :is(p, li, dd, dt, blockquote, figcaption, td, th) a[href] {
  text-decoration: underline;
  text-underline-offset: .16em;
}

/* Primary branded actions: retain sufficient contrast on solid green/gold. */
body.ia-site main a[href]:is(
  .ia-btn--gold, .ia23-action--light
) { color: #173626 !important; }
body.ia-site main a[href]:is(
  .ia-btn--outline, .ia16-primary-action, .ia22-action,
  .ia23-action:not(.ia23-action--light), .ia26-primary-link,
  .ia22-awrad-video__link
) { color: #fff !important; }
body.ia-site main .ia5-pagination a[href],
body.ia-site main .ia-deep-nav a.ia-deep-nav__index,
body.ia-site main .ia4-inline-callout a[href],
body.ia-site main .ia27-qunawi-actions a:first-child { color: #fff !important; }

/* Links over forest-green hero panels must not become dark blue. */
body.ia-site main :is(
  .ia-hero, .ia-hub-hero, .ia16-hero, .ia18-hero,
  .ia20-hero, .ia22-hero, .ia23-hero, .ia24-hero,
  .ia25-hero, .ia26-hero, .ia8-forum-hero
) a[href] { color: #fff !important; }
/* Gold foreground on a gold call-to-action remains dark for readability. */
body.ia-site main .ia-hero a[href].ia-btn--gold,
body.ia-site main .ia23-hero a[href].ia23-action--light { color: #173626 !important; }

/* Active dark-green tabs/switches retain white foreground. */
body.ia-site main :is(
  .ia7-mod-tabs, .ia8-switch, .ia10-edition-switch,
  .ia13-source-nav, .ia14-nav, .ia16-ui-languages,
  .ia18-langlinks, .ia19-languages, .ia20-langbar,
  .ia22-pager, .ia23-tabs, .ia23-languages,
  .ia26-related__list, .ia-legacy-tabs__row
) a[href][aria-current],
body.ia-site main .ia-legacy-tabs__row > a[href][aria-current="page"] {
  color: #fff !important;
}
body.ia-site main .ia8-switch a[href]:is(:hover,:focus-visible),
body.ia-site main .ia23-tabs a[href]:is(:hover,:focus-visible),
body.ia-site main .ia-deep-nav a.ia-deep-nav__index:is(:hover,:focus-visible) {
  color: #fff !important;
}

/* Legacy pages not yet on the modern shared shell: change content text only.
 * The old header, sign-in form, and site navigation remain as designed.
 */
body:not(.ia-site) .tm-main a[href]:not(.btn):not(.tm-btn):not([role="button"]),
body:not(.ia-site) .tm-main a[href]:not(.btn):not(.tm-btn):not([role="button"]):visited {
  color: var(--ia28-link) !important;
}
body:not(.ia-site) .tm-main a[href]:not(.btn):not(.tm-btn):not([role="button"]):is(:hover,:focus-visible) {
  color: var(--ia28-link-hover) !important;
}
body:not(.ia-site) .tm-main :is(p,li,td,th,blockquote) a[href] {
  text-decoration: underline;
  text-underline-offset: .16em;
}
