/* ==========================================================================
   Journey overview page (custom_programs/program_overview.html)
   Figma: FS1 - Future Skills - Graphics Development 2025
          "Journey Overview Page Structure" > Frame 3829 (desktop) + mobile frame
   Everything is scoped under .jo so nothing leaks into the rest of the LMS.
   ========================================================================== */

.jo {
  --jo-midnight: #100e4a;
  --jo-accent: #d16cff;          /* Vibe Violet (overridable per journey: css_single_color) */
  --jo-yellow: #ffcb05;          /* Cyber Yellow */
  --jo-btn-text: #110d7c;
  --jo-smoke: #f4f4f4;
  --jo-white: #ffffff;
  --jo-glass-bg: rgba(244, 244, 244, 0.1);
  --jo-glass-border: rgba(255, 255, 255, 0.5);
  --jo-shadow:
    0 4px 4px 0 rgba(0, 0, 0, 0.25),
    -6.89px -6.89px 20.671px 0 rgba(255, 255, 255, 0.12),
    6.89px 6.89px 20.671px 0 rgba(34, 26, 55, 0.1);
  --jo-shadow-sm:
    0 2.342px 2.342px 0 rgba(0, 0, 0, 0.25),
    -4.034px -4.034px 12.102px 0 rgba(255, 255, 255, 0.12),
    4.034px 4.034px 12.102px 0 rgba(34, 26, 55, 0.1);
  --jo-text-shadow: 1.378px 1.378px 1.378px rgba(0, 0, 0, 0.15);
  --jo-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  display: block;
  direction: rtl;
  font-family: var(--jo-font);
  color: var(--jo-white);
  background: linear-gradient(180deg, #416a9e 0%, #253b8c 35%, #150f73 70%, #100c66 100%);
  padding: 72px 24px 96px;
  outline: none;
}
.jo *, .jo *::before, .jo *::after { box-sizing: border-box; }
.jo img { max-width: 100%; }
.jo h1, .jo h2, .jo h3, .jo p { margin: 0; color: inherit; font-family: inherit; letter-spacing: 0; text-transform: none; }
.jo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.jo-wrap { max-width: 1248px; margin: 0 auto; }
.jo-body {
  max-width: 802px;
  margin: 63px auto 0;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

/* ---------- Buttons ---------- */
.jo .jo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 164px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 20px;
  font: 700 16px/1 var(--jo-font);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--jo-shadow);
  transition: transform .15s ease, filter .15s ease;
}
.jo .jo-btn--primary,
.jo a.jo-btn--primary:link,
.jo a.jo-btn--primary:visited { background: var(--jo-yellow); color: var(--jo-btn-text); text-shadow: var(--jo-text-shadow); cursor: pointer; }
.jo .jo-btn--primary:hover,
.jo .jo-btn--primary:focus-visible { color: var(--jo-btn-text); filter: brightness(1.05); transform: translateY(-1px); text-decoration: none; }
.jo .jo-btn--primary:focus-visible { outline: 3px solid var(--jo-white); outline-offset: 3px; }
.jo .jo-btn--disabled { background: rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.85); cursor: not-allowed; box-shadow: none; }
.jo .jo-btn--sm { min-width: 0; height: 36px; font-size: 14px; }
/* Enrolled learner (Figma): yellow status label (not clickable) + "عرض المغامرة" secondary button. */
.jo-enrolled { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; }
.jo .jo-btn--status { background: var(--jo-yellow); color: var(--jo-btn-text); text-shadow: var(--jo-text-shadow); cursor: default; }
.jo .jo-btn--secondary,
.jo a.jo-btn--secondary:link,
.jo a.jo-btn--secondary:visited { min-width: 136px; background: rgba(65, 106, 158, 0.9); color: var(--jo-white); text-shadow: var(--jo-text-shadow); cursor: pointer; }
.jo .jo-btn--secondary:hover,
.jo .jo-btn--secondary:focus-visible { color: var(--jo-white); filter: brightness(1.1); transform: translateY(-1px); text-decoration: none; }
.jo .jo-btn--secondary:focus-visible { outline: 3px solid var(--jo-white); outline-offset: 3px; }

.jo-note { margin-top: 8px !important; font-size: 14px; line-height: 1.6; text-align: center; color: rgba(255, 255, 255, 0.9); }
.jo-note a { color: var(--jo-yellow); text-decoration: underline; }
.jo-note--ok { color: #b9f6ca; }

/* ---------- Round icon badge ---------- */
.jo-badge {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--jo-accent);
  box-shadow: var(--jo-shadow-sm);
  color: var(--jo-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.jo-badge svg { width: 19px; height: 19px; }

/* Badge icons for content written in the admin editor (the editor strips inline SVG):
   <div class="jo-badge jo-badge--target|clock|check"></div> */
.jo-badge[class*="jo-badge--"]::before {
  content: ""; width: 19px; height: 19px; background: currentColor;
  -webkit-mask: var(--jo-icon) center / contain no-repeat; mask: var(--jo-icon) center / contain no-repeat;
}
.jo-badge--target { --jo-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3C/svg%3E"); }
.jo-badge--clock { --jo-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.jo-badge--check { --jo-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12 2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }

/* Editor content joins the page flow (same gaps as the automatic sections). */
.jo-editor { display: contents; }

/* ---------- 1. Hero ---------- */
.jo-hero {
  position: relative;
  min-height: 558px;
  border-radius: 25px;
  overflow: hidden;
  box-shadow: var(--jo-shadow);
  background: linear-gradient(135deg, #0b1d6b 0%, #123a9a 50%, #0b1660 100%);
}
.jo-hero--bg::before {
  content: "";
  position: absolute;
  inset: -30px;
  background: var(--jo-hero-bg) center / cover no-repeat;
  filter: blur(1.3px);
}
.jo-hero__banner {
  position: absolute;
  top: 121px;
  inset-inline: 0;
  height: 316px;
}
/* Glass bar (Figma "Sidebar Background"): background blur 35, 3px gradient border,
   radius 40. Built in CSS, no image. */
.jo-hero__glass {
  position: absolute;
  inset: 0;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(35px) saturate(1.15);
  backdrop-filter: blur(35px) saturate(1.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.jo-hero__glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0) 65%, rgba(255, 255, 255, 0.54) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
/* Figma "Section Container": 652 wide, centred, 148px from the glass top;
   title (48/72) then the pill 24px below it, both aligned to the right (RTL start). */
.jo-hero__text {
  position: absolute;
  top: 148px;
  left: 50%;
  transform: translateX(-50%);
  width: 652px;
  max-width: 56%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  z-index: 2;
}
.jo-hero__title { font-size: 48px; font-weight: 700; line-height: 1.5; text-shadow: var(--jo-text-shadow); }
.jo-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  line-height: 24px;
  border-radius: 8px;
  background: var(--jo-accent);
  box-shadow: var(--jo-shadow);
  color: var(--jo-midnight);
  font-size: 16px;
  font-weight: 600;
}
.jo-pill__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; color: var(--jo-btn-text); }  /* Figma icon fill #110D7C */
.jo-pill__icon svg { width: 24px; height: 24px; display: block; }
.jo-meta { list-style: none; margin: -8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jo-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 14, 74, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 14px;
  font-weight: 600;
}
.jo-meta__icon { display: inline-flex; }
.jo-meta__icon svg { width: 16px; height: 16px; }


/* Character art, positioned per journey from the admin (css_overview_image_*). */
.jo .jo-hero__deco {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  height: auto;
  filter: drop-shadow(0 5.9px 5.9px rgba(0, 0, 0, 0.25));
}
.jo .jo-hero__deco--left  { left: 0; top: 34px; width: 445px; }
.jo .jo-hero__deco--right { right: -18px; top: 6px; width: 436px; }

.jo-hero__cta {
  position: absolute;
  top: 471px;
  inset-inline: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Admin notice ---------- */
.jo-admin-notice {
  padding: 16px 20px;
  border-radius: 12px;
  background: #fff4d6;
  color: #5a4300;
  font-size: 15px;
  line-height: 1.7;
}
.jo-admin-notice a { color: #5a4300; text-decoration: underline; font-weight: 700; }

/* ---------- 2. Intro story ---------- */
.jo-intro {
  border: 3px solid var(--jo-glass-border);
  border-radius: 7px;
  box-shadow: var(--jo-shadow);
  overflow: hidden;
}
.jo-intro__head {
  padding: 16px 32px;
  border-bottom: 10px solid var(--jo-accent);
  background: linear-gradient(63deg, rgba(255, 255, 255, 0.35) 11%, rgba(255, 255, 255, 0.035) 113%);
}
.jo-intro__head p { font-size: 18px; font-weight: 700; line-height: 24px; white-space: pre-line; }
.jo-intro__head:last-child { border-bottom: 0; }
.jo-intro__media { background: var(--jo-smoke); }
.jo-intro__media picture { display: block; }
.jo-intro__media + .jo-intro__media { border-top: 3px solid var(--jo-glass-border); }
.jo-intro__media img,
.jo-intro__video { display: block; width: 100%; height: auto; }

/* Intro written in the admin editor ("Program Overview"). Same look as above:
   <div class="jo-intro__head"><p>..</p></div>, then the comic in
   <div class="jo-intro__media jo-intro__media--desktop"> / --mobile. Plain text and
   images typed without these classes still get the same style. */
.jo-intro--rich > p,
.jo-intro--rich > h2,
.jo-intro--rich > h3 {
  margin: 0;
  padding: 16px 32px;
  border-bottom: 10px solid var(--jo-accent);
  background: linear-gradient(63deg, rgba(255, 255, 255, 0.35) 11%, rgba(255, 255, 255, 0.035) 113%);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}
.jo-intro--rich .jo-intro__head p { margin: 0; }
.jo-intro--rich > img,
.jo-intro--rich > p > img { display: block; width: 100%; height: auto; }
.jo-intro--rich > p:has(> img:only-child) { padding: 0; border: 0; background: var(--jo-smoke); }
/* Desktop/mobile comic: picked by the image file name (".._mobile.jpg"), so it still
   works if the editor drops the classes on save. */
.jo-intro__media--mobile,
.jo-intro--rich > :is(div, p):has(> img[src*="_mobile."]),
.jo-intro--rich > img[src*="_mobile."] { display: none; }

/* ---------- 3. Rich text ---------- */
.jo-rich {
  padding: 24px 32px;
  border: 3px solid var(--jo-glass-border);
  border-radius: 25px;
  background: var(--jo-glass-bg);
  font-size: 18px;
  line-height: 1.8;
}
.jo-rich h2, .jo-rich h3 { font-weight: 700; margin: 0 0 8px; }
.jo-rich h2 { font-size: 28px; }
.jo-rich h3 { font-size: 22px; }
.jo-rich p, .jo-rich ul, .jo-rich ol { margin: 0 0 12px; }
.jo-rich a { color: var(--jo-yellow); }

/* ---------- 4. Stations / challenges ---------- */
.jo-section-title { display: flex; align-items: center; gap: 16px; margin: 0 10px 16px 0; }
.jo-section-title h2 { font-size: 40px; font-weight: 700; line-height: 1.5; }

.jo-route__list { list-style: none; margin: 0; padding: 0 10px 0 0; display: flex; flex-direction: column; gap: 16px; }
.jo-stop { position: relative; display: flex; align-items: flex-start; gap: 16px; margin: 0; }
.jo-stop__num {
  position: relative;
  z-index: 1;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--jo-accent);
  border-radius: 50%;
  background: var(--jo-midnight);
  box-shadow: var(--jo-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.jo-stop:not(:last-child)::after {           /* dashed connector between numbers */
  content: "";
  position: absolute;
  inset-inline-start: 16.5px;
  top: 37px;
  bottom: -13px;
  border-inline-start: 1px dashed var(--jo-yellow);
}
.jo-stop__card {
  flex: 1;
  min-width: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 15px;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.2));  /* Figma: lighter towards the left */
  box-shadow: var(--jo-shadow);
  overflow: hidden;
}
.jo-stop__bar {
  min-height: 34px;
  margin: -1px -1px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  background: var(--jo-midnight);
  border: 1px solid var(--jo-accent);
  border-bottom: 0;
  border-radius: 15px 15px 0 0;   /* Figma: full-width bar, both top corners rounded */
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.jo-stop__body { display: flex; align-items: center; gap: 28px; min-height: 100px; padding: 8px 48px; }
.jo-stop__icon { flex: none; width: 88px; height: 88px; display: flex; align-items: center; justify-content: center; }
.jo-stop__icon img { width: 84px; height: 76px; object-fit: contain; filter: drop-shadow(0 1.66px 1.66px rgba(0, 0, 0, 0.25)); }
.jo-stop__title { font-size: 28px; font-weight: 700; line-height: 1.5; }

/* ---------- 5. Duration + certificate ---------- */
.jo-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 24px; }
.jo-info__card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 16px;
  /* Figma: violet-blue border, brighter on top and bottom, soft glow (not white) */
  border: 3px solid rgba(88, 92, 235, 0.32);
  border-block-color: rgba(88, 92, 235, 0.7);
  border-radius: 25px;
  box-shadow: 0 0 10px rgba(88, 92, 235, 0.35), var(--jo-shadow);
  background: var(--jo-glass-bg);
  -webkit-backdrop-filter: blur(35px);
  backdrop-filter: blur(35px);
}
.jo-info__card .jo-badge { margin-top: 11px; }
.jo-info__body { display: flex; flex-direction: column; gap: 8px; }
.jo-info__title { font-size: 40px; font-weight: 700; line-height: 1.5; }
.jo-info__text { font-size: 18px; font-weight: 400; line-height: 24px; }
.jo-info__text--label { font-size: 16px; font-weight: 600; line-height: 25.8px; }

/* ---------- 6. Final CTA + sticky bar ---------- */
.jo-final { display: flex; justify-content: center; }
.jo-sticky {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(16, 14, 74, 0.95);
  border-top: 1px solid var(--jo-accent);
  transform: translateY(100%);
  transition: transform .2s ease;
}
.jo-sticky.is-visible { transform: translateY(0); }
.jo-sticky__name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (max-width: 1200px) {
  .jo .jo-hero__deco--left  { width: 32%; }
  .jo .jo-hero__deco--right { width: 30%; }
  .jo-hero__title { font-size: 40px; }
}
@media (min-width: 769px) {
  .jo-sticky { display: none; }
}

/* ==========================================================================
   Mobile (design frame: 393px)
   ========================================================================== */
@media (max-width: 768px) {
  .jo { padding: 24px 16px 88px; }
  .jo-body { margin-top: 40px; gap: 40px; }

  /* Mobile hero (Figma mobile frame, card 392x555): glass card; title + tag at the top right;
     left character at the top left next to the title; right character at the bottom right over
     the glass edge; button at the bottom. Same images as desktop, sizes in % so it scales.
     Admin "Overview Image ... CSS - Mobile" fields still override the character rules. */
  .jo-hero { min-height: 0; padding: 0; aspect-ratio: 392 / 555; }
  .jo-hero__banner { position: absolute; top: 6.7%; left: 11.2%; right: 11.2%; height: 71.7%; padding: 0; transform: none; width: auto; max-width: none; z-index: 1; }
  .jo-hero__glass { border-radius: 24px; }
  .jo-hero__text { position: absolute; top: 12%; right: 18%; left: auto; width: 56%; transform: none; max-width: none; gap: 10px; align-items: flex-start; z-index: 3; }
  .jo-hero__title { font-size: clamp(20px, 7.4vw, 32px); line-height: 1.3; text-align: right; }
  .jo-pill { white-space: nowrap; width: max-content; max-width: none; font-size: clamp(10px, 3.1vw, 13px); padding: 4px 8px; gap: 4px; }
  .jo-pill__icon, .jo-pill__icon svg { width: 16px; height: 16px; }
  .jo .jo-hero__deco { position: absolute; width: auto; max-height: none; object-fit: contain; z-index: 2; }
  .jo .jo-hero__deco--left  { display: block; left: 8%; right: auto; top: 11%; bottom: auto; height: 30%; max-width: 36%; object-position: top left; }
  .jo .jo-hero__deco--right { right: 3%; left: auto; top: auto; bottom: 19%; height: 33%; max-width: 50%; object-position: bottom right; }
  .jo-hero__cta { position: absolute; top: auto; bottom: 6.7%; inset-inline: 0; transform: none; z-index: 4; }
  .jo-enrolled { flex-wrap: nowrap; gap: 6px; }   /* keep the label and the button on one row inside the hero */
  .jo .jo-enrolled .jo-btn { min-width: 0; height: 34px; padding: 0 10px; font-size: clamp(11px, 3.6vw, 14px); }

  .jo-intro__head { padding: 16px; }
  .jo-intro__head p { font-size: 16px; }
  .jo-intro--rich > p, .jo-intro--rich > h2, .jo-intro--rich > h3 { padding: 16px; font-size: 16px; }
  .jo-intro--rich > p:has(> img:only-child) { padding: 0; }
  .jo-intro__media--mobile,
  .jo-intro--rich > :is(div, p):has(> img[src*="_mobile."]) { display: block; }
  .jo-intro--rich > img[src*="_mobile."] { display: block; }
  .jo-intro--rich:has(img[src*="_mobile."]) > :is(div, p):has(> img:not([src*="_mobile."])),
  .jo-intro--rich:has(img[src*="_mobile."]) > img:not([src*="_mobile."]) { display: none; }
  .jo-rich { padding: 20px 16px; font-size: 16px; }

  .jo-section-title h2 { font-size: 28px; }
  .jo-route__list { padding: 0; }
  .jo-stop__body { padding: 8px 16px; gap: 12px; min-height: 72px; }
  .jo-stop__icon { width: 56px; height: 56px; }
  .jo-stop__icon img { width: 52px; height: 46px; }
  .jo-stop__title { font-size: 20px; line-height: 1.5; }
  .jo-stop__bar { font-size: 13px; }

  .jo-info { grid-template-columns: 1fr; gap: 16px; }
  .jo-info__title { font-size: 32px; }
  .jo-info__text { font-size: 16px; }
}

/* Course-team bar (instructors/staff of the journey + admins) */

/* Very small phones (< 360px): the hero gets taller, title and tag smaller, the glass shorter,
   and the enrolled label + button stack, so nothing overlaps or leaves the hero. */
@media (max-width: 359px) {
  .jo-hero { aspect-ratio: 392 / 640; }
  .jo-hero__banner { height: 66%; }
  .jo-hero__title { font-size: clamp(16px, 7vw, 22px); }
  .jo-pill { font-size: 10px; padding: 3px 6px; }
  .jo-enrolled { flex-direction: column; gap: 6px; }
  .jo .jo-enrolled .jo-btn { height: 30px; font-size: 12px; padding: 0 12px; }
}
