/* features.css: page sections used on some pages (feature grid, Question Generator steps and pills, resource type
   cards, Resources by topic). The walkthrough animations are in css/walkthroughs.css. */

/* ==========================================================================
   feature-grid (was css/feature-grid.css)
   ========================================================================== */
/* mathsbox-secondary.php ("Why MathsBox for Secondary"): the "Why MathsBox" bento grid (.bx), and the topic list further down the page (.wt, at the end).
   The bento is three columns of cards, each a picture over a title and a line of text. The pictures are decorative (aria-hidden):
   kept simple: one real MathsBox resource on a soft panel, or a few tags.
   Selectors use two classes so they win over site.css rules such as "body.home h2". */

.bx{background:#f3f4f6;color:#141a2e;font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif}
.bx *{box-sizing:border-box}
.bx .bx-in{max-width:1140px;margin:0 auto;padding:88px 20px 96px}

/* ---------- heading ---------- */
.bx .bx-head{max-width:880px;margin:0 auto 44px;text-align:center}
.bx .bx-head p{max-width:600px;margin-left:auto;margin-right:auto}
.bx .bx-pill{display:inline-block;margin:0 0 16px;padding:5px 14px;border-radius:999px;background:#fff;box-shadow:0 2px 6px rgba(20,26,46,.08);font-size:13px;font-weight:700;color:#5b6475}
.bx .bx-head h2{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:0 12px;margin:0 0 14px;font-size:clamp(30px,4vw,46px);font-weight:800;line-height:1.1;letter-spacing:-.02em;color:#141a2e}
.bx .bx-ic{display:grid;place-items:center;width:1.05em;height:1.05em;border-radius:.26em;background:linear-gradient(135deg,#5b8cff,#3d5afe);box-shadow:0 8px 18px -6px rgba(61,90,254,.6);transform:rotate(-6deg)}
.bx .bx-ic img{width:44%;height:auto;filter:brightness(0) invert(1)}
.bx .bx-hl{color:#3d5afe}
.bx .bx-head p{margin:0;font-size:17px;line-height:1.55;color:#5b6475}

/* ---------- the grid: three columns that stretch to the same height ---------- */
.bx .bx-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;align-items:stretch}
.bx .bx-col{display:flex;flex-direction:column;gap:20px}
.bx .bx-card{display:flex;flex-direction:column;flex:1 1 auto;border-radius:24px;background:#fff;box-shadow:0 1px 2px rgba(20,26,46,.05),0 12px 30px -18px rgba(20,26,46,.18);overflow:hidden}
.bx .bx-vis{position:relative;flex:1 1 auto;min-height:150px;overflow:hidden}
.bx .bx-txt{padding:20px 24px 24px}
.bx .bx-txt h3{margin:0 0 8px;font-size:17px;font-weight:700;letter-spacing:-.015em;color:#141a2e}
.bx .bx-txt p{margin:0;font-size:14.5px;line-height:1.55;color:#5b6475}
.bx .bx-lnk{display:inline-block;margin-top:12px;font-size:14px;font-weight:700;color:#3d5afe;text-decoration:none}
.bx .bx-lnk:hover{text-decoration:underline;text-underline-offset:3px}
.bx .bx-lnk:focus-visible,.bx .bx-btn:focus-visible{outline:2px solid #3d5afe;outline-offset:3px;border-radius:6px}

/* the pictures: one real resource rising from the bottom of a soft panel, with a small badge */
.bx .bx-one{display:flex;align-items:flex-end;justify-content:center;min-height:250px;padding:56px 28px 0;background:#f5f6fa}
/* every sheet shows at the same height, its top part, whatever its shape */
.bx .bx-one img{display:block;width:84%;height:194px;object-fit:cover;object-position:top;border-radius:10px 10px 0 0;box-shadow:0 14px 28px -16px rgba(20,26,46,.35)}
.bx .bx-tint-g{background:#f1f8f3}
.bx .bx-tint-p{background:#f4f2fd}
.bx .bx-badge{position:absolute;top:16px;left:18px;display:inline-flex;align-items:center;gap:7px;padding:5px 11px;border-radius:999px;background:#fff;box-shadow:0 2px 8px -3px rgba(20,26,46,.2);font-size:12px;font-weight:700;color:#141a2e}
.bx .bx-badge b{display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:#16a34a;color:#fff;font-size:12px}
.bx .bx-badge i{width:7px;height:7px;border-radius:50%;background:#16a34a}

/* tags instead of a picture, for the formats and the courses */
.bx .bx-tags{display:flex;flex-wrap:wrap;align-content:center;justify-content:center;gap:8px;min-height:130px;padding:24px;background:#f5f6fa}
.bx .bx-tags-tall{min-height:250px;padding:32px}
.bx .bx-tags span{padding:7px 13px;border-radius:999px;background:#fff;box-shadow:0 2px 8px -3px rgba(20,26,46,.2);font-size:12.5px;font-weight:700;color:#141a2e}

/* the call to action card: a plain gradient with the icon */
.bx .bx-feat-top{position:relative;flex:1 1 auto;min-height:130px;background:linear-gradient(140deg,#c9d6ff 0%,#dcd2ff 45%,#fde2f3 100%)}
.bx .bx-feat-top::after{content:"";position:absolute;left:0;right:0;bottom:0;height:55%;background:linear-gradient(to bottom,rgba(255,255,255,0),#fff)}
.bx .bx-feat-ic{position:absolute;left:24px;top:24px;z-index:1;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#fff;box-shadow:0 10px 20px -10px rgba(61,90,254,.6)}
.bx .bx-feat-ic img{width:16px;height:auto}
.bx .bx-feat .bx-txt h3{font-size:22px;line-height:1.2}
.bx .bx-btn{display:inline-flex;align-items:center;gap:8px;margin-top:18px;padding:12px 20px;border-radius:999px;background:#141a2e;color:#fff;font-size:14.5px;font-weight:700;text-decoration:none;box-shadow:0 10px 20px -10px rgba(20,26,46,.6)}
.bx .bx-btn:hover{background:#2a3150}

/* ---------- smaller screens ---------- */
@media(max-width:980px){
 .bx .bx-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .bx .bx-col:last-child{grid-column:1 / -1;flex-direction:row}
 .bx .bx-col:last-child .bx-card{flex:1 1 0}
}
@media(max-width:640px){
 .bx .bx-in{padding:64px 16px 72px}
 .bx .bx-grid{grid-template-columns:minmax(0,1fr)}
 .bx .bx-col:last-child{flex-direction:column}
 .bx .bx-col:last-child .bx-card{flex:1 1 auto}
}

/* ---------- topics covered: the full Secondary topic list (moved here from the old secondarytopics.html) ---------- */
.wt .pt-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 0}
.wt .seg{display:flex;flex-wrap:wrap;gap:5px}
.wt .seg button{padding:8px 12px;border:1px solid rgba(20,26,46,.18);border-radius:999px;background:#fff;font:inherit;font-size:13.5px;font-weight:700;color:#141a2e;cursor:pointer}
.wt .seg button:hover{border-color:#3d5afe}
.wt .seg button[aria-pressed="true"]{background:rgba(61,90,254,.1);border-color:#3d5afe;color:#3d5afe}
.wt .pt-right{display:flex;flex:1 1 auto;justify-content:flex-end;gap:8px;min-width:0}
.wt .pt-course{flex:none}
.wt .pt-tools .bk-dl{flex:none;margin:0 0 0 auto}
.wt .pt-course select{padding:8px 34px 8px 14px;border:1px solid rgba(20,26,46,.18);border-radius:999px;font:inherit;font-size:14px;color:#141a2e;appearance:none;-webkit-appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23141a2e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center}
.wt .pt-search{flex:0 1 220px;min-width:120px}
.wt .pt-search input{width:100%;padding:8px 14px;border:1px solid rgba(20,26,46,.18);border-radius:999px;font:inherit;font-size:14px;background:#fff}
.wt .pt-course select:focus-visible,.wt .pt-search input:focus-visible{outline:2px solid #3d5afe;outline-offset:1px;border-color:#3d5afe}
.wt .pt-unit{margin-top:40px}
.wt .pt-unit h2{margin:0 0 4px;padding-bottom:12px;border-bottom:2px solid #141a2e;font-size:clamp(24px,3vw,30px);letter-spacing:-.02em}
.wt .pt-card{display:grid;grid-template-columns:260px 1fr;grid-template-rows:auto 1fr;column-gap:32px;padding:20px 0;border-bottom:1px solid rgba(20,26,46,.1)}
.wt .pt-card h3{grid-column:1;margin:0;font-size:17px;letter-spacing:-.01em;color:#141a2e}
.wt .pt-card .pt-n{grid-column:1;margin:4px 0 0;font-size:13px;font-weight:500;color:#646b7a}
.wt .pt-card ul{grid-column:2;grid-row:1 / span 2;margin:0;padding:0;list-style:none;columns:2;column-gap:32px}
.wt .pt-card li{position:relative;break-inside:avoid;margin:0 0 7px;padding-left:16px;font-size:15px;line-height:1.45;color:#2b3245}
.wt .pt-card li::before{content:"";position:absolute;left:0;top:.6em;width:6px;height:6px;border-radius:50%;background:#9aa1b2}
.wt .pt-empty{margin:32px 0;color:#4a5268;font-weight:600}
@media(max-width:1000px){
 .wt .pt-tools{flex-wrap:wrap}
 .wt .pt-right{flex-basis:100%;justify-content:flex-start}
}
@media(max-width:760px){
 .wt .pt-card{grid-template-columns:1fr;grid-template-rows:auto}
 .wt .pt-card ul{grid-column:1;grid-row:auto;margin-top:12px;columns:1}
 .wt .pt-right,.wt .pt-course,.wt .pt-course select,.wt .pt-search{width:100%;flex-basis:auto}
 .wt .pt-right{flex-direction:column}
}

/* ==========================================================================
   qg-steps (was css/qg-steps.css)
   ========================================================================== */
/* Question Generator pages: "How it works" timeline (text and the generator's own cards either side of a dashed line)
   and the free sample / full access section. Builds on the body.skills styles in site.css. */

.qgs-head{text-align:center;max-width:720px;margin:0 auto 64px}
.qgs-head .intro{margin-left:auto;margin-right:auto}

/* timeline: text | numbered dot | cards, swapping sides each step; the dashed line runs behind the dots */
.qgs-list{position:relative;list-style:none;margin:0;padding:0;display:grid;gap:96px}
.qgs-list::before{content:"";position:absolute;top:24px;bottom:24px;left:50%;width:0;border-left:2px dashed rgba(61,90,254,.25);transform:translateX(-1px)}
.qgs-step{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 56px minmax(0,1fr);column-gap:44px;align-items:center}
.qgs-step .qgs-txt{grid-column:1;grid-row:1;justify-self:end;max-width:440px}
.qgs-step .qgs-num{grid-column:2;grid-row:1}
.qgs-step .qgs-vis{grid-column:3;grid-row:1}
.qgs-step:nth-child(even) .qgs-txt{grid-column:3;justify-self:start}
.qgs-step:nth-child(even) .qgs-vis{grid-column:1}
.qgs-num{position:relative;z-index:1;display:grid;place-items:center;width:56px;height:56px;border-radius:50%;background:var(--blue);color:#fff;font-size:22px;font-weight:800;box-shadow:0 0 0 8px #fff,0 14px 28px -12px rgba(61,90,254,.7)}
.qgs-txt .qgs-k{margin:0 0 8px;font-size:13px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--blue)}
.qgs-txt h3{margin:0 0 12px;font-size:clamp(26px,2.8vw,34px);font-weight:800;letter-spacing:-.018em;line-height:1.1}
.qgs-txt p{margin:0;font-size:17px;line-height:1.6;color:var(--mut)}
.qgs-txt p b{color:var(--fg)}
.qgs-tags{list-style:none;margin:16px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.qgs-tags li{padding:5px 11px;border-radius:999px;background:#eef2ff;font-size:13.5px;font-weight:600;color:#3446c9}
/* the generator's own cards, floating with drop shadows (no frame), styled like the walkthrough and the real tool */
.qgs-vis{min-width:0}

/* step 1: level buttons in rows of three */
.qgs-levels{display:flex;flex-direction:column;align-items:center;gap:10px}
.qgs-levels div{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.qgs-levels span{padding:11px 18px;border-radius:20px;background:#fff;box-shadow:0 0 0 1px #eef0f3,0 8px 20px -10px rgba(17,24,39,.3);font-size:14.5px;color:#1f2937;white-space:nowrap}
.qgs-levels span.on{background:#3b82f6;color:#fff;box-shadow:0 0 0 1px #3b82f6,0 10px 22px -10px rgba(59,130,246,.8)}

/* step 2: resource type cards */
.qgs-types{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.qgs-types span{display:block;padding:8px 8px 9px;border-radius:14px;background:#fff;box-shadow:0 0 0 1px #eef0f3,0 8px 20px -10px rgba(17,24,39,.3);text-align:center}
.qgs-types i{position:relative;display:block;height:74px;border-radius:9px;background:#f5f6fb;overflow:hidden}
.qgs-types img{position:absolute;inset:7px;width:calc(100% - 14px);height:calc(100% - 14px);object-fit:contain}
.qgs-types b{display:block;margin-top:6px;font-size:12.5px;font-weight:600;color:#1f2937}
.qgs-types span.on{box-shadow:0 0 0 2px #3b82f6,0 12px 24px -10px rgba(59,130,246,.6)}

/* step 3: topic dropdowns with tick boxes beside the list of chosen structures */
.qgs-pick{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:18px;align-items:start}
.qgs-cart-h{margin:0 0 8px;font-size:13px;font-weight:800;color:#111827}
.qgs-acc{margin:0 0 7px;border:1px solid #e5e7eb;border-radius:11px;background:#fff;overflow:hidden;box-shadow:0 6px 16px -10px rgba(17,24,39,.3)}
.qgs-acc-h{display:flex;align-items:center;gap:8px;height:36px;margin:0;padding:0 14px;font-size:14px;font-weight:700;color:#111827}
.qgs-acc-h em{margin-left:auto;font-style:normal;font-weight:400;font-size:12px;color:#646b7a}
.qgs-acc-h i{width:14px;text-align:center;font-style:normal;font-weight:600;font-size:16px;color:#4b5563}
.qgs-count{display:grid;place-items:center;width:18px;height:18px;border-radius:4px;background:#60a5fa;font-size:12px;font-weight:600;color:#fff}
.qgs-acc-b{display:grid;grid-template-columns:1fr;gap:2px;padding:6px 10px 8px;border-top:1px solid #eef0f3}
.qgs-acc-b p{display:flex;align-items:center;gap:8px;margin:0;padding:5px 8px;border-radius:7px;font-size:12.5px;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.qgs-acc-b u{position:relative;flex:none;width:16px;height:16px;border:1.5px solid #cbd5e1;border-radius:4px;background:#fff;box-sizing:border-box}
.qgs-acc-b p.on{background:#eff6ff}
.qgs-acc-b p.on u{border-color:#3b82f6;background:#3b82f6}
.qgs-acc-b p.on u::after{content:"";position:absolute;left:4px;top:1px;width:4px;height:8px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}
.qgs-cart{padding:12px 10px;border-radius:12px;background:#fff;box-shadow:0 0 0 1px #eef0f3,0 14px 30px -16px rgba(17,24,39,.4)}
.qgs-prog{display:flex;align-items:center;gap:8px;margin:0 0 4px}
.qgs-prog div{flex:1;height:5px;border-radius:99px;background:#e5e7eb;overflow:hidden}
.qgs-prog i{display:block;width:100%;height:100%;border-radius:99px;background:#4caf50}
.qgs-prog span{font-size:12px;color:#6b7280;white-space:nowrap}
.qgs-item{display:flex;align-items:center;gap:6px;margin:7px 0 0;padding:7px 8px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;font-size:12px}
.qgs-item em{font-style:normal;color:#646b7a;letter-spacing:-2px}
.qgs-item span{flex:none;padding:1px 5px;border:1px solid #e5e7eb;border-radius:5px;font-weight:700;color:#111827}
.qgs-item b{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:600;color:#111827}
.qgs-item s{text-decoration:none;color:#ef4444;font-weight:700}
.qgs-clear{margin:10px 0 0;text-align:center;font-size:12px;color:#6b7280}
.qgs-go{display:block;margin-top:10px;padding:10px 12px;border-radius:10px;background:#3b82f6;color:#fff;text-align:center;font-size:13.5px;font-weight:700;box-shadow:0 8px 18px -8px rgba(59,130,246,.7)}

/* step 4: toolbar above an A4 landscape sheet, like the generator's printed sheets */
.qgs-tools{display:flex;justify-content:flex-end;gap:8px;margin:0 0 12px}
.qgs-tools span{padding:7px 13px;border:1px solid #e5e7eb;border-radius:9px;background:#fff;font-size:13px;font-weight:600;color:#374151;box-shadow:0 4px 10px -6px rgba(17,24,39,.3)}
.qgs-tools span.dark{background:#111827;border-color:#111827;color:#fff}
.qgs-sheet{display:block;width:100%;height:auto}
/* buttons under the last step */
.qgs-acts{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:80px}
/* full access: free sample beside the subscription card */
.qgu{background:#f6f7fb}
.qgu-grid{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:20px;max-width:960px;margin:0 auto;align-items:stretch}
.qgu-card{display:flex;flex-direction:column;align-items:flex-start;padding:32px;border-radius:24px;background:#fff;border:1px solid rgba(20,26,46,.12)}
.qgu-card.full{border:2px solid var(--blue);box-shadow:0 30px 60px -40px rgba(61,90,254,.6)}
.qgu-tag{display:inline-block;margin:0 0 14px;padding:4px 12px;border-radius:999px;background:rgba(20,26,46,.06);font-size:12.5px;font-weight:700;color:var(--mut)}
.qgu-card.full .qgu-tag{background:var(--blue);color:#fff}
.qgu-card h3{margin:0 0 10px;font-size:24px;font-weight:800;letter-spacing:-.02em}
.qgu-card p{margin:0 0 22px;font-size:16px;line-height:1.55;color:var(--mut)}
.qgu-card>a{margin-top:auto}
.qgu-list{list-style:none;margin:0 0 20px;padding:0;display:grid;gap:10px}
.qgu-list li{position:relative;padding-left:28px;font-size:16px;font-weight:600;color:var(--fg)}
.qgu-list li::before{content:"";position:absolute;left:0;top:.2em;width:18px;height:18px;border-radius:50%;background:var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat}
.qgu-price{font-size:15px}
.qgu-price b{color:var(--fg)}

@media(max-width:1000px){
 .qgs-list{gap:64px}
 .qgs-list::before{left:27px}
 .qgs-step{grid-template-columns:56px minmax(0,1fr);column-gap:24px;row-gap:24px;align-items:start}
 .qgs-step .qgs-num,.qgs-step:nth-child(even) .qgs-num{grid-column:1;grid-row:1}
 .qgs-step .qgs-txt,.qgs-step:nth-child(even) .qgs-txt{grid-column:2;grid-row:1;justify-self:start;max-width:none}
 .qgs-step .qgs-vis,.qgs-step:nth-child(even) .qgs-vis{grid-column:2;grid-row:2}
 .qgu-grid{grid-template-columns:1fr}
}
@media(max-width:560px){
 .qgs-pick{grid-template-columns:1fr}
 .qgs-types{grid-template-columns:repeat(2,minmax(0,1fr))}
 .qgs-list::before{display:none}
 .qgs-step{grid-template-columns:1fr}
 .qgs-step .qgs-num,.qgs-step:nth-child(even) .qgs-num{width:44px;height:44px;font-size:18px}
 .qgs-step .qgs-txt,.qgs-step:nth-child(even) .qgs-txt{grid-column:1;grid-row:2}
 .qgs-step .qgs-vis,.qgs-step:nth-child(even) .qgs-vis{grid-column:1;grid-row:3}
 .qgs-levels span{padding:10px 14px;font-size:13.5px}
 .qgu-card{padding:24px}
}

/* ==================== question structure pills drifting on scroll (was css/topic-pills.css; script js/features.js) ==================== */
/* Topic pills: full-width rows of question-structure pills that drift sideways on scroll (js/features.js),
   with stage buttons underneath. Used on the home page and the Question Generator page. The section around them
   needs class v2-topics; each page sets the rows' side margin to cancel its own section padding. */

.v2-topics {
    overflow: hidden;
}

/* the rows run edge to edge and fade out at both sides */
.v2-tp-rows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    /* room above and below, so the mask (which clips to this box) does not cut off the pills' shadows; the label below has less margin to match */
    padding: 6px 0 22px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

/* each row is wider than the screen and centred (by the column above), so it can drift either way without running out */
.v2-tp-row {
    display: flex;
    flex: none;
    gap: 10px;
    width: max-content;
    will-change: transform;
    transition: transform .9s cubic-bezier(.22, .61, .36, 1);
}

.v2-tp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 16px -12px rgba(17, 24, 39, .35);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary, #374151);
    white-space: nowrap;
}

/* .checks: each pill gets a checkbox, ticked on .on pills (decorative, like picking structures in the generator) */
.v2-tp-rows.checks .v2-tp::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #c5cad6;
    border-radius: 4px;
    background: #fff;
}

.v2-tp-rows.checks .v2-tp.on {
    border-color: #3161ff;
    background: #eef2ff;
    color: #1e3a8a;
}

.v2-tp-rows.checks .v2-tp.on::before {
    border-color: #3161ff;
    background: #3161ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* course links under the pills: a small label, then the courses as plain text links on one line with dots between */
.v2-tp-label {
    margin: 22px 0 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #646b7a;
}

.v2-tp-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px 0;
    max-width: 900px;
    margin: 0 auto;
}

.v2-tp-links a {
    padding: 2px 4px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-underline-offset: 4px;
    white-space: nowrap;
    transition: color .15s ease;
}

.v2-tp-links a + a::before {
    content: "\0000B7";
    display: inline-block;
    margin: 0 10px 0 6px;
    color: #d1d5db;
    font-weight: 700;
}

/* link colours scoped to the section so page-wide rules (site.css "body.skills a{color:inherit}") don't override them */
.v2-topics .v2-tp-links a {
    color: #4b5563;
}

.v2-topics .v2-tp-links a:hover,
.v2-topics .v2-tp-links a:focus-visible {
    color: #3161ff;
    text-decoration: underline;
}
@media (max-width: 680px) {
    .v2-tp-rows {
        gap: 9px;
    }

    .v2-tp-row {
        gap: 8px;
    }

    .v2-tp {
        padding: 7px 13px;
        font-size: 13.5px;
    }

    .v2-tp-rows.checks .v2-tp::before {
        width: 14px;
        height: 14px;
    }

    .v2-tp-label {
        margin-top: 32px;
    }

    .v2-tp-links a {
        padding: 2px 3px;
        font-size: 14px;
    }

    .v2-tp-links a + a::before {
        margin: 0 8px 0 5px;
    }
}

/* ==========================================================================
   qg-types (was css/qg-types.css)
   ========================================================================== */
/* Question Generator pages (questiongenerator-primary.php, -secondary, -alevel, -tutors): the resource type cards.
   site.css (body.qg .qg-types / .qg-type) draws the cards; this makes them a compact, even grid and adds the New badge.
   Every card is the same height (3 x 3 grid); the picture fills what's left under the text, cropped at the card edge, so a
   tall picture (the Assessment Maker booklet) can't stretch its row. */
body.qg .qg-types{grid-auto-rows:330px}
body.qg .qg-type{min-height:0;padding:24px 24px 0}
body.qg .qg-type h3{font-size:22px}
body.qg .qg-type p{font-size:14.5px}
/* the picture starts just under the text and runs off the bottom of the card (cropped there), so it never covers the text */
body.qg .qg-type-vis{position:relative;min-height:0;margin-right:-24px;padding-top:16px;align-items:flex-start}
body.qg .qg-type-vis img,body.qg .qg-type-vis svg{margin:0 -10% 0 0;transform:rotate(-4deg);transform-origin:right top}
body.qg .qg-type-vis.xl img{width:108%;margin:0 -8% 0 0}
/* the worksheet card on questiongenerator-primary.php: the same HTML sheet as step 4, drawn at a fixed size and scaled down */
body.qg .qg-type-ws .qgs-ws{position:absolute;top:16px;right:-26px;flex:none;width:520px;transform:rotate(-4deg) scale(.66);transform-origin:right top}
body.qg .qg-type-vis .qgs-ws img{width:20px;height:20px;margin:0;transform:none;filter:none}
/* questions to project: the four layouts as small chips */
body.qg .qg-fmts{display:flex;flex-wrap:wrap;gap:5px;margin:10px 0 0;padding:0;list-style:none}
body.qg .qg-fmts li{padding:4px 9px;border:1px solid #d6d9e2;border-radius:999px;background:#fff;font-size:12px;font-weight:700;color:#5b6275} /* grey, not the card's colour */
/* the yellow New badge after a card's name (Settlers, Assessment Maker) */
.qg-new{display:inline-block;margin-left:6px;padding:2px 8px;border-radius:999px;background:#fcd34d;font-style:normal;font-size:12px;letter-spacing:.04em;color:#422006;vertical-align:1px}
/* "Free resources to try." band (lab.css .fd): the two cards styled like the free resources page (css/free-resources.css).
   1. .fd-qg: the Question Generator card, in its level colour, with an "∞ Unlimited" chip, the level name and a real Question
      Generator worksheet (images/worksheet.svg, 2026-11-18) that straightens on hover; 2. .fd-unl: the grey padlocked
      "Unlock all resources today" card */
.fd-img.fd-qg{display:block;background:linear-gradient(135deg,#7b8fff,#3d5afe)}
.fd-img.fd-qg.ks-primary{background:linear-gradient(135deg,#34d399,#10b981)}
.fd-img.fd-qg.ks-alevel{background:linear-gradient(135deg,#fb7185,#ef4444)}
/* the Further Maths generators, in the free resources page's colours (site.css .fr-thumb.qg.ks-*) */
.fd-img.fd-qg.ks-alevelfm{background:linear-gradient(135deg,#e11d48,#9f1239)}
.fd-img.fd-qg.ks-l2fm{background:linear-gradient(135deg,#c084fc,#a855f7)}
/* three across: the cards are narrower, so the level name is smaller (longer names wrap onto two or three lines) */
.fd-grid.three .fd-qg .qg-ks{font-size:18px}
/* phones: lab.css puts three-card grids two across, too narrow for the chip, the name and the sheet; one card per row here */
@media (max-width:600px){#free-qg .fd-grid.three{grid-template-columns:1fr}}
.fd-qg .qg-chip{position:absolute;left:16px;top:16px;z-index:2;display:inline-flex;align-items:center;gap:6px;padding:5px 11px 5px 9px;border-radius:999px;background:rgba(255,255,255,.2);box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);font-size:12px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:#fff}
.fd-img.fd-qg .qg-chip img,.fd-card:hover .fd-img.fd-qg .qg-chip img{position:static;width:20px;height:auto;max-width:none;object-fit:initial;filter:brightness(0) invert(1);transform:none}
.fd-qg .qg-ks{position:absolute;left:18px;bottom:16px;z-index:2;max-width:40%;font-size:22px;font-weight:800;line-height:1.1;letter-spacing:-.02em;color:#fff}
.fd-qg .qg-sheet{position:absolute;left:46%;right:-5%;top:22px;bottom:-24px;overflow:hidden;border-radius:10px;background:#fff;box-shadow:0 18px 30px -14px rgba(20,26,46,.5);transform:rotate(3deg);transform-origin:left top;transition:transform .35s cubic-bezier(.3,1.3,.5,1)}
/* the worksheet image has its own white margin: scaled up and pinned top-left so the header and first questions show */
.fd-img.fd-qg .qg-sheet img,.fd-card:hover .fd-img.fd-qg .qg-sheet img{position:absolute;left:-12%;top:-15%;width:185%;max-width:none;height:auto;object-fit:initial;filter:none;transform:none}
.fd-card:hover .fd-qg .qg-sheet,.fd-card:focus-visible .fd-qg .qg-sheet{transform:rotate(0) translateY(-6px)}
/* the Primary free trial card (Primary pages only: free trials are for primary schools), in the grey of the padlocked card */
.fd-img.fd-trial{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:16px;background:#eef0f4;text-align:center;transition:transform .3s cubic-bezier(.3,1.2,.5,1),background .2s}
.fd-card:hover .fd-img.fd-trial,.fd-card:focus-visible .fd-img.fd-trial{background:#e6e9ef}
.fd-trial svg{width:40px;height:40px;margin-bottom:6px;fill:none;stroke:#10b981;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.fd-trial b{font-size:26px;font-weight:800;letter-spacing:-.018em;line-height:1.05;color:#141a2e}
.fd-trial small{font-size:13.5px;font-weight:600;color:#5b6275}
/* the level pages (mathsbox-primary.php, mathsbox-secondary.php, mathsbox-alevel.php): the Question Generator free samples as a row of two above the
   other free resources */
.fd-grid.fd-qgrow{margin-bottom:32px}
.fd-img.fd-unl{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:16px;background:#eef0f4;transition:transform .3s cubic-bezier(.3,1.2,.5,1),background .2s}
.fd-card:hover .fd-img.fd-unl,.fd-card:focus-visible .fd-img.fd-unl{background:#e6e9ef}
.fd-unl .fr-lock{width:64px;height:64px;overflow:visible;--lock:#c6cbd5}
.fd-card:hover .fd-unl .fr-lock,.fd-card:focus-visible .fd-unl .fr-lock{--lock:#b7bdc9}
.fd-unl .fr-lock-body{fill:var(--lock);transition:fill .2s}
.fd-unl .fr-key{fill:#eef0f4;transition:fill .2s}
.fd-card:hover .fd-unl .fr-key,.fd-card:focus-visible .fd-unl .fr-key{fill:#e6e9ef}
.fd-unl .fr-shackle{fill:none;stroke:var(--lock);stroke-width:2.8;stroke-linecap:round;transform-box:view-box;transform-origin:16px 11px;transition:transform .35s cubic-bezier(.3,1.4,.5,1),stroke .2s}
.fd-card:hover .fd-unl .fr-shackle,.fd-card:focus-visible .fd-unl .fr-shackle{transform:translateY(-2.5px) rotate(28deg)}
.fd-unl .fr-unlock-text{max-width:80%;font-size:18px;font-weight:800;letter-spacing:-.01em;line-height:1.25;text-align:center;color:#141a2e}
@media (prefers-reduced-motion:reduce){.fd-qg .qg-sheet{transition:none}}
@media(max-width:900px){body.qg .qg-types{grid-auto-rows:310px}}
@media(max-width:560px){body.qg .qg-types{grid-auto-rows:auto}body.qg .qg-type{min-height:300px}}

/* ==========================================================================
   resources-by-topic (was css/resources-by-topic.css)
   ========================================================================== */
/* Resources by topic (resourcesbytopic.php and resourcesbytopic-secondary.php), built by tools/build-features.js.
   The pages use the clean design: css/lab.css for the hero (.lh), the free band (.fd), the section headings and the strand
   filter (.cg-head / .cg-filter). This file has only what these pages add, scoped to body.rbt: the stack of sheets in the hero,
   the resource type cards, the topic cards and the "and there's more" cards.
   The resource type cards at the end of this file are copies of the Question Generator page rules. */

body.rbt .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
body.rbt [hidden]{display:none!important}

/* ---------- hero: the link to the other key stage, and a stack of two whole sheets on the right ---------- */
body.rbt .rbt-other-link{color:var(--blue);font-weight:700;text-decoration:none}
body.rbt .rbt-other-link:hover{text-decoration:underline}
/* each sheet draws its own page, so no card or fade: just a soft shadow, each tilted a little */
body.rbt .rbt-stack{left:52%}
body.rbt .rbt-stack::after{display:none}
body.rbt .rbt-stack img{position:absolute;max-width:none;height:auto;border-radius:0;background:none;box-shadow:none;filter:drop-shadow(0 16px 24px rgba(20,26,46,.22))}
body.rbt .rbt-stack img:nth-child(1){top:100px;left:40px;width:400px;transform:rotate(-5deg)}
body.rbt .rbt-stack img:nth-child(2){top:180px;left:290px;width:400px;transform:rotate(4deg)}


/* ---------- resource types ---------- */
body.rbt .rbt-types{padding:100px 0 40px}
body.rbt .rbt-type-n{display:block;margin:-2px 0 8px;font-size:13px;font-weight:700;color:#646b7a}

/* ---------- topics covered: the strand filter (.cg-filter), then every topic in that strand as a row, in the same style
   as the Topics covered lists on mathsbox-primary.php and the course pages (css/feature-grid.css .wt .pt-card): the topic name
   and its count on the left, its sub-topics in two columns on the right, a thin line between rows ---------- */
body.rbt .rbt-browse{padding-bottom:60px}
body.rbt .rbt-grid{margin-top:24px;border-top:2px solid var(--ink)}
body.rbt .rbt-topic{display:grid;grid-template-columns:260px minmax(0,1fr);column-gap:32px;padding:22px 0;border-bottom:1px solid rgba(20,26,46,.1);scroll-margin-top:110px}
body.rbt .rbt-topic.is-target{background:linear-gradient(90deg,var(--pri-t),transparent 70%)}
body.rbt .rbt-th{margin:0}
body.rbt .rbt-th h3{margin:0 0 4px;font-size:17px;letter-spacing:-.01em;color:var(--ink)}
body.rbt .rbt-th p{margin:0;font-size:13px;font-weight:500;color:#646b7a}
/* each sub-topic: a small heading, then its resource sets, flowing down two columns */
body.rbt .rbt-subs{list-style:none;margin:0;padding:0;columns:2;column-gap:32px}
body.rbt .rbt-subs>li{break-inside:avoid;padding:0 0 14px}
body.rbt .rbt-subs h4{margin:0 0 4px;font-size:14.5px;letter-spacing:-.01em;color:var(--ink)}
body.rbt .rbt-subs ul{list-style:none;margin:0;padding:0}
body.rbt .rbt-subs ul li{position:relative;padding:3px 0 3px 14px;font-size:14px;line-height:1.4;color:var(--mut)}
body.rbt .rbt-subs ul li::before{content:"";position:absolute;left:2px;top:.75em;width:5px;height:5px;border-radius:50%;background:#b9bfcc}

/* under the topic cards: a link to the Question Generator's topics */
body.rbt .rbt-qg-link{margin:14px 0 0;padding:18px 22px;border-radius:16px;border:1px dashed rgba(20,26,46,.2);text-align:center;font-size:16px;color:var(--mut)}
body.rbt .rbt-qg-link a{color:var(--blue);font-weight:700;text-decoration:none;white-space:nowrap}
body.rbt .rbt-qg-link a:hover{text-decoration:underline}

/* ---------- and there's more: one card for each other part of MathsBox, three across ---------- */
body.rbt .rbt-more{padding:60px 0 110px}
body.rbt .rbt-more .hl-lede{margin-bottom:28px}
/* compact cards: a small preview on the left, the name and a line about it on the right */
body.rbt .rbt-others{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
body.rbt .rbt-other{display:flex;align-items:center;gap:16px;padding:12px 16px 12px 12px;border:1px solid var(--line);border-radius:18px;background:#fff;color:var(--ink);text-decoration:none;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
body.rbt .rbt-other:hover{transform:translateY(-2px);border-color:rgba(61,90,254,.4);box-shadow:0 16px 28px -22px rgba(20,26,46,.45)}
body.rbt .rbt-other:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
body.rbt .rbt-other-img{position:relative;flex:none;display:block;width:84px;height:84px;border-radius:12px;overflow:hidden}
body.rbt .rbt-other-img img{position:absolute;inset:6px;width:calc(100% - 12px);height:calc(100% - 12px);object-fit:contain;display:block;filter:drop-shadow(0 4px 8px rgba(20,26,46,.18))}
body.rbt .rbt-other-txt{display:block;min-width:0}
body.rbt .rbt-other-txt strong{display:block;margin:0 0 3px;font-size:16.5px;letter-spacing:-.01em}
body.rbt .rbt-other-txt span{display:block;color:var(--mut);font-size:14px;line-height:1.4}
body.rbt .rbt-other:hover strong{color:var(--blue)}

/* ---------- smaller screens ---------- */
@media(max-width:1000px){
 body.rbt .rbt-topic{grid-template-columns:200px minmax(0,1fr);column-gap:24px}
 body.rbt .rbt-others{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
 /* lab.css turns the hero sheet into a strip under the text; the two sheets sit side by side in it */
 body.rbt .rbt-stack{left:auto}
 body.rbt .rbt-stack img:nth-child(1){top:20px;left:6%;width:52%}
 body.rbt .rbt-stack img:nth-child(2){top:44px;left:42%;width:52%}
 body.rbt .rbt-types{padding-top:72px}
}
@media(max-width:760px){
 /* the topic name above its sub-topics, one column */
 body.rbt .rbt-topic{grid-template-columns:minmax(0,1fr)}
 body.rbt .rbt-th{margin-bottom:12px}
 body.rbt .rbt-subs{columns:1}
}
@media(max-width:560px){
 body.rbt .rbt-others{grid-template-columns:minmax(0,1fr);gap:10px}
 body.rbt .rbt-other-img{width:68px;height:68px}
}
@media(prefers-reduced-motion:reduce){
 body.rbt .rbt-other{transition:none}
 body.rbt .rbt-other:hover{transform:none}
}

/* ---------- resource type cards: copied from the Question Generator page rules in site.css (body.qg), so they look the same ---------- */
body.rbt .qg-types-head{display:grid;grid-template-columns:1.2fr 1fr;gap:20px 48px;align-items:end;margin-bottom:40px}
body.rbt .qg-types-head h2{margin:0}
body.rbt .qg-types-head .hl-lede{margin:0 0 6px}
body.rbt .qg-types{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
body.rbt .qg-type{position:relative;display:flex;flex-direction:column;min-height:360px;margin:0;padding:28px 28px 0;border-radius:28px;background:#f4f5f8;overflow:hidden;outline:0}
body.rbt .qg-type:focus-visible{box-shadow:0 0 0 3px var(--ink)}
/* "+" in the corner says there's more; hover (or tap/focus) slides up a panel of classroom ideas over the sheet */
/* the plus is two centred bars (a text "+" sits off-centre); turning it 45deg makes the close cross */
body.rbt .qg-type::after{content:"";position:absolute;z-index:2;top:20px;right:20px;width:34px;height:34px;border-radius:50%;--bar:var(--ink);background:linear-gradient(var(--bar),var(--bar)) center/14px 2px no-repeat,linear-gradient(var(--bar),var(--bar)) center/2px 14px no-repeat,#fff;transition:transform .3s ease}
body.rbt .qg-type:hover::after,body.rbt .qg-type:focus-within::after{transform:rotate(45deg);--bar:#fff;background-color:var(--ink)}
body.rbt .qg-type-ideas{position:absolute;inset:10px;z-index:1;display:flex;flex-direction:column;justify-content:center;margin:0;padding:24px 26px;list-style:none;border-radius:20px;background:#fff;border:1px solid color-mix(in srgb,var(--ink) 25%,#fff);box-shadow:0 18px 34px -22px rgba(20,26,46,.45);transform:translateY(calc(100% + 20px));transition:transform .4s cubic-bezier(.22,.61,.36,1)}
body.rbt .qg-type-ideas::before{content:"Ways to use it";display:block;margin-bottom:10px;color:var(--ink);font-size:12px;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
body.rbt .qg-type-ideas li{position:relative;padding:10px 0 10px 24px;border-top:1px solid rgba(20,26,46,.08);font-size:15.5px;font-weight:600;line-height:1.4;color:#141a2e}
body.rbt .qg-type-ideas li:first-child{border-top:0}
body.rbt .qg-type-ideas li::before{content:"\002192";position:absolute;left:0;color:var(--ink)}
body.rbt .qg-type:hover .qg-type-ideas,body.rbt .qg-type:focus-within .qg-type-ideas{transform:none}
body.rbt .qg-type.feat .qg-type-ideas,body.rbt .qg-type.wide .qg-type-ideas{left:auto;width:calc(54% - 24px)}
body.rbt .qg-type.feat,body.rbt .qg-type.wide{grid-column:span 2;display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1fr);gap:28px}
body.rbt .qg-type.feat .qg-type-txt,body.rbt .qg-type.wide .qg-type-txt{align-self:center;padding-bottom:28px}
body.rbt .qg-type-tag{display:block;margin-bottom:12px;color:var(--ink);font-size:12px;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
body.rbt .qg-type h3{margin:0 0 8px;font-size:24px;letter-spacing:-.018em;line-height:1.15;color:#141a2e}
body.rbt .qg-type.feat h3{font-size:36px}
body.rbt .qg-type p{margin:0;color:#4a5268;font-size:15px;line-height:1.5}
body.rbt .qg-type.feat p{font-size:17px}
/* the sheet sits low and is cropped by the card's bottom edge */
/* the sheet sits in the bottom-right corner and runs off the right and bottom edges (the card clips it) */
body.rbt .qg-type-vis{flex:1;display:flex;justify-content:flex-end;align-items:flex-end;min-height:230px;margin-right:-28px;padding-top:24px}
body.rbt .qg-type.feat .qg-type-vis,body.rbt .qg-type.wide .qg-type-vis{align-self:stretch;min-height:300px;padding-top:28px}
body.rbt .qg-type-vis img,body.rbt .qg-type-vis svg{display:block;flex:none;width:100%;max-width:none;height:auto;margin:0 -12% -12% 0;transform:rotate(-5deg);transform-origin:right bottom;filter:drop-shadow(0 18px 26px rgba(20,26,46,.22))}
body.rbt .qg-type.feat .qg-type-vis img{width:105%}
/* sheets with lots of small detail (worksheet, projector, loop cards, bingo) run larger */
body.rbt .qg-type-vis.xl img{width:112%;margin:0 -9% -8% 0}
body.rbt .qg-type.feat .qg-type-vis.xl img{width:108%;margin:0 -9% -9% 0}
/* bingogameg.svg has empty space down its right side, so it runs further off the edge */
body.rbt .qg-type.wide .qg-type-vis.xl img{width:128%;margin:0 -24% -10% 0}
@media(max-width:980px){
 body.rbt .qg-types{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.rbt .qg-type.wide{grid-column:auto;display:flex}
 body.rbt .qg-type.wide .qg-type-txt{padding-bottom:0;align-self:auto}
 body.rbt .qg-type.wide .qg-type-vis{min-height:230px;padding-top:24px}
 body.rbt .qg-type.wide .qg-type-sketch svg{width:75%}
 body.rbt .qg-type.wide .qg-type-vis.xl img{width:118%;margin:0 -20% -8% 0}
 body.rbt .qg-type.wide .qg-type-ideas{left:14px;width:auto}
}
@media(max-width:860px){
 body.rbt .qg-types-head{grid-template-columns:1fr;margin-bottom:28px}
 body.rbt .qg-type.feat h3{font-size:28px}
}
@media(max-width:620px){
 body.rbt .qg-types{grid-template-columns:1fr;gap:14px}
 body.rbt .qg-type,body.rbt .qg-type.feat{grid-column:auto;display:flex;min-height:0;padding:24px 22px 0;border-radius:24px}
 body.rbt .qg-type.feat .qg-type-txt{padding-bottom:0;align-self:auto}
 body.rbt .qg-type.feat .qg-type-ideas{left:14px;width:auto}
 body.rbt .qg-type::after{top:18px;right:18px}
 body.rbt .qg-type h3{font-size:22px}
 body.rbt .qg-type-vis,body.rbt .qg-type.feat .qg-type-vis,body.rbt .qg-type.wide .qg-type-vis{min-height:0;margin-right:-22px;padding-top:20px}
 body.rbt .qg-type-vis.xl img,body.rbt .qg-type.feat .qg-type-vis.xl img{width:100%;margin:0 -8% -8% 0}
}

/* ---------- shorter type cards ---------- */
/* a tall sheet is cropped at the bottom of its box (object-fit) instead of stretching the whole row, and the sheet area is a little shorter */
body.rbt .qg-type{min-height:0}
body.rbt .qg-type-vis{min-height:170px}
body.rbt .qg-type.feat .qg-type-vis,body.rbt .qg-type.wide .qg-type-vis{min-height:200px}
body.rbt .qg-type-vis img{max-height:215px;object-fit:cover;object-position:top left}
/* the text of the wide cards starts at the top, like the others, instead of sitting half way down */
body.rbt .qg-type.feat .qg-type-txt,body.rbt .qg-type.wide .qg-type-txt{align-self:start;padding-bottom:0}
