/* Add large custom styles here. Example: fix skip link focus for accessibility */
.skip-link:focus { position: static; width: auto; height: auto; clip: auto; }

/* Offset anchors for sticky header (site-wide) */
html { scroll-padding-top: 170px!important; }

/* Screen-reader only utility */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Hide default Springshare LibChat button (we use our own slide-in panel) */
.libchat_online, .libchat_offline { display: none !important; }

/* ── LibChat Slide-in Panel ── */
.sbu-chat-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(11,32,65,0.35);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.sbu-chat-overlay.active { opacity: 1; visibility: visible; }

.sbu-chat-panel {
  position: fixed; z-index: 99999;
  bottom: 20px; right: 20px;
  width: 420px; height: 580px;
  max-width: calc(100vw - 30px); max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(11,32,65,0.25);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0; visibility: hidden;
  transition: transform .35s cubic-bezier(.22,.61,.36,1), opacity .3s ease, visibility .3s ease,
              width .3s ease, height .3s ease;
}
.sbu-chat-panel.active {
  transform: translateY(0) scale(1);
  opacity: 1; visibility: visible;
}
/* Expanded size */
.sbu-chat-panel.sbu-chat-expanded {
  width: 560px; height: 720px;
}

.sbu-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  background: #0B2041;
  color: #fff;
  flex-shrink: 0;
}
.sbu-chat-header-left {
  display: flex; align-items: center; gap: 14px;
}
.sbu-chat-header-icon {
  position: relative;
  width: 42px; height: 42px;
  background: rgba(153,0,0,0.3);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
/* Status dot — hidden by default, JS adds .online/.offline */
.sbu-chat-header-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 11px; height: 11px;
  border-radius: 50%; border: 2px solid #0B2041;
  background: #64748B; /* neutral gray by default */
}
.sbu-chat-header-dot.online {
  background: #22c55e;
  animation: sbuChatPulse 2s ease infinite;
}
.sbu-chat-header-dot.offline { background: #94A3B8; }
@keyframes sbuChatPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.sbu-chat-header-title {
  font-size: 18px; font-weight: 700;
  letter-spacing: .3px;
}
.sbu-chat-header-sub {
  font-size: 13px; font-weight: 400;
  color: #FFFFFF; margin-top: 2px;
}
.sbu-chat-header-actions {
  display: flex; align-items: center; gap: 6px;
}
.sbu-chat-expand,
.sbu-chat-close {
  background: rgba(255,255,255,0.12);
  border: none; color: #FFFFFF;
  width: 42px; height: 42px;
  padding: 12px;
  border-radius: 10px;
  font-size: 24px; line-height: 1;
  cursor: pointer;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.sbu-chat-expand svg,
.sbu-chat-close svg { width: 24px; height: 24px; }
.sbu-chat-expand:hover,
.sbu-chat-close:hover { background: rgba(255,255,255,0.25); }

.sbu-chat-body {
  flex: 1; position: relative;
  padding: 10px 12px;
  overflow-y: auto;
}
.sbu-chat-body iframe {
  width: 100%; height: 100%;
  border: none; border-radius: 8px;
}
.sbu-chat-loading {
  position: absolute; inset: 10px 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; background: #fff;
  color: #64748B; font-size: 14px;
  border-radius: 8px;
}
.sbu-chat-spinner {
  width: 28px; height: 28px;
  border: 3px solid #E2E8F0; border-top-color: #990000;
  border-radius: 50%;
  animation: sbuSpin .7s linear infinite;
}
@keyframes sbuSpin { to { transform: rotate(360deg); } }
.sbu-chat-footer {
  padding: 14px 20px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  text-align: center;
  font-size: 13px; color: #64748B; /* 4.7:1 contrast on #F8FAFC */
  flex-shrink: 0;
}
.sbu-chat-footer a { color: #990000; text-decoration: underline; font-weight: 600; }
.sbu-chat-footer a:hover { color: #6B0000; }

/* Focus-visible outlines for keyboard navigation */
.sbu-chat-close:focus-visible,
.sbu-chat-expand:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.sbu-chat-footer a:focus-visible {
  outline: 2px solid #990000;
  outline-offset: 2px;
  border-radius: 2px;
}
/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .sbu-chat-panel { transition: opacity .15s ease, visibility .15s ease; transform: none !important; }
  .sbu-chat-overlay { transition: opacity .15s ease, visibility .15s ease; }
  .sbu-chat-header-dot { animation: none !important; }
  .sbu-chat-spinner { animation-duration: 1.5s; }
}

@media (max-width: 480px) {
  .sbu-chat-panel,
  .sbu-chat-panel.sbu-chat-expanded {
    bottom: 0; right: 0;
    width: 100%; height: 100%;
    max-width: 100%; max-height: 100%;
    border-radius: 0;
  }
  .sbu-chat-expand { display: none; } /* no expand on mobile, already fullscreen */
}

/* ── Elementor icon-list links: subtle style ── */
.elementor-icon-list-items a {
  color: inherit !important;
  text-decoration: none !important;
}
.elementor-icon-list-items a:hover {
  color: #990000 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.elementor-icon-list-items a:focus-visible {
  outline: 2px solid #0B2041;
  outline-offset: 2px;
  border-radius: 2px;
}
/* Small arrow-up-right after link text to signal "link" */
.elementor-icon-list-items a .elementor-icon-list-text::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'/%3E%3Cpolyline points='7 7 17 7 17 17'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}