/**
 * The Library — combined Blog + Resources (+ Videos coming soon).
 *
 * Source of truth: docs/design/library-page-mockup.html. Selectors
 * here are scoped under `.songreps-library` so they don't bleed into
 * the rest of the theme — but the structure (filters, featured, grid,
 * card, chip, coming) maps 1:1 to the mockup.
 *
 * Media treatment (spec §4): featured images render grayscale + a
 * SOLID brand-color wash at 0.7 opacity; media-less posts render the
 * same assigned color as a solid block. Per-post color is assigned
 * deterministically server-side via inline `--c` (post ID mod 6 over
 * the 6-color palette in the shortcode).
 */

.songreps-library {
	max-width: 1040px;
	margin: 0 auto;
	padding: 40px 24px 80px;
	font-family: 'Inter', system-ui, sans-serif;
	color: #2a3744;
}

.songreps-library .lib-head h1 {
	font-family: 'Manrope', system-ui, sans-serif;
	font-weight: 700;
	font-size: 32px;
	letter-spacing: -0.02em;
	margin: 0 0 6px;
	color: #2a3744;
}

.songreps-library .lib-head p {
	font-size: 15px;
	color: #8c8478;
	margin: 0 0 24px;
}

.songreps-library .filters {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	border-bottom: 0.5px solid rgba(42, 55, 68, 0.08);
	margin-bottom: 28px;
}

.songreps-library .filters button {
	background: none;
	border: none;
	cursor: pointer;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: #5b6f7d;
	padding: 10px 14px;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.songreps-library .filters button:hover {
	color: #2a3744;
}

.songreps-library .filters button.is-active {
	color: #b58655;
	font-weight: 600;
	border-bottom-color: #b58655;
}

/* Media treatment — see file header. */
.songreps-library .media {
	position: relative;
	overflow: hidden;
	background: var(--c);
}

.songreps-library .media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	filter: grayscale(1) contrast(1.05);
}

.songreps-library .media__wash {
	position: absolute;
	inset: 0;
	background: var(--c);
	opacity: 0.7;
}

.songreps-library .media--none::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--c);
}

.songreps-library .media .play {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none; /* clicks pass through to the card's stretched link */
}

.songreps-library .media .play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent rgba(255, 250, 240, 0.95);
}

/* Members badge — Option B corner marker; renders only on members-only
   posts (the shortcode gates on $members && $is_member). pointer-events:
   none so the card's stretched link still receives the click. Anchor
   top-right on grid cards, top-left on the wide featured card. */
.songreps-library .media__badge {
	position: absolute;
	z-index: 3;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 3px 8px 3px 7px;
	border-radius: 999px;
	background: rgba(255, 250, 240, 0.94);
	color: #2a3744;
	box-shadow: 0 1px 2px rgba(42, 55, 68, 0.2);
	pointer-events: none;
}

.songreps-library .media__badge svg {
	display: block;
}

.songreps-library .featured .media__badge {
	top: 12px;
	left: 12px;
	right: auto;
}

/* Featured — one connected card; image column = ((100% - gap) / 2). */
.songreps-library .featured {
	position: relative; /* anchor for the stretched-link ::after */
	display: grid;
	grid-template-columns: calc((100% - 24px) / 2) 1fr;
	background: #fffaf0;
	border: 0.5px solid rgba(42, 55, 68, 0.1);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(42, 55, 68, 0.08);
	margin-bottom: 24px;
}

.songreps-library .featured .media {
	grid-column: 1;
	min-height: 240px;
}

.songreps-library .featured__body {
	grid-column: 2;
	padding: 26px 28px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.songreps-library .featured__body h2 {
	font-family: 'Manrope', system-ui, sans-serif;
	font-weight: 700;
	font-size: 24px;
	letter-spacing: -0.01em;
	margin: 10px 0 8px;
	color: #2a3744;
}

.songreps-library .featured__body h2 a {
	color: inherit;
	text-decoration: none;
}

.songreps-library .featured__body p {
	font-size: 14.5px;
	line-height: 1.55;
	color: #46555f;
	margin: 0 0 12px;
}

.songreps-library .grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

.songreps-library .card {
	position: relative; /* anchor for the stretched-link ::after */
	background: #fffaf0;
	border: 0.5px solid rgba(42, 55, 68, 0.1);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(42, 55, 68, 0.08);
	display: flex;
	flex-direction: column;
}

/* Stretched link — the title anchor covers the whole card so the entire
   surface (media included) is one click target. ONE anchor = one tab stop
   for screen readers / keyboard, not a duplicate link wrapping the media.
   Same pattern for featured. */
.songreps-library .card__title a::after,
.songreps-library .featured__body h2 a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.songreps-library .card .media {
	height: 150px;
}

.songreps-library .card__body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.songreps-library .card__title {
	font-family: 'Manrope', system-ui, sans-serif;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.3;
	margin: 8px 0 6px;
	color: #2a3744;
}

.songreps-library .card__title a {
	color: inherit;
	text-decoration: none;
}

.songreps-library .card__lede {
	font-size: 13.5px;
	line-height: 1.55;
	color: #46555f;
	margin: 0 0 12px;
	flex: 1 1 auto;
}

.songreps-library .card__meta {
	font-size: 12px;
	color: #5b6f7d;
}

.songreps-library .chip {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 999px;
	width: max-content;
}

.songreps-library .chip--blog {
	background: rgba(119, 145, 161, 0.14);
	color: #4d5f6b;
}

.songreps-library .chip--resource {
	background: rgba(122, 140, 111, 0.16);
	color: #4d5e44;
}

.songreps-library .chip--video {
	background: rgba(181, 134, 85, 0.14);
	color: #8a6238;
}

/* Videos coming-soon panel. Display toggled by library.js. */
.songreps-library .coming {
	display: none;
	text-align: center;
	padding: 60px 20px;
	background: #fffaf0;
	border: 0.5px dashed rgba(42, 55, 68, 0.2);
	border-radius: 12px;
}

.songreps-library .coming h3 {
	font-family: 'Manrope', system-ui, sans-serif;
	font-weight: 700;
	font-size: 20px;
	margin: 0 0 6px;
	color: #2a3744;
}

.songreps-library .coming p {
	font-size: 14.5px;
	color: #8c8478;
	margin: 0;
}

/* Empty-state cards (no public posts at all, or "no public but
   members-only exists" for logged-out). Re-uses the .coming panel
   shape so the surface stays coherent. */
.songreps-library .empty {
	text-align: center;
	padding: 60px 20px;
	background: #fffaf0;
	border: 0.5px dashed rgba(42, 55, 68, 0.2);
	border-radius: 12px;
}

.songreps-library .empty h3 {
	font-family: 'Manrope', system-ui, sans-serif;
	font-weight: 700;
	font-size: 20px;
	margin: 0 0 6px;
	color: #2a3744;
}

.songreps-library .empty p {
	font-size: 14.5px;
	color: #8c8478;
	margin: 0 0 12px;
}

.songreps-library .empty a {
	color: #b58655;
	text-decoration: none;
	font-weight: 600;
}

@media (max-width: 720px) {
	.songreps-library .featured {
		grid-template-columns: 1fr;
	}
	.songreps-library .featured .media,
	.songreps-library .featured__body {
		grid-column: 1;
	}
	.songreps-library .grid {
		grid-template-columns: 1fr;
	}
}
