/* PrimaryClass.co.uk — 2026 refresh */
:root{
  --blue:#1d4fa8; --blue-l:#e8effb;
  --red:#c8202f;  --red-l:#fcebec;
  --green:#2f9a3c;--green-l:#e7f5e9;
  --yellow:#f2b705;--yellow-l:#fff6d6;
  --orange:#ec6f1c;--orange-l:#fdeee3;
  --purple:#7a3fb5;--purple-l:#f2eafa;
  --ink:#1f2433; --muted:#5b6275; --line:#e6e2d6;
  --bg:#fffdf7; --card:#ffffff;
  --accent:var(--blue); --accent-l:var(--blue-l);
  --radius:16px; --shadow:0 2px 0 rgba(31,36,51,.06),0 8px 24px -12px rgba(31,36,51,.18);
  --head:"Fredoka","Trebuchet MS",system-ui,sans-serif;
  --body:"Nunito","Segoe UI",system-ui,sans-serif;
}
body.s-maths{--accent:var(--blue);--accent-l:var(--blue-l)}
body.s-english{--accent:var(--red);--accent-l:var(--red-l)}
body.s-displays{--accent:var(--green);--accent-l:var(--green-l)}
body.s-certs{--accent:var(--purple);--accent-l:var(--purple-l)}
body.s-classroom{--accent:var(--orange);--accent-l:var(--orange-l)}
body.s-info{--accent:#2a7f8f;--accent-l:#e3f3f5}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);font:400 17px/1.6 var(--body)}
img{max-width:100%;height:auto;vertical-align:middle}
a{color:var(--accent);text-underline-offset:2px}
a:hover{color:var(--ink)}
h1,h2,h3{font-family:var(--head);font-weight:600;line-height:1.2;margin:0 0 .5em}
h2{font-size:1.6rem;margin-top:1.6em}
h3{font-size:1.2rem}
p{margin:0 0 1em}
.wrap{max-width:1240px;margin:0 auto;padding:0 16px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:-999px;top:0;background:var(--ink);color:#fff;padding:8px 14px;z-index:99}
.skip:focus{left:8px}

/* promo bar */
.promo{background:var(--blue);color:#fff;font-size:.92rem;text-align:center;padding:7px 16px}
.promo a{color:#fff;font-weight:700}
.promo a:hover{color:var(--yellow)}

/* header */
.site-header{background:#fff;position:sticky;top:0;z-index:50;box-shadow:0 1px 0 var(--line)}
.rainbow{height:5px;background:linear-gradient(90deg,var(--blue) 0 25%,var(--red) 25% 50%,var(--yellow) 50% 75%,var(--green) 75%)}
.head-row{display:flex;align-items:center;gap:20px;padding-top:10px;padding-bottom:10px}
.logo{display:block;flex:0 0 auto;line-height:0}
.logo img{width:132px;height:auto}
.search{flex:1;display:flex;max-width:420px;margin-left:auto}
.search input{flex:1;min-width:0;border:2px solid var(--line);border-right:0;border-radius:999px 0 0 999px;padding:9px 16px;font:inherit;font-size:.95rem;background:#fbfaf6}
.search input:focus{outline:none;border-color:var(--blue);background:#fff}
.search button{border:0;background:var(--blue);color:#fff;border-radius:0 999px 999px 0;padding:0 16px;cursor:pointer;display:flex;align-items:center}
.search button:hover{background:var(--ink)}
.menu-btn{display:none;border:2px solid var(--line);background:#fff;border-radius:12px;padding:8px 12px;font:700 .95rem var(--body);color:var(--ink);cursor:pointer;align-items:center;gap:8px}

/* nav */
.nav{border-top:1px solid var(--line)}
.nav>ul{list-style:none;margin:0 auto;padding:0 16px;max-width:1240px;display:flex;gap:4px}
.nav li{position:relative}
.nav>ul>li>a,.nav>ul>li>button{display:flex;align-items:center;gap:6px;padding:12px 14px;font:600 1rem var(--head);color:var(--ink);text-decoration:none;background:none;border:0;cursor:pointer;border-bottom:4px solid transparent}
.nav>ul>li.c-blue>*:first-child{--c:var(--blue)}
.nav>ul>li.c-red>*:first-child{--c:var(--red)}
.nav>ul>li.c-green>*:first-child{--c:var(--green)}
.nav>ul>li.c-purple>*:first-child{--c:var(--purple)}
.nav>ul>li.c-orange>*:first-child{--c:var(--orange)}
.nav>ul>li.c-teal>*:first-child{--c:#2a7f8f}
.nav>ul>li>*:first-child:hover,.nav>ul>li.open>*:first-child,.nav>ul>li.current>*:first-child{border-bottom-color:var(--c);color:var(--c)}
.nav .chev{width:10px;height:10px;transition:transform .2s}
.nav li.open .chev{transform:rotate(180deg)}
.nav .sub{display:none;position:absolute;left:0;top:100%;min-width:250px;background:#fff;border-radius:0 0 14px 14px;box-shadow:var(--shadow);padding:8px;list-style:none;margin:0;border-top:4px solid var(--c,var(--blue))}
.nav li.c-blue .sub{--c:var(--blue)} .nav li.c-red .sub{--c:var(--red)} .nav li.c-green .sub{--c:var(--green)}
.nav li.c-purple .sub{--c:var(--purple)} .nav li.c-orange .sub{--c:var(--orange)} .nav li.c-teal .sub{--c:#2a7f8f}
.nav li.open>.sub{display:block}
@media (hover:hover) and (min-width:961px){.nav>ul>li:hover>.sub{display:block}}
.nav .sub a{display:block;padding:8px 12px;border-radius:10px;color:var(--ink);text-decoration:none;font-size:.96rem}
.nav .sub a:hover{background:var(--bg);color:var(--c)}
.nav .sub .indent a{padding-left:26px;font-size:.92rem;color:var(--muted)}
.nav .sub .ext::after{content:" ↗";color:var(--muted)}

@media (max-width:960px){
  .menu-btn{display:flex;margin-left:auto}
  .head-row{flex-wrap:wrap;gap:12px}
  .search{order:3;max-width:none;flex-basis:100%}
  .nav{display:none;max-height:calc(100vh - 140px);overflow:auto}
  .nav.open{display:block}
  .nav>ul{flex-direction:column;padding:8px 16px 16px}
  .nav>ul>li>a,.nav>ul>li>button{width:100%;justify-content:space-between;border-bottom:1px solid var(--line)}
  .nav .sub{position:static;box-shadow:none;border-top:0;padding:4px 0 8px 8px;border-radius:0}
}

/* page header */
.page-head{background:var(--accent-l);border-bottom:1px solid var(--line);position:relative;overflow:hidden}
.page-head::after{content:"";position:absolute;right:-60px;top:-60px;width:220px;height:220px;border-radius:50%;background:var(--accent);opacity:.08}
.page-head .wrap{padding-top:26px;padding-bottom:24px;position:relative;z-index:1}
.crumbs{font-size:.88rem;color:var(--muted);margin-bottom:6px}
.crumbs a{color:var(--muted)}
.crumbs span[aria-hidden]{margin:0 6px}
.page-head h1{font-size:clamp(1.8rem,4vw,2.6rem);color:var(--accent);margin:0}
.page-head .lede{margin:.5em 0 0;max-width:760px;color:var(--ink);font-size:1.05rem}

/* layout */
.layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:32px;padding-top:24px;padding-bottom:48px}
.layout.full{grid-template-columns:minmax(0,1fr)}
.sidebar{position:relative}
.sidebar .stick{position:sticky;top:150px}
@media (max-width:1100px){.layout{grid-template-columns:minmax(0,1fr)}.sidebar{display:none}}

/* ads */
.ad{margin:0 auto 24px;text-align:center;min-height:100px}
.ad-label{display:block;font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;color:#a29f94;margin-bottom:4px}
.ad-top{padding-top:18px;margin-bottom:0}
.ad-side{min-height:600px}

/* chips (section sub-nav) */
.chips,.content ul.chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 24px;padding:0;list-style:none}
.chips li{margin:0}
.chips a{display:inline-block;padding:7px 14px;border-radius:999px;background:#fff;border:2px solid var(--line);color:var(--ink);text-decoration:none;font-weight:700;font-size:.92rem}
.chips a:hover{border-color:var(--accent);color:var(--accent)}
.chips a[aria-current]{background:var(--accent);border-color:var(--accent);color:#fff}

/* content basics */
.content>:first-child{margin-top:0}
.content ul{padding-left:1.3em}
.content li{margin-bottom:.3em}
.note{background:var(--yellow-l);border-left:5px solid var(--yellow);padding:12px 16px;border-radius:10px;margin:0 0 1.2em}
.intro{font-size:1.05rem}
.content iframe{max-width:100%;border:0;display:block;margin:0 auto 1em}

/* tiles */
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px;margin:0 0 28px}
@media (max-width:520px){.tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.tile{padding:12px 10px}.tile img{max-height:80px}.tile span{font-size:.92rem}}
.tile{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:10px;background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px 14px 14px;text-decoration:none;color:var(--ink);text-align:center;border-top:5px solid var(--tc,var(--accent));transition:transform .15s,box-shadow .15s}
.tile:nth-child(4n+1){--tc:var(--blue)}.tile:nth-child(4n+2){--tc:var(--red)}.tile:nth-child(4n+3){--tc:var(--yellow)}.tile:nth-child(4n+4){--tc:var(--green)}
.tile:hover{transform:translateY(-3px);box-shadow:0 4px 0 rgba(31,36,51,.06),0 16px 30px -14px rgba(31,36,51,.3);color:var(--ink)}
.tile .ti{flex:1;display:flex;align-items:center;justify-content:center;min-height:90px}
.tile img{max-height:110px;width:auto;object-fit:contain}
.tile span{font:600 1.02rem/1.25 var(--head)}

/* resource cards (Sample / Description / Download tables) */
.cards{display:grid;gap:16px;margin:0 0 28px}
.card{display:grid;grid-template-columns:200px minmax(0,1fr);gap:20px;background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px;border-left:6px solid var(--accent);scroll-margin-top:160px}
.card .c-img{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;background:var(--bg);border-radius:12px;padding:10px;text-align:center}
.card .c-img img{max-height:170px;width:auto;object-fit:contain}
.card .c-body>:last-child{margin-bottom:0}
.card .c-body p{margin-bottom:.6em}
.card .c-label{font:600 .78rem var(--body);text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:10px 0 6px}
.card .c-dl{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.card .c-dl p{display:contents}
.card .c-dl br{display:none}
.card .c-noimg{grid-template-columns:minmax(0,1fr)}
@media (max-width:640px){.card{grid-template-columns:minmax(0,1fr)}.card .c-img img{max-height:150px}}
.section-h{display:flex;align-items:center;gap:10px;scroll-margin-top:160px}
.section-h::before{content:"";width:12px;height:12px;border-radius:4px;background:var(--accent);flex:0 0 auto}

/* buttons */
.btn,.c-dl a,.dl a{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:999px;background:var(--accent);color:#fff;text-decoration:none;font-weight:700;font-size:.9rem;line-height:1.2;border:0}
.btn:hover,.c-dl a:hover,.dl a:hover{background:var(--ink);color:#fff}
.c-dl a::before,.dl a::before{content:"";width:14px;height:14px;flex:0 0 auto;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m0 0l-5-5m5 5l5-5M4 20h16'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m0 0l-5-5m5 5l5-5M4 20h16'/%3E%3C/svg%3E") center/contain no-repeat}
a.buy,.c-dl a.buy{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:999px;background:var(--green);color:#fff;text-decoration:none;font-weight:700;font-size:.9rem;line-height:1.2;margin:3px 2px}
a.buy:hover{color:#fff}
a.buy::before,.c-dl a.buy::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.5'/%3E%3Ccircle cx='18' cy='20' r='1.5'/%3E%3Cpath d='M2 3h3l2.7 12.4a2 2 0 0 0 2 1.6h8.6a2 2 0 0 0 2-1.6L22 7H6'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.5'/%3E%3Ccircle cx='18' cy='20' r='1.5'/%3E%3Cpath d='M2 3h3l2.7 12.4a2 2 0 0 0 2 1.6h8.6a2 2 0 0 0 2-1.6L22 7H6'/%3E%3C/svg%3E")}
a.buy:hover{background:var(--ink)}
.c-img a::before{display:none}
.c-img a{background:none;color:var(--accent);padding:0;font-weight:600}

/* generic layout grid (was layout tables) */
.lay{display:grid;gap:16px;margin:0 0 24px}
.lay-row{display:grid;grid-template-columns:repeat(var(--cols,1),minmax(0,1fr));gap:16px}
.lay-cell{min-width:0}
.lay-cell.box{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px;text-align:center}
.lay-cell.box img{max-height:220px;width:auto;object-fit:contain}
.lay-cell .span{grid-column:1/-1}
@media (max-width:760px){.lay-row{grid-template-columns:repeat(min(var(--cols,1),2),minmax(0,1fr))}}
@media (max-width:460px){.lay-row{grid-template-columns:minmax(0,1fr)}}

/* data tables */
.table-wrap{overflow-x:auto;margin:0 0 24px;border-radius:var(--radius);box-shadow:var(--shadow);background:var(--card)}
table.data{width:100%;border-collapse:collapse;font-size:.95rem}
table.data th,table.data td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:center;vertical-align:middle}
table.data thead th,table.data tr.hrow th{background:var(--accent);color:#fff;font-family:var(--head);font-weight:600}
table.data tbody th{background:var(--accent-l);font-weight:700}
table.data tr:last-child td{border-bottom:0}
table.data img{max-height:200px;width:auto}
table.data a.buy,table.data a.btn{margin:2px}

/* resource library (filterable) */
.lib-tools{display:flex;flex-wrap:wrap;gap:10px;align-items:center;background:var(--card);padding:14px;border-radius:var(--radius);box-shadow:var(--shadow);margin:0 0 16px;position:sticky;top:138px;z-index:5}
.lib-tools input,.lib-tools select{font:inherit;font-size:.95rem;border:2px solid var(--line);border-radius:999px;padding:8px 14px;background:#fbfaf6;color:var(--ink)}
.lib-tools input{flex:1 1 220px;min-width:0}
.lib-tools input:focus,.lib-tools select:focus{outline:none;border-color:var(--accent);background:#fff}
.lib-count{font-weight:700;color:var(--muted);font-size:.9rem;margin-left:auto}
@media (max-width:960px){.lib-tools{position:static}}
.lib{display:grid;gap:12px;margin:0 0 28px}
.res{background:var(--card);border-radius:14px;box-shadow:var(--shadow);padding:14px 16px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 16px;align-items:start;border-left:5px solid var(--accent);scroll-margin-top:220px}
.res h3{margin:0;font-size:1.08rem}
.res .meta{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.res .tag{font-size:.78rem;font-weight:700;padding:2px 9px;border-radius:999px;background:var(--accent-l);color:var(--accent)}
.res .tag.yr{background:var(--yellow-l);color:#8a6400}
.res .tag.dif{background:var(--green-l);color:var(--green)}
.res p{margin:0;color:var(--muted);font-size:.95rem}
.res .dl{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;max-width:260px}
.res .dl a{font-size:.82rem;padding:6px 11px}
.res.hide{display:none}
@media (max-width:640px){.res{grid-template-columns:minmax(0,1fr)}.res .dl{justify-content:flex-start;max-width:none}}
.lib-empty{display:none;text-align:center;padding:30px;color:var(--muted)}

/* home */
.hero{background:#fff;border-bottom:1px solid var(--line);position:relative;overflow:hidden}
.hero::before,.hero::after{content:"";position:absolute;border-radius:50%;opacity:.12}
.hero::before{width:260px;height:260px;background:var(--yellow);left:-90px;bottom:-120px}
.hero::after{width:200px;height:200px;background:var(--blue);right:-60px;top:-70px}
.hero .wrap{padding-top:40px;padding-bottom:40px;text-align:center;position:relative;z-index:1}
.hero h1{font-size:clamp(2rem,5.5vw,3.4rem);margin-bottom:.25em}
.rb span:nth-child(5n+1){color:var(--blue)}.rb span:nth-child(5n+2){color:var(--red)}.rb span:nth-child(5n+3){color:var(--yellow)}.rb span:nth-child(5n+4){color:var(--green)}.rb span:nth-child(5n+5){color:var(--orange)}
.hero p{font-size:1.15rem;max-width:720px;margin:0 auto 1.2em;color:var(--muted)}
.hero .search{margin:0 auto;max-width:560px}
.hero .search input{padding:13px 20px;font-size:1.05rem}
.home-sec h2{display:flex;align-items:center;gap:10px}
.home-sec h2 .dot{width:14px;height:14px;border-radius:5px;background:var(--c)}
.home-blurb{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px 24px;margin:8px 0 28px}

/* search page */
.results{display:grid;gap:12px}
.result{background:var(--card);border-radius:14px;box-shadow:var(--shadow);padding:14px 18px}
.result a.t{font:600 1.1rem var(--head);text-decoration:none}
.result .u{font-size:.85rem;color:var(--green)}
.result p{margin:.3em 0 0;color:var(--muted);font-size:.95rem}

/* footer */
.site-footer{background:#1f2433;color:#d7d9e0;margin-top:20px}
.site-footer .rainbow{height:6px}
.foot{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:28px;padding-top:36px;padding-bottom:28px}
.foot h3{color:#fff;font-size:1.05rem}
.foot ul{list-style:none;margin:0;padding:0}
.foot li{margin:0 0 6px}
.foot a{color:#d7d9e0;text-decoration:none}
.foot a:hover{color:var(--yellow)}
.foot .logo-f{background:#fff;border-radius:14px;display:inline-block;padding:8px 12px;margin-bottom:12px}
.foot .logo-f img{width:120px}
.copy{border-top:1px solid #343a4d;padding:16px;text-align:center;font-size:.88rem;color:#9aa0b2}
@media (max-width:860px){.foot{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.foot{grid-template-columns:1fr}}

.to-top{position:fixed;right:16px;bottom:16px;width:44px;height:44px;border-radius:50%;background:var(--accent);color:#fff;border:0;box-shadow:var(--shadow);cursor:pointer;opacity:0;pointer-events:none;transition:opacity .2s;display:flex;align-items:center;justify-content:center;z-index:40}
.to-top.show{opacity:1;pointer-events:auto}
@media print{.site-header,.promo,.ad,.sidebar,.site-footer,.to-top,.lib-tools{display:none!important}}
