/* ----------------------------------------------------------------
	Custom CSS

	Add all your Custom Styled CSS here for New Styles or
	Overwriting Default Theme Styles for Better Handling Updates
-----------------------------------------------------------------*/
/* Restore rounding when stacked (mobile) */
.btn-group > .btn:first-child {
  border-top-left-radius: 0.375rem !important;
  border-bottom-left-radius: 0.375rem !important;
}
.btn-group > .btn:last-child {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}
@media (max-width: 767.98px) {
  .btn-group {
    flex-direction: column;
  }
  .btn-group > .btn {
    border-radius: 0.375rem !important; /* standard Bootstrap rounding */
    margin-bottom: 0.5rem;
  }
  .btn-group > .btn:last-child {
    margin-bottom: 0;
  }
}

h2 img {
  display: inline;
  vertical-align: middle;
}
/* Kill the theme’s link styles ONLY inside .link-safe */
.link-safe :where(a:any-link) {
  all: unset; /* wipe theme rules */
  color: inherit !important; /* show like normal text */
  text-decoration: none !important;
  cursor: pointer;
  -webkit-text-fill-color: currentColor; /* fixes Safari weirdness */
}

/* Just in case the theme hits visited differently */
.link-safe a:visited {
  color: inherit !important;
}

/* If the theme uses pseudo-elements for underlines */
.link-safe a::before,
.link-safe a::after {
  content: none !important;
}

/* Optional: make accidental tel links inert */
.link-safe a[href^="tel:"],
.link-safe a[href^="sms:"] {
  pointer-events: none;
}

/* ========== Accessibility Widget ========== */
:root {
  --a11y-green: #065f46;
  --a11y-bg: #111827; /* panel bg (near-tailwind slate-900) */
  --a11y-surface: #1f2937;
  --a11y-text: #e5e7eb; /* slate-200 */
  --a11y-border: #374151; /* slate-700 */
}
#a11y-panel {
  z-index: 100000 !important;
}
.a11y-panel[hidden] {
  display: none !important;
}
.a11y-panel {
  position: fixed;
  min-width: 320px;
  min-height: 220px;
}
/* Floating launcher: default mid-right */
.a11y-launcher {
  position: fixed;
  right: 200px;
  bottom: 20px;
  transform: translateY(-50%);
  z-index: 9999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #065f46;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  touch-action: none; /* allow touch dragging */
}
.a11y-launcher:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.a11y-launcher:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.a11y-panel[hidden] {
  display: none;
}
.a11y-panel {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 10000;
  max-width: 360px;
  width: calc(100vw - 32px);
}
.a11y-panel__inner {
  background: var(--a11y-bg);
  color: var(--a11y-text);
  border: 1px solid var(--a11y-border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 12px;
}
.a11y-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px 4px;
  border-bottom: 1px solid var(--a11y-border);
}
.a11y-title {
  font-size: 18px;
  color: white;
  margin: 0;
}
.a11y-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
}
.a11y-close:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.a11y-group {
  padding: 8px 4px;
  border-bottom: 1px dashed var(--a11y-border);
}
.a11y-group:last-child {
  border-bottom: 0;
}
.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
}
.a11y-label {
  font-size: 14px;
}

.a11y-actions {
  display: flex;
  gap: 8px;
}
.a11y-btn {
  background: #334155;
  color: #fff;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
}
.a11y-btn:hover {
  background: #475569;
}
.a11y-btn--danger {
  background: #7f1d1d;
  border-color: #991b1b;
}
.a11y-btn--danger:hover {
  background: #991b1b;
}

.a11y-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.a11y-switch input {
  inline-size: 1rem;
  block-size: 1rem;
}

/* ========== Feature classes toggled on <html> ========== */
html.a11y-dark {
  color-scheme: dark;
  background: #0b0f14;
}
html.a11y-dark body {
  background: #0b0f14;
  color: #e5e7eb;
}
html.a11y-dark img {
  filter: brightness(0.95) contrast(1.05);
}

html.a11y-high-contrast * {
  background-color: transparent !important;
  color: #000 !important;
  border-color: #000 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.a11y-high-contrast body {
  background: #fff !important;
  color: #000 !important;
}

html.a11y-grayscale {
  filter: grayscale(100%) !important;
}

/* Readable font: use system UI stack to avoid external fonts */
html.a11y-readable-font,
html.a11y-readable-font body,
html.a11y-readable-font
  :not(i):not([class*="fa"]):not([class*="icon"]):not(svg):not(path) {
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    sans-serif !important;
}

/* Text spacing (WCAG technique) */
html.a11y-text-spacing body,
html.a11y-text-spacing body * {
  letter-spacing: 0.06em !important;
  word-spacing: 0.16em !important;
  line-height: 1.7 !important;
}

/* Underline & highlight links */
html.a11y-underline-links a {
  text-decoration: underline !important;
}
html.a11y-highlight-links a {
  outline: 2px dashed #f59e0b;
  outline-offset: 3px;
}

/* Reduce motion / pause common CSS animations & transitions */
html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Make sure the panel is readable above your site styles */
.a11y-panel * {
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

/* Respect user OS pref by default (we still let users override) */
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
}

/* ===== A11y Dark: hard override backgrounds & text ===== */
/* 1) Global canvas */
html.a11y-dark {
  color-scheme: dark;
}
html.a11y-dark,
html.a11y-dark body {
  background: #0b0f14 !important;
  color: #e5e7eb !important;
}

/* 2) Kill images/gradients set via classes or inline styles */
html.a11y-dark [style*="background"],
html.a11y-dark [style*="background-image"],
html.a11y-dark [style*="linear-gradient"],
html.a11y-dark .section,
html.a11y-dark .content-wrap,
html.a11y-dark .wrapper,
html.a11y-dark header,
html.a11y-dark footer,
html.a11y-dark .container,
html.a11y-dark .card,
html.a11y-dark .tab-pane,
html.a11y-dark .primary-menu,
html.a11y-dark .site-header,
html.a11y-dark .bg-color,
html.a11y-dark [class*="bg-"],
html.a11y-dark [class*="background"] {
  background: #0b0f14 !important;
  background-image: none !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

/* 3) Transparent headers / overlays used by Canvas themes */
html.a11y-dark .transparent-header,
html.a11y-dark .floating-header,
html.a11y-dark .header-wrap,
html.a11y-dark .header-wrap::before,
html.a11y-dark .header-wrap::after {
  background: #0b0f14 !important;
  background-image: none !important;
}

/* 4) Text colours */
html.a11y-dark h1,
html.a11y-dark h2,
html.a11y-dark h3,
html.a11y-dark h4,
html.a11y-dark h5,
html.a11y-dark h6,
html.a11y-dark p,
html.a11y-dark li,
html.a11y-dark small,
html.a11y-dark .menu-link,
html.a11y-dark .button {
  color: #e5e7eb !important;
}

/* 5) Links / buttons / pills */
html.a11y-dark a {
  color: #93c5fd !important;
}
html.a11y-dark a:hover {
  color: #bfdbfe !important;
}
html.a11y-dark .button,
html.a11y-dark .nav-link {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #e5e7eb !important;
}
html.a11y-dark .nav-link.active {
  background: #334155 !important;
}

/* 6) Inputs */
html.a11y-dark input,
html.a11y-dark textarea,
html.a11y-dark select {
  background: #111827 !important;
  color: #e5e7eb !important;
  border-color: #374151 !important;
}

/* 7) Dividers & borders */
html.a11y-dark hr,
html.a11y-dark .line,
html.a11y-dark .border,
html.a11y-dark [class*="border-"] {
  border-color: #334155 !important;
}

/* 8) Images slightly adjusted (optional) */
html.a11y-dark img {
  filter: brightness(0.95) contrast(1.05);
}

/* 9) Keep the A11y panel readable regardless of site styles */
html.a11y-dark .a11y-panel,
html.a11y-dark .a11y-panel * {
  color: #e5e7eb !important;
}

/* Nuclear fallback */

html.a11y-dark img,
html.a11y-dark video,
html.a11y-dark iframe,
html.a11y-dark .a11y-panel,
html.a11y-dark .no-invert {
  filter: invert(1) hue-rotate(180deg) !important;
}

/* avatar in about page */
.avatar-bg {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #eef2ff, #e5f3ff);
  overflow: hidden;
  user-select: none;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
