/*
 * blog.css - BotSpice blog templates, built on the main site's tokens (ds-chrome.css).
 * Every colour and size comes from a --ds- token. Scoped to .bs-blog so Astra pages are untouched.
 */

/* ---------- Layout: let our templates run full width inside Astra's wrappers ---------- */
.bs-blog #page,
.bs-blog #content { background: var(--ds-surface); }
.bs-blog #content > .ast-container {
	max-width: none;
	padding: 0;
	display: block;
}
.bs-blog .bs-main { display: block; }
.bs-blog .bs-main :where(h1, h2, h3, h4, p, ul, ol, figure, blockquote) { margin: 0; }
.bs-blog a { color: var(--ds-teal-700); }
.bs-blog a:hover { color: var(--ds-ink-teal); }

.bs-narrow {
	max-width: calc(760px + 2 * var(--ds-gutter));
	margin: 0 auto;
	padding-left: var(--ds-gutter);
	padding-right: var(--ds-gutter);
}

/* ---------- Type helpers ---------- */
.bs-accent { color: var(--ds-teal); }
.bs-eyebrow {
	font-size: var(--ds-fs-eyebrow);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ds-teal-700);
}

/* ---------- Hero band ---------- */
.bs-hero {
	background: var(--ds-teal-50);
	padding: clamp(48px, 6vw, 88px) 0 clamp(40px, 5vw, 64px);
}
.bs-hero .ds-container { display: flex; flex-direction: column; gap: 18px; }
.bs-blog .bs-hero__title {
	font-family: var(--ds-font-display);
	font-weight: 700;
	font-size: clamp(36px, 4.4vw, 60px);
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: var(--ds-deck-grey);
	text-wrap: balance;
	max-width: 900px;
}
.bs-hero--archive .bs-hero__title { font-size: clamp(32px, 3.6vw, 48px); }
.bs-hero .bs-accent { color: var(--ds-teal-accent-band); }
.bs-hero__intro {
	font-size: var(--ds-fs-intro);
	line-height: var(--ds-lh-intro);
	color: var(--ds-text-muted);
	max-width: 680px;
}

/* ---------- Topic pills ---------- */
.bs-pills { margin-top: 8px; }
.bs-pills ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.bs-blog .bs-pills a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 16px;
	border-radius: var(--ds-radius-pill);
	background: var(--ds-surface);
	border: 1.5px solid var(--ds-teal-200);
	color: var(--ds-ink-teal);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 200ms var(--ds-ease), background-color 200ms var(--ds-ease);
}
.bs-blog .bs-pills a:hover { border-color: var(--ds-teal-700); }
.bs-blog .bs-pills a[aria-current="page"] {
	background: var(--ds-teal-700);
	border-color: var(--ds-teal-700);
	color: #fff;
}

/* ---------- Sections ---------- */
.bs-section { padding: var(--ds-section-y-sm) 0; }
.bs-section--cta { padding-top: 0; }
.bs-empty { color: var(--ds-text-muted); }

/* ---------- Post grid and cards ---------- */
.bs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
	gap: 28px;
}
.bs-card {
	display: flex;
	flex-direction: column;
	background: var(--ds-surface);
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius-card);
	overflow: hidden;
	transition: transform 200ms var(--ds-ease), box-shadow 200ms var(--ds-ease);
}
.bs-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(13, 68, 78, 0.12); }
.bs-card__media {
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--ds-teal-50);
	overflow: hidden;
}
.bs-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.bs-card__placeholder { display: block; width: 100%; height: 100%; background: var(--ds-teal-100); }
.bs-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 24px 24px 26px;
	flex: 1;
}
.bs-blog .bs-card__tag {
	align-self: flex-start;
	font-size: 13px;
	line-height: 18px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ds-teal-700);
	text-decoration: none;
}
.bs-blog .bs-card__title {
	font-family: var(--ds-font-display);
	font-size: 22px;
	line-height: 30px;
	font-weight: 700;
	color: var(--ds-navy);
}
.bs-blog .bs-card__title a { color: inherit; text-decoration: none; }
.bs-blog .bs-card__title a:hover { color: var(--ds-teal-700); }
.bs-card__excerpt { color: var(--ds-text-muted); font-size: 15px; line-height: 24px; }
.bs-card__meta { margin-top: auto !important; padding-top: 6px; font-size: 14px; line-height: 20px; color: var(--ds-text-soft); }

/* ---------- Pagination ---------- */
.bs-pagination { margin-top: 48px; }
.bs-pagination ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.bs-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border-radius: var(--ds-radius-btn-sm);
	border: 1.5px solid var(--ds-teal-200);
	color: var(--ds-ink-teal);
	font-weight: 600;
	text-decoration: none;
	background: var(--ds-surface);
}
.bs-blog .bs-pagination a.page-numbers:hover { border-color: var(--ds-teal-700); color: var(--ds-ink-teal); }
.bs-pagination .page-numbers.current { background: var(--ds-teal-700); border-color: var(--ds-teal-700); color: #fff; }
.bs-pagination .page-numbers.dots { border-color: transparent; }

/* ---------- Breadcrumb ---------- */
.bs-breadcrumb { font-size: 14px; line-height: 20px; color: var(--ds-text-soft); }
.bs-breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bs-breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--ds-border-dashed); }
.bs-blog .bs-breadcrumb a { color: var(--ds-teal-700); text-decoration: none; font-weight: 600; }

/* ---------- Single post ---------- */
.bs-article__head { padding: clamp(40px, 5vw, 72px) 0 32px; }
.bs-article__head .bs-narrow { display: flex; flex-direction: column; gap: 18px; }
.bs-blog .bs-article__title {
	font-family: var(--ds-font-display);
	font-weight: 700;
	font-size: clamp(34px, 4vw, 52px);
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--ds-deck-grey);
	text-wrap: balance;
}
.bs-article__meta { font-size: 15px; line-height: 22px; color: var(--ds-text-soft); }
.bs-blog .bs-article__meta a { color: var(--ds-ink-teal); font-weight: 600; text-decoration: none; }
.bs-article__hero {
	max-width: calc(1040px + 2 * var(--ds-gutter));
	margin: 0 auto 48px !important;
	padding: 0 var(--ds-gutter);
}
.bs-article__hero img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 560px;
	object-fit: cover;
	border-radius: var(--ds-radius-card);
}
.bs-article__foot { padding-top: 32px; padding-bottom: 16px; }
.bs-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bs-blog .bs-tags a {
	padding: 6px 12px;
	border-radius: var(--ds-radius-pill);
	background: var(--ds-teal-100);
	color: var(--ds-ink-teal);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

/* ---------- Article body (prose) ---------- */
.bs-prose { padding-bottom: 48px; font-size: 18px; line-height: 31px; color: var(--ds-text); }
.bs-prose > * + * { margin-top: 1.1em !important; }
.bs-blog .bs-prose :where(h2, h3, h4) {
	font-family: var(--ds-font-display);
	font-weight: 700;
	color: var(--ds-deck-grey);
	letter-spacing: -0.01em;
}
.bs-blog .bs-prose h2 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.25; margin-top: 1.8em !important; }
.bs-blog .bs-prose h3 { font-size: clamp(21px, 2vw, 24px); line-height: 1.3; margin-top: 1.5em !important; }
.bs-blog .bs-prose h4 { font-size: 19px; line-height: 1.35; margin-top: 1.4em !important; }
.bs-prose :where(ul, ol) { padding-left: 1.4em; }
.bs-prose li + li { margin-top: 0.4em; }
.bs-prose li::marker { color: var(--ds-teal-700); }
.bs-blog .bs-prose a { color: var(--ds-teal-700); text-decoration: underline; text-underline-offset: 3px; }
.bs-blog .bs-prose a:hover { color: var(--ds-ink-teal); }
.bs-prose strong { color: var(--ds-navy); }
.bs-prose img { border-radius: var(--ds-radius-card-sm); height: auto; }
.bs-prose figure { margin-left: 0; margin-right: 0; }
.bs-prose figcaption { font-size: 14px; line-height: 20px; color: var(--ds-text-soft); margin-top: 8px; text-align: center; }
.bs-prose blockquote {
	border-left: 4px solid var(--ds-teal);
	background: var(--ds-teal-50);
	padding: 18px 22px;
	border-radius: 0 var(--ds-radius-card-sm) var(--ds-radius-card-sm) 0;
	color: var(--ds-ink-teal);
	font-style: normal;
}
.bs-prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 24px; }
.bs-prose :where(th, td) { border: 1px solid var(--ds-border); padding: 10px 12px; text-align: left; vertical-align: top; }
.bs-prose th { background: var(--ds-teal-50); color: var(--ds-navy); }
.bs-prose hr { border: 0; border-top: 1px solid var(--ds-border); }
.bs-prose code { background: var(--ds-surface-soft); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }

/* Related posts (YARPP) */
.bs-prose .yarpp-related { margin-top: 56px !important; padding-top: 32px; border-top: 1px solid var(--ds-border); }
.bs-blog .bs-prose .yarpp-related h3 { margin-top: 0 !important; font-size: 24px; text-transform: none; }
.bs-prose .yarpp-thumbnails-horizontal .yarpp-thumbnail { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-card-sm); overflow: hidden; }
.bs-prose .yarpp-thumbnail-title { font-weight: 600; color: var(--ds-navy); }

/* ---------- CTA banner (mirrors .ds-cta on the main site) ---------- */
.bs-cta {
	background: var(--ds-teal-700);
	border-radius: var(--ds-radius-panel);
	padding: clamp(36px, 5vw, 64px);
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	align-items: center;
	justify-content: space-between;
}
.bs-cta__text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.bs-blog .bs-cta__title {
	font-family: var(--ds-font-display);
	font-weight: 700;
	font-size: var(--ds-fs-h2-cta);
	line-height: 1.12;
	color: #fff;
	text-wrap: balance;
}
.bs-cta__text p { font-size: 18px; line-height: 28px; font-weight: 700; color: #fff; }

/* ---------- 404 ---------- */
.bs-404__btns { margin-top: 12px; }

@media (max-width: 600px) {
	.bs-prose { font-size: 17px; line-height: 29px; }
	.bs-card__body { padding: 20px; }
}

/* ---------- Astra / WordPress overrides ---------- */
.bs-blog .bs-card,
.bs-blog .bs-article { padding: 0; margin: 0; }
.bs-blog #ast-scroll-top { display: none !important; }
/* Keep the fixed header below the admin bar when logged in. */
.admin-bar .ds-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ds-header { top: 46px; } }
/* Topic pills scroll sideways on phones instead of stacking. */
@media (max-width: 640px) {
	.bs-blog .bs-pills ul {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		margin: 0 calc(-1 * var(--ds-gutter));
		padding: 2px var(--ds-gutter);
	}
	.bs-pills ul::-webkit-scrollbar { display: none; }
	.bs-pills li { flex: 0 0 auto; }
	.bs-blog .bs-pills a { white-space: nowrap; }
}
