/* Course catalogue and My courses (L3, plan §8.1). Needs tokens.css and components.css. */

.muted { color: var(--ink-3); }
.ui-messages { display: grid; gap: 8px; margin: 0 0 18px; }
.ui-msg { margin: 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--rule); background: var(--paper); }
.ui-msg.error { border-color: #f1c4c4; background: #fdf2f2; color: var(--danger); }
.ui-msg.success { border-color: #bfe5cd; background: #effaf3; color: var(--ok); }
.ui-msg.warning { border-color: #f0dca8; background: #fdf8ea; color: #7a5300; }

.cat-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 22px; }
.cat-head .grow { flex: 1; min-width: 200px; }
.cat-head h1 { font-size: 20px; margin: 0; }
.cat-head .lede { margin: 2px 0 0; font-size: 13.5px; }
.cat-logo { height: 44px; width: auto; border-radius: 4px; }

/* The visitor's hero (as the live front page): the screenshots on the left, fading one into the next, and on the right
 * the Euro-CNS logo and name, what the site is, and Log in / Create an account. */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; padding: 20px; margin-bottom: 28px; align-items: center; box-shadow: var(--shadow-1); }
.hero-org { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-weight: 650; font-size: 15px; line-height: 1.3; color: var(--ink); }
.hero-org img { height: 46px; width: auto; border-radius: 4px; flex: none; }
.hero h1 { font-size: 28px; margin: 0 0 10px; letter-spacing: -.01em; }
.hero .lede { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.hero-actions .btn { height: 38px; padding: 0 16px; font-size: 14px; }
.hero-carousel { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--hema-wash); box-shadow: var(--shadow-2); }
.hc-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .8s var(--ease); }
.hc-slide.on { opacity: 1; }
.hc-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hc-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 40px; color: #fff; font-size: 12.5px;
    background: linear-gradient(to top, rgba(15, 20, 30, .72), rgba(15, 20, 30, 0)); display: grid; gap: 2px; }
.hc-slide figcaption b { font-size: 14px; }
.hc-slide figcaption span { opacity: .9; }
.hc-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .85); color: var(--ink); cursor: pointer; opacity: 0; transition: opacity .2s; box-shadow: var(--shadow-1); }
.hc-arrow.prev { left: 10px; } .hc-arrow.next { right: 10px; }
.hero-carousel:hover .hc-arrow, .hc-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .hc-arrow { opacity: 1; } }
.hc-foot { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.hc-dots { display: flex; gap: 2px; }
.hc-dots button { width: 24px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.hc-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .55); transition: transform .2s, background .2s; }
.hc-dots button[aria-current="true"]::before { background: #fff; transform: scale(1.25); }
.hc-pause { width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .25); color: #fff; font-size: 11px; cursor: pointer; }
.hc-pause:hover { background: rgba(255, 255, 255, .4); }
@media (prefers-reduced-motion: reduce) { .hc-slide { transition: none; } }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 20px; padding: 14px; } .hero-text { padding: 0 6px 8px; } .hero h1 { font-size: 24px; } }

/* The catalogue is as wide as the live front page (four cards a row on a wide screen); My courses shares it. */
.page.catalogue { max-width: 1536px; padding-left: 32px; padding-right: 32px; }
@media (max-width: 640px) { .page.catalogue { padding-left: 16px; padding-right: 16px; } }
.cat-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-bar .cat-title { margin: 0 auto 0 0; font-size: 21px; }
.cat-filter { position: relative; display: flex; align-items: center; }
.cat-filter > i { position: absolute; left: 10px; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.cat-filter .inp { width: 200px; height: 32px; padding: 0 28px 0 30px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--paper); font-size: 13.5px; }
.cat-filter .inp:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.cat-filter .cf-clear { position: absolute; right: 8px; color: var(--ink-3); font-size: 13px; }
.cat-filter .cf-clear:hover { color: var(--ink); }
.cat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-chips a { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--rule); color: var(--ink-2); text-decoration: none; }
.cat-chips a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-chips .n { opacity: .7; }
@media (max-width: 640px) { .cat-bar .cat-title { flex-basis: 100%; } .cat-filter, .cat-filter .inp { flex: 1; width: auto; } }

.cat-group + .cat-group { margin-top: 40px; }
.cat-title { font-size: 17px; margin: 0 0 12px; }
.cat-title .n { font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
/* A group heading between two rules, with its icon and a count pill (as the live front page) */
.cat-title.grouped { display: flex; align-items: center; gap: 18px; font-size: 21px; margin: 0 0 18px; }
.cat-title.grouped::before, .cat-title.grouped::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.cat-title.grouped .ct-in { display: inline-flex; align-items: center; gap: 10px; text-align: center; }
.cat-title.grouped .ct-in > i { color: var(--brand); }
.cat-title.grouped.src-versatest .ct-in > i { color: var(--ok); }
.cat-title.grouped.src-community .ct-in > i { color: var(--dab); }
.cat-title.grouped.src-custom .ct-in > i { color: var(--ink-2); }
.cat-title.grouped .n { margin-left: 0; padding: 2px 10px; border-radius: 999px; background: var(--brand-wash); color: var(--brand-ink); white-space: nowrap; }
.cat-title.grouped.src-versatest .n { background: #e7f6ec; color: var(--ok); }
@media (max-width: 640px) { .cat-title.grouped { font-size: 17px; gap: 10px; } .cat-title.grouped .ct-in { flex-wrap: wrap; justify-content: center; } }

.course-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.course-card { display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-1); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
@media (prefers-reduced-motion: reduce) { .course-card, .course-card:hover { transition: none; transform: none; } }
/* One cover size for every card, whatever the picture's shape: the image is taken out of the flow, so its own height
 * can't stretch the grid row past the aspect ratio, and it is cropped to fill. */
.cc-cover { position: relative; overflow: hidden; aspect-ratio: 3 / 2; background: var(--hema-wash); color: var(--hema); display: grid; place-items: center; font-size: 26px; }
.cc-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-badge { position: absolute; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 650; color: #fff; line-height: 1.4; box-shadow: 0 1px 3px rgba(15, 20, 30, .25); }
.cc-badge.level { top: 8px; left: 8px; background: var(--brand); }
.cc-badge.level.lv-beginner { background: var(--ok); }
.cc-badge.level.lv-advanced { background: var(--danger); }
.cc-badge.price { top: 8px; right: 8px; border-radius: 999px; background: var(--brand); padding: 3px 10px; }
.cc-badge.price.paid { background: var(--ok); }
.cc-badge.mode { bottom: 8px; left: 8px; background: rgba(24, 32, 46, .82); }
.cc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cc-body h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.cc-desc { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.cc-facts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; color: var(--ink-3); }
.cc-facts li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc-facts i { width: 13px; text-align: center; color: var(--ink-3); }
.cc-facts i.cert { color: var(--tutor); }
.cc-price { margin: 0; font-size: 13px; }
.cc-progress { display: flex; align-items: center; gap: 8px; }
.cc-progress .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--rule-2); overflow: hidden; }
.cc-progress .bar span { display: block; height: 100%; background: var(--brand); }
.cc-progress .pct { font-size: 12px; color: var(--ink-2); min-width: 3ch; }
.cc-done { margin: 0; font-size: 12.5px; color: var(--ok); }
.cc-action { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.cc-action .btn-primary { flex: 1; justify-content: center; height: 38px; font-size: 14px; }
.empty { padding: 22px; text-align: center; color: var(--ink-2); }

/* ---------- footer (ui/_footer.html) ---------- */
.site-foot { background: #18202e; color: #c8d0dc; font-size: 13px; }
.site-foot .foot-inner { max-width: 1000px; margin: 0 auto; padding: 32px 16px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-foot b { color: #fff; }
.site-foot p { margin: 8px 0 0; font-size: 12px; }
.site-foot h2 { font-size: 13px; color: #fff; margin: 0 0 8px; }
.site-foot nav { display: flex; flex-direction: column; gap: 5px; }
.site-foot a { color: #c8d0dc; text-decoration: none; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 720px) { .site-foot .foot-inner { grid-template-columns: 1fr; } }

/* ---------- course page (ui/courses/course.html, L3 slice 2) ---------- */
.course-page .back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); text-decoration: none; margin-bottom: 12px; }
.course-page .back:hover { color: var(--ink); }
.cp-head { padding: 20px 22px; display: grid; gap: 10px; }
.cp-head .lede { margin: 0; }
.cp-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cp-title h1 { margin: 0; }
.cp-head .cc-progress { max-width: 420px; }
.cp-head .cc-progress .pct { white-space: nowrap; }
.cp-section { margin-top: 28px; }
.cp-section h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.cp-section h2 i { color: var(--ink-3); font-size: 15px; }
.cp-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cp-section-head a { font-size: 13px; text-decoration: none; }
.cp-section .lede { margin: -4px 0 12px; font-size: 13px; }
.cp-main { flex: 1; min-width: 0; }
.cp-main p { margin: 0; }
.cp-main .t { font-weight: 600; }
.cp-main .cc-desc, .cp-main .cc-facts { margin-top: 3px; }

.cp-live > li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
.cp-live > li.soon { background: #f3fbf6; }
.cp-live .muted { font-size: 12.5px; }

.cp-module { margin-bottom: 14px; overflow: hidden; }
.cp-module > header { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--rule-2); flex-wrap: wrap; }
.cp-module h3 { margin: 0; font-size: 15.5px; }
.cp-module h3 .n { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-right: 6px; text-transform: uppercase; letter-spacing: .03em; }
.cp-mod-progress { width: 160px; padding-top: 3px; }
.cp-objectives { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.cp-objectives summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); }
.cp-objectives ul { margin: 6px 0 0; padding-left: 18px; }
.cp-module .empty { padding: 14px 16px; text-align: left; font-size: 13px; }
.cp-lesson .type { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; font-size: 13px; }
.t-hema { background: var(--hema-wash); color: var(--hema); }
.t-dab { background: var(--dab-wash); color: var(--dab); }
.t-lfb { background: var(--lfb-wash); color: var(--lfb); }
.t-eosin { background: var(--eosin-wash); color: var(--eosin); }
.t-text { background: var(--text-wash); color: var(--text); }
.cp-lesson .state { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cp-lesson .state.ok { color: var(--ok); }
.cp-lesson.done .t { color: var(--ink-2); }
.cp-lesson .go { color: var(--ink-3); font-size: 12px; }
@media (max-width: 560px) {
    .cp-lesson a.row { flex-wrap: wrap; }
    .cp-lesson a.row span.meta { order: 3; width: 100%; padding-left: 40px; }
    .cp-mod-progress { width: 100%; }
}

.cp-cases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.cp-cases a { display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; height: 100%; }
.cp-cases a:hover .t { color: var(--brand-ink); }
.cp-cases .thumb { position: relative; aspect-ratio: 3 / 2; background: var(--hema-wash); color: var(--hema); display: grid; place-items: center; font-size: 22px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; margin-bottom: 6px; }
.cp-cases .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cp-cases .thumb .count { position: absolute; right: 6px; top: 6px; font-size: 11px; background: rgba(24,32,46,.65); color: #fff; padding: 1px 6px; border-radius: 4px; }
.cp-cases .t { font-weight: 600; font-size: 13.5px; padding: 0 12px; }
.cp-cases .meta { font-size: 12px; color: var(--ink-3); padding: 0 12px 12px; }
.cp-shared { border-top: 1px dashed var(--rule); }

/* R5b: the owning organisation on the course page */
.cp-org { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.cp-org img { height: 22px; width: auto; }
/* "Your progress" with Continue, and what the certificate asks (prototype studio.css .lv-progress; audit wave 6) */
.cp-progress { padding: 12px 16px; display: grid; gap: 8px; }
.cp-progress p { margin: 0; }
.lvp-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lvp-top span { color: var(--ink-2); font-size: 13px; }
.lvp-top .btn, .lvp-top .lvp-all { margin-left: auto; }
.lvp-all { color: var(--ok) !important; font-weight: 600; }
.lvp-bar { height: 6px; border-radius: 99px; background: var(--rule-2); overflow: hidden; }
.lvp-bar span { display: block; height: 100%; background: var(--ok); }
.cp-end { text-align: center; margin: 32px 0 0; color: var(--ink-3); font-size: 13px; }
/* An organisation's house style (prototype studio.css:1044-1046,1199-1204) */
.brand-bar { display: flex; gap: 10px; align-items: center; color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.brand-bar .bb-url { margin-left: auto; font-weight: 400; font-size: 11.5px; opacity: .9; font-family: var(--mono, ui-monospace, monospace); }
@media (max-width: 640px) { .brand-bar .bb-url { display: none; } }
.brand-bar .bp-logo, .org-brand .site-nav .org-chip { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 6px; background: rgba(255,255,255,.18); color: #fff; font-size: 11px; font-weight: 700; overflow: hidden; }
.brand-bar .bp-logo img, .org-brand .site-nav .org-chip img { height: 100%; width: auto; }
.org-brand .site-nav { background: var(--org-color); }
.org-brand .site-nav .logo { color: #fff; display: inline-flex; gap: 8px; align-items: center; }
.org-brand .site-nav .logo small { font-weight: 400; font-size: 11px; opacity: .85; }
.org-brand .site-nav nav a, .org-brand .site-nav .who-btn { color: #fff; }
.org-brand .site-nav nav a[aria-current], .org-brand .site-nav nav a.on { background: rgba(0,0,0,.18); }
