/* JD Core — the courses page (/courses/). See loader.php. Every selector is under #jd (the specificity floor);
   every colour, size and radius is a token. Same grammar as the books page (includes/books/books.css). */

#jd .jd-cs{ font-family:var(--jd-font-text); font-size:var(--jd-fs-body); line-height:1.55; color:var(--jd-text); padding-bottom:40px; }
#jd .jd-cs .jd-cs-wrap{ max-width:var(--jd-max); margin:0 auto; padding:0 32px; box-sizing:border-box; width:100%; }
#jd .jd-cs :is(h1,h2,h3){ font-family:var(--jd-font-heading); color:var(--jd-navy-dark); margin:0; text-transform:none; letter-spacing:normal; font-weight:700; text-wrap:balance; }
#jd .jd-cs h1{ font-size:clamp(34px,4.4vw,56px); line-height:1; font-weight:800; text-transform:uppercase; letter-spacing:.004em; }
#jd .jd-cs h2{ font-size:var(--jd-fs-h2); line-height:1.3; }
#jd .jd-cs h3{ font-size:var(--jd-fs-h3-card); }
#jd .jd-cs p{ margin:0; }
#jd .jd-cs a{ color:var(--jd-navy); text-decoration:none; font-family:inherit; }
#jd .jd-cs a:hover{ text-decoration:underline; }
#jd .jd-cs :is(a,button,input,select):focus-visible{ outline:2px solid var(--jd-navy-muted); outline-offset:2px; }
#jd .jd-cs .jd-cs-eyebrow{ font-family:var(--jd-font-label); font-size:var(--jd-fs-sign); letter-spacing:var(--jd-ls-sign); text-transform:uppercase; font-weight:700; color:var(--jd-accent-ink); }
#jd .jd-cs .jd-cs-meta{ font-size:var(--jd-fs-meta); color:var(--jd-text-muted); }

/* ---- hero ---- */
#jd .jd-cs-hero{ padding:40px 0 22px; }
#jd .jd-cs-hero-in{ display:grid; grid-template-columns:1.1fr 1fr; gap:40px; align-items:end; }
#jd .jd-cs-voice{ font-family:var(--jd-font-accent); font-style:italic; font-weight:500; font-size:var(--jd-fs-voice-long); line-height:1.25; color:var(--jd-navy); margin-top:10px; max-width:30ch; }
#jd .jd-cs-search{ display:flex; gap:8px; }
#jd .jd-cs input[type=search], #jd .jd-cs select{ font:400 14px var(--jd-font-text); padding:9px 12px; border:1px solid var(--jd-rule); border-radius:var(--jd-r-sm); background:var(--jd-surface); color:var(--jd-text); width:100%; box-sizing:border-box; height:auto; }
#jd .jd-cs-stats{ display:flex; gap:26px; margin:16px 0 0; flex-wrap:wrap; }
#jd .jd-cs-stats div{ display:flex; flex-direction:column-reverse; }
#jd .jd-cs-stats dd{ margin:0; font-family:var(--jd-font-display); font-weight:700; font-size:var(--jd-fs-fig-lg); letter-spacing:.02em; color:var(--jd-navy-dark); line-height:1.1; }
#jd .jd-cs-stats dt{ font-size:var(--jd-fs-micro); color:var(--jd-text-muted); }

/* ---- buttons, pills ---- */
#jd .jd-cs .jd-cs-btn{ display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:var(--jd-r-sm); border:1px solid var(--jd-rule); background:var(--jd-surface); color:var(--jd-navy-dark); font:600 var(--jd-fs-meta)/1.3 var(--jd-font-text); cursor:pointer; text-decoration:none; }
#jd .jd-cs .jd-cs-btn:hover{ border-color:var(--jd-navy); text-decoration:none; }
#jd .jd-cs .jd-cs-btn.is-primary{ background:var(--jd-navy); border-color:var(--jd-navy); color:var(--jd-text-invert); }
#jd .jd-cs .jd-cs-pill{ display:inline-flex; font:600 var(--jd-fs-micro)/1 var(--jd-font-text); padding:4px 10px; border-radius:var(--jd-r-pill); background:var(--jd-tint); color:var(--jd-navy); border:1px solid var(--jd-rule); }

/* ---- sections ---- */
#jd .jd-cs-sec{ margin:30px 0; }
#jd .jd-cs-sec-h{ display:flex; justify-content:space-between; align-items:flex-end; gap:12px; margin-bottom:12px; }
#jd .jd-cs-sec-h p{ color:var(--jd-text-muted); font-size:var(--jd-fs-meta); margin-top:2px; }

/* ---- a course: picture, then words. Used on the front door and in the browse ---- */
#jd .jd-cs .jd-cs-card{ display:flex; gap:14px; min-width:0; background:var(--jd-surface); border:1px solid var(--jd-rule); border-radius:var(--jd-r-lg); padding:12px; color:inherit; text-decoration:none; }
#jd .jd-cs .jd-cs-card:hover{ border-color:var(--jd-navy); text-decoration:none; }
#jd .jd-cs-img{ flex:none; width:96px; height:96px; background:var(--jd-tint); border:1px solid var(--jd-rule); border-radius:var(--jd-r-md); overflow:hidden; }
#jd .jd-cs-img img{ width:100%; height:100%; object-fit:cover; display:block; }
#jd .jd-cs-img.is-blank, #jd .jd-cs-logo.is-blank{ display:flex; align-items:center; justify-content:center; background:var(--jd-tint-deep); color:var(--jd-navy-dark); font:700 var(--jd-fs-h3-card)/1 var(--jd-font-heading); letter-spacing:.04em; }
#jd .jd-cs-body{ display:flex; flex-direction:column; gap:3px; min-width:0; }
#jd .jd-cs-prov{ font:700 var(--jd-fs-micro)/1.3 var(--jd-font-label); letter-spacing:var(--jd-ls-sign); text-transform:uppercase; color:var(--jd-accent-ink); }
#jd .jd-cs-t{ font-family:var(--jd-font-heading); font-weight:700; color:var(--jd-navy-dark); line-height:1.3; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
#jd .jd-cs-by{ font-size:var(--jd-fs-meta); color:var(--jd-text-muted); display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
#jd .jd-cs-when{ font-size:var(--jd-fs-meta); color:var(--jd-navy); font-weight:600; }
#jd .jd-cs-pills{ display:flex; flex-wrap:wrap; gap:5px; margin-top:4px; }

/* ---- front door ---- */
#jd .jd-cs-row{ display:grid; grid-auto-flow:column; grid-auto-columns:min(340px,86%); gap:14px; overflow-x:auto; padding:4px 2px 14px; scroll-snap-type:x proximity; }
#jd .jd-cs-row .jd-cs-card{ scroll-snap-align:start; }
#jd .jd-cs-levels{ display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; }
#jd .jd-cs .jd-cs-level{ display:flex; flex-direction:column; gap:2px; background:var(--jd-surface); border:1px solid var(--jd-rule); border-radius:var(--jd-r-lg); padding:16px 18px; color:var(--jd-navy-dark); text-decoration:none; }
#jd .jd-cs .jd-cs-level:hover{ border-color:var(--jd-navy); background:var(--jd-tint); text-decoration:none; }
#jd .jd-cs-level span{ font-family:var(--jd-font-heading); font-weight:700; font-size:var(--jd-fs-h3-card); }
#jd .jd-cs-level small{ color:var(--jd-text-muted); font-size:var(--jd-fs-meta); font-variant-numeric:tabular-nums; }
#jd .jd-cs-ways{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
#jd .jd-cs .jd-cs-ways a{ border:1px solid var(--jd-rule); border-radius:var(--jd-r-pill); padding:4px 14px; background:var(--jd-surface); font-size:var(--jd-fs-meta); }
#jd .jd-cs-ways b{ font-weight:600; color:var(--jd-text-muted); margin-left:4px; font-variant-numeric:tabular-nums; }
#jd .jd-cs-provs{ display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:14px; }
#jd .jd-cs-pvd{ display:flex; flex-direction:column; gap:12px; background:var(--jd-surface); border:1px solid var(--jd-rule); border-radius:var(--jd-r-lg); padding:var(--jd-pad); }
#jd .jd-cs-pvd-top{ display:flex; gap:12px; align-items:center; }
#jd .jd-cs-logo{ flex:none; width:56px; height:56px; border:1px solid var(--jd-rule); border-radius:var(--jd-r-md); background:var(--jd-surface); overflow:hidden; display:block; }
#jd .jd-cs-logo img{ width:100%; height:100%; object-fit:contain; display:block; }
#jd .jd-cs-acts{ display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; }
#jd .jd-cs-topics{ display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:10px; }
#jd .jd-cs .jd-cs-topic{ display:flex; justify-content:space-between; align-items:center; background:var(--jd-surface); border:1px solid var(--jd-rule); border-radius:var(--jd-r-md); padding:13px 14px; color:var(--jd-navy-dark); font-weight:700; text-decoration:none; }
#jd .jd-cs .jd-cs-topic:hover{ border-color:var(--jd-navy); background:var(--jd-tint); text-decoration:none; }
#jd .jd-cs-topic small{ font-weight:400; color:var(--jd-text-muted); font-size:var(--jd-fs-meta); font-variant-numeric:tabular-nums; }
#jd .jd-cs-all{ margin:10px 0 18px; }
#jd .jd-cs-contact{ max-width:70ch; }

/* ---- browse ---- */
#jd .jd-cs-browse{ padding:8px 0 24px; }
#jd .jd-cs-browse[hidden], #jd .jd-cs .jd-cs-hero[hidden], #jd .jd-cs [hidden]{ display:none; }
#jd .jd-cs-browse-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:16px; }
#jd .jd-cs-layout{ display:grid; grid-template-columns:272px 1fr; gap:var(--jd-gap); align-items:start; }
#jd .jd-cs-rail{ position:sticky; top:12px; max-height:calc(100vh - 24px); overflow:auto; }
#jd .jd-cs-rail-in{ display:flex; flex-direction:column; gap:14px; }
#jd .jd-cs-rail summary{ display:none; }
#jd .jd-cs-fac{ background:var(--jd-surface); border:1px solid var(--jd-rule); border-radius:var(--jd-r-lg); padding:16px 18px; }
#jd .jd-cs-fac h3{ font-family:var(--jd-font-label); font-size:var(--jd-fs-sign); letter-spacing:var(--jd-ls-sign); text-transform:uppercase; margin-bottom:8px; }
#jd .jd-cs-fac ul{ list-style:none; margin:0; padding:0; }
#jd .jd-cs-fac li label{ display:flex; gap:8px; align-items:center; padding:3px 0; cursor:pointer; font-size:var(--jd-fs-meta); }
#jd .jd-cs-fac li .n{ margin-left:auto; color:var(--jd-text-muted); font-variant-numeric:tabular-nums; }
#jd .jd-cs-fac li.is-zero{ opacity:.4; }
#jd .jd-cs input[type=checkbox]{ accent-color:var(--jd-navy); }
#jd .jd-cs-note{ font-size:var(--jd-fs-micro); color:var(--jd-text-muted); font-style:italic; margin-top:8px; }
#jd .jd-cs .jd-cs-more{ background:none; border:0; color:var(--jd-navy); font-size:var(--jd-fs-meta); text-decoration:underline; padding:4px 0; cursor:pointer; }
#jd .jd-cs-bar{ display:flex; gap:12px; margin-bottom:12px; }
#jd .jd-cs-bar select{ width:auto; }
#jd .jd-cs-chips{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
#jd .jd-cs-chips button{ background:var(--jd-navy); color:var(--jd-text-invert); border:0; border-radius:var(--jd-r-pill); padding:4px 12px; font:400 var(--jd-fs-meta) var(--jd-font-text); cursor:pointer; }
#jd .jd-cs-chips button::after{ content:' ×'; }
#jd .jd-cs-list{ display:grid; grid-template-columns:repeat(auto-fill,minmax(360px,1fr)); gap:14px; }
#jd .jd-cs-empty{ grid-column:1/-1; padding:40px; text-align:center; color:var(--jd-text-muted); }
#jd .jd-cs .jd-cs-loadmore{ display:flex; margin:30px auto 0; }

@media (max-width:900px){
	#jd .jd-cs .jd-cs-wrap{ padding:0 16px; }
	#jd .jd-cs-hero-in{ grid-template-columns:1fr; gap:22px; }
	#jd .jd-cs-layout{ grid-template-columns:1fr; }
	#jd .jd-cs-rail{ position:static; max-height:none; overflow:visible; }
	#jd .jd-cs-rail summary{ display:block; cursor:pointer; padding:10px 14px; border:1px solid var(--jd-rule); border-radius:var(--jd-r-md); background:var(--jd-surface); font:600 var(--jd-fs-meta) var(--jd-font-text); color:var(--jd-navy-dark); margin-bottom:12px; }
	#jd .jd-cs-rail details:not([open]) summary{ margin-bottom:0; }
	#jd .jd-cs-list{ grid-template-columns:1fr; }
	#jd .jd-cs-sec-h{ flex-direction:column; align-items:flex-start; }
}
@media (max-width:420px){
	#jd .jd-cs-img{ width:72px; height:72px; }
}
