/* Course browser: archive / category / search page + "Course Browser" widget (.jp-cb*) */
.jp-cb { --jp-c-navy: #12306b; --jp-c-green: #2e7d32; --jp-c-border: #e3e8ef; --jp-c-muted: #6b7280; box-sizing: border-box; width: 100%; }
.jp-cb *, .jp-cb *::before, .jp-cb *::after { box-sizing: border-box; }
.jp-cb a, .jp-cb a:hover { text-decoration: none; }

/* ---------- Head: title + search ---------- */
.jp-cb__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.jp-cb__titles { min-width: 0; flex: 1 1 auto; }
.jp-cb__title { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 800; color: var(--jp-c-navy); }
.jp-cb__sub { margin: 4px 0 0; font-size: 12.5px; line-height: 1.4; color: #4b5563; }
.jp-cb__search { display: flex; align-items: stretch; position: relative; flex: 0 1 410px; width: 410px; max-width: 100%; height: 40px; margin: 0; }
.jp-cb__sicon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; width: 16px; height: 16px; color: #6b7280; pointer-events: none; }
.jp-cb__sicon svg { width: 100%; height: 100%; }
.jp-cb .jp-cb__sinput { flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; padding: 0 12px 0 36px; border: 1px solid #d5dbe6; border-right: 0; border-radius: 8px 0 0 8px; background: #fff; font-size: 14px; color: #111827; box-shadow: none; outline: 0; }
.jp-cb .jp-cb__sinput:focus { border-color: var(--jp-c-navy); }
.jp-cb .jp-cb__sbtn { flex: none; height: 100%; margin: 0; padding: 0 22px; border: 0; border-radius: 0 8px 8px 0; background: var(--jp-c-navy); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.jp-cb .jp-cb__sbtn:hover { background: #0c2250; color: #fff; }

/* ---------- Category pills ---------- */
.jp-cb__pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.jp-cb .jp-cb__pill { display: inline-flex; align-items: center; padding: 7px 15px; border: 1px solid #cfd6e2; border-radius: 999px; background: #fff; color: #1f2937; font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.jp-cb .jp-cb__pill:hover { border-color: var(--jp-c-navy); color: var(--jp-c-navy); }
.jp-cb .jp-cb__pill.is-active, .jp-cb .jp-cb__pill.is-active:hover { background: var(--jp-c-navy); border-color: var(--jp-c-navy); color: #fff; }

/* ---------- Layout: sidebar + main ---------- */
.jp-cb__layout { display: grid; grid-template-columns: 275px minmax(0, 1fr); gap: 16px; align-items: start; }
.jp-cb__layout--full { grid-template-columns: minmax(0, 1fr); }
.jp-cb__main { min-width: 0; }
.jp-cb__side { padding: 16px 14px; border: 1px solid var(--jp-c-border); border-radius: 12px; background: #fff; }
.jp-cb__sidetitle { margin: 0 0 8px; padding: 0 4px; font-size: 16px; font-weight: 800; color: var(--jp-c-navy); }
.jp-cb__cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.jp-cb__cats li { margin: 0; }
.jp-cb .jp-cb__cat { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 6px; color: #1f2937; font-size: 14px; line-height: 1.3; }
.jp-cb .jp-cb__cat:hover { background: #f3f6fb; color: var(--jp-c-navy); }
.jp-cb .jp-cb__cat.is-active { background: #e8eefb; color: var(--jp-c-navy); font-weight: 700; }
.jp-cb__cico { flex: none; display: inline-flex; width: 16px; height: 16px; color: var(--jp-c-navy); }
.jp-cb__cico svg { width: 100%; height: 100%; }

/* ---------- Toolbar ---------- */
.jp-cb__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 12px; }
.jp-cb__count { font-size: 12.5px; color: var(--jp-c-muted); }
.jp-cb__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.jp-cb__sort { display: flex; align-items: center; gap: 8px; white-space: nowrap; margin: 0; font-size: 13px; color: #1f2937; }
.jp-cb__sort label { margin: 0; font-size: inherit; white-space: nowrap; flex: none; }
.jp-cb .jp-cb__sortsel { height: 34px; margin: 0; padding: 0 28px 0 10px; border: 1px solid #d5dbe6; border-radius: 6px; background-color: #fff; font-size: 13px; color: #111827; min-width: 96px; }
.jp-cb__views { display: flex; gap: 8px; }
.jp-cb .jp-cb__vbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; margin: 0; padding: 0 12px; border: 1px solid #d5dbe6; border-radius: 6px; background: #fff; color: #1f2937; font-size: 13px; font-weight: 600; cursor: pointer; }
.jp-cb .jp-cb__vbtn svg { width: 13px; height: 13px; }
.jp-cb .jp-cb__vbtn.is-active { background: var(--jp-c-navy); border-color: var(--jp-c-navy); color: #fff; }

/* ---------- Items ---------- */
.jp-cb--grid .jp-cb__items { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.jp-cb .jp-crs__top { flex-wrap: wrap; justify-content: space-between; }
.jp-cb .jp-crs__type { margin-left: 0; }
.jp-cb .jp-crs { border-radius: 12px; box-shadow: none; padding: 14px; gap: 12px; }
.jp-cb .jp-crs:hover { box-shadow: 0 4px 14px rgba(15, 27, 61, .08); }
.jp-cb .jp-crs__img { height: 135px; border-radius: 6px; }
.jp-cb .jp-crs__title { font-size: 19px; }
.jp-cb .jp-crs__prov, .jp-cb .jp-crs__meta { font-size: 13.5px; }
.jp-cb .jp-crs__btn { height: 44px; font-size: 14.5px; }
.jp-cb__empty { text-align: center; color: var(--jp-c-muted); padding: 32px 0; }
.jp-cb__empty a { color: var(--jp-c-navy); font-weight: 700; margin-left: 6px; }

/* List view */
.jp-cb--list .jp-cb__items { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.jp-cb--list .jp-crs { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 0; row-gap: 0; align-items: start; height: auto; padding: 12px; }
.jp-cb--list .jp-crs__body { display: contents; }
.jp-cb--list .jp-crs__img { grid-column: 1; grid-row: 1 / span 4; width: 200px; height: 113px; margin-right: 16px; }
.jp-cb--list .jp-crs__top, .jp-cb--list .jp-crs__title, .jp-cb--list .jp-crs__prov, .jp-cb--list .jp-crs__meta { grid-column: 2; }
.jp-cb--list .jp-crs__top { justify-content: flex-start; margin-bottom: 4px; }
.jp-cb--list .jp-crs__type { margin-left: 4px; }
.jp-cb--list .jp-crs__title { margin: 0 0 4px; font-size: 19px; }
.jp-cb--list .jp-crs__prov { margin-bottom: 6px; }
.jp-cb--list .jp-crs__meta { margin: 0; gap: 5px; }
.jp-cb--list .jp-crs__btn { grid-column: 3; grid-row: 1 / span 4; align-self: center; margin: 0 0 0 16px; min-width: 170px; padding: 0 18px; }

/* ---------- Pagination ---------- */
.jp-cb__pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.jp-cb .jp-cb__pg { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid #d5dbe6; border-radius: 6px; background: #fff; color: #1f2937; font-size: 13px; font-weight: 600; line-height: 1; }
.jp-cb a.jp-cb__pg:hover { border-color: var(--jp-c-navy); color: var(--jp-c-navy); }
.jp-cb .jp-cb__pg.is-current { background: var(--jp-c-navy); border-color: var(--jp-c-navy); color: #fff; }
.jp-cb .jp-cb__pg.is-disabled { color: #b4bcc9; background: #f6f7f9; cursor: default; }
.jp-cb .jp-cb__pg--dots { border-color: transparent; background: transparent; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
	.jp-cb--grid .jp-cb__items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.jp-cb__layout { grid-template-columns: 230px minmax(0, 1fr); }
	.jp-cb--list .jp-crs__img { width: 160px; height: 100px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.jp-cb__head { flex-direction: column; gap: 12px; }
	.jp-cb__title { font-size: 21px; }
	.jp-cb__search { flex: none; width: 100%; height: 38px; }
	.jp-cb__pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
	.jp-cb__pills::-webkit-scrollbar { display: none; }
	.jp-cb .jp-cb__pill { flex: none; padding: 6px 13px; }
	.jp-cb__layout { grid-template-columns: minmax(0, 1fr); }
	.jp-cb__side { display: none; }
	.jp-cb__count { flex: 1 1 100%; }
	.jp-cb__tools { width: 100%; justify-content: space-between; margin-left: 0; }
	.jp-cb--grid .jp-cb__items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.jp-cb--grid .jp-crs { padding: 8px; }
	.jp-cb--grid .jp-crs__img { height: 92px; }
	.jp-cb--grid .jp-crs__title { font-size: 14.5px; }
	.jp-cb--grid .jp-crs__meta, .jp-cb--grid .jp-crs__prov { font-size: 11.5px; }
	.jp-cb--grid .jp-crs__btn { height: 36px; font-size: 12.5px; }
	.jp-cb--list .jp-crs { grid-template-columns: auto minmax(0, 1fr); padding: 10px; }
	.jp-cb--list .jp-crs__img { width: 96px; height: 96px; margin-right: 12px; }
	.jp-cb--list .jp-crs__title { font-size: 15.5px; }
	.jp-cb--list .jp-crs__btn { grid-column: 1 / -1; grid-row: auto; margin: 10px 0 0; min-width: 0; height: 38px; }
	.jp-cb .jp-cb__vbtn span { display: inline; }
}
