/**
 * Homepage Insights section — Figma node 308:791.
 * Typography & spacing tokens: base.css (--sp-insights-*), scaled in responsive.css.
 */

.sp-insights {
	padding: var(--sp-insights-pad-top) 0 var(--sp-insights-pad-bottom);
	background-color: var(--spaciefy-white);
	color: var(--spaciefy-black);
}

.sp-insights__inner {
	display: flex;
	flex-direction: column;
}

.sp-insights__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-insights-header-gap);
	margin-bottom: var(--sp-insights-header-bottom);
}

.sp-insights__heading {
	margin: 0;
	font-family: "Helvetica Neue", Helvetica, var(--spaciefy-font);
	font-size: var(--sp-insights-heading-size);
	font-style: normal;
	font-weight: 400;
	line-height: var(--sp-insights-heading-lh, 0.98);
	text-align: left;
	color: #000;
}

.sp-insights__cta {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--sp-hero-cta-gap);
	flex-shrink: 0;
	width: fit-content;
	max-width: 100%;
}

.sp-insights__cta-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 1 auto;
	padding: var(--sp-insights-cta-button-pad-y) var(--sp-insights-cta-button-pad-x);
	border: 0;
	border-radius: var(--sp-hero-cta-radius);
	font-family: var(--spaciefy-font-manrope);
	font-size: var(--sp-insights-cta-button-size);
	font-style: normal;
	font-weight: 700;
	line-height: normal;
	color: #000;
	background-color: var(--spaciefy-yellow);
	text-align: center;
	max-width: 100%;
	transition: opacity 0.2s ease;
}

.sp-insights__cta-button:hover,
.sp-insights__cta-button:focus-visible {
	opacity: 0.9;
}

.sp-insights__cta-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: var(--sp-insights-cta-icon-size);
	height: var(--sp-insights-cta-icon-size);
	border-radius: var(--sp-cta-icon-radius);
	color: var(--spaciefy-yellow);
	background-color: var(--spaciefy-black);
	transition: opacity 0.2s ease;
}

.sp-insights__cta-icon:hover,
.sp-insights__cta-icon:focus-visible {
	opacity: 0.9;
}

.sp-insights__cta-icon svg {
	width: var(--sp-insights-cta-icon-svg);
	height: var(--sp-insights-cta-icon-svg);
}

.sp-insights__grid {
	display: grid;
	grid-template-columns: repeat(var(--sp-insights-grid-columns, 3), minmax(0, 1fr));
	gap: var(--sp-insights-grid-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.sp-insights__item {
	min-width: 0;
}

.sp-insights__link {
	display: block;
	color: inherit;
	text-decoration: none;
	font-weight: 400;
}

.sp-insights__link:focus-visible {
	outline: 2px solid var(--spaciefy-yellow);
	outline-offset: 4px;
}

.sp-insights__media {
	overflow: hidden;
	aspect-ratio: var(--sp-insights-image-ratio);
	background-color: #f2f2f2;
}

.sp-insights__image,
.sp-insights__image-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.sp-insights__image-placeholder {
	background: linear-gradient(135deg, #ececec 0%, #d8d8d8 100%);
}

.sp-insights__link:hover .sp-insights__image,
.sp-insights__link:focus-visible .sp-insights__image {
	transform: scale(1.05);
}

.sp-insights__body {
	min-width: 0;
}

.sp-insights__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: flex-start;
	gap: 0.35em;
	margin: var(--sp-insights-meta-top) 0 0;
}

.sp-insights__meta-label,
.sp-insights__reading-time {
	margin: 0;
	font-family: var(--spaciefy-font-helvetica);
	font-size: var(--sp-insights-meta-size);
	font-style: normal;
	font-weight: 400;
	line-height: var(--sp-insights-meta-lh, 1.13);
	color: #000;
	opacity: 0.5;
}

.sp-insights__title {
	margin: var(--sp-insights-title-top) 0 0;
	font-family: var(--spaciefy-font-helvetica);
	font-size: var(--sp-insights-title-size);
	font-style: normal;
	font-weight: 400;
	font-synthesis: none;
	line-height: var(--sp-insights-title-lh, 1.23);
	color: #0e0e0e;
}

/* Tablet — 2-column grid from 992px and below */
@media (max-width: 992px) {
	:root {
		--sp-insights-grid-columns: 2;
		--sp-insights-grid-row-gap: clamp(28px, calc(40 / var(--spaciefy-artboard) * 100vw), 40px);
	}

	.sp-insights__header {
		align-items: flex-start;
		flex-wrap: wrap;
		row-gap: var(--sp-insights-header-stack-gap);
	}

	.sp-insights__grid {
		row-gap: var(--sp-insights-grid-row-gap);
	}

	.sp-insights__cta {
		align-self: flex-end;
	}
}

/* ---------------------------------------------------------------------------
 * Mobile — 768px and below.
 *
 * The design turns the card grid into a reading list: a fixed thumbnail on the
 * left with the meta line and title beside it, and a rule between rows.
 * ------------------------------------------------------------------------- */

@media (max-width: 768px) {
	:root {
		--sp-insights-grid-columns: 1;
		--sp-insights-grid-row-gap: 0;
	}

	.sp-insights {
		--sp-insights-row-thumb: clamp(128px, calc(8.5246vw + 122.74px), 190px);
		--sp-insights-row-gap: clamp(16px, calc(1.2022vw + 17.17px), 26.4px);
		--sp-insights-row-pad: clamp(20px, calc(1.4208vw + 20.29px), 31.2px);
		--sp-insights-title-size: clamp(18px, calc(1.25vw + 14px), 24px);
		--sp-insights-meta-size: clamp(12px, calc(0.6011vw + 9.58px), 14.4px);
		--sp-insights-cta-button-size: clamp(12px, calc(0.55vw + 9.8px), 13.3px);
		--sp-insights-cta-button-pad-y: clamp(8px, calc(0.35vw + 6.5px), 11px);
		--sp-insights-cta-button-pad-x: clamp(14px, calc(0.8vw + 10px), 18px);
		--sp-insights-cta-icon-size: clamp(32px, calc(0.9vw + 26px), 38px);
		--sp-insights-cta-icon-svg: clamp(9px, calc(0.25vw + 7.5px), 11px);
	}

	.sp-insights__header {
		align-items: center;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-between;
		row-gap: var(--sp-insights-header-stack-gap);
		margin-bottom: clamp(24px, calc(40 / var(--spaciefy-artboard) * 100vw), 40px);
	}

	.sp-insights__heading {
		text-align: left;
	}

	.sp-insights__cta {
		flex-direction: row;
		align-items: center;
		align-self: auto;
		width: auto;
	}

	.sp-insights__cta-button {
		width: auto;
	}

	.sp-insights__grid {
		row-gap: 0;
	}

	/* Rules sit between rows only, so the list does not open or close on one. */
	.sp-insights__item + .sp-insights__item {
		border-top: 1px solid rgba(0, 0, 0, 0.12);
		margin-top: var(--sp-insights-row-pad);
		padding-top: var(--sp-insights-row-pad);
	}

	.sp-insights__link {
		display: grid;
		grid-template-columns: var(--sp-insights-row-thumb) minmax(0, 1fr);
		column-gap: var(--sp-insights-row-gap);
		align-items: start;
	}

	.sp-insights__media {
		grid-column: 1;
		grid-row: 1;
		align-self: start;
		aspect-ratio: 157 / 95;
		border-radius: 6px;
	}

	.sp-insights__body {
		grid-column: 2;
		grid-row: 1;
		display: flex;
		flex-direction: column;
		gap: clamp(6px, calc(0.5464vw + 3.8px), 10px);
	}

	.sp-insights__meta {
		margin-top: 0;
	}

	.sp-insights__title {
		margin-top: 0;
		font-weight: 400;
		font-synthesis: none;
		line-height: 1.32;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sp-insights__image {
		transition: none;
	}

	.sp-insights__link:hover .sp-insights__image,
	.sp-insights__link:focus-visible .sp-insights__image {
		transform: none;
	}
}
