/**
 * Advanced page template library.
 *
 * @package New_Bloggers_Theme
 */

.cst-template-library__header {
	margin-bottom: 2rem;
}

.cst-template-library__description {
	max-width: 760px;
	margin: -0.5rem 0 1rem;
	color: var(--cst-color-muted);
	font-size: 1rem;
	line-height: 1.7;
}

.cst-template-library__intro {
	max-width: 860px;
}

.cst-template-section {
	margin: 0 0 2.5rem;
}

.cst-template-section__description {
	max-width: 700px;
	margin: -0.75rem 0 1.25rem;
	color: var(--cst-color-muted);
}

.cst-template-post-loop {
	display: grid;
	gap: var(--cst-gap);
}

.cst-template-post-loop--cols-1 {
	grid-template-columns: 1fr;
}

.cst-template-post-loop--cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cst-template-post-loop--cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cst-template-post-loop--cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cst-template-post-loop--standard,
.cst-template-post-loop--timeline {
	display: flex;
	flex-direction: column;
}

.cst-template-post-loop--masonry {
	column-count: 3;
	column-gap: var(--cst-gap);
	display: block;
}

.cst-template-post-loop--masonry .cst-card {
	break-inside: avoid;
	margin-bottom: var(--cst-gap);
}

.cst-template-split {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
	gap: var(--cst-gap);
	align-items: start;
}

.cst-template-split__list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.cst-template-category-grid,
.cst-template-author-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--cst-gap);
}

.cst-template-category-card,
.cst-template-author-card,
.cst-template-callout,
.cst-template-empty {
	display: block;
	padding: 1.25rem;
	background: var(--cst-color-surface);
	border: 1px solid var(--cst-color-border);
	border-radius: var(--cst-radius);
	box-shadow: var(--cst-shadow);
	color: inherit;
}

.cst-template-category-card:hover,
.cst-template-author-card:hover {
	border-color: var(--cst-color-accent);
	text-decoration: none;
}

.cst-template-category-card__name,
.cst-template-author-card__name {
	display: block;
	font-family: var(--cst-font-heading);
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1.3;
}

.cst-template-category-card__count,
.cst-template-author-card__bio {
	display: block;
	margin-top: 0.45rem;
	color: var(--cst-color-muted);
	font-size: 0.875rem;
	line-height: 1.55;
}

.cst-template-author-card {
	text-align: center;
}

.cst-template-author-card__avatar {
	width: 72px;
	height: 72px;
	margin: 0 auto 0.75rem;
	border-radius: 50%;
	object-fit: cover;
}

.cst-template-callout {
	border-left: 4px solid var(--cst-color-accent);
}

.cst-template-callout p,
.cst-template-empty {
	margin: 0;
	color: var(--cst-color-muted);
}

.cst-template-library--minimal .cst-template-library__header,
.cst-template-library--journal .cst-template-library__header,
.cst-template-library--columnist .cst-template-library__header {
	text-align: center;
}

.cst-template-library--minimal .cst-template-library__description,
.cst-template-library--journal .cst-template-library__description,
.cst-template-library--columnist .cst-template-library__description,
.cst-template-library--minimal .cst-template-library__intro,
.cst-template-library--journal .cst-template-library__intro,
.cst-template-library--columnist .cst-template-library__intro {
	margin-inline: auto;
}

@media (max-width: 1024px) {
	.cst-template-post-loop--cols-3,
	.cst-template-post-loop--cols-4,
	.cst-template-category-grid,
	.cst-template-author-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cst-template-split {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	.cst-template-post-loop--cols-2,
	.cst-template-post-loop--cols-3,
	.cst-template-post-loop--cols-4,
	.cst-template-category-grid,
	.cst-template-author-grid {
		grid-template-columns: 1fr;
	}

	.cst-template-post-loop--masonry {
		column-count: 1;
	}
}
