/* ==========================================================================
   Jobingo — Custom stylesheet (progressive enhancement on top of Tailwind)
   ========================================================================== */

:root {
  --font-en: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-ar: 'Tajawal', 'Cairo', ui-sans-serif, system-ui, sans-serif;
  --font-ar-heading: 'Cairo', 'Tajawal', ui-sans-serif, system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-en);
}

html[dir="rtl"] body {
  font-family: var(--font-ar);
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .font-heading {
  font-family: var(--font-ar-heading);
}

/* Disable transitions until the app signals it's safe (prevents FOUC flash) */
.no-transitions * {
  transition: none !important;
}

/* Smooth theme + color transitions after first paint */
body,
header,
footer,
.themed {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Skip link */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 100;
  background: #1e50be;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.5rem 0.5rem;
}
.skip-link:focus {
  inset-inline-start: 1rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(30, 80, 190, 0.35);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(30, 80, 190, 0.6);
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #fa8014;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Marquee for trusted companies.
   `direction: ltr` is forced here on purpose: flexbox lays items out from the
   inline-start edge, which flips to the right in an RTL document. Combined
   with the physical translateX() animation below, that flip pushed the
   entire track off-screen for most of each cycle in RTL. Pinning this
   component to LTR keeps the box geometry (and the translateX math)
   consistent regardless of page direction; company names are Latin-script
   brand names anyway, so there's no bidi text to lose. */
.marquee-wrap {
  direction: ltr;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
html[dir="rtl"] .marquee-track {
  animation-direction: reverse;
}
.marquee-wrap:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* File dropzone */
.dropzone {
  border: 2px dashed rgba(30, 80, 190, 0.35);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.dropzone.dropzone-active {
  border-color: #1e50be;
  background-color: rgba(30, 80, 190, 0.06);
}
html.dark .dropzone {
  border-color: rgba(148, 163, 184, 0.35);
}
html.dark .dropzone.dropzone-active {
  border-color: #4a7ce8;
  background-color: rgba(74, 124, 232, 0.1);
}

/* Animated entrance */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Blob decoration */
.blob {
  filter: blur(60px);
  opacity: 0.35;
}
html.dark .blob {
  opacity: 0.25;
}

/* Input invalid state */
.field-invalid {
  border-color: #e11d48 !important;
  box-shadow: 0 0 0 1px #e11d48;
}
.field-error-msg {
  display: none;
}
.field-invalid ~ .field-error-msg,
.field-error-msg.force-show {
  display: block;
}

/* Range/checkbox accent */
input[type="checkbox"],
input[type="radio"] {
  accent-color: #1e50be;
}

/* Toast */
#toast-region {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Flip directional icons (arrows) in RTL */
html[dir="rtl"] .icon-flip-rtl {
  transform: scaleX(-1);
}

/* Line clamp helper */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
