/* =====================================================================
   Agency website stylesheet
   - One file for Arabic (RTL) and English (LTR): it uses "logical"
     properties (margin-inline-start, padding-inline, inset-inline-end...)
     which flip automatically with the page direction.
   - Mobile first: base styles are for phones; @media (min-width) adds
     the tablet/desktop layout.
   ===================================================================== */

/* ---------- 1. Colours, fonts, sizes (change the look here) ---------- */
:root {
  --navy: #13283A;
  --green: #1D6B57;
  --green-dark: #155443;
  --bg: #F7F4EE;
  --card: #FFFFFF;
  --border: #E3DCCF;
  --muted: #4D5B66;
  --tag: #E6EFEA;
  --danger: #A3302A;
  --danger-bg: #FBECEA;

  --font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-head: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --max: 1160px;
  --gutter: 16px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
img, svg { max-width: 100%; }
img { height: auto; }
ul { padding-inline-start: 1.25rem; }

/* Clear, visible keyboard focus everywhere */
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }

.icon { flex-shrink: 0; vertical-align: middle; }
[dir="rtl"] .icon--dir { transform: scaleX(-1); }

/* Phone numbers, emails, codes: always left-to-right */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; color: #fff; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: 48px; }
.section--tight { padding-block: 32px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; text-align: center;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); color: #fff; }
.btn--outline { border-color: var(--green); color: var(--green); background: transparent; }
.btn--outline:hover { background: var(--tag); color: var(--green-dark); }
.btn--light { border-color: rgba(255,255,255,.7); color: #fff; background: transparent; }
.btn--light:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn--whatsapp { background: #1E7E4B; color: #fff; }
.btn--whatsapp:hover { background: #17663C; color: #fff; }
.btn--small { min-height: 44px; padding: 8px 16px; font-size: .95rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 4. Header and menu ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-width: 0; margin-inline-end: auto; }
.brand:hover { color: var(--navy); }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--green); color: #fff; flex-shrink: 0; }
.brand-logo { max-height: 44px; width: auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
/* Filtal text logo */
.wordmark { font-family: "Readex Pro", var(--font-head); font-weight: 700; font-size: 1.6rem; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
.wordmark__a { color: var(--navy); }
.wordmark__b { color: var(--green); }
.wordmark--light .wordmark__a { color: #fff; }
.wordmark--light .wordmark__b { color: #7FCBB0; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tagline { display: none; font-size: .8rem; color: var(--muted); line-height: 1.3; }

.lang-switch {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--navy); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.lang-switch:hover { border-color: var(--green); color: var(--green); }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--navy); cursor: pointer;
}
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: inline; }

/* Mobile: the menu is a panel under the header, hidden until opened. */
.site-nav { display: none; flex-basis: 100%; order: 10; border-top: 1px solid var(--border); padding-block: 8px 16px; }
.site-nav.is-open { display: block; }
.no-js .site-nav { display: block; }
.no-js .menu-toggle { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: flex; align-items: center; min-height: 48px; padding-inline: 4px;
  color: var(--navy); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--bg);
}
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--green); }
.nav-list a[aria-current="page"] { font-weight: 600; }
.nav-cta { margin-top: 12px; }
.header-cta { display: none; }

@media (min-width: 640px) {
  .brand-tagline { display: block; }
}

@media (min-width: 1000px) {
  .menu-toggle { display: none; }
  .header-inner { min-height: 76px; gap: 20px; }
  .site-nav, .no-js .site-nav { display: block; flex-basis: auto; border: 0; padding: 0; order: 2; }
  .brand { margin-inline-end: 0; }
  .site-nav { margin-inline-end: auto; }
  .nav-list { display: flex; gap: 4px; }
  .nav-list a { border: 0; padding-inline: 12px; min-height: 44px; border-radius: var(--radius-sm); }
  .nav-list a[aria-current="page"] { background: var(--tag); }
  .nav-cta { display: none; }
  .lang-switch { order: 3; }
  .header-cta { display: inline-flex; order: 4; }
}

/* ---------- 5. Hero (home page) ---------- */
.hero { background: var(--navy); color: #fff; padding-block: 48px 96px; }
.hero h1 { color: #fff; max-width: 18em; }
.hero p { color: #D5DEE5; font-size: 1.1rem; max-width: 36em; margin-bottom: 28px; }
.hero-eyebrow { display: inline-block; font-size: .9rem; font-weight: 500; color: #BFE3D6; margin-bottom: 12px; }

.quick-search {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; margin-top: -64px; position: relative;
}
.quick-search h2 { font-size: 1.15rem; margin-bottom: 12px; }
.quick-search form { display: grid; gap: 12px; }
@media (min-width: 760px) {
  .hero { padding-block: 72px 120px; }
  .quick-search { padding: 24px 28px; }
  .quick-search form { grid-template-columns: 1fr 1fr auto; align-items: end; }
}

/* ---------- 6. Page header (inner pages) ---------- */
.page-header { background: var(--card); border-bottom: 1px solid var(--border); padding-block: 28px 24px; }
.page-header h1 { margin-bottom: 4px; }
.page-header p { margin: 0; color: var(--muted); }
.page-header--dark { background: var(--navy); color: #fff; border: 0; padding-block: 40px 36px; }
.page-header--dark h1 { color: #fff; }
.page-header--dark p { color: #D5DEE5; }

.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 4px; color: var(--border); }
.breadcrumb a { color: var(--muted); }

/* ---------- 7. Cards and grids ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card--pad-lg { padding: 24px; }
@media (min-width: 760px) { .card--pad-lg { padding: 32px; } }

.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid { gap: 20px; }
}

.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; background: var(--tag); color: var(--green-dark);
  font-size: .85rem; font-weight: 500; line-height: 1.6;
}
.tag--featured { background: #FFF3D6; color: #7A5300; }

/* Job card */
.job-card { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.job-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.job-card__company { margin: 0; color: var(--muted); font-size: .92rem; }
.job-card__title { margin: 0; font-size: 1.15rem; }
.job-card__title a { color: var(--navy); text-decoration: none; }
.job-card__title a:hover { color: var(--green); }
.job-card__meta { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .93rem; color: var(--muted); }
.job-card__meta li { display: flex; align-items: center; gap: 8px; }
.job-card__footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--bg); }
.job-card__link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; }

/* Steps (how it works) */
.steps { list-style: none; padding: 0; margin: 0; }
.step { position: relative; }
.step__num {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px;
  border-radius: 50%; background: var(--tag); color: var(--green-dark);
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem;
}
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); }

/* Feature (icon + title + text) */
.feature__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--tag); color: var(--green); margin-bottom: 14px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; }
.check-list .icon { color: var(--green); margin-top: 4px; }
.check-list strong { display: block; }

/* Call-to-action banner */
.cta-banner {
  display: flex; flex-direction: column; gap: 16px; align-items: flex-start;
  background: var(--tag); border: 1px solid #CFE0D7; border-radius: var(--radius-lg); padding: 28px 24px;
}
.cta-banner h2 { margin: 0 0 4px; }
.cta-banner p { margin: 0; color: var(--muted); }
.cta-banner--dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.cta-banner--dark h2 { color: #fff; }
.cta-banner--dark p { color: #D5DEE5; }
@media (min-width: 760px) {
  .cta-banner { flex-direction: row; align-items: center; justify-content: space-between; padding: 32px 40px; }
}

/* ---------- 8. Jobs list ---------- */
.filters { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.filters .field + .field { margin-top: 0; }
/* On phones: keyword and button full width, the three lists two per row */
.filters .field:first-child, .filters .field:last-child { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  .filters { grid-template-columns: 1.4fr 1fr 1fr 1fr auto; align-items: end; }
  .filters .field:first-child, .filters .field:last-child { grid-column: auto; }
}
.results-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 24px 0 16px; color: var(--muted); }

.empty-state { text-align: center; padding: 48px 20px; }
.empty-state__icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--tag); color: var(--green); margin-bottom: 16px; }
.empty-state .btn-row { justify-content: center; margin-top: 20px; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 32px; }
.pagination__info { padding-inline: 8px; color: var(--muted); }

/* ---------- 9. Job detail ---------- */
.job-layout { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1000px) { .job-layout { grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; } }
.job-header__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.job-header__company { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 1.05rem; margin: 0; }
.facts { display: grid; gap: 10px; margin: 0 0 28px; padding: 0; grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts div { padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.facts dt { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.facts .icon { color: var(--green); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.job-section + .job-section { margin-top: 28px; }
.job-section h2 { font-size: 1.2rem; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.job-section ul { margin: 0; display: grid; gap: 6px; }
.job-section li::marker { color: var(--green); }

.apply-box h2 { font-size: 1.25rem; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-sm);
  background: var(--tag); color: var(--navy); margin-bottom: 16px;
}
.notice .icon { color: var(--green); margin-top: 3px; }
.notice p { margin: 0; }
.notice--warning { background: #FFF3D6; }
.notice--warning .icon { color: #7A5300; }
.notice--error { background: var(--danger-bg); }
.notice--error .icon { color: var(--danger); }

/* ---------- 10. Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 16px; }
.field label, .field .label { font-weight: 500; }
.field .required { color: var(--danger); margin-inline-start: 2px; }
.field .help { font-size: .88rem; color: var(--muted); margin: 0; }
.field .error { font-size: .92rem; color: var(--danger); margin: 0; font-weight: 500; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: 400 16px/1.5 var(--font-body); /* 16px stops iPhone from zooming in */
  color: var(--navy); background: #fff;
  border: 1px solid #CFC6B6; border-radius: var(--radius-sm);
}
textarea { min-height: 120px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234D5B66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
[dir="rtl"] select { background-position: left 12px center; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29,107,87,.35); outline-offset: 0; border-color: var(--green); }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--danger); }
input[type="file"] { width: 100%; min-height: 48px; padding: 10px; font-size: 16px; background: #fff; border: 1px dashed #B9AE99; border-radius: var(--radius-sm); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; }
.checkbox input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--green); flex-shrink: 0; }
.form-grid { display: grid; gap: 16px; }
.form-grid .field + .field { margin-top: 0; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.form-actions { margin-top: 20px; }


/* ---------- 11. Text pages (About, Privacy) ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.3rem; margin-top: 1.6em; }
.prose ul { display: grid; gap: 6px; }
.prose li::marker { color: var(--green); }

/* ---------- 12. Contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 16px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .feature__icon { width: 44px; height: 44px; margin: 0; }
.contact-list .label { display: block; font-size: .88rem; color: var(--muted); }
.contact-list a { font-weight: 600; text-decoration: none; }
.map-frame { width: 100%; height: 320px; border: 0; border-radius: var(--radius); display: block; background: var(--border); }
.social { display: flex; gap: 8px; }
.social a { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid currentColor; }

/* ---------- 13. Messages (success / error) ---------- */
.messages { list-style: none; padding: 0; margin: 16px 0 0; }
.messages li { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--tag); border: 1px solid #CFE0D7; }
.messages li.error { background: var(--danger-bg); border-color: #F0C9C5; }

/* ---------- 14. Footer ---------- */
.site-footer { background: var(--navy); color: #D5DEE5; margin-top: 56px; padding-block: 40px 24px; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer h2 { font-size: 1rem; color: #fff; margin-bottom: 12px; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; } }
.footer-brand { font-family: var(--font-head); font-size: 1.2rem; color: #fff; font-weight: 600; margin-bottom: 6px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; }
.footer-contact { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .icon { margin-top: 4px; color: #BFE3D6; }
.site-footer .social { margin-top: 16px; }
.site-footer .social a { color: #fff; border-color: rgba(255,255,255,.35); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 32px; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .88rem; }

/* Floating WhatsApp button (phones only) */
.whatsapp-float {
  position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 40;
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: #1E7E4B; color: #fff; box-shadow: 0 2px 8px rgba(19,40,58,.25);
}
.whatsapp-float:hover { background: #17663C; color: #fff; }
@media (min-width: 1000px) { .whatsapp-float { display: none; } }

/* ---------- 15. Error pages ---------- */
.error-page { text-align: center; padding-block: 72px; }
.error-page__code { font-family: var(--font-head); font-size: 4rem; font-weight: 700; color: var(--green); line-height: 1; margin-bottom: 12px; }
.error-page .btn-row { justify-content: center; margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- 16. Small helpers ---------- */
.section--white { background: var(--card); border-block: 1px solid var(--border); }
.btn-row--spaced { margin-top: 24px; }
.stack > * + * { margin-top: 20px; }
.narrow { max-width: 820px; margin-inline: auto; }
.spaced-bottom { margin-bottom: 24px; }
.map-card { padding: 8px; margin-top: 20px; }
.error-page .narrow { text-align: center; }

/* ---------- 17. Form extras ---------- */
/* Spam trap: moved off-screen so people never see it */
.hp-field { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-privacy { margin-top: 16px; }
/* CV upload: hidden real input + styled button and file name */
.file-picker { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px; border: 1px dashed #B9AE99; border-radius: var(--radius-sm); background: #fff; }
.file-picker__input { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; }
.file-picker__input:focus-visible + .file-picker__button { outline: 3px solid var(--green); outline-offset: 2px; }
.file-picker__button { cursor: pointer; }
.file-picker__name { color: var(--muted); font-size: .95rem; word-break: break-all; }
.file-picker.has-file .file-picker__name { color: var(--navy); font-weight: 500; }
.field--invalid .file-picker { border-color: var(--danger); }
.btn[disabled] { opacity: .7; cursor: progress; }
.span-2 { grid-column: 1 / -1; }
