/*
 * Hero Blog Showcase — front-end styles.
 * All colours, sizes and fonts are driven by CSS variables injected per-site.
 */

.hbs-wrap {
	--hbs-section-bg: #f7f8fa;
	--hbs-header-bg: #0f172a;
	--hbs-header-text: #ffffff;
	--hbs-overlay: #0f172a;
	--hbs-overlay-opacity: 0.6;
	--hbs-card-bg: #ffffff;
	--hbs-accent: #2563eb;
	--hbs-heading: #0f172a;
	--hbs-text: #475569;
	--hbs-muted: #94a3b8;
	--hbs-button-text: #ffffff;
	--hbs-font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--hbs-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--hbs-font-size: 16px;
	--hbs-container: 1200px;
	--hbs-gap: 28px;
	--hbs-radius: 14px;
	--hbs-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
	--hbs-heading-scale: 1.28;
	--hbs-columns: 3;

	background: var(--hbs-section-bg);
	font-family: var(--hbs-font-body);
	font-size: var(--hbs-font-size);
	color: var(--hbs-text);
	line-height: 1.65;
	padding: clamp(40px, 6vw, 80px) 20px;
	box-sizing: border-box;
}

.hbs-wrap *,
.hbs-wrap *::before,
.hbs-wrap *::after {
	box-sizing: border-box;
}

.hbs-container {
	max-width: var(--hbs-container);
	margin: 0 auto;
}

/* Kill theme link underlines inside the showcase — the plugin draws its own. */
.hbs-wrap a,
.hbs-wrap a:hover,
.hbs-wrap a:focus {
	text-decoration: none;
	box-shadow: none;
}

/* ---------- Header band ------------------------------------------------ */
.hbs-header {
	background-color: var(--hbs-header-bg);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: var(--hbs-header-text);
	border-radius: var(--hbs-radius);
	padding: clamp(32px, 5vw, 64px) clamp(24px, 4vw, 56px);
	margin-bottom: clamp(32px, 4vw, 56px);
	position: relative;
	overflow: hidden;
}

.hbs-header--image {
	padding: clamp(56px, 8vw, 120px) clamp(24px, 4vw, 56px);
}

.hbs-header__overlay {
	position: absolute;
	inset: 0;
	background: var(--hbs-overlay);
	opacity: var(--hbs-overlay-opacity);
	pointer-events: none;
}

.hbs-header__inner {
	position: relative;
	z-index: 2;
}

.hbs-header--center {
	text-align: center;
}

.hbs-header--center .hbs-header__subtitle {
	margin-left: auto;
	margin-right: auto;
}

/* Accent glow only when there is no background image. */
.hbs-header:not(.hbs-header--image)::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--hbs-accent) 40%, transparent), transparent 60%);
	opacity: 0.5;
	pointer-events: none;
	z-index: 1;
}

.hbs-header__title {
	font-family: var(--hbs-font-heading);
	color: var(--hbs-header-text);
	font-size: clamp(1.9rem, 4vw, 3rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
	margin: 0;
}

.hbs-header__subtitle {
	font-size: clamp(1rem, 1.6vw, 1.2rem);
	margin: 0.75em 0 0;
	max-width: 60ch;
	opacity: 0.85;
}

/* ---------- Section title --------------------------------------------- */
.hbs-section-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: clamp(20px, 3vw, 32px);
}

.hbs-eyebrow {
	display: inline-block;
	width: 36px;
	height: 4px;
	border-radius: 999px;
	background: var(--hbs-accent);
	flex: none;
}

.hbs-section-title {
	font-family: var(--hbs-font-heading);
	color: var(--hbs-heading);
	font-size: clamp(1.3rem, 2.4vw, 1.75rem);
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0;
}

/* ---------- Cards: shared --------------------------------------------- */
.hbs-card {
	background: var(--hbs-card-bg);
	border-radius: var(--hbs-radius);
	box-shadow: var(--hbs-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hbs-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.hbs-card__media {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: color-mix(in srgb, var(--hbs-heading) 8%, var(--hbs-card-bg));
}

.hbs-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.hbs-card:hover .hbs-card__media img {
	transform: scale(1.05);
}

.hbs-card__placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg,
		color-mix(in srgb, var(--hbs-accent) 18%, var(--hbs-card-bg)),
		color-mix(in srgb, var(--hbs-heading) 12%, var(--hbs-card-bg)));
}

.hbs-card__cat,
.hbs-resource__cat {
	background: var(--hbs-accent);
	color: var(--hbs-button-text);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	padding: 6px 12px;
	border-radius: 999px;
	display: inline-block;
}

.hbs-card__cat {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
}

.hbs-card__body {
	padding: clamp(20px, 2.4vw, 28px);
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.hbs-card__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.82rem;
	color: var(--hbs-muted);
	margin-bottom: 12px;
}

.hbs-card__author {
	font-weight: 600;
	color: var(--hbs-muted);
}

.hbs-card__title {
	font-family: var(--hbs-font-heading);
	color: var(--hbs-heading);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: var(--hbs-heading-scale);
	letter-spacing: -0.01em;
	margin: 0 0 0.5em;
}

.hbs-card__title a,
.hbs-resource__title a {
	color: inherit;
	background-image: linear-gradient(var(--hbs-accent), var(--hbs-accent));
	background-size: 0% 2px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size 0.3s ease;
}

.hbs-card__title a:hover,
.hbs-resource__title a:hover {
	background-size: 100% 2px;
}

.hbs-card__excerpt {
	color: var(--hbs-text);
	margin: 0 0 1.25em;
	font-size: 0.95rem;
}

.hbs-card__more {
	margin-top: auto;
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--hbs-accent);
	font-weight: 600;
	font-size: 0.92rem;
}

.hbs-arrow {
	transition: transform 0.25s ease;
}

.hbs-card__more:hover .hbs-arrow {
	transform: translateX(4px);
}

/* ---------- Featured (hero) card -------------------------------------- */
.hbs-card--featured {
	flex-direction: row;
	margin-bottom: var(--hbs-gap);
}

.hbs-card--featured .hbs-card__media {
	aspect-ratio: auto;
	flex: 1 1 56%;
	min-height: 340px;
}

.hbs-card--featured .hbs-card__body {
	flex: 1 1 44%;
	justify-content: center;
	padding: clamp(28px, 4vw, 52px);
}

.hbs-card--featured .hbs-card__title {
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	margin-bottom: 0.6em;
}

.hbs-card--featured .hbs-card__excerpt {
	font-size: 1.05rem;
}

/* ---------- Grid ------------------------------------------------------- */
.hbs-grid {
	display: grid;
	gap: var(--hbs-gap);
	grid-template-columns: repeat(var(--hbs-columns), minmax(0, 1fr));
}

/* ---------- Scrolling rail -------------------------------------------- */
.hbs-scroll {
	display: flex;
	gap: var(--hbs-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 4px 2px 16px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--hbs-accent) transparent;
}

.hbs-scroll::-webkit-scrollbar {
	height: 8px;
}

.hbs-scroll::-webkit-scrollbar-thumb {
	background: color-mix(in srgb, var(--hbs-accent) 60%, transparent);
	border-radius: 999px;
}

.hbs-scroll:focus-visible {
	outline: 3px solid var(--hbs-accent);
	outline-offset: 4px;
	border-radius: var(--hbs-radius);
}

.hbs-slide {
	flex: 0 0 calc((100% - (var(--hbs-columns) - 1) * var(--hbs-gap)) / var(--hbs-columns));
	scroll-snap-align: start;
}

/* ---------- Carousel --------------------------------------------------- */
.hbs-carousel {
	position: relative;
}

.hbs-carousel__viewport {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.hbs-carousel__viewport::-webkit-scrollbar {
	display: none;
}

.hbs-carousel__track {
	display: flex;
	gap: var(--hbs-gap);
	padding: 4px 2px;
}

.hbs-carousel__nav {
	position: absolute;
	top: calc(50% - 24px);
	z-index: 5;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 0;
	background: var(--hbs-card-bg);
	color: var(--hbs-heading);
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.hbs-carousel__nav:hover {
	background: var(--hbs-accent);
	color: var(--hbs-button-text);
	transform: scale(1.06);
}

.hbs-carousel__nav:disabled {
	opacity: 0.35;
	cursor: default;
	transform: none;
}

.hbs-carousel__prev {
	left: -10px;
}

.hbs-carousel__next {
	right: -10px;
}

.hbs-carousel__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
}

.hbs-carousel__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	background: color-mix(in srgb, var(--hbs-heading) 25%, transparent);
	cursor: pointer;
	transition: background 0.2s ease, width 0.2s ease;
}

.hbs-carousel__dot.is-active {
	background: var(--hbs-accent);
	width: 26px;
	border-radius: 999px;
}

/* ---------- Resource / news list -------------------------------------- */
.hbs-resource {
	display: flex;
	flex-direction: column;
	background: var(--hbs-card-bg);
	border-radius: var(--hbs-radius);
	box-shadow: var(--hbs-shadow);
	overflow: hidden;
}

.hbs-resource__item {
	display: flex;
	gap: clamp(18px, 2.5vw, 32px);
	padding: clamp(18px, 2.4vw, 28px);
	border-bottom: 1px solid color-mix(in srgb, var(--hbs-heading) 8%, transparent);
}

.hbs-resource__item:last-child {
	border-bottom: 0;
}

.hbs-resource__media {
	flex: 0 0 clamp(120px, 22%, 240px);
	aspect-ratio: 4 / 3;
	border-radius: calc(var(--hbs-radius) * 0.7);
	overflow: hidden;
	position: relative;
	background: color-mix(in srgb, var(--hbs-heading) 8%, var(--hbs-card-bg));
}

.hbs-resource__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.hbs-resource__item:hover .hbs-resource__media img {
	transform: scale(1.05);
}

.hbs-resource__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.hbs-resource__cat {
	align-self: flex-start;
	margin-bottom: 10px;
}

.hbs-resource__title {
	font-family: var(--hbs-font-heading);
	color: var(--hbs-heading);
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	font-weight: 700;
	line-height: var(--hbs-heading-scale);
	letter-spacing: -0.01em;
	margin: 0 0 0.4em;
}

.hbs-resource__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: auto;
	flex-wrap: wrap;
}

.hbs-resource__foot .hbs-card__meta {
	margin-bottom: 0;
}

.hbs-resource__foot .hbs-card__more {
	margin-top: 0;
}

/* ---------- Empty ------------------------------------------------------ */
.hbs-empty {
	text-align: center;
	color: var(--hbs-muted);
	padding: 48px 0;
	font-size: 1.05rem;
}

/* ---------- Responsive ------------------------------------------------- */
@media (max-width: 960px) {
	.hbs-card--featured {
		flex-direction: column;
	}
	.hbs-card--featured .hbs-card__media {
		aspect-ratio: 16 / 9;
		min-height: 0;
	}
	.hbs-grid--cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.hbs-slide {
		flex-basis: 62%;
	}
	.hbs-carousel__prev { left: 4px; }
	.hbs-carousel__next { right: 4px; }
}

@media (max-width: 720px) {
	.hbs-grid {
		grid-template-columns: 1fr;
	}
	.hbs-slide {
		flex-basis: 84%;
	}
	.hbs-resource__item {
		flex-direction: column;
	}
	.hbs-resource__media {
		flex-basis: auto;
		width: 100%;
		aspect-ratio: 16 / 9;
	}
}

/* ---------- Accessibility --------------------------------------------- */
.hbs-card__title a:focus-visible,
.hbs-resource__title a:focus-visible,
.hbs-card__more:focus-visible,
.hbs-card__media:focus-visible {
	outline: 3px solid var(--hbs-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.hbs-card,
	.hbs-card__media img,
	.hbs-resource__media img,
	.hbs-arrow,
	.hbs-card__title a,
	.hbs-carousel__viewport {
		transition: none;
		scroll-behavior: auto;
	}
	.hbs-card:hover {
		transform: none;
	}
	.hbs-card:hover .hbs-card__media img,
	.hbs-resource__item:hover .hbs-resource__media img {
		transform: none;
	}
}
