/*
 * Student Commons 5.9.4 — final Community visibility + unified search boundary.
 * This file is linked after wp_head and repeated after wp_footer. It is deliberately
 * scoped to the Community document and uses explicit colour ownership for controls
 * that have historically been repainted by late theme/cache styles.
 */

/* ===== Guest inverse controls: the label must remain visible regardless of late CSS. ===== */
html body.nsc5-document.nsc594-guest-document .nsc590-join,
html body.nsc5-document.nsc594-guest-document .nsc590-join:link,
html body.nsc5-document.nsc594-guest-document .nsc590-join:visited,
html body.nsc5-document.nsc594-guest-document .nsc590-mobile-menu a.is-join,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-mobile-nav a.is-join {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  min-height:44px!important;
  background:#07583a!important;
  border-color:#07583a!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  text-decoration:none!important;
  text-shadow:none!important;
  opacity:1!important;
  visibility:visible!important;
}
html body.nsc5-document.nsc594-guest-document .nsc590-join *,
html body.nsc5-document.nsc594-guest-document .nsc590-mobile-menu a.is-join *,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-mobile-nav a.is-join * {
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  opacity:1!important;
  visibility:visible!important;
}
html body.nsc5-document.nsc594-guest-document .nsc590-join:hover,
html body.nsc5-document.nsc594-guest-document .nsc590-join:focus-visible,
html body.nsc5-document.nsc594-guest-document .nsc590-mobile-menu a.is-join:hover,
html body.nsc5-document.nsc594-guest-document .nsc590-mobile-menu a.is-join:focus-visible,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-mobile-nav a.is-join:hover,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-mobile-nav a.is-join:focus-visible {
  background:#00442a!important;
  border-color:#00442a!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* Secondary guest actions are explicit too. */
html body.nsc5-document.nsc594-guest-document .nsc590-secondary,
html body.nsc5-document.nsc594-guest-document .nsc590-secondary:visited {
  background:#fff!important;
  border:1px solid #71867c!important;
  color:#173c2c!important;
  -webkit-text-fill-color:#173c2c!important;
  opacity:1!important;
}
html body.nsc5-document.nsc594-guest-document .nsc590-secondary * {
  color:#173c2c!important;
  -webkit-text-fill-color:#173c2c!important;
}

/* ===== Guest footer owns every visible character. ===== */
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer {
  background:linear-gradient(135deg,#073d2c 0%,#064a34 50%,#052f24 100%)!important;
  color:#e5f3eb!important;
  -webkit-text-fill-color:#e5f3eb!important;
}
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer :where(strong,h2,h3,h4) {
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  opacity:1!important;
}
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer :where(p,span,small,.nsc590-footer-bottom) {
  color:#dcece3!important;
  -webkit-text-fill-color:#dcece3!important;
  opacity:1!important;
}
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer a,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer a:link,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer a:visited,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer a * {
  color:#e8f6ee!important;
  -webkit-text-fill-color:#e8f6ee!important;
  opacity:1!important;
  visibility:visible!important;
  text-decoration:none!important;
}
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer a:hover,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer a:focus-visible,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer a:hover *,
html body.nsc5-document.nsc594-guest-document .nsc590-guest-footer a:focus-visible * {
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  text-decoration:underline!important;
}

/* ===== Unified search trigger — guest + member. ===== */
html body.nsc5-document .nsc594-search-trigger {
  appearance:none!important;
  -webkit-appearance:none!important;
  display:grid!important;
  grid-template-columns:22px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:11px!important;
  width:100%!important;
  min-width:0!important;
  min-height:48px!important;
  padding:7px 9px 7px 14px!important;
  border:1px solid #8ca198!important;
  border-radius:15px!important;
  background:#fff!important;
  color:#18382b!important;
  -webkit-text-fill-color:#18382b!important;
  box-shadow:0 1px 0 rgba(7,63,44,.03)!important;
  cursor:pointer!important;
  text-align:left!important;
  font:inherit!important;
  opacity:1!important;
}
html body.nsc5-document .nsc594-search-trigger:hover {
  background:#f0f7f3!important;
  border-color:#356d55!important;
}
html body.nsc5-document .nsc594-search-trigger svg {
  width:20px!important;
  height:20px!important;
  fill:none!important;
  stroke:#07583a!important;
  stroke-width:2!important;
}
html body.nsc5-document .nsc594-search-trigger>span {
  display:block!important;
  min-width:0!important;
  color:#18382b!important;
  -webkit-text-fill-color:#18382b!important;
  line-height:1.15!important;
  overflow:hidden!important;
}
html body.nsc5-document .nsc594-search-trigger strong,
html body.nsc5-document .nsc594-search-trigger small {
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:#18382b!important;
  -webkit-text-fill-color:#18382b!important;
}
html body.nsc5-document .nsc594-search-trigger strong {font-size:.82rem!important;font-weight:850!important}
html body.nsc5-document .nsc594-search-trigger small {margin-top:2px!important;color:#52665c!important;-webkit-text-fill-color:#52665c!important;font-size:.68rem!important;font-weight:600!important}
html body.nsc5-document .nsc594-search-trigger kbd {
  display:grid!important;
  min-width:28px!important;
  height:28px!important;
  place-items:center!important;
  padding:0 6px!important;
  border:1px solid #c6d3cc!important;
  border-radius:8px!important;
  background:#f4f7f5!important;
  color:#405249!important;
  -webkit-text-fill-color:#405249!important;
  box-shadow:none!important;
  font:700 .72rem/1 ui-monospace,SFMono-Regular,Menlo,monospace!important;
}

/* Member header uses the new command control rather than the old giant text field. */
html body.nsc5-document.nsc594-member-document .nsc5-topbar-inner {
  grid-template-columns:minmax(210px,280px) minmax(300px,560px) auto!important;
  gap:clamp(14px,2vw,28px)!important;
}
html body.nsc5-document.nsc594-member-document .nsc594-member-search-trigger {max-width:560px!important;justify-self:stretch!important}

/* Guest trigger keeps its simpler single-line presentation. */
html body.nsc5-document.nsc594-guest-document .nsc594-search-trigger>span {
  color:#18382b!important;
  -webkit-text-fill-color:#18382b!important;
  font-size:.8rem!important;
  font-weight:800!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
  overflow:hidden!important;
}

/* ===== Shared command-search overlay. ===== */
body.nsc594-search-open {overflow:hidden!important}
html body.nsc5-document .nsc594-search-overlay[hidden] {display:none!important}
html body.nsc5-document .nsc594-search-overlay {
  position:fixed!important;
  z-index:2147483000!important;
  inset:0!important;
  display:grid!important;
  place-items:start center!important;
  padding:clamp(90px,12vh,150px) 24px 32px!important;
}
html body.nsc5-document .nsc594-search-backdrop {
  position:absolute!important;
  inset:0!important;
  background:rgba(5,17,12,.66)!important;
  backdrop-filter:blur(5px)!important;
}
html body.nsc5-document .nsc594-search-dialog {
  position:relative!important;
  z-index:1!important;
  width:min(760px,100%)!important;
  padding:26px!important;
  border:1px solid #8da197!important;
  border-radius:24px!important;
  background:#fff!important;
  color:#173229!important;
  -webkit-text-fill-color:#173229!important;
  box-shadow:0 28px 90px rgba(2,24,15,.28)!important;
}
html body.nsc5-document .nsc594-search-head {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:18px!important;
  align-items:start!important;
  margin-bottom:20px!important;
}
html body.nsc5-document .nsc594-search-head>div>span {
  display:block!important;
  margin-bottom:5px!important;
  color:#005a36!important;
  -webkit-text-fill-color:#005a36!important;
  font-size:.72rem!important;
  font-weight:900!important;
  letter-spacing:.11em!important;
  text-transform:uppercase!important;
}
html body.nsc5-document .nsc594-search-head h2 {
  margin:0!important;
  max-width:650px!important;
  color:#10231b!important;
  -webkit-text-fill-color:#10231b!important;
  font:700 clamp(1.45rem,3vw,2.2rem)/1.12 Georgia,'Times New Roman',serif!important;
}
html body.nsc5-document .nsc594-search-head p {
  margin:8px 0 0!important;
  color:#405249!important;
  -webkit-text-fill-color:#405249!important;
  font-size:.9rem!important;
}
html body.nsc5-document .nsc594-search-close {
  display:grid!important;
  width:42px!important;height:42px!important;
  place-items:center!important;
  padding:0!important;
  border:1px solid #b7c7bf!important;
  border-radius:50%!important;
  background:#f4f7f5!important;
  color:#173229!important;
  -webkit-text-fill-color:#173229!important;
  font:800 1.35rem/1 system-ui,sans-serif!important;
  cursor:pointer!important;
}
html body.nsc5-document .nsc594-search-form {
  display:grid!important;
  grid-template-columns:24px minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:center!important;
  padding:8px!important;
  border:2px solid #07583a!important;
  border-radius:17px!important;
  background:#fff!important;
}
html body.nsc5-document .nsc594-search-form>svg {
  width:21px!important;height:21px!important;
  margin-left:7px!important;
  fill:none!important;stroke:#07583a!important;stroke-width:2!important;
}
html body.nsc5-document .nsc594-search-form input {
  width:100%!important;
  min-width:0!important;
  min-height:48px!important;
  padding:8px 4px!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  color:#10231b!important;
  -webkit-text-fill-color:#10231b!important;
  font:700 1rem/1.3 system-ui,-apple-system,'Segoe UI',sans-serif!important;
  box-shadow:none!important;
}
html body.nsc5-document .nsc594-search-form input::placeholder {color:#52665c!important;-webkit-text-fill-color:#52665c!important;opacity:1!important}
html body.nsc5-document .nsc594-search-submit {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  min-height:44px!important;
  padding:0 18px!important;
  border:0!important;
  border-radius:12px!important;
  background:#07583a!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:850 .9rem/1 system-ui,-apple-system,'Segoe UI',sans-serif!important;
  cursor:pointer!important;
}
html body.nsc5-document .nsc594-search-submit * {color:#fff!important;-webkit-text-fill-color:#fff!important}
html body.nsc5-document .nsc594-search-submit:hover {background:#00442a!important}
html body.nsc5-document .nsc594-search-meta {margin-top:20px!important;padding-top:17px!important;border-top:1px solid #d4dfd9!important}
html body.nsc5-document .nsc594-search-meta>span {display:block!important;margin-bottom:9px!important;color:#405249!important;-webkit-text-fill-color:#405249!important;font-size:.7rem!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:.08em!important}
html body.nsc5-document .nsc594-search-quick {display:flex!important;flex-wrap:wrap!important;gap:8px!important}
html body.nsc5-document .nsc594-search-quick a,
html body.nsc5-document .nsc594-search-quick a:visited {
  display:inline-flex!important;align-items:center!important;min-height:36px!important;padding:6px 11px!important;
  border:1px solid #b7c7bf!important;border-radius:999px!important;background:#f7faf8!important;
  color:#173c2c!important;-webkit-text-fill-color:#173c2c!important;text-decoration:none!important;font-size:.78rem!important;font-weight:800!important;
}
html body.nsc5-document .nsc594-search-quick a:hover {background:#e7f3ec!important;border-color:#6e8c7d!important}
html body.nsc5-document .nsc594-search-help {display:flex!important;align-items:center!important;gap:7px!important;margin-top:16px!important;color:#52665c!important;-webkit-text-fill-color:#52665c!important;font-size:.72rem!important}
html body.nsc5-document .nsc594-search-help kbd {display:inline-grid!important;min-width:26px!important;height:24px!important;place-items:center!important;padding:0 5px!important;border:1px solid #c6d3cc!important;border-radius:6px!important;background:#f4f7f5!important;color:#405249!important;-webkit-text-fill-color:#405249!important;font:700 .68rem/1 ui-monospace,monospace!important}

/* Member responsive search: visible and useful on mobile, not silently removed. */
@media(max-width:1220px){
  html body.nsc5-document.nsc594-member-document .nsc5-topbar-inner{grid-template-columns:210px minmax(240px,1fr) auto!important}
  html body.nsc5-document.nsc594-member-document .nsc594-member-search-trigger small{display:none!important}
}
@media(max-width:782px){
  html body.nsc5-document.nsc594-member-document .nsc5-topbar-inner{grid-template-columns:minmax(0,1fr) auto auto!important;width:calc(100% - 24px)!important;gap:8px!important}
  html body.nsc5-document.nsc594-member-document .nsc594-member-search-trigger{
    width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;grid-template-columns:1fr!important;place-items:center!important;border-radius:13px!important
  }
  html body.nsc5-document.nsc594-member-document .nsc594-member-search-trigger>span,
  html body.nsc5-document.nsc594-member-document .nsc594-member-search-trigger kbd{display:none!important}
  html body.nsc5-document .nsc594-search-overlay{padding:76px 16px 24px!important;place-items:start stretch!important}
  html body.nsc5-document .nsc594-search-dialog{width:100%!important;padding:18px!important;border-radius:19px!important}
  html body.nsc5-document .nsc594-search-head h2{font-size:1.55rem!important}
  html body.nsc5-document .nsc594-search-head p{font-size:.82rem!important}
  html body.nsc5-document .nsc594-search-form{grid-template-columns:22px minmax(0,1fr)!important}
  html body.nsc5-document .nsc594-search-submit{grid-column:1/-1!important;width:100%!important}
}

/* Dark mode for unified search. */
html[data-theme="dark"] body.nsc5-document .nsc594-search-trigger,
body.nsc5-document.dark-mode .nsc594-search-trigger,
body.nsc5-document.nsc-dark-mode .nsc594-search-trigger,
html[data-theme="dark"] body.nsc5-document .nsc594-search-dialog,
body.nsc5-document.dark-mode .nsc594-search-dialog,
body.nsc5-document.nsc-dark-mode .nsc594-search-dialog {
  background:#111f18!important;border-color:#536b5f!important;color:#f3faf6!important;-webkit-text-fill-color:#f3faf6!important
}
html[data-theme="dark"] body.nsc5-document .nsc594-search-trigger :where(strong,span),
body.nsc5-document.dark-mode .nsc594-search-trigger :where(strong,span),
body.nsc5-document.nsc-dark-mode .nsc594-search-trigger :where(strong,span){color:#f3faf6!important;-webkit-text-fill-color:#f3faf6!important}
html[data-theme="dark"] body.nsc5-document .nsc594-search-trigger small,
body.nsc5-document.dark-mode .nsc594-search-trigger small,
body.nsc5-document.nsc-dark-mode .nsc594-search-trigger small{color:#c2d1c8!important;-webkit-text-fill-color:#c2d1c8!important}
html[data-theme="dark"] body.nsc5-document .nsc594-search-head h2,
body.nsc5-document.dark-mode .nsc594-search-head h2,
body.nsc5-document.nsc-dark-mode .nsc594-search-head h2{color:#f5fbf7!important;-webkit-text-fill-color:#f5fbf7!important}
html[data-theme="dark"] body.nsc5-document .nsc594-search-head p,
html[data-theme="dark"] body.nsc5-document .nsc594-search-meta>span,
html[data-theme="dark"] body.nsc5-document .nsc594-search-help,
body.nsc5-document.dark-mode .nsc594-search-head p,
body.nsc5-document.dark-mode .nsc594-search-meta>span,
body.nsc5-document.dark-mode .nsc594-search-help{color:#c2d1c8!important;-webkit-text-fill-color:#c2d1c8!important}
html[data-theme="dark"] body.nsc5-document .nsc594-search-form,
body.nsc5-document.dark-mode .nsc594-search-form{background:#0d1813!important;border-color:#8fd9b6!important}
html[data-theme="dark"] body.nsc5-document .nsc594-search-form input,
html[data-theme="dark"] body.nsc5-document .nsc594-search-form input::placeholder,
body.nsc5-document.dark-mode .nsc594-search-form input,
body.nsc5-document.dark-mode .nsc594-search-form input::placeholder{color:#f0f8f3!important;-webkit-text-fill-color:#f0f8f3!important}
html[data-theme="dark"] body.nsc5-document .nsc594-search-quick a,
body.nsc5-document.dark-mode .nsc594-search-quick a{background:#172820!important;border-color:#536b5f!important;color:#f0f8f3!important;-webkit-text-fill-color:#f0f8f3!important}

@media(forced-colors:active){
  html body.nsc5-document .nsc594-search-trigger,
  html body.nsc5-document .nsc594-search-dialog,
  html body.nsc5-document .nsc594-search-form,
  html body.nsc5-document .nsc594-search-submit,
  html body.nsc5-document.nsc594-guest-document .nsc590-join{forced-color-adjust:auto!important;border:2px solid CanvasText!important}
}
