/*
 * Lesson list filter bar.
 *
 * Only the filter controls are styled here — the cards themselves keep the
 * existing .tasket rules from style.css untouched, which is the point of
 * matching the old markup exactly.
 */

.og-lesson-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
}

.og-lesson-filters .og-filter {
	font: inherit;
	cursor: pointer;
	padding: 0.5em 1em;
	border: 1px solid currentColor;
	border-radius: 2em;
	background: transparent;
	color: inherit;
	opacity: 0.65;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.og-lesson-filters .og-filter:hover,
.og-lesson-filters .og-filter:focus-visible {
	opacity: 1;
}

/* Filled pill. `color` has to change with `background` or the label vanishes into
   it — the first version used mix-blend-mode for this and hid the text. */
.og-lesson-filters .og-filter.is-active {
	opacity: 1;
	background: #2f2f2f;
	border-color: #2f2f2f;
	color: #fff;
}

.og-filter-count {
	display: inline-block;
	margin-left: 0.4em;
	font-size: 0.85em;
	opacity: 0.7;
}

.og-lesson-empty {
	padding: 1rem 0;
	opacity: 0.7;
}

.og-lesson-more {
	display: block;
	margin: 1.5rem auto 0;
	cursor: pointer;
}

/*
 * The module is a fixed-height panel: .container.yourtasks is height:76vh and
 * #all-lessons is height:100%. Ajax Load More's own container carried
 * `overflow:auto; max-height:calc(100% - 8em)`, which is what kept the list
 * scrolling INSIDE the white card. Without it the list grows unbounded and
 * spills over the module's background.
 *
 * Flex column rather than reinstating the 8em magic number, so the scroll area
 * measures itself against the real height of the title and filter bar.
 */
@media screen and (min-width: 768px) {
	#all-lessons {
		display: flex;
		flex-direction: column;
	}

	#all-lessons .module-title,
	#all-lessons .og-lesson-filters,
	#all-lessons .og-lesson-more,
	#all-lessons .og-lesson-empty {
		flex: 0 0 auto;
	}

	#all-lessons .og-lesson-list {
		flex: 1 1 auto;
		overflow-y: auto;
		/* Without min-height a flex child refuses to shrink below its content,
		   so the overflow never engages and the panel blows out anyway. */
		min-height: 0;
	}
}

/* [hidden] must win over any display rule the theme sets on .tasket. */
.og-lesson-list .tasket[hidden],
.og-lesson-empty[hidden],
.og-lesson-more[hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- notebook */

.og-notebook-search {
	margin-bottom: 1rem;
}

.og-notebook-q {
	width: 100%;
	font: inherit;
	padding: 0.6em 0.9em;
	border: 1px solid currentColor;
	border-radius: 2em;
	background: transparent;
	color: inherit;
	box-sizing: border-box;
}

.og-notebook-empty {
	padding: 1rem 0;
	opacity: 0.7;
}

.og-modal-loading {
	padding: 1.5rem 0;
	opacity: 0.6;
}

/* Same reason as the lesson list: [hidden] has to beat the theme's display rules. */
.og-note-row[hidden],
.og-notebook-empty[hidden] {
	display: none !important;
}
