/* Explore / subject template – reuses V9 tokens (v9.css); layout only */
.crumbs{font-size:13px;color:var(--muted);margin:0 0 6px}.crumbs a{color:var(--accent)}
#main h1{font-family:Georgia,serif;font-weight:500;font-size:clamp(28px,4vw,40px);margin:4px 0 6px}
.intro{color:var(--muted);margin:0 0 18px;max-width:720px;line-height:1.6}
.ex-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-bottom:18px}
.switch,.chips{display:flex;flex-wrap:wrap;gap:6px}
.switch button,.chips button{border:1px solid #c8d6e8;background:#fff;border-radius:999px;padding:8px 14px;cursor:pointer;font-weight:600;color:var(--ink);font-size:14px}
.switch button[aria-pressed=true],.chips button[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:#fff}
.ex-search input{border:1px solid #c8d6e8;border-radius:6px;padding:9px 10px;width:200px;max-width:100%;font:inherit}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.ex-layout{display:grid;grid-template-columns:190px minmax(0,1fr);gap:28px;align-items:start}
.ex-layout.collapsed{grid-template-columns:44px minmax(0,1fr)}
.ex-side{background:#f4f7fb;border-radius:8px;padding:8px;position:sticky;top:8px}
.ex-toggle{width:100%;text-align:left;border:0;background:none;font-weight:700;color:var(--ink);cursor:pointer;padding:8px 6px;font-size:13px;text-transform:uppercase;letter-spacing:1px}
.ex-layout.collapsed #sideList{display:none}.ex-layout.collapsed .ex-toggle{writing-mode:vertical-rl;padding:10px 4px}
#sideList button{display:block;width:100%;text-align:left;border:0;background:none;padding:8px 6px;cursor:pointer;color:var(--ink);font-size:14px;border-radius:5px}
#sideList button:hover{background:#e3f2ff}#sideList button[aria-current=true]{background:#e3f2ff;font-weight:700;color:var(--accent)}
.grp{margin:0 0 22px}.grp h2{font-size:18px;margin:0 0 4px;color:var(--ink)}
.row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}
.row .t{min-width:0}.row strong{display:block;font-size:15px;overflow-wrap:anywhere}
.row .m{font-size:12.5px;color:var(--muted);margin-top:3px}
.row .a{display:flex;gap:8px;align-items:center;flex-shrink:0}
.badge{font-size:11px;font-weight:700;border-radius:999px;padding:3px 9px;letter-spacing:.3px;white-space:nowrap}
.b-free{background:#e3f2ff;color:#1749a8}.b-premium{background:#fbe3ee;color:#a3285e}.b-soon{background:#eef0f4;color:#52647c}.b-hidden{background:#fff3cd;color:#6b5200}
.open{border:1px solid #c8d6e8;background:#fff;border-radius:6px;padding:7px 12px;font-weight:700;font-size:13px;color:var(--ink);white-space:nowrap}
.open:hover{border-color:var(--accent);color:var(--accent)}
.empty,.msg{background:#f4f7fb;border-radius:8px;padding:16px;color:var(--muted)}.msg{margin-bottom:16px;color:var(--ink)}
@media(max-width:760px){.ex-layout,.ex-layout.collapsed{grid-template-columns:1fr}.ex-side{position:static}.ex-layout.collapsed .ex-toggle{writing-mode:horizontal-tb}.row{flex-wrap:wrap}.ex-search,.ex-search input{width:100%}}
#main.panel{padding:28px 28px 40px}@media(max-width:620px){#main.panel{padding:20px 17px 32px}}
/* Catalogue cards (one reusable component) */
.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.ccard{display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:0 2px 10px #09245c14;transition:box-shadow .2s,transform .2s}
.ccard:hover,.ccard:focus-within{box-shadow:0 8px 24px #09245c24;transform:translateY(-2px)}
.cc-th{position:relative;aspect-ratio:16/9;background:#eaf2fb}.cc-th img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.cc-ph{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:linear-gradient(135deg,#eef4fc,#e3ecf9);color:#8da4c6;font-size:34px}
.cc-th .badge{position:absolute;top:10px;left:10px;box-shadow:0 1px 4px #0002}
.cc-b{display:flex;flex-direction:column;gap:6px;padding:14px 16px 16px;flex:1}
.cc-b h3{margin:0;font-size:17px;line-height:1.25;color:var(--ink);overflow-wrap:anywhere}
.cc-b p{margin:0;font-size:13.5px;line-height:1.5;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.9em}
.cc-f{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding-top:10px}
.cc-g{font-size:12.5px;font-weight:700;color:#a3285e}
.cc-f .open{background:#245db8;border-color:#245db8;color:#fff}.cc-f .open:hover{background:#1749a8;color:#fff}
.cc-f .open.dis{background:#eef0f4;border-color:#eef0f4;color:#52647c;cursor:default}
.cards.compact{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.cards.compact .ccard{flex-direction:row;align-items:stretch;border-radius:10px;box-shadow:0 1px 5px #09245c10}
.cards.compact .cc-th{aspect-ratio:1/1;width:76px;flex:0 0 76px}.cards.compact .cc-th .badge{display:none}
.cards.compact .cc-b{padding:9px 12px;gap:3px;min-width:0}.cards.compact h3{font-size:14px}.cards.compact .cc-b p{display:none}
.cards.compact .cc-f{padding-top:4px}.cards.compact .badge{font-size:10.5px}.cards.compact .open{padding:4px 9px;font-size:12px}
@media(max-width:1100px){.cards,.cards.compact{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.cards{grid-template-columns:1fr}.cards.compact{grid-template-columns:1fr}}
.cards.compact .cc-g{white-space:nowrap}.cards.compact .cc-f{flex-wrap:wrap;row-gap:4px}

/* Catalogue page atmosphere (Celestial Blue V1.0, very subtle) */
body.explore{background:linear-gradient(165deg,#E3F2FF 0%,#F8FAFF 42%,#EEE8FC 100%);min-height:100vh}
body.explore header,body.explore footer{background:#fff}
.ex-side{background:#ffffffcc}
#subjChips{width:100%;flex-basis:100%}
#subjChips[hidden]{display:none}
/* Consistent card heights; button pinned to the bottom */
.cards{align-items:stretch}
.ccard{height:100%;background:#fff}
.cc-b{flex:1;min-height:0}
.cc-b h3{min-height:2.5em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cc-b p{min-height:3em;-webkit-line-clamp:2}
.cc-f{margin-top:auto}

.open.unlock{background:#245db8;color:#fff;border-color:#245db8}.open.unlock:hover{color:#fff;background:#1a4a96}.open.alt{font-weight:600}

#typeChips[hidden]{display:none}
/* Free Practice page only: slightly lighter Celestial Blue ground */
body.explore.free-practice{background:linear-gradient(165deg,#F0F7FF 0%,#FBFCFF 45%,#F6F2FC 100%)}

/* Free Practice cards: subject colour, tactile thumbnail band */
.ccard{border-top:6px solid var(--cc,#c8d6e8)}
.ccard.subj-math{--cc:#D64D87;--cc2:#FDE7EF;--cc3:#B83A70}
.ccard.subj-science{--cc:#2A8C86;--cc2:#E3F1EF;--cc3:#1D6560}
.ccard.subj-english{--cc:#7253C4;--cc2:#EEE8F6;--cc3:#5A3FA0}
.ccard.subj-reading{--cc:#C45B2D;--cc2:#FFEBDD;--cc3:#9A4A1F}
.ccard.subj-social-studies{--cc:#5A9FCC;--cc2:#E8F3FA;--cc3:#2F6E99}
.ccard.subj-other{--cc:#8F2C57;--cc2:#FDF1F7;--cc3:#B83A70}
.ccard .cc-ph{background:linear-gradient(135deg,var(--cc2,#eef4fc),#fff);color:var(--cc3,#8da4c6)}
.ccard .cc-g{color:var(--cc3,#a3285e)}
.ccard .cc-f .open{background:var(--cc3,#245db8);border-color:var(--cc3,#245db8)}
.ccard .cc-f .open:hover{background:var(--cc,#1749a8);border-color:var(--cc,#1749a8)}
body.explore.free-practice .cc-th{background:var(--cc2,#eaf2fb)}
@media (prefers-reduced-motion:reduce){.ccard,.ccard:hover,.ccard:focus-within{transition:none;transform:none}}


/* Free Practice layout (mockup structure, site palette — not navy) */
body.explore.free-practice .ex-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
body.explore.free-practice .ex-search{margin-left:auto}
body.explore.free-practice .ex-search input{border:1px solid var(--line,#c8d6e8);border-radius:999px;padding:9px 14px;width:240px;max-width:100%;background:#fff;color:var(--ink)}
body.explore.free-practice .intro{max-width:720px;color:var(--muted)}
body.explore.free-practice .grp h2{font-family:Georgia,serif;font-weight:500;font-size:clamp(20px,2.4vw,26px);color:var(--ink);margin:6px 0 12px;padding-bottom:6px;border-bottom:1px solid var(--line)}
body.explore.free-practice .cards.fp-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:stretch}
body.explore.free-practice .fp-card{flex-direction:row;align-items:stretch;height:auto;border-radius:12px;box-shadow:0 2px 10px #09245c12;background:#fff;border:1px solid var(--line);border-top:6px solid var(--cc,#c8d6e8)}
body.explore.free-practice .fp-card .cc-th{aspect-ratio:1/1;width:88px;flex:0 0 88px;background:var(--cc2,#eaf2fb)}
body.explore.free-practice .fp-card .cc-th img{object-fit:cover}
body.explore.free-practice .fp-card .cc-ph{font-size:28px;color:var(--cc3,#8da4c6)}
body.explore.free-practice .fp-card .cc-b{padding:12px 14px 12px;gap:4px;min-height:0;display:flex;flex-direction:column}
body.explore.free-practice .fp-card h3{font-size:16px;line-height:1.3;min-height:0;-webkit-line-clamp:3;margin:0}
body.explore.free-practice .fp-card .fp-meta{margin:0;font-size:13px;line-height:1.4;color:var(--muted);min-height:0;-webkit-line-clamp:unset;display:block}
body.explore.free-practice .fp-card .cc-f{padding-top:8px;margin-top:auto;justify-content:flex-start}
body.explore.free-practice .fp-card .cc-f .open{background:var(--cc3,#245db8);border-color:var(--cc3,#245db8);color:#fff;border-radius:8px;padding:8px 14px;font-size:13px;font-weight:700}
body.explore.free-practice .fp-card .cc-f .open:hover{background:var(--cc,#1749a8);border-color:var(--cc,#1749a8);color:#fff}
body.explore.free-practice .ex-side{background:#ffffffcc;border:1px solid var(--line)}
body.explore.free-practice #sideList button[aria-current=true]{background:var(--accent);color:#fff;font-weight:700}
@media(max-width:900px){body.explore.free-practice .cards.fp-cards{grid-template-columns:1fr}}
@media(max-width:760px){
  body.explore.free-practice .ex-controls{flex-direction:column;align-items:stretch}
  body.explore.free-practice .ex-search,body.explore.free-practice .ex-search input{width:100%;margin-left:0}
  body.explore.free-practice .ex-layout,body.explore.free-practice .ex-layout.collapsed{grid-template-columns:1fr}
  body.explore.free-practice .ex-side{position:static;background:transparent;border:0;padding:0;margin:0 0 14px}
  body.explore.free-practice .ex-toggle{display:none}
  body.explore.free-practice #sideList{display:flex;flex-wrap:wrap;gap:6px;overflow:visible;padding:2px 0 8px}
  body.explore.free-practice #sideList button{display:inline-flex;width:auto;white-space:nowrap;border:1px solid #c8d6e8;background:#fff;border-radius:999px;padding:8px 14px;color:var(--ink);font-size:13px;font-weight:600}
  body.explore.free-practice #sideList button[aria-current=true]{background:var(--accent);border-color:var(--accent);color:#fff}
  body.explore.free-practice .fp-card .cc-th{width:72px;flex-basis:72px}
}
@media (prefers-reduced-motion:reduce){body.explore.free-practice .fp-card:hover,body.explore.free-practice .fp-card:focus-within{transform:none}}

body.explore.free-practice .switch{order:1}
body.explore.free-practice .ex-search{order:2;margin-left:auto}
body.explore.free-practice #subjChips{order:3;flex-basis:100%;width:100%}

/* device-sweep 2 Dec 2026: keep subject and grade chips fully visible on phone/iPad */
@media (max-width: 760px) {
  body.explore.free-practice #subjChips,
  body.explore.free-practice #sideList {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    gap: 6px;
  }
}

/* 2 Dec 2026: Free Practice titles never clipped (3 lines max on tablet/laptop, no clamp on phones) */
article.ccard.fp-card .cc-b h3,body.explore.free-practice .fp-card h3{-webkit-line-clamp:3}
@media (max-width:760px){article.ccard.fp-card .cc-b h3,body.explore.free-practice .fp-card h3{display:block;-webkit-line-clamp:unset;line-clamp:none;overflow:visible;min-height:0}}
