/* ==========================================================================
   Maryam page (Phase 3 demo, RD16, 15 Oct 2026): story, stage, credentials, Q explainer.
   Loads after site.css + academy.css (tokens, .ac-facts). Becomes page-maryam.php.
   ========================================================================== */
.hdr-nav a[aria-current="page"] { color: var(--saffron-lt); }

/* ---------- hero ---------- */
.mp-hero { padding-top: clamp(24px, 4vw, 56px); }
.mp-hero-grid { display: grid; gap: 28px; }
.mp-hero-copy { display: grid; gap: 18px; align-content: center; justify-items: start; }
.mp-hero h1 { font-size: calc(var(--ds) * clamp(48px, 5vw + 20px, 96px)); color: var(--cream); }
.mp-lede { color: var(--ink-soft); font-size: 18px; line-height: 1.55; max-width: 34em; }
.mp-hero .ac-facts { width: 100%; max-width: 34em; }
.mp-hero-photo { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--espresso-3); }
.mp-hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
@media (max-width: 599px) { .mp-hero-photo { aspect-ratio: 1 / 1; } }
@media (min-width: 1024px) {
  .mp-hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 64px; }
  .mp-hero-photo { aspect-ratio: auto; height: min(680px, calc(100svh - var(--hdr) - 80px)); min-height: 520px; }
}

/* ---------- story: a year rail ---------- */
.mp-story-grid { display: grid; gap: 32px; }
.mp-story-head h2 { font-size: calc(var(--ds) * clamp(34px, 2.6vw + 20px, 60px)); color: var(--cream); }
.mp-steps { border-top: 1px solid var(--line); }
.mp-step {
  display: grid; grid-template-columns: 5.5em 1fr; gap: 6px 16px; align-items: start;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.mp-step-when { color: var(--saffron); font-variant-numeric: tabular-nums; padding-top: 1px; }
.mp-step-what { color: var(--ink); line-height: 1.5; }
.mp-step { grid-template-columns: 4.6em 1fr 64px; }
.mp-step-img { grid-column: 3; grid-row: 1; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
@media (min-width: 1024px) {
  .mp-story-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 72px; align-items: start; }
  .mp-story-head { position: sticky; top: calc(var(--hdr) + 32px); }
  .mp-step { grid-template-columns: 6.5em 1fr 200px; gap: 0 24px; }
  .mp-step-img { width: 200px; height: auto; aspect-ratio: 3 / 2; border-radius: 10px; }
}

/* ---------- stage ---------- */
.mp-stage-list { display: grid; gap: 12px; }
.mp-stage-card { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--espresso-2); }
.mp-stage-card img { width: 112px; height: 112px; object-fit: cover; border-radius: 10px; }
.mp-stage-card.is-text { grid-template-columns: 1fr; padding: 20px; }
.mp-stage-big { display: none; }
.mp-stage-card > div { display: grid; gap: 4px; }
.mp-stage-k { font-size: calc(var(--ds) * 36px); font-weight: var(--display-weight); letter-spacing: var(--display-track); line-height: 1; color: var(--saffron-lt); }
.mp-stage-what { color: var(--cream); line-height: 1.35; }
@media (min-width: 900px) {
  .mp-stage-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mp-stage-card { grid-template-columns: 1fr; align-content: start; padding: 0; overflow: hidden; }
  .mp-stage-card img { width: 100%; height: 260px; border-radius: 0; }
  .mp-stage-card > div { padding: 4px 22px 22px; }
  .mp-stage-card.is-text { padding: 0; align-content: end; background: color-mix(in oklab, var(--saffron) 10%, var(--espresso-2)); }
  .mp-stage-card.is-text > div { padding: 22px; }
  .mp-stage-big { display: flex; align-items: center; justify-content: center; height: 260px; margin: 0;
    font-size: calc(var(--ds) * 76px); font-weight: var(--display-weight); letter-spacing: var(--display-track);
    color: color-mix(in oklab, var(--saffron) 55%, transparent); border-bottom: 1px solid var(--line); }
}

/* ---------- credentials library ---------- */
.mp-tier { margin-top: clamp(40px, 6vw, 80px); }
.mp-tier:first-of-type { margin-top: 0; }
.mp-tier-head { display: grid; gap: 8px; max-width: 44em; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line-strong); }
.mp-tier-head h3 { font-size: calc(var(--ds) * clamp(30px, 2vw + 18px, 44px)); color: var(--cream); margin: 0; }
.mp-tier-head p:not(.label) { color: var(--ink-soft); }
.mp-certs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
.mp-cert { --c: var(--saffron); display: grid; gap: 6px; align-content: start; min-width: 0; }
.mp-cert-thumb {
  display: block; width: 100%; aspect-ratio: 1 / 1.414; padding: 0; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: zoom-in;
  background: var(--cream);
  transition: border-color .4s var(--ease), transform .6s var(--ease);
}
.mp-cert-thumb img { width: 100%; height: 100%; object-fit: contain; }
.mp-cert-thumb:hover, .mp-cert-thumb:focus-visible { border-color: var(--c); }
@media (prefers-reduced-motion: no-preference) { .mp-cert-thumb:hover { transform: translateY(-3px); } }
.mp-cert-body { display: grid; gap: 6px; align-content: start; }
.mp-cert-issuer { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mp-cert-issuer::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.mp-cert-title { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.3; color: var(--cream); }
.mp-cert-meta { display: grid; gap: 2px; margin: 0; font-size: 14px; }
.mp-cert-meta div { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-cert-meta dt { color: var(--ink-muted); }
.mp-cert-meta dd { margin: 0; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .mp-certs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; } }
@media (min-width: 1200px) { .mp-certs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* phones: each group is one swipeable row, so 16 certificates don't make the page 16 screens long */
@media (max-width: 767px) {
  .mp-certs:not(.mp-certs--one) {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 8px; scroll-padding-inline: var(--gutter);
  }
  .mp-certs:not(.mp-certs--one)::-webkit-scrollbar { display: none; }
  .mp-certs:not(.mp-certs--one) .mp-cert { flex: 0 0 62%; scroll-snap-align: start; }
}
/* the teaching licence: one featured card, certificate beside its details */
.mp-certs.mp-certs--one { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 40em; }
.mp-certs--one .mp-cert { grid-template-columns: minmax(0, 150px) 1fr; gap: 18px; align-items: center; }
.mp-certs--one .mp-cert-thumb { margin: 0; }
@media (min-width: 768px) { .mp-certs--one .mp-cert { grid-template-columns: 220px 1fr; gap: 28px; } }
.mp-swipe-hint { display: none; }
@media (max-width: 767px) { .mp-swipe-hint { display: block; font-size: 14px; color: var(--ink-muted); margin-top: 6px; } }

/* ---------- Q explainer ---------- */
.mp-q-card { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: clamp(22px, 4vw, 56px); background: var(--espresso-2); display: grid; gap: 28px; }
.mp-q-card .sec-head { margin: 0; }
.mp-q-card h2 { font-size: calc(var(--ds) * clamp(32px, 2.4vw + 18px, 56px)); color: var(--cream); }
.mp-q-steps { display: grid; gap: 0; counter-reset: q; border-top: 1px solid var(--line); }
.mp-q-steps li { counter-increment: q; display: grid; grid-template-columns: 2.4em 1fr; gap: 4px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.mp-q-steps li::before { content: counter(q, decimal-leading-zero); color: var(--saffron); grid-row: span 2; font-variant-numeric: tabular-nums; padding-top: 1px; }
.mp-q-steps b { font-weight: 500; color: var(--cream); }
.mp-q-steps p { color: var(--ink-soft); }
@media (min-width: 1024px) {
  .mp-q-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; border-top: 0; }
  .mp-q-steps li { grid-template-columns: 1fr; align-content: start; border-bottom: 0; border-top: 2px solid var(--line-strong); padding-top: 16px; }
  .mp-q-steps li::before { grid-row: auto; }
}
.mp-scale { display: grid; gap: 12px; }
.mp-scale-bar { display: flex; border-radius: 999px; overflow: hidden; font-size: 14px; line-height: 1.2; }
.mp-scale-bar span { flex: 0 0 var(--w); padding: 12px 10px; color: var(--espresso); font-variant-numeric: tabular-nums; }
.mp-scale-bar span:nth-child(1) { background: var(--espresso-3); color: var(--ink-soft); }
.mp-scale-bar span:nth-child(2) { background: color-mix(in oklab, var(--saffron) 55%, var(--espresso-3)); color: var(--cream); }
.mp-scale-bar span:nth-child(3) { background: var(--saffron); }
.mp-scale-bar span:nth-child(4) { background: var(--saffron-lt); }
@media (max-width: 599px) {
  .mp-scale-bar { flex-direction: column; border-radius: 12px; }
  .mp-scale-bar span { flex-basis: auto; }
}
.mp-scale-note { color: var(--ink-muted); font-size: 15px; max-width: 52em; }

/* ---------- closing ---------- */
.mp-close { border-top: 1px solid var(--line); }
.mp-close .wrap { display: grid; gap: 20px; justify-items: start; }
.mp-close h2 { font-size: calc(var(--ds) * clamp(36px, 3vw + 20px, 68px)); color: var(--cream); max-width: 16em; }

/* ---------- certificate viewer ---------- */
.mp-viewer {
  width: min(720px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--espresso-2); color: var(--ink);
}
.mp-viewer::backdrop { background: rgba(10, 5, 2, .78); }
.mp-viewer-in { display: grid; gap: 16px; padding: 16px; }
.mp-viewer-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.mp-viewer-title { font-size: 20px; font-weight: 500; color: var(--cream); }
.mp-viewer-meta { font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.mp-viewer img { width: 100%; max-height: calc(100svh - 180px); object-fit: contain; background: var(--cream); border-radius: 8px; }
