/* =========================================================
   Phase PROCESS-2 — "كيف نعمل؟" route timeline (home page)
   Markup: page-templates/home-template.php (#process, .almp)
   Behaviour: assets/js/home-process.js sets --almp-p (0..1) on
   the route and .is-done / .is-current on steps. Without JS (or
   with reduced motion) every step shows as done.
   ========================================================= */

.almp {
  --almp-node: 64px;
  --almp-p: 1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 92px 0 96px;          /* overrides the theme's global section padding */
  background: var(--alm-navy);
  color: #fff;
  direction: rtl;
  text-align: right;
}
.almp__bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(201, 154, 58, .22), transparent 60%),
    radial-gradient(700px 380px at 0% 110%, rgba(36, 86, 130, .55), transparent 60%),
    linear-gradient(160deg, #102033 0%, #15304a 55%, #102033 100%);
}
.almp__bg::after {               /* faint dotted map grid */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
}
.almp__inner { position: relative; }

/* ---------- Head ---------- */
.almp__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px; flex-wrap: wrap; margin-bottom: 56px;
}
.almp__head-copy { max-width: 640px; }
.almp__kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(201, 154, 58, .14); border: 1px solid rgba(201, 154, 58, .35);
  color: #E6C77E; font-weight: 900; font-size: .92rem;
}
.almp__kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--alm-gold); box-shadow: 0 0 0 4px rgba(201, 154, 58, .22); }
.almp__title {
  margin: 0 0 12px; color: #fff; font-weight: 1000;
  font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.6rem); line-height: 1.35;
}
.almp__title span {
  display: block;
  background: linear-gradient(90deg, #F1D58E, var(--alm-gold) 60%, #E6C77E);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.almp__sub { margin: 0; color: rgba(255, 255, 255, .78); font-weight: 700; font-size: 1.04rem; line-height: 1.9; }

.almp__facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.almp__facts li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  color: #fff; font-weight: 850; font-size: .92rem;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.almp__facts .alm-icon { width: 18px; height: 18px; color: var(--alm-gold); }

/* ---------- Route (desktop: horizontal) ---------- */
.almp__route { position: relative; }
.almp__steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px;
}
.almp__track {
  position: absolute; z-index: 0;
  top: calc(var(--almp-node) / 2 - 2px); height: 4px;
  inset-inline: 12.5%;                              /* node centre of col 1 → col 4 */
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 10px, transparent 10px 20px);
}
.almp__track-fill {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: calc(var(--almp-p) * 100%);
  border-radius: inherit;
  background: linear-gradient(270deg, #F1D58E, var(--alm-gold));
  box-shadow: 0 0 18px rgba(201, 154, 58, .55);
}
.almp__truck {
  position: absolute; top: 50%; inset-inline-start: calc(var(--almp-p) * 100%);
  width: 42px; height: 42px; margin-top: -21px;
  transform: translateX(50%);                       /* RTL: centre on the fill tip */
  display: grid; place-items: center; border-radius: 50%;
  background: #fff; color: var(--alm-navy);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35), 0 0 0 5px rgba(201, 154, 58, .3);
  opacity: 0; transition: opacity .3s ease;
}
.almp__truck .alm-icon { width: 22px; height: 22px; transform: scaleX(-1); } /* face the travel direction */
.almp--js .almp__truck { opacity: 1; }
.almp--js .almp__route.is-complete .almp__truck { opacity: 0; }

/* ---------- Step ---------- */
.almp-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.almp-step__node {
  position: relative; flex: none;
  width: var(--almp-node); height: var(--almp-node); border-radius: 50%;
  display: grid; place-items: center;
  background: #16304a; border: 2px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .7);
  transition: background .45s ease, border-color .45s ease, color .45s ease, box-shadow .45s ease, transform .45s ease;
}
.almp-step__icon .alm-icon { width: 26px; height: 26px; }
.almp-step__node::after {                          /* pulse ring on the current step */
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(201, 154, 58, .55); opacity: 0;
}

.almp-step__card {
  position: relative; overflow: hidden; width: 100%; flex: 1;
  padding: 24px 20px 20px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .12);
  display: flex; flex-direction: column;
  transition: border-color .45s ease, transform .45s ease, opacity .45s ease, box-shadow .45s ease;
}
.almp-step__num {
  position: absolute; top: -6px; inset-inline-end: 12px;
  font-size: 4.6rem; font-weight: 1000; line-height: 1; letter-spacing: -2px;
  color: transparent; -webkit-text-stroke: 1.5px rgba(201, 154, 58, .32);
  pointer-events: none; user-select: none;
}
.almp-step__label { margin: 0 0 6px; color: #E6C77E; font-weight: 900; font-size: .85rem; }
.almp-step__title { margin: 0 0 10px; color: #fff; font-weight: 1000; font-size: 1.14rem; line-height: 1.5; }
.almp-step__text { margin: 0 0 16px; color: rgba(255, 255, 255, .76); font-weight: 700; font-size: .96rem; line-height: 1.85; }
.almp-step__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.almp-step__tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 10px;
  background: rgba(201, 154, 58, .14); color: #F1D58E; font-weight: 850; font-size: .82rem;
}
.almp-step__tag .alm-icon { width: 15px; height: 15px; }
.almp-step__link {
  display: inline-flex; align-items: center; gap: 4px;
  color: #fff; font-weight: 850; font-size: .86rem; text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, .35); padding-bottom: 1px;
}
.almp-step__link .alm-icon { width: 15px; height: 15px; transition: transform .2s ease; }
.almp-step__link:hover { color: #F1D58E; border-color: #F1D58E; }
.almp-step__link:hover .alm-icon { transform: translateX(-3px); }

/* Done state (default without JS) */
.almp-step.is-done .almp-step__node,
.almp:not(.almp--js) .almp-step__node {
  background: linear-gradient(135deg, #F1D58E, var(--alm-gold) 60%, #A97E25);
  border-color: transparent; color: var(--alm-navy);
  box-shadow: 0 10px 26px rgba(201, 154, 58, .35);
}
.almp-step.is-done .almp-step__card { border-color: rgba(201, 154, 58, .3); }
.almp-step.is-current .almp-step__node { transform: scale(1.06); }
.almp-step.is-current .almp-step__node::after { animation: almp-pulse 1.8s ease-out infinite; }
.almp-step--last.is-done .almp-step__card,
.almp:not(.almp--js) .almp-step--last .almp-step__card {
  background: linear-gradient(180deg, rgba(201, 154, 58, .16), rgba(255, 255, 255, .04));
  border-color: rgba(201, 154, 58, .45);
}

/* Pre-reveal state (JS only) */
.almp--js .almp-step:not(.is-done) .almp-step__card { opacity: .55; transform: translateY(10px); }

@keyframes almp-pulse {
  0%   { opacity: .9; transform: scale(.92); }
  100% { opacity: 0;  transform: scale(1.35); }
}

/* ---------- CTA ---------- */
.almp-cta {
  margin-top: 48px; padding: 22px 24px; border-radius: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.almp-cta__title { margin: 0 0 4px; color: #fff; font-weight: 1000; font-size: 1.25rem; }
.almp-cta__text { margin: 0; color: rgba(255, 255, 255, .78); font-weight: 700; }
.almp-cta__actions { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }

.almp-cta__call {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 22px 10px 14px; border-radius: 18px; text-decoration: none;
  background: linear-gradient(135deg, #F1D58E, var(--alm-gold) 55%, #A97E25);
  color: var(--alm-navy); box-shadow: 0 14px 30px rgba(201, 154, 58, .38);
  transition: transform .2s ease, box-shadow .2s ease;
}
.almp-cta__call:hover { color: var(--alm-navy); transform: translateY(-2px); box-shadow: 0 18px 36px rgba(201, 154, 58, .48); }
.almp-cta__call-icon {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--alm-navy); color: #fff; flex: none;
}
.almp-cta__call-icon::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(16, 32, 51, .45); animation: almp-pulse 2s ease-out infinite;
}
.almp-cta__call-icon .alm-icon { width: 22px; height: 22px; }
.almp-cta__call-text { display: flex; flex-direction: column; line-height: 1.25; }
.almp-cta__call-text b { font-weight: 1000; font-size: 1.08rem; }
.almp-cta__call-text small { font-weight: 900; font-size: .95rem; direction: ltr; text-align: right; }

.almp-cta__wa {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; font-weight: 850; text-decoration: none;
  padding: 10px 4px; border-bottom: 1px dashed rgba(255, 255, 255, .35);
}
.almp-cta__wa .alm-icon { width: 20px; height: 20px; color: #25D366; }
.almp-cta__wa:hover { color: #fff; border-color: #25D366; }

.almp a:focus-visible { outline: 3px solid #F1D58E; outline-offset: 3px; }

/* ---------- Tablet / phone: vertical route ---------- */
@media (max-width: 991px) {
  .almp { --almp-node: 54px; padding: 64px 0 72px; }
  .almp__head { margin-bottom: 36px; align-items: flex-start; }
  .almp__steps { grid-template-columns: 1fr; gap: 18px; }
  .almp-step { flex-direction: row; align-items: flex-start; gap: 16px; }
  .almp-step__icon .alm-icon { width: 23px; height: 23px; }
  .almp__track {
    inset-inline: auto; inset-inline-start: calc(var(--almp-node) / 2 - 2px);
    width: 4px; height: var(--almp-len, calc(100% - 120px));
    top: var(--almp-top, calc(var(--almp-node) / 2));
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .22) 0 10px, transparent 10px 20px);
  }
  .almp__track-fill { inset-inline: 0; width: auto; height: calc(var(--almp-p) * 100%); background: linear-gradient(180deg, var(--alm-gold), #F1D58E); }
  .almp__truck {
    inset-inline-start: 50%; top: calc(var(--almp-p) * 100%);
    width: 36px; height: 36px; margin-top: -18px;
  }
  .almp__truck .alm-icon { width: 19px; height: 19px; transform: rotate(90deg); }
  .almp-step__card { padding: 20px 18px 18px; }
  .almp-step__num { font-size: 3.6rem; }
  .almp--js .almp-step:not(.is-done) .almp-step__card { transform: translateX(-10px); }
  .almp-cta { margin-top: 36px; padding: 20px; }
}
@media (max-width: 560px) {
  .almp__facts { width: 100%; }
  .almp__facts li { flex: 1 1 auto; justify-content: center; padding: 9px 10px; font-size: .86rem; }
  .almp-cta { text-align: center; justify-content: center; }
  .almp-cta__copy { width: 100%; }
  .almp-cta__actions { width: 100%; flex-direction: column; }
  .almp-cta__call { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .almp *, .almp *::before, .almp *::after { transition: none !important; animation: none !important; }
}
