/* ------------------------------------------------------------------ *
 * Thinkera — the public guides (learner.html, trainer.html)
 *
 * The two guides are one document in two voices, so they share this file
 * rather than each carrying a copy: a colour fixed in one used to stay
 * wrong in the other for as long as nobody happened to look.
 *
 * The palette is the one the USP page uses, with its measured ratios kept
 * in the comments. Brand teal #0ABFA3 is 2.33:1 on white: it never carries
 * text and never draws a boundary on a light surface. Teal text is #067A68
 * (5.26:1 on white) and a teal edge is #08937D (3.83:1 on white).
 *
 * Written RTL-first with logical properties, because Arabic is the language
 * this is read in and English is the translation, not the other way round.
 * ------------------------------------------------------------------ */
:root{
  --royal:#113972;      /* 11.34:1 on white */
  --royal2:#1E4D91;     /* white on it: 8.31:1 */
  --azure:#426EB5;
  --azure700:#2F5795;   /* 7.20:1 on white */
  --teal-text:#067A68;  /* 5.26:1 on white, 4.80:1 on --teal-bg */
  --teal-edge:#08937D;  /* 3.83:1 on white */
  --teal-bg:#E7F8F5;
  --azure-bg:#EAF0FA;
  --page:#F4F7FB;
  --card:#FFFFFF;
  --ink:#1B2433;        /* 15.59:1 on white, 14.51:1 on page */
  --muted:#52627A;      /* 6.20:1 on white, 5.77:1 on page */
  --on-royal:#CFE0FA;   /* 8.47:1 on royal */
  --hairline:#D3DCE9;   /* decorative divider only */
  --edge:#6B7789;       /* functional control border, 4.54:1 on white */
  --focus:#113972;
  --shadow:0 1px 2px rgba(17,57,114,.06), 0 8px 24px rgba(17,57,114,.06);
  --radius:14px;
  --maxw:1080px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --royal:#9CC4F5;      /* 8.72:1 on card */
    --royal2:#1B3050;
    --azure:#7FB0F0;
    --azure700:#9CC4F5;
    --teal-text:#0ABFA3;  /* 5.94:1 on --teal-bg */
    --teal-edge:#0ABFA3;
    --teal-bg:#10322C;
    --azure-bg:#1B3050;
    --page:#0A1628;
    --card:#13233C;
    --ink:#E9EFF8;        /* 13.62:1 on card */
    --muted:#A7B8D0;      /* 7.81:1 on card */
    --on-royal:#CFE0FA;
    --hairline:#2A3E5F;
    --edge:#6E87AD;       /* 4.30:1 on card */
    --focus:#7FB0F0;
    --shadow:0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.28);
  }
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--page); color:var(--ink);
  font-family:'IBM Plex Sans Arabic','Segoe UI',Tahoma,system-ui,sans-serif;
  font-size:17px; line-height:1.75; letter-spacing:0;   /* Arabic joins: never track it */
}
:where(a){color:var(--royal); text-underline-offset:3px}
:where(a):hover{color:var(--azure700)}
:where(a):focus-visible,:where(button):focus-visible{outline:3px solid var(--focus); outline-offset:2px}
img{max-width:100%; height:auto; display:block}
.ltr{direction:ltr; unicode-bidi:isolate; display:inline-block}
.wrap{max-inline-size:var(--maxw); margin-inline:auto; padding-inline:20px}
.visually-hidden{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}

/* the language switch: one document, two voices */
[data-lang="ar"] .doc-en,[data-lang="en"] .doc-ar{display:none}

.site{position:sticky; inset-block-start:0; z-index:10; background:var(--card);
  border-block-end:1px solid var(--hairline)}
.site .wrap{display:flex; align-items:center; gap:16px; justify-content:space-between;
  min-block-size:64px; flex-wrap:wrap}
.brand{display:flex; align-items:baseline; gap:10px; font-weight:700}
.brand b{font-size:1.15rem; color:var(--royal)}
.brand span{font-size:.82rem; font-weight:600; color:var(--muted)}
.langsw{display:flex; gap:6px}
.langsw button{min-block-size:40px; padding-inline:14px; border-radius:999px; cursor:pointer;
  font:inherit; font-size:.9rem; font-weight:700;
  border:1px solid var(--edge); background:var(--card); color:var(--ink)}
.langsw button[aria-pressed="true"]{background:var(--royal); border-color:var(--royal); color:#fff}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .langsw button[aria-pressed="true"]{color:#0A1628}
}

/* the opening */
.hero{background:linear-gradient(180deg,var(--azure-bg),var(--page)); padding-block:56px 40px;
  border-block-end:1px solid var(--hairline)}
.hero .kicker{margin:0 0 10px; font-size:.85rem; font-weight:700; color:var(--teal-text);
  letter-spacing:0}
.hero h1{margin:0 0 14px; font-size:clamp(1.7rem,4.5vw,2.6rem); line-height:1.3; color:var(--royal)}
.hero .lead{margin:0 0 18px; font-size:1.06rem; color:var(--ink); max-inline-size:62ch}
.hero .pull{margin:0; display:inline-block; padding:8px 14px; border-radius:999px;
  background:var(--teal-bg); color:var(--teal-text); border:1px solid var(--teal-edge);
  font-weight:700; font-size:.92rem}

/* contents */
.toc{margin:0; padding:0}
.toc ol{margin:0; padding:0; list-style:none; display:grid; gap:8px;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.toc a{display:flex; align-items:center; gap:10px; min-block-size:52px; padding-inline:14px;
  border-radius:var(--radius); background:var(--card); border:1px solid var(--hairline);
  text-decoration:none; color:var(--ink); font-weight:600}
.toc a:hover{border-color:var(--azure)}
.toc .no{flex:none; inline-size:28px; block-size:28px; display:grid; place-items:center;
  border-radius:8px; background:var(--azure-bg); color:var(--royal); font-size:.8rem; font-weight:700}

section.wrap{padding-block:38px}
.shead{margin:0 0 6px; font-size:clamp(1.3rem,3vw,1.7rem); color:var(--royal); line-height:1.35}
.sdek{margin:0 0 22px; color:var(--muted); max-inline-size:66ch}
h3{margin:26px 0 8px; font-size:1.12rem; color:var(--ink)}
h4{margin:18px 0 6px; font-size:1rem; color:var(--ink)}
p{margin:0 0 14px; max-inline-size:70ch}
.lead-in{font-size:1.02rem}

/* the cards a step or a tool is described in */
.grid{display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); margin-block:18px}
.card{background:var(--card); border:1px solid var(--hairline); border-radius:var(--radius);
  padding:18px; box-shadow:var(--shadow)}
.card h3,.card h4{margin-block-start:0}
.card p:last-child{margin-block-end:0}
.card .tag{display:inline-block; margin-block-end:8px; padding:3px 10px; border-radius:999px;
  background:var(--azure-bg); color:var(--royal); font-size:.76rem; font-weight:700}
.card.is-new .tag{background:var(--teal-bg); color:var(--teal-text); border:1px solid var(--teal-edge)}

/* numbered steps, in the order they happen */
ol.steps{margin:18px 0; padding:0; list-style:none; display:grid; gap:12px}
ol.steps>li{display:grid; grid-template-columns:auto 1fr; gap:14px; align-items:start;
  background:var(--card); border:1px solid var(--hairline); border-radius:var(--radius); padding:16px 18px}
ol.steps>li::before{content:counter(step); counter-increment:step;
  inline-size:32px; block-size:32px; display:grid; place-items:center; border-radius:10px;
  background:var(--royal); color:#fff; font-weight:700; font-size:.92rem}
ol.steps{counter-reset:step}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) ol.steps>li::before{color:#0A1628}
}
ol.steps h3{margin:0 0 4px; font-size:1.05rem}
ol.steps p{margin:0}
ol.steps p+p{margin-block-start:8px}

ul.plain{margin:0 0 14px; padding-inline-start:1.25em; max-inline-size:70ch}
ul.plain li{margin-block-end:6px}
ul.plain li::marker{color:var(--royal)}

/* a picture of a screen, or a drawing of how something works */
figure.shot{margin:22px 0; background:var(--card); border:1px solid var(--hairline);
  border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow)}
figure.shot img,figure.shot svg{inline-size:100%; block-size:auto; display:block;
  border-block-end:1px solid var(--hairline)}
figure.shot.is-phone{max-inline-size:340px; margin-inline:auto}
figure.shot figcaption{padding:12px 16px; font-size:.88rem; color:var(--muted)}
.shots-2{display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
.shots-2 figure.shot{margin:0}

/* a line worth stopping on */
.note{margin:18px 0; padding:14px 16px; border-radius:var(--radius);
  background:var(--teal-bg); border:1px solid var(--teal-edge); color:var(--ink)}
.note b{color:var(--teal-text)}
.note p:last-child{margin-block-end:0}

/* the table of what a screen offers */
table{inline-size:100%; border-collapse:collapse; margin-block:18px; font-size:.95rem}
th,td{text-align:start; padding:10px 12px; border-block-end:1px solid var(--hairline); vertical-align:top}
th{color:var(--royal); font-weight:700}
tbody tr:last-child td{border-block-end:0}
.table-wrap{overflow-x:auto; background:var(--card); border:1px solid var(--hairline);
  border-radius:var(--radius); padding-inline:4px}

.cta{margin-block:26px; display:flex; flex-wrap:wrap; gap:12px; align-items:center}
.btn{display:inline-flex; align-items:center; min-block-size:48px; padding-inline:22px;
  border-radius:999px; background:var(--royal); color:#fff; text-decoration:none; font-weight:700;
  border:1px solid var(--royal)}
.btn:hover{background:var(--royal2); color:#fff}
.btn.ghost{background:transparent; color:var(--royal); border-color:var(--edge)}
.btn.ghost:hover{background:var(--azure-bg); color:var(--royal)}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .btn{color:#0A1628}
  :root:not([data-theme="light"]) .btn:hover{color:#0A1628}
  :root:not([data-theme="light"]) .btn.ghost{color:var(--royal)}
}

.foot{margin-block-start:30px; padding-block:28px; border-block-start:1px solid var(--hairline);
  background:var(--card); color:var(--muted); font-size:.9rem}
.foot .wrap{display:flex; flex-wrap:wrap; gap:14px; justify-content:space-between}
.foot a{font-weight:600}

@media print{
  .site,.langsw,.cta{display:none}
  body{background:#fff; font-size:12pt}
  figure.shot{break-inside:avoid}
  /* A picture taller than it is wide fills an A4 column, and the rule above then pushes everything after it
     to the next page — half-empty pages, for a screenshot read for its shape rather than its detail. On paper
     it is held to two thirds of the column and centred. Inside .shots-2 it is already half width. */
  figure.shot.is-tall{max-inline-size:62%; margin-inline:auto}
  .shots-2 figure.shot.is-tall{max-inline-size:100%}
}
@media (prefers-reduced-motion: reduce){
  *{animation:none !important; transition:none !important}
}
