/*
 * Grace at Wellington — Content Model block styles.
 * Extracted from the gracewellington-2025 theme (R407) so the dynamic blocks render styled under ANY
 * theme. Every colour uses var(--wp--preset--color--…, #fallback) — where a theme (e.g. Kadence) has no
 * matching preset, the hard-coded fallback applies, so the blocks look right regardless of theme.
 */

/* --- Navigator wrapper: a min-height so a thin result set doesn't let the footer ride up --- */
.gw-nav {
	min-height: 60vh;
}

/* --- Content-type bar: return-to-parent + "where you are" + a Sermons | Devotionals toggle --- */
.gw-typebar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin: 0 0 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--wp--preset--color--line, #e2e5ee);
}
.gw-typebar__where {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.4rem;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
}
.gw-typebar__parent {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--accent, #3f62c4);
}
.gw-typebar__parent:hover,
.gw-typebar__parent:focus {
	text-decoration: underline;
}
.gw-typebar__arrow {
	font-size: 1.1em;
	line-height: 1;
}
.gw-typebar__sep {
	color: var(--wp--preset--color--line, #9aa2b8);
}
.gw-typebar__ctxtype {
	color: var(--wp--preset--color--contrast-2, #5a6079);
}
.gw-typebar__ctxname {
	font-weight: 600;
	color: var(--wp--preset--color--primary-dark, #20205a);
}
.gw-typebar__streams {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.gw-typechip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--wp--preset--color--line, #e2e5ee);
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--primary-dark, #20205a);
	background: var(--wp--preset--color--base, #fff);
}
.gw-typechip:hover,
.gw-typechip:focus {
	border-color: var(--wp--preset--color--accent, #3f62c4);
}
.gw-typechip.is-active {
	color: var(--wp--preset--color--base, #fff);
	background: var(--wp--preset--color--accent, #3f62c4);
	border-color: var(--wp--preset--color--accent, #3f62c4);
}
.gw-typechip__n {
	font-size: 0.85em;
	opacity: 0.75;
}
.gw-typechip.is-active .gw-typechip__n {
	opacity: 0.9;
}

/* --- Related resources block (R313) — contextual View on single sermon/devotional pages --- */
.gw-related {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--line, #e2e5ee);
}
.gw-related__title {
	font-size: var(--wp--preset--font-size--large, 1.5rem);
	margin: 0 0 1.25rem;
}
.gw-related__section {
	margin-bottom: 1.5rem;
}
.gw-related__heading {
	font-size: 1.05rem;
	margin: 0 0 0.5rem;
}
.gw-related__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gw-related__list li {
	margin: 0 0 0.35rem;
}
.gw-related__type {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--accent, #3f62c4);
	margin-right: 0.4rem;
}
.gw-related__more {
	margin: 0.5rem 0 0;
	font-size: 0.85rem;
	font-weight: 600;
}
/* Author-by-series list: inline chips, each with a per-author count. */
.gw-related__list--series {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.gw-related__list--series li {
	margin: 0;
}
.gw-related__list--series a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.6rem;
	background: var(--wp--preset--color--accent-tint, #eef1fb);
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.9rem;
}
.gw-related__count {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--wp--preset--color--base, #fff);
	background: var(--wp--preset--color--accent, #3f62c4);
	border-radius: 999px;
	padding: 0.02rem 0.4rem;
	min-width: 1.2rem;
	text-align: center;
}

/* --- Book index block (R313) — "explore by book", counts advertise library size --- */
.gw-bookindex {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 0.5rem;
}
.gw-bookindex__item a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 0.85rem;
	border-radius: 6px;
	text-decoration: none;
	color: var(--wp--preset--color--primary-dark, #20205a);
}
.gw-bookindex__count {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--wp--preset--color--base, #fff);
	border-radius: 999px;
	padding: 0.05rem 0.5rem;
	min-width: 1.4rem;
	text-align: center;
}
/* Old Testament = brand blue; New Testament = green (the new covenant). */
.gw-bookindex__item--ot a { background: #eaeefc; }
.gw-bookindex__item--ot .gw-bookindex__count { background: #3f62c4; }
.gw-bookindex__item--nt a { background: #e6f2ea; }
.gw-bookindex__item--nt .gw-bookindex__count { background: #2f8f5b; }
.gw-bookindex__empty {
	color: #5a5a6a;
	font-style: italic;
}
/* Legend for the OT/NT colours. */
.gw-bookindex-legend {
	display: flex;
	gap: 1.1rem;
	margin: 0 0 0.75rem;
	font-size: 0.82rem;
	color: #5a5a6a;
}
.gw-bookindex-legend span::before {
	content: "";
	display: inline-block;
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 3px;
	margin-right: 0.35rem;
	vertical-align: -1px;
}
.gw-bookindex-legend__ot::before { background: #3f62c4; }
.gw-bookindex-legend__nt::before { background: #2f8f5b; }

/* --- Series tiles (R313) — the index lead: current/recent series with hero + count --- */
.gw-series-tiles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.25rem;
}
.gw-series-tiles__item a {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--wp--preset--color--line, #e2e5ee);
	border-radius: 10px;
	overflow: hidden;
	background: var(--wp--preset--color--base, #fff);
	height: 100%;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.gw-series-tiles__item a:hover {
	box-shadow: 0 6px 20px rgba(32, 32, 90, 0.12);
	transform: translateY(-2px);
}
.gw-series-tiles__thumb {
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--wp--preset--color--accent-tint, #eef1fb);
}
.gw-series-tiles__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.gw-series-tiles__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--wp--preset--color--base, #fff);
	background: var(--wp--preset--color--primary, #213a8f);
}
.gw-series-tiles__name {
	font-weight: 700;
	color: var(--wp--preset--color--primary-dark, #20205a);
	padding: 0.75rem 0.9rem 0.1rem;
}
.gw-series-tiles__count {
	font-size: 0.82rem;
	color: #5a5a6a;
	padding: 0 0.9rem 0.85rem;
}

/* --- Book archive (R322) — a book's sermons/devotionals ordered by chapter, with facet filters --- */
/* Horizontal filter rows (Chapter, Preacher/author): a scrollable chip row that FILTERS via query args,
   led by an "All" deselect chip. The selected chip is filled (is-active). */
.gw-bookfilter {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	margin: 0 0 0.85rem;
}
.gw-bookfilter:last-of-type {
	margin-bottom: 1.75rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--wp--preset--color--line, #e2e5ee);
}
.gw-bookfilter__label {
	flex: 0 0 auto;
	min-width: 4.5rem;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #5a5a6a;
	padding-top: 0.3rem;
}
.gw-bookfilter__list {
	list-style: none;
	margin: 0;
	padding: 0.15rem 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}
.gw-bookfilter__list li {
	margin: 0;
	flex: 0 0 auto;
}
.gw-bookfilter__chip {
	display: inline-block;
	text-align: center;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary-dark, #20205a);
	background: var(--wp--preset--color--accent-tint, #eef1fb);
}
.gw-bookfilter__chip:hover,
.gw-bookfilter__chip:focus {
	background: #dde3f7;
}
.gw-bookfilter__chip.is-active {
	background: var(--wp--preset--color--accent, #3f62c4);
	color: var(--wp--preset--color--base, #fff);
}

.gw-bookarch {
	margin: 0;
}
.gw-bookarch__chapter {
	font-size: 1.25rem;
	color: var(--wp--preset--color--primary-dark, #20205a);
	margin: 2rem 0 0.75rem;
}
.gw-bookarch__chapter:first-child {
	margin-top: 0;
}
.gw-bookarch__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gw-bookarch__item {
	margin: 0 0 1.5rem;
}
.gw-bookarch__link {
	font-size: 1.25rem;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
}
.gw-bookarch__type {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--accent, #3f62c4);
	margin-right: 0.4rem;
	vertical-align: 0.1em;
}
.gw-bookarch__meta {
	font-size: 0.85rem;
	color: #5a5a6a;
	margin-top: 0.2rem;
}
.gw-bookarch__excerpt {
	margin: 0.4rem 0 0;
	color: #3a3a46;
}
.gw-bookarch__empty {
	color: #5a5a6a;
	font-style: italic;
}

/* --- Shared navigator card + list (R408) — the ONE item card + list used by every navigator
   (series, author, date, search, book). Same look as the book-archive item it generalises. --- */
.gw-navlist {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gw-navcard {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	margin: 0 0 1.5rem;
}
/* Card thumbnail (R413): a small featured image, or a tinted placeholder with the title's initial. */
.gw-navcard__thumb {
	flex: 0 0 auto;
	display: block;
	width: 84px;
	height: 84px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--wp--preset--color--accent-tint, #eef1fb);
}
.gw-navcard__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.gw-navcard__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--wp--preset--color--base, #fff);
	background: var(--wp--preset--color--primary, #213a8f);
}
.gw-navcard__body {
	min-width: 0; /* let the title/excerpt wrap inside the flex row instead of overflowing */
}
.gw-navcard__link {
	font-size: 1.25rem;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
}
.gw-navcard__type {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--accent, #3f62c4);
	margin-right: 0.4rem;
	vertical-align: 0.1em;
}
.gw-navcard__meta {
	font-size: 0.85rem;
	color: #5a5a6a;
	margin-top: 0.2rem;
}
.gw-navcard__excerpt {
	margin: 0.4rem 0 0;
	color: #3a3a46;
}
.gw-navcard-empty {
	color: #5a5a6a;
	font-style: italic;
}

/* "View more / View all series" link under a capped landing lead (recent-list, series-tiles). */
.gw-navmore {
	margin: 0.85rem 0 0;
}
.gw-navmore__link {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--accent, #3f62c4);
}
.gw-navmore__link:hover,
.gw-navmore__link:focus {
	text-decoration: underline;
}
.gw-navmore__arrow {
	font-size: 1.05em;
	line-height: 1;
}

/* Date navigator month headings + search group headings — echo the book-archive chapter heading. */
.gw-navdate__month,
.gw-navsearch__group {
	font-size: 1.25rem;
	color: var(--wp--preset--color--primary-dark, #20205a);
	margin: 2rem 0 0.75rem;
}
.gw-navdate__month:first-child,
.gw-navsearch__group:first-child {
	margin-top: 0;
}

/* --- Return-across INDEX (R408) — the "explore other series / contributors / years" foot of each
   navigator, and the standalone index blocks. A wrapped chip list; the current term is muted. --- */
.gw-navindex-wrap {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--line, #e2e5ee);
}
.gw-navindex-wrap__title {
	font-size: 1.05rem;
	margin: 0 0 0.85rem;
	color: var(--wp--preset--color--primary-dark, #20205a);
}
.gw-navindex {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.gw-navindex__item a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.7rem;
	background: var(--wp--preset--color--accent-tint, #eef1fb);
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary-dark, #20205a);
}
.gw-navindex__item a:hover,
.gw-navindex__item a:focus {
	background: #dde3f7;
}
.gw-navindex__item.is-current a {
	background: var(--wp--preset--color--accent, #3f62c4);
	color: var(--wp--preset--color--base, #fff);
}
.gw-navindex__count {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--wp--preset--color--base, #fff);
	background: var(--wp--preset--color--accent, #3f62c4);
	border-radius: 999px;
	padding: 0.02rem 0.4rem;
	min-width: 1.2rem;
	text-align: center;
}
.gw-navindex__item.is-current .gw-navindex__count {
	color: var(--wp--preset--color--accent, #3f62c4);
	background: var(--wp--preset--color--base, #fff);
}
.gw-navindex--years .gw-navindex__yr { display: inline; }
.gw-navindex__empty {
	color: #5a5a6a;
	font-style: italic;
}
