/**
 * Theme 17.0.12 — category description + PWA install visibility repair.
 * Final public-theme layer; Student Commons remains excluded.
 */

/* Category descriptions can contain their own <p> markup. The template now
 * uses a div wrapper; target both the wrapper and its descendants so WordPress
 * term formatting cannot escape the contrast boundary. */
body.ns17:not(.nsc5-document) .ns-cat-hero .ns-cat-desc,
body.ns17:not(.nsc5-document) .ns-cat-hero .ns-cat-desc :where(p,span,strong,em,a) {
  color:#f8fffb !important;
  -webkit-text-fill-color:#f8fffb !important;
  opacity:1 !important;
  text-shadow:0 1px 1px rgba(0,0,0,.18) !important;
}
body.ns17:not(.nsc5-document) .ns-cat-hero .ns-cat-desc {
  max-width:1040px;
  margin:18px auto 0;
  font-size:clamp(1rem,1.45vw,1.12rem);
  line-height:1.7;
}
body.ns17:not(.nsc5-document) .ns-cat-hero .ns-cat-desc > :last-child { margin-bottom:0; }
body.ns17:not(.nsc5-document) .ns-cat-hero .ns-cat-desc a {
  text-decoration-color:rgba(255,255,255,.72) !important;
}

/* The install control is a dialog wrapper containing two buttons. Earlier
 * broad button rules could repaint the child buttons and visually wash out the
 * whole pill. Keep the wrapper and every child on one intentional inverse
 * surface in both themes. */
body.ns17:not(.nsc5-document) .nspwa-install-pill {
  background:linear-gradient(135deg,#064e3b 0%,#022c22 100%) !important;
  border:2px solid rgba(255,255,255,.92) !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  box-shadow:0 10px 28px rgba(2,44,34,.34),0 2px 8px rgba(0,0,0,.22) !important;
}
body.ns17:not(.nsc5-document) .nspwa-install-pill :where(.nspwa-install-trigger,.nspwa-install-close,.nspwa-install-pill-ico,span,strong,small,svg,path) {
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  opacity:1 !important;
}
body.ns17:not(.nsc5-document) .nspwa-install-pill .nspwa-install-trigger {
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}
body.ns17:not(.nsc5-document) .nspwa-install-pill .nspwa-install-close {
  background:rgba(255,255,255,.18) !important;
  border:1px solid rgba(255,255,255,.42) !important;
}
body.ns17:not(.nsc5-document) .nspwa-install-pill:hover,
body.ns17:not(.nsc5-document) .nspwa-install-pill:focus-within {
  background:linear-gradient(135deg,#043d2e 0%,#011f18 100%) !important;
  box-shadow:0 12px 32px rgba(1,31,24,.42),0 2px 8px rgba(0,0,0,.26) !important;
}
html[data-theme="dark"] body.ns17:not(.nsc5-document) .nspwa-install-pill {
  background:linear-gradient(135deg,#0b5f47 0%,#043326 100%) !important;
  border-color:#d9fbe8 !important;
}
html[data-theme="dark"] body.ns17:not(.nsc5-document) .nspwa-install-pill:hover,
html[data-theme="dark"] body.ns17:not(.nsc5-document) .nspwa-install-pill:focus-within {
  background:linear-gradient(135deg,#084b39 0%,#02271d 100%) !important;
}

@media (forced-colors:active) {
  body.ns17:not(.nsc5-document) .nspwa-install-pill,
  body.ns17:not(.nsc5-document) .nspwa-install-pill * { forced-color-adjust:auto !important; }
}
