/* ==========================================================================
   EL BADR Industries — Careers page (careers.html / careers-ar.html)
   Reuses the design-system variables from main.css. Light mode is the default
   styling; every dark override lives in the block at the bottom of this file.
   ========================================================================== */

/* The Apply control ships as a <button> with no handler and the address slot as
   a placeholder, because careers.js is what turns them into a real mailto: link
   (see that file for why the address is not in the HTML). Hide both until it
   has run, so a visitor with JavaScript off gets the WhatsApp button and the
   <noscript> note rather than a dead button. careers.js renames the class as it
   swaps each one in, so the replacement is unaffected by these rules. */
.js-apply,
.js-mail-text { display: none; }

/* --- benefits strip ------------------------------------------------------ */
.perk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}
.perk-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.5rem;
  overflow: hidden;
}
.perk-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 3px;
  height: 100%;
  background: var(--red);
  opacity: 0.85;
}
.perk-card__num {
  display: block;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.perk-card h3 { font-size: 1.12rem; margin: 0 0 0.45rem; color: var(--ink); }
.perk-card p { margin: 0; color: var(--text); font-size: 0.97rem; line-height: 1.7; }

/* --- the openings accordion ---------------------------------------------- */
.job-list { display: grid; gap: 1.1rem; max-width: 900px; margin-inline: auto; }

.job {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  /* scrolled to by #fragment — clear the sticky header */
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.job[open] { border-color: var(--red); box-shadow: var(--shadow-lg); }

.job__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.35rem clamp(1.1rem, 3vw, 1.8rem);
  cursor: pointer;
  list-style: none;              /* hide the native disclosure triangle */
  user-select: none;
}
.job__head::-webkit-details-marker { display: none; }
.job__head:hover h3 { color: var(--red); }
.job__head:focus-visible { outline: 2px solid var(--red); outline-offset: -3px; }

.job__headline { min-width: 0; }
.job__headline h3 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--ink);
  transition: color 0.2s ease;
}

.job__meta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.job__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.job__tag--pin { color: var(--text); }
.job__tag svg { width: 14px; height: 14px; color: var(--red); flex: none; }

.job__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--red);
}
.job__toggle svg {
  width: 20px; height: 20px;
  transition: transform 0.28s ease;
}
.job[open] .job__toggle svg { transform: rotate(180deg); }
/* The label is a nicety on a wide screen; the chevron carries it on a phone. */
@media (max-width: 720px) { .job__toggle-text { display: none; } }

.job__body {
  padding: 0 clamp(1.1rem, 3vw, 1.8rem) 1.7rem;
  border-top: 1px solid var(--line);
  margin-top: -1px;
  padding-top: 1.5rem;
}
.job__summary { font-size: 1.04rem; }
.job__block { margin-top: 1.7rem; }
.job__h {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.8rem;
  font-family: var(--font-head);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--red);
}
.job__h::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* editor-produced HTML inside a job */
.rich p { margin: 0 0 0.9rem; color: var(--text); line-height: 1.75; }
.rich p:last-child { margin-bottom: 0; }
.rich ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.rich li { position: relative; padding-inline-start: 1.5rem; color: var(--text); line-height: 1.7; }
.rich li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.62em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
}
/* the requirements list reads better as ticks than as bullets */
.rich--check li { padding-inline-start: 1.75rem; }
.rich--check li::before {
  top: 0.34em;
  width: 15px; height: 15px;
  border-radius: 0;
  background: none;
  /* stroke-coloured tick, drawn so it inherits the brand colour */
  -webkit-mask: var(--tick) center / contain no-repeat;
          mask: var(--tick) center / contain no-repeat;
  background-color: var(--red);
}
.rich--check {
  --tick: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>');
}

/* the facts row: experience / posted / closes */
.job__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.2rem;
  margin: 1.4rem 0 0;
  padding: 1rem 1.1rem;
  background: var(--paper);
  border-radius: 10px;
}
.job__facts > div { min-width: 0; }
.job__facts dt {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.job__facts dd { margin: 0; color: var(--ink); font-weight: 500; font-size: 0.95rem; }

/* software / skills chips */
.skill-row { list-style: none; display: flex; flex-wrap: wrap; gap: 0.55rem; padding: 0; margin: 0; }
.skill {
  background: var(--red-soft);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.35rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--red-dark);
}

.job__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.job__anchor {
  margin-inline-start: auto;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.job__anchor:hover { color: var(--red); }
@media (max-width: 560px) { .job__anchor { display: none; } }

/* --- how to apply -------------------------------------------------------- */
.apply-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: start;
}
@media (max-width: 860px) { .apply-grid { grid-template-columns: 1fr; } }

.apply-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0;
  display: grid;
  gap: 1rem;
}
.apply-steps li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 3rem;
  color: var(--text);
  line-height: 1.7;
  min-height: 2rem;
}
.apply-steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: -0.1rem;
  width: 2rem; height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
}

.apply-fraud {
  margin-top: 1.8rem;
  padding: 0.9rem 1.1rem;
  border-inline-start: 3px solid var(--red);
  background: var(--red-soft);
  border-radius: 0 10px 10px 0;
  font-size: 0.92rem;
  color: var(--red-dark);
  font-weight: 500;
}
[dir="rtl"] .apply-fraud { border-radius: 10px 0 0 10px; }

.apply-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 3vw, 2rem);
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
@media (max-width: 860px) { .apply-card { position: static; } }
.apply-card h3 { margin: 0 0 0.6rem; color: var(--ink); }
.apply-card p { color: var(--text); line-height: 1.7; }
.apply-card__mail {
  margin: 1.2rem 0;
  padding: 0.9rem 1rem;
  background: var(--paper);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.apply-card__label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.apply-card__mail a { color: var(--red); font-weight: 600; }
.apply-card__actions { display: grid; gap: 0.7rem; }
.apply-card__actions .btn { width: 100%; justify-content: center; text-align: center; }

/* ==========================================================================
   Dark mode
   ========================================================================== */
[data-theme="dark"] .perk-card,
[data-theme="dark"] .job,
[data-theme="dark"] .apply-card { border-color: rgba(255, 255, 255, 0.1); }

[data-theme="dark"] .job__tag {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .job__facts,
[data-theme="dark"] .apply-card__mail { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .job__body,
[data-theme="dark"] .job__actions,
[data-theme="dark"] .job__h::after { border-color: rgba(255, 255, 255, 0.1); }

/* --red-soft is a pale tint derived for light surfaces; on a dark card it has
   to become a translucent wash of the brand colour instead. */
[data-theme="dark"] .skill,
[data-theme="dark"] .apply-fraud { background: rgba(209, 32, 38, 0.14); }
[data-theme="dark"] .skill { color: var(--red); border-color: rgba(209, 32, 38, 0.3); }
[data-theme="dark"] .apply-fraud { color: var(--red); }

/* ==========================================================================
   LinkedIn touches — hero chip and the apply-card nudge
   ========================================================================== */
.careers { --li: #0a66c2; --li-dark: #004182; --fb: #1877f2; }

.li-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.4rem;
  padding: 0.4rem 0.95rem 0.4rem 0.4rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
[dir="rtl"] .li-chip { padding: 0.4rem 0.4rem 0.4rem 0.95rem; }
.li-chip:hover { transform: translateY(-2px); border-color: var(--li); color: var(--li); }
.li-chip__logo {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--li);
  color: #fff;
}
.li-chip__logo svg { width: 15px; height: 15px; }
.li-chip__arrow { width: 15px; height: 15px; opacity: 0.6; }
[dir="rtl"] .li-chip__arrow { transform: scaleX(-1); }

.apply-card__li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line);
  color: var(--li);
  font-weight: 600;
  font-size: 0.92rem;
}
.apply-card__li svg { width: 20px; height: 20px; flex: none; }
.apply-card__li:hover span { text-decoration: underline; }

/* ==========================================================================
   Past job posts, embedded — then the LinkedIn card
   careers.js drops each network frame into .fb-post__embed at the width its
   column allows; .fb-post__link is the fallback when the frame is blocked.
   ========================================================================== */
.fb-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 500px));
  justify-content: center;
  align-items: start;
  gap: 1.8rem;
  margin-bottom: clamp(2.2rem, 5vw, 3.4rem);
}
.fb-post {
  margin: 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fb-post__embed {
  position: relative;
  min-height: 160px;
  background: var(--paper);
}
.fb-post__embed[data-loading]::before {
  content: attr(data-loading);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted); font-size: 0.9rem;
}
.fb-post__embed iframe { position: relative; display: block; width: 100%; border: 0; background: transparent; }
.fb-post__link {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.4rem 0.7rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.fb-post__link svg { width: 16px; height: 16px; flex: none; color: var(--fb); }
.fb-post--li .fb-post__link svg { color: var(--li); }
.fb-post__link strong { color: var(--ink); font-weight: 600; }
.fb-post__go { margin-inline-start: auto; }
.fb-post__link:hover .fb-post__go { color: var(--red); }
/* blocked or never loaded: the link becomes the whole card */
.fb-post.is-fb-blocked .fb-post__embed { display: none; }
.fb-post.is-fb-blocked .fb-post__link { border-top: 0; padding: 1.2rem 1.3rem; font-size: 0.95rem; }

.li-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem 1.4rem;
  align-items: start;
  padding: clamp(1.4rem, 3.5vw, 2.2rem);
  border-radius: calc(var(--radius) + 4px);
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(135deg, var(--li) 0%, var(--li-dark) 100%);
  box-shadow: 0 24px 60px rgba(10, 102, 194, 0.28);
  overflow: hidden;
}
.li-card::after {              /* a big faint "in" watermark */
  content: "in";
  position: absolute;
  inset-inline-end: -0.6rem; bottom: -3.6rem;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 12rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.li-card__logo {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: 16px;
  background: #fff;
  color: var(--li);
}
.li-card__logo svg { width: 34px; height: 34px; }
.li-card__text { min-width: 0; }
.li-card__text h3 { margin: 0 0 0.5rem; color: #fff; font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
.li-card__text p { margin: 0; color: rgba(255,255,255,0.88); line-height: 1.7; }
.li-card__handle {
  margin-top: 0.7rem !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  direction: ltr;
  text-align: start;
  color: rgba(255,255,255,0.65) !important;
}
.li-card__actions {
  grid-column: 1 / -1;
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem;
  margin-top: 0.4rem;
}
.li-btn { background: #fff; color: var(--li); }
.li-btn svg { width: 18px; height: 18px; }
.li-btn:hover { background: #eaf3fc; color: var(--li-dark); }
.li-card__fb { display: inline-flex; align-items: center; gap: 0.45rem; color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 500; }
.li-card__fb svg { width: 16px; height: 16px; }
.li-card__fb:hover { color: #fff; text-decoration: underline; }

@media (max-width: 860px) {
  .li-card { grid-template-columns: 1fr; }
}

/* past posts + LinkedIn — dark */
[data-theme="dark"] .fb-post,
[data-theme="dark"] .fb-post__link,
[data-theme="dark"] .li-chip { border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .fb-post__embed { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .apply-card__li { border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .li-chip:hover,
[data-theme="dark"] .apply-card__li { color: #70b5f9; }
[data-theme="dark"] .fb-post__link svg { color: #6aa8ff; }
[data-theme="dark"] .fb-post--li .fb-post__link svg { color: #70b5f9; }
