/**
 * Template visual families — New Bloggers Theme.
 *
 * The 56 selectable page templates (inc/template-library.php) share one
 * renderer and only differ in section order/content. nbt_template_library_family()
 * stamps a `cst-family--{family}` class on the template <main> alongside the
 * existing `cst-template-library--{layout}` class so each of the 8 families
 * below gets a genuinely different look — not just a different accent color.
 *
 * Most of the reskinning happens by overriding the theme's own CSS custom
 * properties (--cst-color-surface, --cst-color-text, etc.) inside each family
 * scope; because `.cst-card`, sidebar widgets, and section titles already
 * read those variables, they restyle automatically with no markup changes.
 *
 * @package New_Bloggers_Theme
 * @license GPL-2.0-or-later
 */

/* -------------------------------------------------------------------------
   1. Editorial / Serif
   ------------------------------------------------------------------------- */
.cst-family--editorial .cst-template-library__header {
	max-width: 760px;
	margin-inline: auto;
	text-align: center;
	border-bottom: 0;
	padding-bottom: 0;
}

.cst-family--editorial .cst-page-title {
	font-size: clamp(2rem, 1.5rem + 2.5vw, 3.1rem);
	letter-spacing: -0.015em;
}

.cst-family--editorial .cst-template-library__description,
.cst-family--editorial .cst-template-library__intro {
	margin-inline: auto;
}

.cst-family--editorial .cst-template-library__intro > *:first-child::first-letter {
	float: left;
	font-family: var(--cst-font-heading);
	font-size: 3.6em;
	line-height: 0.78;
	font-weight: 700;
	padding: 0.05em 0.1em 0 0;
	color: var(--cst-color-accent);
}

.cst-family--editorial .cst-section-title {
	font-family: var(--cst-font-heading);
	font-style: italic;
	font-weight: 400;
	font-size: 1.5rem;
	text-align: center;
}

.cst-family--editorial .cst-template-section__head {
	text-align: center;
	max-width: 640px;
	margin-inline: auto;
}

.cst-family--editorial .cst-card {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	border-bottom: 1px solid var(--cst-color-border);
	background: transparent;
}

.cst-family--editorial .cst-card:hover {
	transform: none;
	box-shadow: none;
}

.cst-family--editorial .cst-card__title {
	font-size: 1.4rem;
}

/* -------------------------------------------------------------------------
   2. News Desk / Dense
   ------------------------------------------------------------------------- */
.cst-family--newsdesk {
	--cst-gap: 1.15rem;
}

.cst-family--newsdesk .cst-template-library__header {
	border-bottom: 3px double var(--cst-color-text);
	padding-bottom: 1rem;
}

.cst-family--newsdesk .cst-section-title {
	font-size: 0.95rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	border-bottom: 2px solid var(--cst-color-accent);
	padding-bottom: 0.5rem;
	display: inline-block;
}

.cst-family--newsdesk .cst-card {
	border-radius: var(--cst-radius-sm);
	box-shadow: none;
}

.cst-family--newsdesk .cst-card:hover {
	transform: none;
	box-shadow: none;
	border-color: var(--cst-color-accent);
}

.cst-family--newsdesk .cst-card__meta {
	font-family: var(--cst-font-mono);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* -------------------------------------------------------------------------
   3. Crypto / Terminal Dark
   ------------------------------------------------------------------------- */
.cst-family--terminal {
	--cst-color-bg: #0a0e16;
	--cst-color-surface: #121826;
	--cst-color-text: #e7edf7;
	--cst-color-muted: #8fa0bd;
	--cst-color-border: rgba(255, 255, 255, 0.09);
	background: var(--cst-color-bg);
	color: var(--cst-color-text);
	padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
	border-radius: var(--cst-radius-lg);
	box-shadow: var(--cst-shadow-lg);
}

.cst-family--terminal .cst-page-title,
.cst-family--terminal .cst-entry-title {
	color: #fff;
}

.cst-family--terminal .cst-section-title {
	font-family: var(--cst-font-mono);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--cst-color-accent);
	text-shadow: 0 0 18px color-mix(in srgb, var(--cst-color-accent) 55%, transparent);
}

.cst-family--terminal .cst-card {
	border: 1px solid var(--cst-color-border);
	box-shadow: none;
}

.cst-family--terminal .cst-card:hover {
	border-color: var(--cst-color-accent);
	box-shadow: 0 0 0 1px var(--cst-color-accent), 0 20px 40px -20px color-mix(in srgb, var(--cst-color-accent) 60%, transparent);
}

.cst-family--terminal .cst-card__meta,
.cst-family--terminal .cst-card__excerpt {
	font-family: var(--cst-font-mono);
}

.cst-family--terminal .cst-card__link {
	color: var(--cst-color-accent);
}

.cst-family--terminal .cst-template-callout {
	border-left-color: var(--cst-color-accent);
	background: color-mix(in srgb, var(--cst-color-surface) 90%, var(--cst-color-accent));
}

/* -------------------------------------------------------------------------
   4. Magazine Grid / Bold
   ------------------------------------------------------------------------- */
.cst-family--bold-grid .cst-page-title {
	font-family: var(--cst-font-body);
	font-size: clamp(2.1rem, 1.5rem + 3vw, 3.4rem);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: -0.02em;
}

.cst-family--bold-grid .cst-section-title {
	font-family: var(--cst-font-body);
	font-weight: 800;
	font-size: 1.4rem;
	text-transform: uppercase;
}

.cst-family--bold-grid .cst-card {
	border-radius: var(--cst-radius-lg);
	border-width: 2px;
}

.cst-family--bold-grid .cst-template-post-loop--grid-2 > .cst-card:first-child,
.cst-family--bold-grid .cst-template-post-loop--cols-3 > .cst-card:first-child {
	grid-column: span 2;
}

.cst-family--bold-grid .cst-template-post-loop--grid-2 > .cst-card:first-child .cst-card__image,
.cst-family--bold-grid .cst-template-post-loop--cols-3 > .cst-card:first-child .cst-card__image {
	aspect-ratio: 21 / 9;
}

.cst-family--bold-grid .cst-card:first-child .cst-card__category .cst-badge {
	border-radius: var(--cst-radius-sm);
}

/* -------------------------------------------------------------------------
   5. Visual / Masonry
   ------------------------------------------------------------------------- */
.cst-family--visual .cst-template-post-loop--grid,
.cst-family--visual .cst-template-post-loop--cols-2,
.cst-family--visual .cst-template-post-loop--cols-3 {
	gap: 0.85rem;
}

.cst-family--visual .cst-card--grid {
	position: relative;
	min-height: 360px;
	border: 0;
	border-radius: var(--cst-radius-lg);
	overflow: hidden;
}

.cst-family--visual .cst-card--grid .cst-card__media {
	position: absolute;
	inset: 0;
}

.cst-family--visual .cst-card--grid .cst-card__image {
	height: 100%;
	aspect-ratio: auto;
}

.cst-family--visual .cst-card--grid .cst-card__body {
	position: relative;
	z-index: 1;
	margin-top: auto;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.88) 65%);
	color: #fff;
}

.cst-family--visual .cst-card--grid .cst-card__title a,
.cst-family--visual .cst-card--grid .cst-card__meta {
	color: #fff;
}

.cst-family--visual .cst-card--grid .cst-card__excerpt,
.cst-family--visual .cst-card--grid .cst-card__link {
	opacity: 0;
	max-height: 0;
	overflow: hidden;
	margin: 0;
	transition: opacity 0.25s ease, max-height 0.3s ease;
}

.cst-family--visual .cst-card--grid:hover .cst-card__excerpt,
.cst-family--visual .cst-card--grid:hover .cst-card__link {
	opacity: 1;
	max-height: 6rem;
	margin-bottom: 0.5rem;
}

/* -------------------------------------------------------------------------
   6. Commerce / Card
   ------------------------------------------------------------------------- */
.cst-family--commerce .cst-card {
	border-radius: var(--cst-radius-md);
	border: 2px solid var(--cst-color-border);
	box-shadow: none;
}

.cst-family--commerce .cst-card:hover {
	transform: none;
	border-color: var(--cst-color-accent);
	box-shadow: var(--cst-shadow-sm);
}

.cst-family--commerce .cst-card__link {
	display: inline-flex;
	margin-top: 0.35rem;
	padding: 0.5rem 1.1rem;
	border-radius: var(--cst-radius-pill);
	background: var(--cst-color-accent);
	color: #fff !important;
	font-size: 0.75rem;
}

.cst-family--commerce .cst-card__link::after {
	display: none;
}

.cst-family--commerce .cst-template-callout {
	border-radius: var(--cst-radius-md);
	border-left-width: 6px;
}

/* -------------------------------------------------------------------------
   7. Community / Directory
   ------------------------------------------------------------------------- */
.cst-family--directory .cst-template-category-card,
.cst-family--directory .cst-template-author-card {
	text-align: center;
	border-radius: var(--cst-radius-lg);
	padding: 1.85rem 1.25rem;
}

.cst-family--directory .cst-template-author-card__avatar {
	border: 3px solid var(--cst-color-accent-soft, var(--cst-color-border));
	transition: border-color 0.25s ease, transform 0.25s ease;
}

.cst-family--directory .cst-template-author-card:hover .cst-template-author-card__avatar {
	border-color: var(--cst-color-accent);
	transform: scale(1.05);
}

.cst-family--directory .cst-template-category-card__name,
.cst-family--directory .cst-template-author-card__name {
	font-family: var(--cst-font-heading);
}

/* -------------------------------------------------------------------------
   8. Landing / Campaign
   ------------------------------------------------------------------------- */
.cst-family--campaign .cst-template-library__header {
	position: relative;
	text-align: center;
	color: #fff;
	padding: clamp(2.25rem, 1.5rem + 3vw, 4rem) clamp(1.5rem, 1rem + 2vw, 3rem);
	border-radius: var(--cst-radius-lg);
	overflow: hidden;
	background:
		radial-gradient(circle at 15% 15%, color-mix(in srgb, var(--cst-color-accent) 65%, transparent), transparent 55%),
		radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--cst-color-accent) 35%, transparent), transparent 55%),
		#14141a;
}

.cst-family--campaign .cst-page-title,
.cst-family--campaign .cst-template-library__description {
	color: #fff;
}

.cst-family--campaign .cst-template-library__description {
	margin-inline: auto;
	opacity: 0.85;
}

.cst-family--campaign .cst-template-section--newsletter,
.cst-family--campaign .cst-template-callout {
	border-radius: var(--cst-radius-lg);
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 700px) {
	.cst-family--bold-grid .cst-template-post-loop--grid-2 > .cst-card:first-child,
	.cst-family--bold-grid .cst-template-post-loop--cols-3 > .cst-card:first-child {
		grid-column: auto;
	}

	.cst-family--terminal,
	.cst-family--campaign .cst-template-library__header {
		border-radius: var(--cst-radius-md);
	}
}
