/* Insights (blog): home.php, single.php, archive.php, parts/post-card.php, parts/insights-filter.php.
   Enqueued only on blog pages (functions.php), after sp-redesign.css.
   The banner reuses the theme's .interior_hero (style.css); rules here only adjust it. */

/* ---------- Banner (interior_hero) ---------- */

/* Blue fallback when there is no featured image, plus a dark tint so white text stays readable */
.sp-insights-hero .interior_hero_container .image {
	position: relative;
	background-color: #2a4a6b;
}

.sp-insights-hero .interior_hero_container .image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
}

.sp-insights-hero .interior_hero_container .copy {
	max-width: min(1280px, 95%);
	z-index: 1;
}

/* Same look as the theme's interior hero h2 (_typography.scss) but as the page's h1 */
.sp-insights-hero .sp-insights-hero__title {
	margin: 0;
	color: #fff;
	font-size: 3rem;
	font-weight: 500;
	line-height: 1.15;
}

.sp-insights-hero .sp-insights-hero__eyebrow {
	margin: 0 0 0.5rem;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sp-insights-hero .subcopy {
	max-width: 760px;
	margin-top: 1rem;
	font-size: 1.1rem;
	font-weight: 400;
	line-height: 1.5;
}

.sp-insights-hero .subcopy p + p {
	margin-top: 0.75em;
}

.sp-insights-hero .subcopy strong {
	font-weight: 600;
}

/* ---------- Listing (home.php / archive.php) ---------- */

.sp-insights {
	max-width: 1280px;
	margin: 0 auto;
	padding: 2.5rem 0 4rem;
}

.sp-insights-filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 2.5rem;
	padding: 0;
	list-style: none;
}

.sp-insights-filter a {
	display: inline-block;
	padding: 0.45em 1.1em;
	border: 1px solid rgba(42, 74, 107, 0.3);
	border-radius: 1.6em;
	color: #2a4a6b;
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.sp-insights-filter a:hover,
.sp-insights-filter a:focus-visible,
.sp-insights-filter a[aria-current="page"] {
	background-color: #2a4a6b;
	border-color: #2a4a6b;
	color: #fff;
}

.sp-insights__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2rem;
}

.sp-insights__empty {
	font-size: 1.1rem;
}

/* ---------- Card (parts/post-card.php) ---------- */

.sp-post-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: 5px;
	overflow: hidden;
	background-color: #fff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	color: inherit;
	text-decoration: none;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sp-post-card__link:hover,
.sp-post-card__link:focus-visible {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
	transform: translateY(-2px);
}

/* 16:9 image area; light-gold block when the post has no featured image */
.sp-post-card__image {
	aspect-ratio: 16 / 9;
	background-color: #ddd4cb;
}

.sp-post-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sp-post-card__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 1.25rem 1.5rem 1.5rem;
}

.sp-post-card__category {
	color: #9e8e70;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sp-post-card__title {
	margin: 0.4rem 0 0.6rem;
	color: #2a4a6b;
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.25;
}

.sp-post-card__excerpt {
	margin: 0 0 1rem;
	font-size: 0.95rem;
	line-height: 1.55;
}

.sp-post-card__date {
	margin-top: auto;            /* keeps dates aligned at the bottom of each card */
	color: #525252;
	font-size: 0.85rem;
}

/* ---------- Pagination (the_posts_pagination) ---------- */

.sp-insights .pagination {
	margin-top: 3rem;
}

.sp-insights .pagination .nav-links {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

.sp-insights .pagination .page-numbers {
	display: inline-block;
	min-width: 2.5em;
	padding: 0.4em 0.8em;
	border-radius: 1.6em;
	color: #2a4a6b;
	text-align: center;
	text-decoration: none;
}

.sp-insights .pagination .page-numbers.current,
.sp-insights .pagination a.page-numbers:hover {
	background-color: #2a4a6b;
	color: #fff;
}

/* WordPress prints a visually-hidden "Posts navigation" heading */
.sp-insights .pagination .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Article (single.php) ---------- */

.sp-article {
	max-width: 720px;
	margin: 0 auto;
	padding: 2.5rem 0 3rem;
}

.sp-article__meta {
	margin: 0 0 2rem;
	color: #525252;
	font-size: 0.95rem;
}

.sp-article__meta a {
	color: #9e8e70;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
}

/* Editor content: the theme's reset (style.css) strips margins, lists and heading sizes */
.sp-article__body {
	font-size: 1.1rem;
	line-height: 1.7;
}

.sp-article__body > * + * {
	margin-top: 1.25em;
}

.sp-article__body h2,
.sp-article__body h3,
.sp-article__body h4 {
	margin-top: 2em;
	color: #2a4a6b;
	line-height: 1.25;
}

.sp-article__body h2 { font-size: 1.85rem; font-weight: 600; }
.sp-article__body h3 { font-size: 1.45rem; font-weight: 600; }
.sp-article__body h4 { font-size: 1.2rem;  font-weight: 600; }

.sp-article__body a {
	color: #2a4a6b;
	text-decoration: underline;
}

.sp-article__body strong,
.sp-article__body b {
	font-weight: 700;
}

.sp-article__body em,
.sp-article__body i {
	font-style: italic;
}

.sp-article__body ul,
.sp-article__body ol {
	padding-left: 1.5em;
}

.sp-article__body ul { list-style: disc; }
.sp-article__body ol { list-style: decimal; }

.sp-article__body li + li {
	margin-top: 0.4em;
}

.sp-article__body blockquote {
	padding-left: 1.25rem;
	border-left: 4px solid #9e8e70;
	color: #2a4a6b;
	font-size: 1.2rem;
	font-style: italic;
}

.sp-article__body img {
	max-width: 100%;
	height: auto;
	border-radius: 5px;
}

/* Classic Editor image alignment classes */
.sp-article__body .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.sp-article__body .alignleft   { float: left;  margin: 0.3em 1.5em 1em 0; }
.sp-article__body .alignright  { float: right; margin: 0.3em 0 1em 1.5em; }
.sp-article__body::after { content: ""; display: table; clear: both; }

.sp-article__back {
	display: inline-block;
	margin-top: 3rem;
	color: #2a4a6b;
	font-weight: 600;
	text-decoration: none;
}

.sp-article__back:hover,
.sp-article__back:focus-visible {
	text-decoration: underline;
}

/* ---------- Call to action + related (single.php) ---------- */

.sp-article-cta {
	max-width: 1280px;
	margin: 0 auto 4rem;
	padding: 3rem 2rem;
	border-radius: 5px;
	background-color: #2a4a6b;
	color: #fff;
	text-align: center;
}

.sp-article-cta h2 {
	color: #fff;
	font-size: 2.25rem;
}

.sp-article-cta p {
	margin: 0.75rem 0 1.75rem;
	font-size: 1.1rem;
}

.sp-article-cta .button {
	display: inline-block;
	font-size: 1rem;
	font-weight: 600;
}

.sp-related {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 0 4rem;
}

.sp-related .sp-related__title {
	margin: 0 0 1.5rem;
	font-size: 2rem;
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 1280px) {
	.sp-insights,
	.sp-article-cta,
	.sp-related {
		max-width: 95%;
	}
}

@media screen and (max-width: 1024px) {
	.sp-insights__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media screen and (max-width: 768px) {
	.sp-insights-hero .sp-insights-hero__title {
		font-size: 2.1rem;
	}

	.sp-insights-hero .subcopy {
		font-size: 1rem;
	}

	.sp-insights__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.5rem;
	}

	.sp-article {
		max-width: 95%;
		padding-top: 2rem;
	}

	.sp-article__body {
		font-size: 1rem;
	}

	.sp-article-cta {
		padding: 2.25rem 1.25rem;
	}

	.sp-article-cta h2 {
		font-size: 1.75rem;
	}
}
