/**
 * OTR Lesson Library
 *
 * Frontend styles for the [otr_lesson_library] shortcode: filters, card grid,
 * access badges, and pagination. Layout is responsive — 3 columns on desktop,
 * 2 on tablet, 1 on mobile.
 */

/* Container -------------------------------------------------------------- */
.otr-lesson-library {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.5rem 1rem;
	box-sizing: border-box;
}

.otr-library-header {
	margin-bottom: 1.5rem;
}

.otr-library-title {
	margin: 0 0 0.25rem;
	font-size: 1.75rem;
	line-height: 1.2;
}

.otr-library-intro {
	margin: 0;
	color: #555;
}

/* Filters ---------------------------------------------------------------- */
.otr-library-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem 1rem;
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: #f7f7f9;
	border: 1px solid #e2e2e8;
	border-radius: 8px;
}

.otr-filter-field {
	display: flex;
	flex-direction: column;
	min-width: 140px;
	flex: 1 1 140px;
}

.otr-filter-search {
	flex: 2 1 220px;
}

.otr-filter-field label {
	margin-bottom: 0.25rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #333;
}

.otr-filter-field input[type="search"],
.otr-filter-field select {
	width: 100%;
	padding: 0.45rem 0.6rem;
	font-size: 0.9375rem;
	border: 1px solid #c8c8d0;
	border-radius: 6px;
	background: #fff;
	box-sizing: border-box;
}

.otr-filter-actions {
	display: flex;
	align-items: flex-end;
}

.otr-filter-submit {
	padding: 0.5rem 1.1rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #fff;
	background: #1d4ed8;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

.otr-filter-submit:hover,
.otr-filter-submit:focus {
	background: #1740b0;
}

/* Card grid -------------------------------------------------------------- */
.otr-library-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}

.otr-library-empty {
	padding: 2rem 1rem;
	text-align: center;
	color: #666;
	background: #f7f7f9;
	border: 1px dashed #d0d0d8;
	border-radius: 8px;
}

/* Card ------------------------------------------------------------------- */
.otr-lesson-card {
	display: flex;
	flex-direction: column;
	padding: 1.1rem 1.2rem;
	background: #fff;
	border: 1px solid #e2e2e8;
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.otr-lesson-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.otr-lesson-card.is-locked {
	border-color: #e6d3a3;
	background: #fffdf6;
}

.otr-card-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.6rem;
}

.otr-card-title {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.3;
}

.otr-card-title a {
	color: #15151a;
	text-decoration: none;
}

.otr-card-title a:hover,
.otr-card-title a:focus {
	text-decoration: underline;
}

/* Meta list -------------------------------------------------------------- */
.otr-card-meta {
	list-style: none;
	margin: 0 0 0.6rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.75rem;
	font-size: 0.8125rem;
	color: #555;
}

.otr-card-meta .otr-meta-key {
	font-weight: 600;
	color: #333;
}

.otr-card-description {
	margin: 0 0 0.9rem;
	font-size: 0.9rem;
	line-height: 1.45;
	color: #444;
}

/* Access badges ---------------------------------------------------------- */
.otr-access-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	flex: 0 0 auto;
	padding: 0.2rem 0.55rem;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
	border-radius: 999px;
	white-space: nowrap;
}

.otr-access-free {
	color: #0a6b2d;
	background: #e3f6e8;
}

.otr-access-locked {
	color: #8a5b00;
	background: #fdf0d0;
}

.otr-lock-icon {
	font-size: 0.8rem;
	line-height: 1;
}

/* Card footer / CTA ------------------------------------------------------ */
.otr-card-footer {
	margin-top: auto;
	padding-top: 0.4rem;
}

.otr-card-cta {
	display: inline-block;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
}

.otr-cta-available {
	color: #1d4ed8;
}

.otr-cta-subscribe {
	color: #8a5b00;
}

.otr-cta-download {
	margin-left: 12px;
	color: #047857;
}

.otr-card-cta:hover,
.otr-card-cta:focus {
	text-decoration: underline;
}

/* Pagination ------------------------------------------------------------- */
.otr-pagination {
	margin-top: 1.75rem;
}

.otr-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.otr-pagination a,
.otr-pagination span {
	display: inline-block;
	padding: 0.4rem 0.7rem;
	font-size: 0.875rem;
	color: #1d4ed8;
	text-decoration: none;
	border: 1px solid #d0d0d8;
	border-radius: 6px;
	background: #fff;
}

.otr-pagination a:hover,
.otr-pagination a:focus {
	background: #f0f4ff;
}

.otr-pagination .current {
	color: #fff;
	background: #1d4ed8;
	border-color: #1d4ed8;
}

.otr-pagination .dots {
	border-color: transparent;
	background: transparent;
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 900px) {
	.otr-library-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.otr-library-cards {
		grid-template-columns: 1fr;
	}

	.otr-library-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.otr-filter-field,
	.otr-filter-search {
		flex: 1 1 auto;
		min-width: 0;
	}
}
