/* Lion's Library front end */
.slb {
	--slb-navy: #114455;
	--slb-teal: #118877;
	--slb-gold: #dd9922;
	--slb-green: #99cc55;
	--slb-ink: #16333d;
	--slb-muted: #6b7f87;
	--slb-line: #e2e9eb;
	--slb-bg: #f7f9f9;
	--slb-radius: 14px;
	color: var(--slb-ink);
	font-size: 16px;
	line-height: 1.45;
}
.slb *, .slb *::before, .slb *::after { box-sizing: border-box; }
.slb-sr {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- search ---- */
.slb-head { margin-bottom: 22px; }
.slb-search { position: relative; max-width: 640px; margin: 0 auto; }
.slb-search-icon {
	position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
	width: 20px; height: 20px; fill: none; stroke: var(--slb-muted);
	stroke-width: 1.9; stroke-linecap: round; pointer-events: none;
}
.slb .slb-q {
	width: 100%; padding: 15px 46px 15px 50px; font-size: 16px;
	border: 2px solid var(--slb-line); border-radius: 999px;
	background: #fff; color: var(--slb-ink); box-shadow: 0 1px 2px rgba(17,68,85,.05);
	transition: border-color .15s, box-shadow .15s;
}
.slb .slb-q:focus {
	outline: none; border-color: var(--slb-teal);
	box-shadow: 0 0 0 4px rgba(17,136,119,.13);
}
.slb-q-clear {
	position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
	width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
	background: var(--slb-bg); color: var(--slb-muted); font-size: 20px; line-height: 1;
}
.slb-q-clear:hover { background: var(--slb-line); color: var(--slb-ink); }

/* ---- layout ---- */
.slb-body { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 32px; align-items: start; }
.slb-side-toggle { display: none; }

/* ---- sidebar ---- */
.slb-side {
	position: sticky; top: 16px; background: #fff; border: 1px solid var(--slb-line);
	border-radius: var(--slb-radius); padding: 4px 18px 10px; max-height: calc(100vh - 32px);
	overflow-y: auto;
}
.slb-side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.slb-side-head h2 { margin: 0; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--slb-navy); }
.slb-clear-all {
	border: 0; background: none; padding: 0; cursor: pointer; font-size: 13px;
	color: var(--slb-teal); text-decoration: underline; text-underline-offset: 2px;
}
.slb-group { border-top: 1px solid var(--slb-line); }
.slb-group h3 { margin: 0; font-size: inherit; }
.slb-group-toggle {
	width: 100%; display: flex; align-items: center; justify-content: space-between;
	gap: 8px; padding: 13px 0; border: 0; background: none; cursor: pointer;
	font-size: 14px; font-weight: 700; color: var(--slb-navy); text-align: left;
}
.slb-group-toggle svg { width: 12px; height: 8px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s; flex: none; }
.slb-group-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.slb-group-body { padding-bottom: 12px; }
.slb-group-find {
	width: 100%; padding: 7px 10px; margin-bottom: 8px; font-size: 13px;
	border: 1px solid var(--slb-line); border-radius: 8px; background: var(--slb-bg);
}
.slb-group.is-scroll .slb-opts { max-height: 230px; overflow-y: auto; }
.slb-opts { list-style: none; margin: 0; padding: 0; }
.slb-opts li { margin: 0; }
.slb-opt {
	display: flex; align-items: center; gap: 9px; padding: 5px 6px; margin: 0 -6px;
	border-radius: 7px; cursor: pointer; font-size: 14px;
}
.slb-opt:hover { background: var(--slb-bg); }
.slb-opt input { flex: none; width: 16px; height: 16px; accent-color: var(--slb-teal); margin: 0; }
.slb-opt-name { flex: 1 1 auto; min-width: 0; }
.slb-opt-n { flex: none; font-size: 12px; color: var(--slb-muted); font-variant-numeric: tabular-nums; }
.slb-opt.is-zero { opacity: .42; }

/* ---- results header ---- */
.slb-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.slb-count { margin: 0; font-size: 14px; color: var(--slb-muted); }
.slb-count strong { color: var(--slb-ink); }
.slb .slb-sort-select {
	font-size: 14px; padding: 7px 10px; border: 1px solid var(--slb-line);
	border-radius: 8px; background: #fff; color: var(--slb-ink);
}
.slb-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.slb-pill {
	display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px 5px 12px;
	border: 1px solid var(--slb-line); border-radius: 999px; background: #fff;
	font-size: 13px; cursor: pointer; color: var(--slb-ink);
}
.slb-pill:hover { border-color: var(--slb-teal); }
.slb-pill b { font-weight: 600; }
.slb-pill span { font-size: 15px; line-height: 1; color: var(--slb-muted); }

/* ---- grid ---- */
.slb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
.slb-card {
	display: flex; flex-direction: column; background: #fff; border: 1px solid var(--slb-line);
	border-radius: var(--slb-radius); overflow: hidden; text-decoration: none; color: inherit;
	transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.slb-card:hover, .slb-card:focus-visible {
	transform: translateY(-3px); border-color: #cfe0dd;
	box-shadow: 0 10px 22px -12px rgba(17,68,85,.34); text-decoration: none; color: inherit;
}
/* ---- thumbnail frame ----
   Every image sits in the same sand frame at the same size, so a grid of
   mixed sources (worksheet scans, photos, graphics) still scans evenly. */
.slb-thumb {
	position: relative; aspect-ratio: 4 / 3; overflow: hidden;
	background: #f4efe6;
	background-image:
		radial-gradient(circle at 22% 18%, rgba(255,255,255,.85), transparent 46%),
		linear-gradient(160deg, #faf6ef 0%, #f1ebe0 100%);
	border-bottom: 1px solid var(--slb-line);
	display: flex; align-items: center; justify-content: center;
	padding: 12px;
}
.slb-thumb img {
	max-width: 100%; max-height: 100%;
	width: auto; height: auto;
	object-fit: contain;
	display: block;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 2px 8px -2px rgba(17,68,85,.22), 0 0 0 1px rgba(17,68,85,.06);
	transition: transform .18s ease;
}
.slb-card:hover .slb-thumb img { transform: scale(1.03); }

/* photos fill the frame instead of floating in it */
.slb-thumb.is-photo { padding: 0; }
.slb-thumb.is-photo img {
	width: 100%; height: 100%; object-fit: cover;
	border-radius: 0; box-shadow: none; background: none;
}

/* nothing to show */
.slb-thumb.is-empty::after {
	content: ""; width: 46px; height: 46px; border-radius: 12px;
	background: rgba(17,68,85,.07);
}
.slb-badge {
	position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 999px;
	font-size: 11px; font-weight: 700; letter-spacing: .03em; color: #fff;
	background: var(--slb-navy); box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.slb-badge[data-t^="Printable"] { background: var(--slb-navy); }
.slb-badge[data-t^="Digital"]   { background: var(--slb-teal); }
.slb-badge[data-t="Article"]    { background: #7a6aa8; }
.slb-badge[data-t="Activity"]   { background: var(--slb-gold); }
.slb-body-txt { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.slb-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--slb-navy); }
.slb-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.slb-tag {
	font-size: 11px; padding: 3px 8px; border-radius: 999px;
	background: var(--slb-bg); color: var(--slb-muted); border: 1px solid var(--slb-line);
}
.slb-tag.is-grade { background: #eef7f1; color: #3d7a52; border-color: #d8ebdf; }

/* ---- empty + more ---- */
.slb-empty { padding: 46px 20px; text-align: center; color: var(--slb-muted); }
.slb-empty p { margin: 0 0 6px; }
.slb-empty strong { color: var(--slb-ink); font-size: 17px; }
.slb-empty .slb-clear-all { margin-top: 10px; font-size: 14px; }
.slb-more-wrap { text-align: center; margin-top: 30px; }
.slb .slb-more {
	padding: 12px 30px; border: 2px solid var(--slb-navy); border-radius: 999px;
	background: #fff; color: var(--slb-navy); font-size: 15px; font-weight: 700; cursor: pointer;
	transition: background .15s, color .15s;
}
.slb .slb-more:hover { background: var(--slb-navy); color: #fff; }

/* ---- mobile ---- */
@media (max-width: 860px) {
	.slb-body { grid-template-columns: 1fr; gap: 0; }
	.slb-side-toggle {
		display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
		padding: 10px 18px; border: 2px solid var(--slb-line); border-radius: 999px;
		background: #fff; font-size: 15px; font-weight: 700; color: var(--slb-navy); cursor: pointer;
	}
	.slb-side-count {
		display: inline-flex; align-items: center; justify-content: center;
		min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px;
		background: var(--slb-teal); color: #fff; font-size: 12px;
	}
	.slb-side { position: static; max-height: none; margin-bottom: 20px; }
	.slb-side[hidden] { display: none; }
	.slb-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
	.slb-meta { flex-wrap: wrap; }
}
