/*
 * Josoor design system — the public course page (/course/<id>/, visitor view, data-cv-mode="public"). Prefix `cp-`.
 * The approved public design: a head band (breadcrumb, marker, title, promise, facts), keyboard tabs, the sticky
 * purchase card (desktop) / the card above the tabs and a bottom bar (phone), related courses. It keeps the purchase
 * card's existing hooks (cv-buycard, #cv-buy, cv-actions, cv-btn, cv-mbar) whose base styles are course-view.css.
 * Loaded only in the visitor view; the enrolled / staff views of this URL are untouched. Tokens only.
 */
.cv-wrap.cp-page { max-width: none; padding: 0 0 72px; font-family: var(--font); color: var(--text); line-height: 1.75; }
.cp-page h1, .cp-page h2, .cp-page h3 { line-height: 1.35; text-wrap: balance; }

/* ── Head band ──────────────────────────────────────────────────────────────── */
.cp-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.cp-head-in { padding-bottom: 36px; }
.cp-mark { font-size: var(--fs-sm) !important; margin-top: 22px; }
.cp-head h1 { margin: 10px 0 0; font-size: clamp(1.625rem, 1.15rem + 1.8vw, 2.375rem); font-weight: var(--fw-bold); max-width: 24em; overflow-wrap: anywhere; }
.cp-promise { margin: 10px 0 0; font-size: var(--fs-lg); color: var(--text-2); max-width: 40em; line-height: 1.8; }
.cp-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 22px; font-size: var(--fs-md); color: var(--text-2); }
.cp-facts > span { display: inline-flex; align-items: center; gap: 8px; }
.cp-facts svg.icon.pi { width: 18px; height: 18px; color: var(--text-3); }
.cp-facts .cp-free { color: var(--ok); font-weight: var(--fw-semibold); }
.cp-facts .cp-free svg.icon.pi { color: var(--ok); }
.cp-head-mods { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.cp-head-mods > * { margin: 0 !important; }
/* the course facts block (module course_facts, through classera_course_view_public_head) reads as the facts row here */
.cp-head .cf-facts { margin: 0; padding: 0; background: none; border: 0; border-radius: 0; gap: 10px; }
.cp-head .cf-title { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cp-head .cf-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-head .cf-row { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface-2); font-size: var(--fs-sm); }
.cp-head .cf-row dt { font-size: var(--fs-sm); color: var(--text-3); }
.cp-head .cf-row dt::after { content: ":"; }
.cp-head .cf-row dd { font-weight: var(--fw-semibold); }
.cp-head .cf-block, .cp-head .cf-notice { max-width: 46em; }
.cp-head .inq-course-action { display: flex; }

/* ── Grid: tabs + the purchase card ───────────────────────────────────────────── */
.cp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 48px; align-items: start; padding-block: 36px 24px; }
.cp-main { min-width: 0; }
.cp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 28px; }
.cp-tabs[hidden] { display: none; }
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tabs [role="tab"] { height: 48px; padding: 0 14px; border: 0; background: none; font: inherit; font-weight: var(--fw-semibold); color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; flex: none; }
.cp-tabs [role="tab"]:hover { color: var(--text); }
.cp-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.cp-tabs [role="tab"]:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.cp-panel + .cp-panel { margin-top: 32px; }
.cp-panel[hidden] { display: none; }
.cp-panel:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 4px; }
.cp-prose h2, .cp-panel-h { margin: 0 0 12px; font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.cp-prose p { margin: 0 0 12px; color: var(--text-2); max-width: 46em; }
.cp-note { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--text-2); }
.cp-reqs { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.cp-reqs li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cp-reqs li:last-child { border-bottom: 0; }
.cp-reqs svg.icon.pi { width: 20px; height: 20px; color: var(--brand); margin-top: 3px; }
.cp-reqs b { font-weight: var(--fw-semibold); }

/* the outline (the existing cv-outline / cv-osec / cv-orow markup, in the design's look) */
.cp-page .cv-outline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cp-page .cv-outline-head { background: var(--surface); padding: 16px 18px; }
.cp-page .cv-outline-head h2 { font-size: var(--fs-lg); }
.cp-page .cv-osec > summary { background: var(--surface-2); padding: 16px 18px; }
.cp-page .cv-osec > summary .cv-chev { width: 16px; height: 16px; flex: 0 0 16px; color: var(--text-3); transition: rotate .15s; transform: none; }
.cp-page .cv-osec[open] > summary .cv-chev { rotate: 180deg; transform: none; }
.cp-page .cv-osec-body { padding: 6px 18px 12px; }
.cp-page .cv-orow { padding: 9px 0; font-size: var(--fs-md); color: var(--text); }
.cp-page .cv-orow svg.icon.pi { width: 17px; height: 17px; color: var(--text-3); }
.cp-page .cv-orow-go { color: var(--text-3); }

/* ── The purchase card ────────────────────────────────────────────────────────── */
.cp-aside { min-width: 0; }
.cp-buy { position: sticky; top: calc(var(--pub-hdr-h) + 20px); border: 1px solid var(--border-strong) !important; box-shadow: var(--shadow) !important; scroll-margin-top: calc(var(--pub-hdr-h) + 20px); }
.admin-bar .cp-buy { top: calc(var(--pub-hdr-h) + 52px); }
.cp-buy-cover { height: 120px; display: grid; place-items: center; position: relative; overflow: hidden; background-size: cover; background-position: center; }
.cp-buy-cover svg.icon.pi.ic { width: 52px; height: 52px; stroke-width: 1.5; }
.cp-buy .cv-buybody { padding: 20px; }
.cp-buy .cv-price-now { font-size: 1.875rem; }
.cp-buy .cv-btn { height: 46px !important; font-size: var(--fs-md); }
.cp-buy .cv-incl { margin-top: 18px; padding-top: 16px; font-size: var(--fs-md); gap: 9px; }
.cp-buy .cv-incl svg.icon.pi { width: 18px; height: 18px; color: var(--text-3); }

/* ── Related ──────────────────────────────────────────────────────────────────── */
.cp-related { border-top: 1px solid var(--border); padding-block: 48px 24px; }
.cp-related h2 { margin: 0 0 20px; font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.cp-rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 252px), 1fr)); gap: 20px; }
.cp-rel-grid > * { min-width: 0; }

/* ── Phone ────────────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .cp-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 24px; }
  .cp-aside { order: -1; }
  .cp-buy { position: static; box-shadow: none !important; }
  .cp-buy-cover { display: none; }
}
@media (max-width: 639px) {
  .cp-rel-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
  .cp-rel-grid > * { scroll-snap-align: start; }
}
.cp-page ~ .cv-mbar, .cv-mbar { box-shadow: var(--shadow-lg); padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
@media (prefers-reduced-motion: reduce) { .cp-page * { transition: none !important; } }
