/**
 * Learner guide inside Moodle (guide.php). Same design as the website guide (MoodleAccessGuide.tsx on Framer).
 * Every rule is scoped to .mag-root so nothing else on the site is affected.
 *
 * @copyright  2026 Jake Morrison <info@jakemorrison.co.uk>
 * @license    https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
.mag-root {
  box-sizing: border-box; width: 100%;
  --mag-ink: #10233F;
  --mag-body: #3D4B5C;
  --mag-soft: #53606F;
  --mag-teal: #0F5F52;
  --mag-teal-hover: #1D7A6B;
  --mag-panel: #F4F8F7;
  --mag-badge: #E7F0ED;
  --mag-line: #E4E9EE;
  --mag-key-bg: #FEF6E7;
  --mag-key-line: #F3DCAB;
  --mag-key-ink: #8A5A12;
  color: var(--mag-body);
  font-family: var(--font, "Plus Jakarta Sans"), ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
.mag-root *, .mag-root *::before, .mag-root *::after { box-sizing: border-box; }

.mag-container {
  /* Breakpoints follow the component's own width, so the guide adapts to the
     Framer layout it sits in rather than to the browser window. */
  container-type: inline-size;
  container-name: mag;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 4px 20px 8px;
  font-size: 17px;
  line-height: 1.62;
}

.mag-container p { margin: 0; }
.mag-container h1, .mag-container h2, .mag-container h3, .mag-container h4 { color: var(--mag-ink); margin: 0; }

.mag-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.mag-root :focus-visible {
  outline: 3px solid var(--mag-teal);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---- header ---- */
.mag-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.mag-logo { display: block; height: 40px; width: auto; max-width: 180px; object-fit: contain; }
.mag-orgName {
  font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--mag-teal); background: var(--mag-badge);
  padding: 6px 12px; border-radius: 999px;
}
.mag-title {
  font-size: 29px; line-height: 1.16; font-weight: 650;
  letter-spacing: -0.021em; text-wrap: balance;
}
.mag-pathway { margin-top: 12px !important; font-size: 17px; font-weight: 600; color: var(--mag-teal); }
.mag-intro { margin-top: 16px; display: grid; gap: 12px; }

.mag-included { margin-top: 22px; padding: 18px 20px; background: var(--mag-panel); border-radius: 14px; }
.mag-includedTitle { margin-bottom: 10px !important; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--mag-soft); }
.mag-includedList { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mag-includedList li { display: flex; gap: 10px; align-items: flex-start; }
.mag-includedList svg { color: var(--mag-teal); flex: none; margin-top: 4px; }
.mag-includedName { font-weight: 600; color: var(--mag-ink); }
.mag-includedDetail { display: block; font-size: 15px; color: var(--mag-soft); }

/* ---- where are you starting ---- */
.mag-start { margin: 34px 0 0; padding: 0; border: 0; min-width: 0; }
.mag-startTitle { font-size: 21px; font-weight: 650; letter-spacing: -0.012em; line-height: 1.3; margin-bottom: 14px !important; }
.mag-cards { display: grid; gap: 10px; }
.mag-card { display: block; cursor: pointer; }
.mag-card .mag-cardInner { height: 100%; }
.mag-cardInner {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; column-gap: 14px; align-items: center;
  min-height: 76px; padding: 14px 16px;
  background: #fff; border: 1.5px solid var(--mag-line); border-radius: 16px;
}
.mag-cardIcon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--mag-badge); color: var(--mag-teal);
}
.mag-cardLabel { display: block; font-size: 17.5px; font-weight: 650; color: var(--mag-ink); line-height: 1.3; }
.mag-cardHint { display: block; margin-top: 2px; font-size: 15px; line-height: 1.45; color: var(--mag-soft); }
.mag-cardMark {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--mag-line); color: transparent;
}
.mag-card input:checked + .mag-cardInner {
  border-color: var(--mag-teal); background: var(--mag-panel);
  box-shadow: inset 0 0 0 1px var(--mag-teal);
}
.mag-card input:checked + .mag-cardInner .mag-cardIcon { background: var(--mag-teal); color: #fff; }
.mag-card input:checked + .mag-cardInner .mag-cardMark { background: var(--mag-teal); border-color: var(--mag-teal); color: #fff; }
.mag-card input:focus-visible + .mag-cardInner { outline: 3px solid var(--mag-teal); outline-offset: 2px; }

/* ---- chosen route ---- */
.mag-route { margin-top: 40px; }
.mag-routeHead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.mag-h2 { font-size: 23px; font-weight: 650; letter-spacing: -0.014em; line-height: 1.25; }
.mag-textBtn {
  padding: 6px 2px; margin: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 15.5px; font-weight: 650; color: var(--mag-teal);
  text-decoration: underline; text-underline-offset: 3px;
}
.mag-needs { margin-top: 14px; padding: 14px 18px; background: var(--mag-panel); border-radius: 14px; }
.mag-needsLead { font-size: 15px; font-weight: 650; color: var(--mag-soft); }
.mag-needList { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.mag-needList li { display: flex; gap: 10px; align-items: flex-start; }
.mag-needList svg { color: var(--mag-teal); flex: none; margin-top: 5px; }

/* ---- the step path ---- */
.mag-stops { list-style: none; margin: 22px 0 0; padding: 0; }
.mag-stop { position: relative; padding-bottom: 6px; }
/* The line joining each stop to the next: the learner's route, drawn. */
.mag-stop::before {
  content: ""; position: absolute; left: 19px; top: 50px; bottom: -4px; width: 2px;
  background: var(--mag-line); border-radius: 1px;
}
.mag-stop[data-state="done"]::before { background: var(--mag-teal); opacity: 0.45; }
.mag-stop--end::before { display: none; }
.mag-stopHead { font-size: inherit; }
.mag-stopBtn {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; column-gap: 14px; align-items: center;
  width: 100%; min-height: 58px; padding: 9px 0; margin: 0;
  background: none; border: 0; cursor: pointer; text-align: left;
  font: inherit; color: var(--mag-ink);
  scroll-margin-top: 96px;
}
.mag-dot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 2px solid var(--mag-line); color: var(--mag-soft);
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.mag-stop[data-state="current"] .mag-dot { background: var(--mag-ink); border-color: var(--mag-ink); color: #fff; }
.mag-stop[data-state="done"] .mag-dot { background: var(--mag-teal); border-color: var(--mag-teal); color: #fff; }
.mag-stopTitle { display: block; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
.mag-stop[data-state="later"] .mag-stopTitle { color: var(--mag-soft); font-weight: 600; }
.mag-stopMeta { display: block; font-size: 14px; font-weight: 600; color: var(--mag-soft); line-height: 1.3; margin-top: 1px; }
.mag-stop[data-state="done"] .mag-stopMeta { color: var(--mag-teal); }
.mag-stopBtn > svg { color: var(--mag-soft); justify-self: end; }
.mag-stopBtn[aria-expanded="true"] > svg { transform: rotate(180deg); }
.mag-stopBody { display: grid; gap: 14px; padding: 6px 0 26px; }
.mag-stopBody[hidden] { display: none; }

.mag-stopEnd { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; align-items: center; min-height: 58px; }
.mag-stopEnd .mag-dot { border-style: dashed; border-color: var(--mag-teal); color: var(--mag-teal); }
.mag-stop--end[data-state="done"] .mag-dot { border-style: solid; background: var(--mag-teal); color: #fff; }
.mag-endLead { display: block; font-size: 14px; font-weight: 600; color: var(--mag-soft); line-height: 1.3; }
.mag-endLabel { display: block; font-size: 19px; font-weight: 650; color: var(--mag-ink); line-height: 1.3; }

.mag-next {
  display: inline-flex; align-items: center; gap: 9px; justify-self: start;
  min-height: 46px; padding: 10px 18px; margin-top: 4px;
  background: var(--mag-teal); color: #fff; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 16.5px; font-weight: 650;
}

/* ---- question steps ---- */
.mag-forks { display: grid; gap: 10px; }
.mag-fork {
  display: grid; grid-template-columns: minmax(0, 1fr) 24px; column-gap: 12px; align-items: center;
  width: 100%; min-height: 64px; padding: 12px 16px; margin: 0;
  background: #fff; border: 1.5px solid var(--mag-line); border-radius: 14px; cursor: pointer;
  font: inherit; text-align: left; color: var(--mag-body);
}
.mag-forkLabel { display: block; font-size: 17px; font-weight: 650; color: var(--mag-ink); line-height: 1.3; }
.mag-forkHint { display: block; font-size: 15px; line-height: 1.45; color: var(--mag-soft); margin-top: 2px; }
.mag-fork .mag-cardMark { color: transparent; }
.mag-fork[aria-pressed="true"] { border-color: var(--mag-teal); background: var(--mag-panel); box-shadow: inset 0 0 0 1px var(--mag-teal); }
.mag-fork[aria-pressed="true"] .mag-cardMark { background: var(--mag-teal); border-color: var(--mag-teal); color: #fff; }

.mag-finished {
  display: grid; gap: 10px; margin-top: 14px; padding: 18px 20px;
  background: var(--mag-badge); border-radius: 14px;
}

/* ---- notes ---- */
.mag-note {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 16px; border-radius: 13px; border: 1px solid transparent;
}
.mag-note svg { flex: none; margin-top: 2px; }
.mag-noteLead { display: block; font-weight: 700; color: var(--mag-ink); margin-bottom: 2px; }
.mag-note--key { background: var(--mag-key-bg); border-color: var(--mag-key-line); }
.mag-note--key svg { color: var(--mag-key-ink); }
.mag-note--info { background: var(--mag-badge); }
.mag-note--info svg { color: var(--mag-teal); }

.mag-list { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

.mag-switch { display: grid; gap: 4px; justify-items: start; }
.mag-switchBtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 0; margin: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--mag-teal);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}

/* ---- links ---- */
.mag-container a { color: var(--mag-teal); text-underline-offset: 3px; }
.mag-inlineShortcut { font-weight: 700; color: var(--mag-teal); text-decoration-thickness: 1.5px; }
.mag-urlLink {
  display: inline-flex; align-items: center; gap: 9px;
  justify-self: start; width: fit-content;
  padding: 11px 17px;
  background: var(--mag-teal); color: #fff !important;
  border-radius: 12px; font-weight: 650; font-size: 16.5px;
  text-decoration: none; word-break: break-word;
}
.mag-urlLink svg { flex: none; opacity: 0.9; }
.mag-mailLink { font-weight: 650; font-size: 18px; word-break: break-word; }

/* On-screen control labels: ink, not teal, so they never read as links. */
.mag-ui { font-weight: 700; color: var(--mag-ink); }

/* ---- course page route ---- */
.mag-cp { border: 1px solid var(--mag-line); border-radius: 14px; background: #fff; }
.mag-cpBtn {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 20px; column-gap: 12px; align-items: center;
  width: 100%; padding: 14px 16px; margin: 0; border: 0; background: none; cursor: pointer;
  font: inherit; text-align: left; color: var(--mag-body); border-radius: 14px;
}
.mag-cpBtn > svg:first-child { color: var(--mag-teal); }
.mag-cpBtn > svg:last-child { color: var(--mag-soft); }
.mag-cpBtn[aria-expanded="true"] > svg:last-child { transform: rotate(180deg); }
.mag-cpTitle { display: block; font-size: 16.5px; font-weight: 650; color: var(--mag-ink); line-height: 1.35; }
.mag-cpSub { display: block; font-size: 15px; color: var(--mag-soft); line-height: 1.4; }
.mag-cpBody { display: grid; gap: 18px; padding: 4px 16px 20px; }
.mag-cpBody[hidden] { display: none; }
.mag-cpSteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.mag-cpStep { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; row-gap: 10px; }
.mag-cpLetter {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--mag-panel); color: var(--mag-ink); font-size: 14.5px; font-weight: 700;
}
.mag-cpStepTitle { align-self: center; font-size: 17px; font-weight: 650; line-height: 1.3; }
.mag-cpStepBody { grid-column: 1 / -1; display: grid; gap: 12px; }

/* ---- screenshots ---- */
.mag-fig { margin: 2px 0 0; }
.mag-shotBtn {
  display: inline-block; width: auto; max-width: 100%;
  padding: 0; margin: 0; text-align: left;
  border: 0; background: none; cursor: zoom-in; font: inherit; color: inherit;
  border-radius: 12px;
}
.mag-shot {
  /* Never upscale: tightly cropped screenshots stay sharp, wide ones scale down. */
  display: block; width: auto; height: auto; max-width: 100%;
  border-radius: 12px; border: 1px solid var(--mag-line);
  box-shadow: 0 1px 2px rgba(16, 35, 63, 0.05), 0 8px 22px -14px rgba(16, 35, 63, 0.32);
  background: #fff;
}
.mag-shotHint {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 14px; line-height: 1.3; font-weight: 600; color: var(--mag-soft);
}
.mag-cap {
  display: flex; gap: 9px; align-items: flex-start;
  margin: 0 0 10px; max-width: 60ch;
  font-size: 15px; line-height: 1.45; font-weight: 600; color: var(--mag-soft);
}
.mag-cap svg { flex: none; width: 17px; height: 17px; margin-top: 2px; color: var(--mag-teal); }
.mag-shotEmpty {
  padding: 22px 20px; border: 1px dashed var(--mag-line); border-radius: 12px;
  background: var(--mag-panel); color: var(--mag-soft);
  font-size: 14.5px; line-height: 1.45; text-align: center;
}

/* ---- help ---- */
.mag-accordion { margin-top: 16px; border-top: 1px solid var(--mag-line); }
.mag-row { border-bottom: 1px solid var(--mag-line); }
.mag-rowBtn {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 56px; padding: 14px 2px; margin: 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 600; color: var(--mag-ink);
  text-align: left; line-height: 1.45;
}
.mag-rowBtn svg { flex: none; color: var(--mag-teal); }
.mag-rowBtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.mag-rowPanel { padding: 0 2px 18px; color: var(--mag-body); max-width: 62ch; }
.mag-helpCp { margin-top: 26px; }

.mag-support { margin-top: 26px; padding: 22px 22px; background: var(--mag-badge); border-radius: 16px; display: grid; gap: 10px; }
.mag-supportHead { display: flex; align-items: center; gap: 11px; }
.mag-supportHead svg { color: var(--mag-teal); flex: none; }
.mag-supportHead .mag-h2 { font-size: 20px; }
.mag-supportList { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.mag-supportNote { font-weight: 700; color: var(--mag-ink); }

.mag-container .mag-stuck {
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--mag-line);
  font-size: 15.5px; color: var(--mag-soft);
}

/* ---- lightbox ---- */
.mag-lb {
  position: fixed; inset: 0; z-index: 2147483000;
  background: rgba(9, 20, 36, 0.88);
  overflow: auto; padding: 60px 16px 40px;
  -webkit-overflow-scrolling: touch;
}
.mag-lbImg {
  display: block; width: auto; max-width: 1180px; height: auto;
  margin: 0 auto; border-radius: 10px; background: #fff;
}
.mag-lbClose {
  position: fixed; top: 12px; right: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: #fff; color: var(--mag-ink); border: 0; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

@media (prefers-reduced-motion: no-preference) {
  .mag-stopBody:not([hidden]), .mag-cpBody:not([hidden]), .mag-route { animation: mag-in 200ms ease-out; }
  @keyframes mag-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .mag-rowBtn svg, .mag-stopBtn > svg, .mag-cpBtn > svg { transition: transform 160ms ease; }
  .mag-cardInner, .mag-cardIcon, .mag-cardMark, .mag-fork, .mag-dot, .mag-next, .mag-urlLink, .mag-shot, .mag-lbClose {
    transition: box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
  }
}

@media (hover: hover) {
  .mag-card:hover .mag-cardInner, .mag-fork:hover { border-color: var(--mag-teal); }
  .mag-next:hover, .mag-urlLink:hover { background: var(--mag-teal-hover); }
  .mag-stopBtn:hover .mag-stopTitle, .mag-rowBtn:hover, .mag-cpBtn:hover .mag-cpTitle { color: var(--mag-teal); }
  .mag-inlineShortcut:hover, .mag-switchBtn:hover, .mag-textBtn:hover { color: var(--mag-teal-hover); }
  .mag-shotBtn:hover .mag-shot { border-color: #cfd8e0; box-shadow: 0 2px 4px rgba(16,35,63,0.07), 0 14px 30px -16px rgba(16,35,63,0.45); }
  .mag-lbClose:hover { background: var(--mag-panel); }
}

/* ---- narrow: no indent, so the route line would run through the text ---- */
@container mag (max-width: 519px) {
  .mag-stop::before { display: none; }
  .mag-stopBody { padding-left: 0; }
}

/* ---- wider layout ---- */
@container mag (min-width: 520px) {
  .mag-stopBody { padding-left: 54px; }
  .mag-cpStepBody { grid-column: 2; }
}
@container mag (min-width: 640px) {
  .mag-cards { grid-template-columns: 1fr 1fr; }
  .mag-forks { grid-template-columns: 1fr 1fr; }
}
@container mag (min-width: 700px) {
  .mag-container { padding: 4px 8px 8px; font-size: 17.5px; }
  .mag-title { font-size: 38px; }
  .mag-pathway { font-size: 18px; }
  .mag-startTitle { font-size: 23px; }
  .mag-h2 { font-size: 25px; }
  .mag-stopTitle, .mag-endLabel { font-size: 20px; }
  .mag-support { padding: 26px 28px; }
  .mag-lb { padding: 64px 32px 48px; }
  .mag-lbClose { top: 18px; right: 18px; }
}

/* Moodle page additions. */
.mag-root .mag-start legend.mag-startTitle { float: none; width: auto; padding: 0; }
.mag-root .mag-stopHead, .mag-root .mag-rowHead { margin: 0; font-size: inherit; line-height: inherit; }
.mag-root .mag-rowHead { font-weight: 600; }
.mag-root .mag-mailLink { word-break: break-word; }
.mag-root .mag-rowPanel { display: grid; gap: 12px; }

/* Inside Moodle the page heading sits on the left of the content area: line the guide up with it. */
#page-local-jakeonboarding-guide .mag-container { margin-left: 0; padding-left: 0; padding-right: 0; }
