/* ABOUTME: Front-end styles for the CHMF sermon archive viewer and single template. */
/* ABOUTME: Mockup-aligned list rows, filters, buttons, and related sermon cards. */

.chmf-sermon-archive,
.chmf-sermon-single,
.chmf-sermon-single__related {
	--chmf-sermon-muted: var(--pl-color-neutral-500, #667085);
	--chmf-sermon-body: var(--pl-color-neutral-900, #1d2939);
	--chmf-sermon-accent: var(--pl-color-primary, #358551);
	--chmf-sermon-surface: var(--pl-color-neutral-50, #fafafa);
	--chmf-sermon-border: rgba(0, 0, 0, 0.08);
	--chmf-sermon-radius: var(--pl-radius-md, 0.5rem);
}

.chmf-sermon-archive {
	max-width: var(--pl-width-wide, 1100px);
	margin-inline: auto;
	padding: var(--pl-space-8, 2rem) var(--pl-gutter, 1.5rem) var(--pl-space-10, 2.5rem);
}

.chmf-sermon-archive__header {
	text-align: center;
	margin-bottom: var(--pl-space-6, 1.5rem);
}

.chmf-sermon-archive__title {
	margin: 0 0 var(--pl-space-4, 1rem);
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	font-weight: var(--pl-weight-bold, 700);
	color: var(--chmf-sermon-body);
}

.chmf-sermon-archive__intro {
	max-width: 42rem;
	margin: 0 auto;
	font-size: var(--pl-text-base, 1rem);
	line-height: 1.6;
	color: var(--chmf-sermon-muted);
}

.chmf-sermon-viewer__mount:not(.chmf-sermon-viewer__mount--active) {
	display: none;
}

/* ===========================================================================
   FILTER PANEL
   One control system, so search / comboboxes / switch / date pill read as
   siblings: a single height, a single radius, a single border-and-focus
   treatment. Before this they were 52 / 44 / 37px tall with two radii and
   two font sizes, which is what made the area look assembled rather than
   designed. Geometry lives in these three custom properties.
   ======================================================================== */

.chmf-sermon-archive {
	--chmf-control-h: 2.75rem;
	--chmf-control-radius: var(--chmf-sermon-radius);
	--chmf-control-gap: var(--pl-space-3, 0.75rem);
}

.chmf-sermon-viewer__filters {
	display: grid;
	gap: var(--chmf-control-gap);
	margin-bottom: var(--pl-space-5, 1.25rem);
}

/* Shared shell for every bordered control in the panel. */
.chmf-sermon-viewer__search,
.chmf-combo__control,
.chmf-switch,
.chmf-sermon-viewer__dates-toggle,
.chmf-sermon-viewer__field input[type="date"] {
	box-sizing: border-box;
	min-height: var(--chmf-control-h);
	border: 1px solid var(--chmf-sermon-border);
	border-radius: var(--chmf-control-radius);
	background: #fff;
	font-family: inherit;
	font-size: var(--pl-text-base, 1rem);
	color: var(--chmf-sermon-body);
	transition:
		border-color var(--pl-duration-fast, 150ms) ease,
		box-shadow var(--pl-duration-fast, 150ms) ease;
}

.chmf-sermon-viewer__search:hover,
.chmf-combo__control:hover,
.chmf-switch:hover,
.chmf-sermon-viewer__dates-toggle:hover,
.chmf-sermon-viewer__field input[type="date"]:hover {
	border-color: rgba(0, 0, 0, 0.18);
}

.chmf-sermon-viewer__search:focus,
.chmf-combo__control:focus-within,
.chmf-sermon-viewer__field input[type="date"]:focus,
.chmf-switch:has( input:focus-visible ),
.chmf-sermon-viewer__dates-toggle:focus-visible {
	outline: none;
	border-color: var(--chmf-sermon-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--chmf-sermon-accent) 18%, transparent);
}

@media (prefers-reduced-motion: reduce) {
	.chmf-sermon-viewer__search,
	.chmf-combo__control,
	.chmf-switch,
	.chmf-sermon-viewer__dates-toggle,
	.chmf-sermon-viewer__field input[type="date"] {
		transition: none;
	}
}

/* --- Search: the panel's primary control, so it holds the full width. --- */

.chmf-sermon-viewer__search-wrap {
	position: relative;
}

.chmf-sermon-viewer__search {
	width: 100%;
	padding: 0 2.75rem 0 1rem;
}

.chmf-sermon-viewer__search::placeholder {
	color: var(--chmf-sermon-muted);
	opacity: 1;
}

.chmf-sermon-viewer__search-icon {
	position: absolute;
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
	display: block;
	width: 1.125rem;
	height: 1.125rem;
	color: var(--chmf-sermon-muted);
	pointer-events: none;
}

.chmf-sermon-viewer__search-icon svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
}

/* --- Refine row: two comboboxes plus the secondary controls, one line. --- */

.chmf-sermon-viewer__filter-grid {
	display: grid;
	gap: var(--chmf-control-gap);
	grid-template-columns: minmax(0, 1fr);
}

/* Medium: the two comboboxes share the row, secondary controls sit beneath. */
@media (min-width: 48rem) {
	.chmf-sermon-viewer__filter-grid {
		grid-template-columns: repeat(12, minmax(0, 1fr));
		align-items: end;
	}

	.chmf-sermon-viewer__field--preacher,
	.chmf-sermon-viewer__field--book {
		grid-column: span 6;
	}

	.chmf-sermon-viewer__controls {
		grid-column: 1 / -1;
	}
}

/*
 * Wide: everything on one line. The switch and date pill need ~282px side by
 * side; a 4/12 cell only clears that past ~57rem, so the breakpoint sits at
 * 62rem rather than 48rem — below it they wrapped and broke the row.
 */
@media (min-width: 62rem) {
	.chmf-sermon-viewer__field--preacher,
	.chmf-sermon-viewer__field--book {
		grid-column: span 4;
	}

	.chmf-sermon-viewer__controls {
		grid-column: span 4;
		justify-content: flex-end;
	}
}

/* Secondary controls sit beside labelled fields, so they align to the input
   baseline rather than the top of the label. */
.chmf-sermon-viewer__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--pl-space-2, 0.5rem);
	min-height: var(--chmf-control-h);
}

/* Switch — a real checkbox underneath, so keyboard and forms behave normally. */
.chmf-switch {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0 0.875rem;
	color: var(--chmf-sermon-muted);
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.chmf-switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.chmf-switch__track {
	position: relative;
	display: block;
	flex-shrink: 0;
	width: 1.75rem;
	height: 1rem;
	border-radius: 999px;
	background: var(--pl-color-neutral-300, #cfcfcb);
	transition: background-color var(--pl-duration-fast, 150ms) ease;
}

.chmf-switch__thumb {
	position: absolute;
	top: 0.125rem;
	left: 0.125rem;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transition: transform var(--pl-duration-fast, 150ms) ease;
}

.chmf-switch input:checked ~ .chmf-switch__track {
	background: var(--chmf-sermon-accent);
}

.chmf-switch input:checked ~ .chmf-switch__track .chmf-switch__thumb {
	transform: translateX(0.75rem);
}

.chmf-switch:has( input:checked ) {
	border-color: color-mix(in srgb, var(--chmf-sermon-accent) 40%, #fff);
	color: var(--chmf-sermon-body);
}

@media (prefers-reduced-motion: reduce) {
	.chmf-switch__track,
	.chmf-switch__thumb {
		transition: none;
	}
}

/* === Audio: archive badge + single-page player =========================== */

/*
 * Floated rather than inline: sitting right after the title text it read as
 * punctuation. On the right edge it forms a scannable column instead, and
 * floating keeps it out of the heading's inline flow so search <mark>
 * highlighting still wraps normally.
 */
.chmf-sermon-row__audio {
	float: right;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.0625rem;
	height: 1.0625rem;
	margin-inline-start: 1.5rem;
	color: var(--chmf-sermon-muted);
	opacity: 0.75;
}

.chmf-sermon-row:hover .chmf-sermon-row__audio {
	color: var(--chmf-sermon-accent);
	opacity: 1;
}

.chmf-sermon-row__audio svg,
.chmf-sermon-audio__icon svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.chmf-sermon-audio {
	margin: 0 0 var(--pl-space-6, 1.5rem);
	padding: var(--pl-space-4, 1rem);
	border: 1px solid var(--chmf-sermon-border);
	border-radius: var(--chmf-sermon-radius);
	background: var(--chmf-sermon-surface);
}

.chmf-sermon-audio__label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 var(--pl-space-3, 0.75rem);
	font-size: var(--pl-text-sm, 0.875rem);
	font-weight: var(--pl-weight-medium, 500);
	color: var(--chmf-sermon-body);
}

.chmf-sermon-audio__icon {
	display: block;
	flex-shrink: 0;
	width: 1.125rem;
	height: 1.125rem;
	color: var(--chmf-sermon-accent);
}

.chmf-sermon-audio__player {
	display: block;
	width: 100%;
}

/* === Date range disclosure ================================================
   Rarely used, and two empty mm/dd/yyyy inputs are a lot of visual noise to
   carry for it — so it collapses to one quiet line until opened. */

.chmf-sermon-viewer__dates {
	position: relative;
}

.chmf-sermon-viewer__dates-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	width: fit-content;
	padding: 0 0.875rem;
	color: var(--chmf-sermon-muted);
	cursor: pointer;
	list-style: none;
	user-select: none;
	white-space: nowrap;
}

.chmf-sermon-viewer__dates-toggle::-webkit-details-marker {
	display: none;
}

/* Own marker so it can sit after the label and rotate on open. */
.chmf-sermon-viewer__dates-toggle::after {
	content: "";
	width: 0.4rem;
	height: 0.4rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translate(-0.1em, -0.1em);
	transition: transform var(--pl-duration-fast, 150ms) ease;
}

.chmf-sermon-viewer__dates[open] .chmf-sermon-viewer__dates-toggle::after {
	transform: rotate(-135deg) translate(-0.1em, -0.1em);
}

.chmf-sermon-viewer__dates[open] .chmf-sermon-viewer__dates-toggle {
	color: var(--chmf-sermon-body);
	border-color: rgba(0, 0, 0, 0.18);
}

/* An active range is a filter, so it earns the same accent tint as the switch. */
.chmf-sermon-viewer__dates--active .chmf-sermon-viewer__dates-toggle {
	border-color: color-mix(in srgb, var(--chmf-sermon-accent) 40%, #fff);
	background: color-mix(in srgb, var(--chmf-sermon-accent) 10%, #fff);
	color: color-mix(in srgb, var(--chmf-sermon-accent) 75%, #000);
}

.chmf-sermon-viewer__dates-toggle:focus-visible {
	outline: 2px solid var(--chmf-sermon-accent);
	outline-offset: 2px;
}

/* Popover, matching the combobox dropdown so the strip stays one line tall. */
.chmf-sermon-viewer__dates-fields {
	position: absolute;
	z-index: 25;
	top: calc(100% + 0.375rem);
	left: 0;
	display: grid;
	gap: var(--pl-space-3, 0.75rem);
	width: max-content;
	max-width: min(24rem, calc(100vw - 2rem));
	padding: var(--pl-space-4, 1rem);
	background: #fff;
	border: 1px solid var(--chmf-sermon-border);
	border-radius: var(--chmf-sermon-radius);
	box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 30rem) {
	.chmf-sermon-viewer__dates-fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.chmf-sermon-viewer__dates-clear {
		grid-column: 1 / -1;
	}
}

.chmf-sermon-viewer__dates-clear {
	justify-self: start;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: var(--pl-text-sm, 0.875rem);
	color: var(--chmf-sermon-accent);
	text-decoration: underline;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.chmf-sermon-viewer__dates-toggle,
	.chmf-sermon-viewer__dates-toggle::after {
		transition: none;
	}
}

.chmf-sermon-viewer__field label,
.chmf-sermon-viewer__field-label {
	display: block;
	margin-bottom: var(--pl-space-2, 0.5rem);
	font-size: var(--pl-text-sm, 0.875rem);
	font-weight: var(--pl-weight-medium, 500);
	color: var(--chmf-sermon-body);
}

.chmf-sermon-viewer__apply {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Date inputs inherit the shared shell; only sizing is local. */
.chmf-sermon-viewer__field input[type="date"] {
	width: 100%;
	padding: 0 0.75rem;
}

/* No-JS fallback only: the island replaces these with the combobox. */
.chmf-sermon-viewer__field select {
	width: 100%;
	box-sizing: border-box;
	min-height: var(--chmf-control-h, 2.75rem);
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--chmf-sermon-border);
	border-radius: var(--chmf-control-radius, 0.5rem);
	font-size: var(--pl-text-base, 1rem);
	font-family: inherit;
	background: #fff;
	color: var(--chmf-sermon-body);
}

/* No-JS fallback only: the island replaces these with the combobox. */
.chmf-sermon-viewer__field select[multiple] {
	height: auto;
	padding: 0.25rem;
}

/* === Combobox (multi-select + type-ahead) ===================================
   Hand-rolled against the ARIA combobox pattern: no jQuery, no Select2.
   Shares the border, radius, and height of the native controls beside it. */

.chmf-combo {
	position: relative;
}

.chmf-combo__label {
	display: block;
	margin-bottom: var(--pl-space-2, 0.5rem);
	font-size: var(--pl-text-sm, 0.875rem);
	font-weight: var(--pl-weight-medium, 500);
	color: var(--chmf-sermon-body);
}

/* Shell (height, border, radius, focus) comes from the filter-panel system. */
.chmf-combo__control {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.375rem;
	padding: 0.3125rem 2.25rem 0.3125rem 0.5rem;
	cursor: text;
}

.chmf-combo__chips {
	display: contents;
	margin: 0;
	padding: 0;
	list-style: none;
}

.chmf-combo__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	max-width: 100%;
	padding: 0.1875rem 0.25rem 0.1875rem 0.5rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--chmf-sermon-accent) 12%, #fff);
	color: color-mix(in srgb, var(--chmf-sermon-accent) 75%, #000);
	font-size: var(--pl-text-sm, 0.875rem);
	line-height: 1.3;
}

.chmf-combo__chip > span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chmf-combo__chip-remove,
.chmf-combo__clear {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0;
	border: 0;
	background: none;
	color: currentColor;
	cursor: pointer;
	border-radius: 999px;
	opacity: 0.65;
	transition: opacity var(--pl-duration-fast, 150ms) ease;
}

/*
 * The glyphs read best small, but a 16–18px control is under the 24×24 CSS px
 * floor in WCAG 2.5.8 (Target Size, Minimum) — rough on touch. Grow the hit
 * area with a centred pseudo-element and leave the icon alone.
 */
.chmf-combo__chip-remove::after,
.chmf-combo__clear::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 24px;
	height: 24px;
	transform: translate(-50%, -50%);
}

.chmf-combo__chip-remove {
	width: 1.125rem;
	height: 1.125rem;
}

.chmf-combo__chip-remove svg,
.chmf-combo__clear svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
}

.chmf-combo__chip-remove:hover,
.chmf-combo__chip-remove:focus-visible,
.chmf-combo__clear:hover,
.chmf-combo__clear:focus-visible {
	opacity: 1;
}

.chmf-combo__input {
	flex: 1 1 6ch;
	min-width: 6ch;
	border: 0;
	outline: none;
	padding: 0.25rem 0;
	background: transparent;
	font-size: var(--pl-text-base, 1rem);
	font-family: inherit;
	color: var(--chmf-sermon-body);
}

.chmf-combo__input::placeholder {
	color: var(--chmf-sermon-muted);
}

.chmf-combo__clear {
	position: absolute;
	right: 1.625rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1rem;
	height: 1rem;
	color: var(--chmf-sermon-muted);
}

.chmf-combo__caret {
	position: absolute;
	right: 0.6875rem;
	top: 50%;
	transform: translateY(-50%);
	width: 0.75rem;
	height: 0.75rem;
	color: var(--chmf-sermon-muted);
	pointer-events: none;
	transition: transform var(--pl-duration-fast, 150ms) ease;
}

.chmf-combo__caret svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.chmf-combo__control.is-open .chmf-combo__caret {
	transform: translateY(-50%) rotate(180deg);
}

.chmf-combo__list {
	position: absolute;
	z-index: 30;
	inset-inline: 0;
	top: calc(100% + 0.25rem);
	/* ~9 full rows plus a sliver of the next, so it reads as scrollable. */
	max-height: 19.5rem;
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 0;
	padding: 0.25rem;
	list-style: none;
	background: #fff;
	border: 1px solid var(--chmf-sermon-border);
	border-radius: var(--chmf-sermon-radius);
	box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.25);
}

/*
 * macOS hides overlay scrollbars until you scroll, so force a standing one.
 * Chrome ignores ::-webkit-scrollbar once `scrollbar-width` is set, so the
 * standard properties are scoped to engines without the pseudo-element.
 */
.chmf-combo__list::-webkit-scrollbar {
	width: 0.5rem;
}

@supports not selector(::-webkit-scrollbar) {
	.chmf-combo__list {
		scrollbar-width: thin;
		scrollbar-color: rgba(0, 0, 0, 0.28) transparent;
	}
}

.chmf-combo__list::-webkit-scrollbar-track {
	background: transparent;
}

.chmf-combo__list::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.24);
	border-radius: 999px;
	border: 2px solid #fff;
}

.chmf-combo__list::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.38);
}

.chmf-combo__option {
	display: flex;
	align-items: center;
	/* The theme's body line-height made these rows ~2x taller than they need
	   to be; pin it locally so the list stays compact. */
	padding: 0.3125rem 0.625rem;
	line-height: 1.35;
	border-radius: calc(var(--chmf-sermon-radius) - 0.125rem);
	font-size: var(--pl-text-base, 1rem);
	color: var(--chmf-sermon-body);
	cursor: pointer;
}

.chmf-combo__option[data-active="true"] {
	background: color-mix(in srgb, var(--chmf-sermon-accent) 10%, #fff);
}

.chmf-combo__option-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chmf-combo__empty {
	padding: 0.625rem;
	font-size: var(--pl-text-sm, 0.875rem);
	color: var(--chmf-sermon-muted);
}

@media (prefers-reduced-motion: reduce) {
	.chmf-combo__control,
	.chmf-combo__caret,
	.chmf-combo__chip-remove,
	.chmf-combo__clear {
		transition: none;
	}
}

.chmf-sermon-viewer__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--pl-space-3, 0.75rem);
	margin-bottom: var(--pl-space-4, 1rem);
	padding-top: var(--pl-space-4, 1rem);
	border-top: 1px solid var(--chmf-sermon-border);
}

.chmf-sermon-viewer__count {
	margin: 0;
	font-size: var(--pl-text-sm, 0.875rem);
	color: var(--chmf-sermon-muted);
}

.chmf-sermon-viewer__clear {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	color: var(--chmf-sermon-accent);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.chmf-sermon-viewer__list {
	display: grid;
	gap: var(--pl-space-4, 1rem);
}

.chmf-sermon-row {
	border: 1px solid var(--chmf-sermon-border);
	border-radius: var(--chmf-sermon-radius);
	background: var(--chmf-sermon-surface);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
	transition:
		transform var(--pl-duration-fast, 0.15s) ease,
		box-shadow var(--pl-duration-fast, 0.15s) ease,
		border-color var(--pl-duration-fast, 0.15s) ease,
		background-color var(--pl-duration-fast, 0.15s) ease;
}

.chmf-sermon-row:hover {
	background: #fff;
	border-color: rgba(53, 133, 81, 0.24);
	box-shadow:
		0 2px 4px rgba(16, 24, 40, 0.06),
		0 10px 24px rgba(16, 24, 40, 0.1);
	transform: translateY(-3px);
}

.chmf-sermon-row__link {
	display: block;
	padding: var(--pl-space-4, 1rem) var(--pl-space-5, 1.25rem);
	text-decoration: none;
	color: inherit;
}

.chmf-sermon-row__title {
	margin: 0 0 var(--pl-space-2, 0.5rem);
	font-size: 1.375rem;
	font-weight: var(--pl-weight-bold, 700);
	color: var(--chmf-sermon-body);
	line-height: 1.25;
	text-decoration: none;
}

.chmf-sermon-row__meta {
	margin: 0;
}

.chmf-sermon-row__meta.chmf-sermon-meta {
	font-size: var(--pl-text-sm, 0.875rem);
}

.chmf-sermon-row__excerpt {
	margin: 0.5rem 0 0;
	font-size: var(--pl-text-sm, 0.875rem);
	line-height: 1.55;
	color: var(--chmf-sermon-body);
	opacity: 0.88;
}

.chmf-sermon-search-mark {
	background: color-mix(in srgb, var(--chmf-sermon-accent) 24%, transparent);
	color: inherit;
	font-weight: inherit;
	padding: 0 0.08em;
	border-radius: 0.125rem;
}

.chmf-sermon-viewer__empty,
.chmf-sermon-viewer__loading {
	margin: 0;
	padding: var(--pl-space-6, 1.5rem);
	text-align: center;
	color: var(--chmf-sermon-muted);
}

/*
 * In-flight state. Results stay mounted and simply recede, so the page keeps
 * its height while the request lands — no collapse-and-regrow between filters.
 */
.chmf-sermon-viewer__list.is-loading,
.chmf-sermon-viewer__count.is-loading {
	opacity: 0.45;
	transition: opacity var(--pl-duration-fast, 150ms) ease;
}

.chmf-sermon-viewer__list.is-loading {
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.chmf-sermon-viewer__list.is-loading,
	.chmf-sermon-viewer__count.is-loading {
		transition: none;
	}
}

.chmf-sermon-viewer__pagination {
	margin-top: var(--pl-space-6, 1.5rem);
	text-align: center;
}

.chmf-sermon-viewer__pagination .page-numbers {
	display: inline-block;
	margin: 0 0.25rem;
	padding: 0.375rem 0.625rem;
	text-decoration: none;
	color: var(--chmf-sermon-body);
}

.chmf-sermon-viewer__pagination .current {
	font-weight: var(--pl-weight-bold, 700);
	color: var(--chmf-sermon-accent);
}

/* Single sermon */

.chmf-sermon-meta__list {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	row-gap: 0.25rem;
}

.chmf-sermon-single__meta .chmf-sermon-meta__list {
	justify-content: center;
}

.chmf-sermon-meta__item + .chmf-sermon-meta__item::before {
	content: '·';
	margin-inline: 0.625rem;
	opacity: 0.45;
}

.chmf-sermon-meta {
	margin: 0;
	font-size: var(--pl-text-sm, 0.9375rem);
	line-height: 1.5;
	color: var(--chmf-sermon-muted);
}

.chmf-sermon-single-wrap {
	display: block;
}

.chmf-sermon-single {
	--chmf-single-read: min(100%, 42rem);
	--chmf-single-gap: 0.875rem;
	--chmf-single-gap-lg: 1.25rem;
	max-width: var(--pl-width-wide, 1100px);
	margin-inline: auto;
	padding: var(--pl-space-6, 1.5rem) var(--pl-gutter, 1.5rem) var(--pl-space-8, 2rem);
}

.chmf-sermon-single__main {
	max-width: var(--chmf-single-read);
	margin-inline: auto;
	text-align: center;
}

.chmf-sermon-single__header {
	margin-bottom: var(--chmf-single-gap-lg);
}

.chmf-sermon-single__eyebrow {
	display: inline-block;
	margin-bottom: 0.625rem;
	font-size: 0.75rem;
	font-weight: var(--pl-weight-semibold, 600);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--chmf-sermon-accent);
	text-decoration: none;
}

.chmf-sermon-single__eyebrow:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.chmf-sermon-single__title {
	margin: 0 0 0.375rem;
	font-size: clamp(1.875rem, 3.2vw, 2.375rem);
	font-weight: var(--pl-weight-bold, 700);
	line-height: 1.15;
	letter-spacing: -0.015em;
	color: var(--chmf-sermon-body);
}

.chmf-sermon-single__meta.chmf-sermon-meta {
	font-size: 0.9375rem;
}

.chmf-sermon-single__image {
	margin-bottom: var(--chmf-single-gap-lg);
}

.chmf-sermon-single__image img {
	width: 100%;
	height: auto;
	border-radius: var(--chmf-sermon-radius);
}

.chmf-sermon-single__content {
	text-align: left;
	margin-bottom: var(--chmf-single-gap);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--chmf-sermon-body);
}

.chmf-sermon-single__content :where(p) {
	margin-block: 0 0.875rem;
}

.chmf-sermon-single__content :where(p:empty) {
	display: none;
}

.chmf-sermon-single__content :where(p:last-child) {
	margin-bottom: 0;
}

.chmf-sermon-single__content :where(a) {
	color: var(--chmf-sermon-accent);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.chmf-sermon-single__content :where(a:hover) {
	color: var(--chmf-sermon-body);
}

.chmf-sermon-single__content :where(blockquote) {
	margin: 1rem 0;
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--chmf-sermon-accent);
	background: var(--chmf-sermon-surface);
	border-radius: 0 var(--chmf-sermon-radius) var(--chmf-sermon-radius) 0;
	font-style: italic;
	color: var(--chmf-sermon-body);
}

.chmf-sermon-single__content :where([style*="text-align: center"]) {
	text-align: left !important;
}

.chmf-sermon-single__listen-label {
	margin: 0.75rem 0 0.375rem;
	font-size: 0.6875rem;
	font-weight: var(--pl-weight-semibold, 600);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--chmf-sermon-muted);
	text-align: left;
}

.chmf-sermon-single__content .wp-block-audio {
	margin-block: 0 var(--chmf-single-gap);
	padding: 0;
	background: transparent;
	border: 0;
}

.chmf-sermon-single__content .wp-block-audio audio {
	width: 100%;
	border-radius: var(--chmf-sermon-radius);
}

.chmf-sermon-single__taxonomies {
	margin: 0;
	padding-top: var(--chmf-single-gap);
	border-top: 1px solid var(--chmf-sermon-border);
	font-size: var(--pl-text-sm, 0.875rem);
	line-height: 1.45;
	color: var(--chmf-sermon-muted);
	text-align: center;
}

.chmf-sermon-single__taxonomy-label {
	display: inline;
	margin-right: 0.35rem;
	color: var(--chmf-sermon-muted);
}

.chmf-sermon-single__taxonomy-label::after {
	content: ':';
}

.chmf-sermon-single__taxonomies a {
	color: var(--chmf-sermon-accent);
	text-decoration: none;
	font-weight: var(--pl-weight-medium, 500);
}

.chmf-sermon-single__taxonomies a:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.chmf-sermon-single__filed,
.chmf-sermon-single__preachers,
.chmf-sermon-single__books {
	margin: 0 0 0.25rem;
}

.chmf-sermon-single__books:last-child,
.chmf-sermon-single__filed:last-child,
.chmf-sermon-single__preachers:last-child {
	margin-bottom: 0;
}

.chmf-sermon-single__taxonomy-sep {
	margin-inline: 0.15rem;
}

.chmf-sermon-single__related {
	margin-top: var(--chmf-single-gap-lg);
	padding-top: var(--chmf-single-gap-lg);
	border-top: 1px solid var(--chmf-sermon-border);
	text-align: center;
}

.chmf-sermon-single__related-heading {
	margin: 0 0 var(--chmf-single-gap);
	font-size: 1.125rem;
	font-weight: var(--pl-weight-bold, 700);
	letter-spacing: -0.01em;
	color: var(--chmf-sermon-body);
}

.chmf-sermon-single__related-grid {
	display: grid;
	gap: 0.75rem;
	text-align: left;
}

@media (min-width: 48rem) {
	.chmf-sermon-single__related-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.875rem;
	}
}

.chmf-sermon-related-card {
	display: flex;
	height: 100%;
	border: 1px solid var(--chmf-sermon-border);
	border-radius: var(--chmf-sermon-radius);
	background: #fff;
	transition: border-color var(--pl-duration-fast, 0.15s) ease, box-shadow var(--pl-duration-fast, 0.15s) ease;
}

.chmf-sermon-related-card:hover {
	border-color: rgba(53, 133, 81, 0.28);
	box-shadow: 0 4px 16px rgba(16, 24, 40, 0.07);
}

.chmf-sermon-related-card__link {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 0.875rem 1rem;
	text-decoration: none;
	color: inherit;
	min-height: 100%;
}

.chmf-sermon-related-card__reason {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	align-self: flex-start;
	gap: 0.35rem;
	margin-bottom: 0.5rem;
	padding: 0.2rem 0.5rem;
	border: 1px solid rgba(53, 133, 81, 0.18);
	border-radius: 999px;
	background: var(--chmf-sermon-surface);
	font-size: 0.75rem;
	font-weight: var(--pl-weight-medium, 500);
	line-height: 1.3;
	color: var(--chmf-sermon-accent);
}

.chmf-sermon-related-card__reason-sep {
	opacity: 0.55;
}

.chmf-sermon-related-card__title {
	margin: 0 0 auto;
	padding-bottom: 0.5rem;
	font-size: 1rem;
	font-weight: var(--pl-weight-bold, 700);
	line-height: 1.35;
	color: var(--chmf-sermon-body);
}

.chmf-sermon-related-card__meta {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin-top: auto;
	padding-top: 0.5rem;
	border-top: 1px solid var(--chmf-sermon-border);
}

.chmf-sermon-related-card__meta-line {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--chmf-sermon-muted);
}

.chmf-sermon-related-card__meta-line--primary {
	font-weight: var(--pl-weight-medium, 500);
	color: var(--chmf-sermon-body);
}

.chmf-sermon-related-card__meta-line--passage {
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--chmf-sermon-muted);
}

.chmf-sermon-related-card__meta-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	row-gap: 0.125rem;
}

.chmf-sermon-related-card__meta-item + .chmf-sermon-related-card__meta-item::before {
	content: '·';
	margin-inline: 0.5rem;
	opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
	.chmf-sermon-row,
	.chmf-sermon-related-card {
		transition: none;
	}

	.chmf-sermon-row:hover {
		transform: none;
	}
}
