/* ============================================================
   site.css — SlakBot shared overrides + accessibility fixes
   Loaded AFTER Tailwind to win cascade.
   ============================================================ */

/* ---------- 1. Accessibility: focus-visible ring ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid #5865F2;
  outline-offset: 2px;
  border-radius: 6px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #5865F2;
  outline-offset: 2px;
}

/* ---------- 2. Skip-to-content link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 1000;
  padding: 10px 16px;
  background: #5865F2;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: top 0.2s;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---------- 3. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .live-dot,
  .pulse-dot,
  .orb {
    animation: none !important;
  }
}

/* ---------- 4. Mobile nav drawer ---------- */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f3f4f6;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.1); }
.mobile-menu-btn svg { width: 22px; height: 22px; }

@media (max-width: 767px) {
  .mobile-menu-btn {
    display: inline-flex;
    order: 9999;          /* push hamburger to the far right */
    margin-left: 6px;
  }
  /* Tighten right-cluster so [Add CTA] and hamburger sit together */
  nav > div.flex.items-center.gap-2 {
    gap: 6px;
  }
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  flex-direction: column;
  padding: 64px 24px 32px;
  overflow-y: auto;
  animation: drawerFadeIn 0.2s ease-out;
}
.mobile-drawer.open { display: flex; }

.mobile-drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f3f4f6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-drawer-close svg { width: 22px; height: 22px; }

.mobile-drawer nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-drawer nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 17px;
  font-weight: 600;
  color: #e5e7eb;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
}
.mobile-drawer nav a:hover,
.mobile-drawer nav a:focus-visible {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.mobile-drawer nav a[aria-current="page"] {
  background: rgba(88,101,242,0.18);
  color: #fff;
  border: 1px solid rgba(88,101,242,0.4);
}

.mobile-drawer .drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 18px 16px 8px;
}

.mobile-drawer .drawer-lang {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 8px;
}
.mobile-drawer .drawer-lang a {
  flex: 1;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 15px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}
.mobile-drawer .drawer-lang a[aria-current="page"] {
  background: rgba(88,101,242,0.18);
  border-color: rgba(88,101,242,0.5);
}

.mobile-drawer .drawer-cta {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-drawer .drawer-cta a {
  justify-content: center;
  min-height: 48px;
  font-weight: 700;
}
.mobile-drawer .drawer-cta a.primary {
  background: #5865F2;
  color: #fff;
}
.mobile-drawer .drawer-cta a.primary:hover {
  background: #4752c4;
}

@keyframes drawerFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.no-scroll { overflow: hidden; }

/* ---------- 5. Language switcher visibility ----------
   Visible from sm (640px) and up.
   On smallest phones (<640px) it lives in the mobile drawer to avoid
   header overflow. The wrapper gets data-lang-switch via the inject script. */
nav [data-lang-switch] {
  display: none;
}
@media (min-width: 640px) {
  nav [data-lang-switch] {
    display: inline-flex !important;
  }
}

/* ---------- 6. Touch target minimums ---------- */
@media (max-width: 767px) {
  nav a,
  nav button {
    min-height: 44px;
  }
}

/* ---------- 7. Form inputs >= 16px (prevents iOS zoom on focus) ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="password"],
textarea,
select {
  font-size: 16px !important;
}
@media (min-width: 768px) {
  /* Desktop can use 14px without zoom issue */
  input.text-sm,
  textarea.text-sm,
  select.text-sm {
    font-size: 14px !important;
  }
}

/* ---------- 8. Visually-hidden helper (for sr-only labels we add) ---------- */
.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;
}

/* ---------- 9. Contrast helper: muted text on dark needs gray-400 not gray-500 ---------- */
/* These selectors only apply inside dark contexts (default theme) */
.html-fallback-gray { color: #9ca3af; } /* AA-pass replacement for gray-500 */

/* ---------- 10. Misc polish ---------- */
img { max-width: 100%; height: auto; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
