/* ── Commune Library Search ──────────────────────────────────────── */
/* Same palette as the podcast search tool; own file so the two tools
 * can't break each other. */

:root {
	--linen: #f4f0e3;
	--linen-dark: #e8e2d0;
	--sage: #9aa583;
	--sage-dark: #7d8c6e;
	--forest: #3d5b47;
	--forest-dark: #2c3e33;
	--desert: #c8856a;
	--stone: #6b7d8a;
	--ink: #263029;
}

body {
	background: var(--linen);
	color: var(--ink);
	font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	margin: 0;
}

h1, h2, h3, h4, .ls-serif {
	font-family: 'Libre Baskerville', Georgia, serif;
}

.btn-forest {
	background: var(--forest);
	border-color: var(--forest);
	color: var(--linen);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.btn-forest:hover { background: var(--forest-dark); border-color: var(--forest-dark); color: #fff; }

.btn-outline-forest {
	border-color: var(--forest);
	color: var(--forest);
}
.btn-outline-forest:hover { background: var(--forest); color: var(--linen); }
.btn-outline-forest:disabled { opacity: .4; }

/* ── Boot + auth ─────────────────────────────────────────────────── */

.ls-boot {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ls-auth {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(160deg, var(--linen) 0%, var(--linen-dark) 100%);
}

.ls-auth-card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 4px 24px rgba(44, 53, 48, .15);
	padding: 2.5rem;
	max-width: 420px;
	width: 100%;
	margin: 1.5rem;
	text-align: center;
}

.ls-auth-logo { height: 40px; margin-bottom: 1.25rem; }
.ls-auth-card h2 { font-size: 1.4rem; margin-bottom: .75rem; }
.ls-auth-note { font-size: .8rem; color: var(--stone); margin: .75rem 0 0; }

/* ── Search bar ──────────────────────────────────────────────────── */

.ls-searchbar {
	background: var(--forest-dark);
	padding: 1rem 0;
	position: sticky;
	top: 56px;              /* clears the shared header */
	z-index: 900;
}

.ls-searchbar-inner {
	max-width: 980px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.ls-tabs { display: flex; gap: .35rem; margin-bottom: .7rem; }

.ls-tab {
	background: transparent;
	border: 1px solid rgba(244, 240, 227, .3);
	color: rgba(244, 240, 227, .8);
	border-radius: 20px;
	font-size: .82rem;
	padding: .2rem .95rem;
	cursor: pointer;
}
.ls-tab:hover { border-color: var(--sage); color: var(--linen); }
.ls-tab.active { background: var(--sage); border-color: var(--sage); color: var(--forest-dark); font-weight: 600; }

.ls-input-wrap {
	display: flex;
	align-items: center;
	gap: .5rem;
	background: #fff;
	border-radius: 10px;
	padding: .35rem .35rem .35rem .9rem;
}

.ls-input-wrap > .bi-search { color: var(--stone); }

.ls-input-wrap input[type="search"] {
	border: none;
	box-shadow: none !important;
	flex: 1;
	font-size: 1rem;
	padding: .45rem .25rem;
}

.ls-filters {
	display: flex;
	align-items: center;
	gap: .6rem;
	margin-top: .7rem;
	flex-wrap: wrap;
	color: rgba(244, 240, 227, .75);
	font-size: .85rem;
}

.ls-filter-group { display: contents; }

.ls-mini {
	width: 130px;
	height: 32px;
	font-size: .85rem;
	padding: .2rem .55rem;
}

/* Placeholders read as typed text at the browser default — keep them
 * legible but obviously not content. `opacity` because Firefox dims
 * placeholders on top of the colour. */
.ls-input-wrap input[type="search"]::placeholder,
.ls-mini::placeholder {
	color: #949e99;
	opacity: 1;
}

.ls-select {
	width: auto;
	padding-right: 1.6rem;
	background-position: right .4rem center;
	cursor: pointer;
}
.ls-select:disabled { opacity: .45; cursor: not-allowed; }

.ls-clear { color: rgba(244, 240, 227, .6); font-size: .85rem; text-decoration: none; padding: 0 .3rem; }
.ls-clear:hover { color: var(--linen); }

.ls-spacer { flex: 1; }

.ls-doclink { color: var(--sage); text-decoration: none; font-size: .85rem; white-space: nowrap; }
.ls-doclink:hover { color: var(--linen); }

/* ── Results ─────────────────────────────────────────────────────── */

.ls-main {
	max-width: 980px;
	margin: 0 auto;
	padding: 1.5rem 1.5rem 4rem;
}

.ls-status {
	color: var(--stone);
	font-size: .9rem;
	margin-bottom: 1rem;
	min-height: 1.2rem;
}

/* Status line while a full result set is being paged in. */
.ls-loading {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
}
.ls-loading .spinner-border {
	width: .85rem;
	height: .85rem;
	border-width: .13em;
	color: var(--sage);
}

.ls-note {
	background: rgba(200, 133, 106, .12);
	border-left: 3px solid var(--desert);
	padding: .5rem .85rem;
	border-radius: 0 6px 6px 0;
	font-size: .82rem;
	color: #55605a;
	margin-bottom: 1rem;
}

.ls-empty {
	text-align: center;
	color: var(--stone);
	padding: 3.5rem 1rem;
}
.ls-empty i { font-size: 2.2rem; color: var(--sage); display: block; margin-bottom: .75rem; }

.ls-card {
	background: #fff;
	border: 1px solid rgba(44, 62, 51, .08);
	border-radius: 12px;
	padding: 1rem 1.15rem;
	margin-bottom: .8rem;
	display: flex;
	gap: 1rem;
	transition: box-shadow .15s ease;
}
.ls-card:hover { box-shadow: 0 4px 16px rgba(44, 53, 48, .1); }

.ls-art {
	width: 92px;
	height: 62px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--linen-dark);
}
.ls-art.square { width: 72px; height: 72px; }

.ls-card-body { flex: 1; min-width: 0; }

.ls-title {
	font-family: 'Libre Baskerville', Georgia, serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--forest-dark);
	margin: 0 0 .25rem;
	cursor: pointer;
	line-height: 1.35;
}
.ls-title:hover { color: var(--sage-dark); }

.ls-meta {
	font-size: .8rem;
	color: var(--stone);
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	margin-bottom: .4rem;
	align-items: center;
}

.ls-link {
	color: var(--forest);
	text-decoration: none;
	cursor: pointer;
	border-bottom: 1px dotted rgba(61, 91, 71, .4);
}
.ls-link:hover { color: var(--sage-dark); }

.ls-badge {
	display: inline-block;
	font-size: .68rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: .12rem .45rem;
	border-radius: 4px;
	background: rgba(154, 165, 131, .22);
	color: var(--forest);
}
.ls-badge.plays { background: rgba(200, 133, 106, .2); color: #a3573a; }

.ls-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.ls-tag {
	background: rgba(154, 165, 131, .2);
	color: var(--forest);
	border-radius: 20px;
	padding: .1rem .6rem;
	font-size: .75rem;
	cursor: pointer;
}
.ls-tag:hover { background: rgba(154, 165, 131, .38); }

.ls-desc {
	font-size: .87rem;
	line-height: 1.55;
	color: #45514a;
	margin-bottom: .4rem;
}

.ls-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-top: 1.5rem;
	color: var(--stone);
	font-size: .85rem;
}

/* ── Detail ──────────────────────────────────────────────────────── */

.ls-detail {
	background: var(--linen);
	min-height: calc(100vh - 56px);
}

.ls-detail-inner {
	max-width: 880px;
	margin: 0 auto;
	padding: 1.5rem 1.5rem 5rem;
}

.ls-detail-close { color: var(--forest); text-decoration: none; padding-left: 0; }

.ls-detail-head { display: flex; gap: 1.25rem; margin: .5rem 0 1.5rem; }
.ls-detail-head img { width: 190px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.ls-detail-head img.round { width: 110px; height: 110px; border-radius: 50%; }
.ls-detail-head h1 { font-size: 1.4rem; line-height: 1.35; margin-bottom: .4rem; }

.ls-section {
	background: #fff;
	border: 1px solid rgba(44, 62, 51, .08);
	border-radius: 12px;
	padding: 1.15rem 1.35rem;
	margin-bottom: 1rem;
}
.ls-section h3 {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--stone);
	font-family: 'Nunito Sans', sans-serif;
	font-weight: 700;
	margin-bottom: .8rem;
}
.ls-section p { line-height: 1.65; }
.ls-section p:last-child { margin-bottom: 0; }

.ls-facts { display: grid; grid-template-columns: 150px 1fr; gap: .35rem 1rem; font-size: .88rem; }
.ls-facts dt { color: var(--stone); font-weight: 400; }
.ls-facts dd { margin: 0; }

.ls-links { display: flex; flex-wrap: wrap; gap: .5rem; }

.ls-lesson-row {
	display: flex;
	gap: .75rem;
	align-items: baseline;
	padding: .4rem 0;
	border-bottom: 1px solid rgba(44, 62, 51, .07);
	font-size: .9rem;
}
.ls-lesson-row:last-child { border-bottom: none; }
.ls-lesson-num { color: var(--desert); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; width: 2.5rem; flex-shrink: 0; }
.ls-lesson-sub { color: var(--stone); font-size: .8rem; }

.ls-transcript {
	max-height: 560px;
	overflow-y: auto;
	white-space: pre-wrap;
	font-size: .88rem;
	line-height: 1.65;
	color: #45514a;
}

.ls-teacher-chip {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	background: rgba(154, 165, 131, .18);
	border-radius: 20px;
	padding: .15rem .7rem .15rem .18rem;
	font-size: .82rem;
	color: var(--forest);
	cursor: pointer;
	margin: 0 .3rem .3rem 0;
}
.ls-teacher-chip:hover { background: rgba(154, 165, 131, .35); }
.ls-teacher-chip .ls-avatar {
	width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--linen-dark);
}

@media (max-width: 640px) {
	.ls-art { display: none; }
	.ls-detail-head { flex-direction: column; }
	.ls-detail-head img { width: 100%; max-width: 260px; }
	.ls-facts { grid-template-columns: 1fr; }
	.ls-searchbar { position: static; }
}
