/* =============================================================================
   Stack Heading — Frontend Styles
   ============================================================================= */

:root {
	--stk-primary:     #0e0e0e;
	--stk-secondary:   #444444;
	--stk-accent:      #6c63ff;
	--stk-accent-rgb:  108, 99, 255;
	--stk-muted:       #888888;
	--stk-border:      #e0e0e0;
	--stk-white:       #ffffff;
	--stk-shadow:      rgba(0, 0, 0, 0.08);
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */

.stk-heading-wrap {
	position: relative;
}

/* Overlay layer — used when a background image needs a colour tint */
.stk-heading-wrap::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	border-radius: inherit;
	background-color: transparent;
}

/* Keep all direct children above the overlay */
.stk-heading-wrap > * {
	position: relative;
	z-index: 1;
}

/* ── Alignment variants ───────────────────────────────────────────────────── */

.stk-heading-wrap.stk-center            { text-align: center; }
.stk-heading-wrap.stk-left              { text-align: left;   }
.stk-heading-wrap.stk-right             { text-align: right;  }

/* ── Style 8: Split (title left / button right) ───────────────────────────── */
/* ── Style 22: Split Reverse (button left / title right) ─────────────────── */

.stk-heading-wrap.stk-split {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}
.stk-split .stk-split-inner {
	flex: 1 1 0;
	min-width: 0;
}
.stk-split .stk-split-btn {
	flex-shrink: 0;
}
.stk-split.stk-split-reverse {
	flex-direction: row-reverse;
}

/* ── Style 4/5: Divider line on side ─────────────────────────────────────── */

.stk-heading-wrap.stk-has-line .stk-main {
	position: relative;
	padding-bottom: 16px;
}
.stk-heading-wrap.stk-has-line .stk-main::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 60px;
	height: 4px;
	background-color: var(--stk-accent);
	border-radius: 2px;
}
.stk-heading-wrap.stk-center.stk-has-line .stk-main::after {
	left: 50%;
	transform: translateX(-50%);
}
.stk-heading-wrap.stk-right.stk-has-line .stk-main::after {
	left: auto;
	right: 0;
}

/* ── Style 6: Badge top ───────────────────────────────────────────────────── */

.stk-heading-wrap.stk-has-badge .stk-badge {
	display: inline-block;
}

/* ── Tier 1: Badge ────────────────────────────────────────────────────────── */

.stk-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--stk-accent);
	background-color: rgba(var(--stk-accent-rgb), 0.10);
	border: 1px solid rgba(var(--stk-accent-rgb), 0.25);
	border-radius: 100px;
	padding: 4px 14px;
	margin-bottom: 14px;
}

/* ── Tier 2: Pre-Title ────────────────────────────────────────────────────── */

.stk-pretitle {
	font-size: 18px;
	font-weight: 500;
	color: var(--stk-secondary);
	margin: 0 0 10px;
	line-height: 1.4;
}

/* ── Tier 3: Main Heading ─────────────────────────────────────────────────── */

.stk-main {
	position: relative;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.15;
	color: var(--stk-primary);
	margin: 0 0 14px;
}

/* ── Tier 4: Sub Heading ──────────────────────────────────────────────────── */

.stk-sub {
	font-size: 22px;
	font-weight: 600;
	color: var(--stk-secondary);
	margin: 0 0 12px;
	line-height: 1.35;
}

/* ── Tier 5: Highlight / Tagline ─────────────────────────────────────────── */

.stk-highlight {
	font-size: 20px;
	font-weight: 700;
	color: var(--stk-accent);
	font-style: italic;
	margin: 0 0 14px;
	line-height: 1.4;
}

/* ── Tier 6: Description ──────────────────────────────────────────────────── */

.stk-desc {
	font-size: 16px;
	line-height: 1.75;
	color: var(--stk-muted);
	margin: 0 0 14px;
}

.stk-heading-wrap.stk-center .stk-desc {
	margin-left: auto;
	margin-right: auto;
}

/* ── Tier 7: Footer Note ──────────────────────────────────────────────────── */

.stk-footnote {
	display: block;
	font-size: 12px;
	color: var(--stk-muted);
	margin-top: 8px;
	opacity: 0.75;
}

/* ── Inline span highlight ────────────────────────────────────────────────── */

.stk-pretitle span,
.stk-main span,
.stk-sub span,
.stk-highlight span,
.stk-desc span {
	color: var(--stk-accent);
}

/* ── Icon ─────────────────────────────────────────────────────────────────── */

.stk-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
	color: var(--stk-accent);
}
.stk-icon i,
.stk-icon svg {
	font-size: 40px;
	width: 40px;
	height: auto;
	fill: var(--stk-accent);
	transition: color 0.25s ease;
}

/* ── Divider Bar ──────────────────────────────────────────────────────────── */

.stk-bar {
	display: block;
	width: 60px;
	height: 4px;
	background-color: var(--stk-accent);
	border-radius: 2px;
	margin: 0 0 18px;
}

.stk-heading-wrap.stk-center .stk-bar {
	margin-left: auto;
	margin-right: auto;
}

.stk-heading-wrap.stk-right .stk-bar {
	margin-left: auto;
	margin-right: 0;
}

/* ── Circle bar animation ─────────────────────────────────────────────────── */

.stk-circle-bar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-top: 16px;
}
.stk-circle-bar span {
	display: block;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 4px solid transparent;
	border-top-color: var(--stk-accent);
	animation: stk-spin 1.4s linear infinite;
}

@keyframes stk-spin {
	to { transform: rotate(360deg); }
}

/* ── Image ────────────────────────────────────────────────────────────────── */

.stk-image {
	display: inline-block;
	margin-bottom: 16px;
}
.stk-image img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ── Button ───────────────────────────────────────────────────────────────── */

.stk-btn {
	display: inline-block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	padding: 13px 28px;
	border-radius: 4px;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	white-space: nowrap;
}
.stk-btn-outline {
	color: var(--stk-accent);
	border: 2px solid var(--stk-accent);
	background: transparent;
}
.stk-btn-outline:hover {
	background-color: var(--stk-accent);
	color: var(--stk-white);
}
.stk-btn-fill {
	color: var(--stk-white);
	background-color: var(--stk-accent);
	border: 2px solid var(--stk-accent);
}
.stk-btn-fill:hover {
	background-color: transparent;
	color: var(--stk-accent);
}
.stk-btn-ghost {
	color: var(--stk-primary);
	background: transparent;
	border: none;
	padding-left: 0;
	padding-right: 0;
}
.stk-btn-ghost:hover {
	color: var(--stk-accent);
}

/* ── Style 9: Center + Overline Rule ──────────────────────────────────────── */

.stk-overline .stk-main {
	padding-top: 18px;
}
.stk-overline .stk-main::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 3px;
	background-color: var(--stk-accent);
	border-radius: 2px;
}

/* ── Style 11: Left + Vertical Border Bar ─────────────────────────────────── */

.stk-bordered {
	padding-left: 20px;
	border-left: 4px solid var(--stk-accent);
}

/* ── Style 13: Center + Flanked Lines ─────────────────────────────────────── */

.stk-flanked .stk-badge,
.stk-flanked .stk-pretitle {
	display: flex;
	align-items: center;
	gap: 14px;
	white-space: nowrap;
}
.stk-flanked .stk-badge::before,
.stk-flanked .stk-badge::after,
.stk-flanked .stk-pretitle::before,
.stk-flanked .stk-pretitle::after {
	content: '';
	flex: 1;
	height: 1px;
	background-color: var(--stk-border);
	min-width: 24px;
}

/* ── Style 14: Left + Filled Tag Badge ────────────────────────────────────── */

.stk-tag .stk-badge {
	border-radius: 4px;
	background-color: var(--stk-accent);
	color: var(--stk-white);
	border-color: var(--stk-accent);
}

/* ── Style 15: Center + Gradient Underline ────────────────────────────────── */

.stk-underline-accent .stk-main {
	padding-bottom: 14px;
}
.stk-underline-accent .stk-main::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 75%;
	height: 3px;
	background: linear-gradient( to right, transparent, var(--stk-accent), transparent );
	border-radius: 2px;
}

/* ── Style 16: Left + Card Container ─────────────────────────────────────── */

.stk-card {
	background: var(--stk-white);
	border: 1px solid var(--stk-border);
	border-radius: 12px;
	padding: 32px 36px;
	box-shadow: 0 4px 24px var(--stk-shadow);
}

/* ── Style 17: Dark Card (Inverted) ───────────────────────────────────────── */

.stk-dark {
	background-color: var(--stk-primary);
	border-radius: 12px;
	padding: 40px 44px;
}
.stk-dark .stk-main,
.stk-dark .stk-sub,
.stk-dark .stk-highlight {
	color: var(--stk-white);
}
.stk-dark .stk-pretitle,
.stk-dark .stk-desc,
.stk-dark .stk-footnote {
	color: rgba( 255, 255, 255, 0.65 );
}
.stk-dark .stk-badge {
	background-color: rgba( 255, 255, 255, 0.1 );
	border-color: rgba( 255, 255, 255, 0.2 );
	color: var(--stk-white);
}
.stk-dark .stk-bar {
	background-color: var(--stk-white);
}

/* ── Style 18: Center + Icon Circle ──────────────────────────────────────── */

.stk-icon-circle .stk-icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background-color: rgba( var(--stk-accent-rgb), 0.1 );
	border: 1px solid rgba( var(--stk-accent-rgb), 0.25 );
	margin-bottom: 20px;
}
.stk-icon-circle .stk-icon i,
.stk-icon-circle .stk-icon svg {
	font-size: 28px;
	width: 28px;
}

/* ── Style 19: Left + Timeline Marker ────────────────────────────────────── */

.stk-timeline {
	padding-left: 40px;
}
.stk-timeline::before {
	content: '';
	position: absolute;
	left: 0;
	top: 6px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background-color: var(--stk-accent);
	box-shadow: 0 0 0 4px rgba( var(--stk-accent-rgb), 0.18 );
	z-index: 1;
}
.stk-timeline::after {
	content: '';
	position: absolute;
	left: 7px;
	top: 28px;
	width: 2px;
	bottom: 0;
	background-color: var(--stk-border);
}

/* ── Style 20: Icon Left / Content Right (CSS grid) ──────────────────────── */

.stk-icon-side {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0 28px;
	align-items: start;
}
.stk-icon-side .stk-icon-pos-top {
	grid-column: 1;
	grid-row: 1 / span 20;
	align-self: start;
	margin-bottom: 0;
}
.stk-icon-side > *:not( .stk-icon-pos-top ) {
	grid-column: 2;
}

/* ── Style 21: Center + Gradient Text ────────────────────────────────────── */

.stk-gradient-text .stk-main {
	background: linear-gradient( 135deg, var(--stk-accent) 0%, #ff6584 100% );
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* ── Style 23: Center Minimal / Bold ─────────────────────────────────────── */

.stk-minimal .stk-main {
	font-size: 52px;
	font-weight: 900;
	letter-spacing: -0.025em;
	line-height: 1.1;
}
.stk-minimal .stk-badge {
	background-color: transparent;
	border: none;
	font-size: 11px;
	letter-spacing: 0.15em;
	color: var(--stk-muted);
	padding: 0;
	margin-bottom: 10px;
}
.stk-minimal .stk-pretitle {
	font-size: 16px;
	color: var(--stk-muted);
	font-weight: 400;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media ( max-width: 1024px ) {
	.stk-main          { font-size: 32px; }
	.stk-minimal .stk-main { font-size: 40px; }
}
@media ( max-width: 767px ) {
	.stk-main      { font-size: 26px; }
	.stk-sub       { font-size: 18px; }
	.stk-highlight { font-size: 17px; }
	.stk-desc      { font-size: 15px; }

	.stk-minimal .stk-main { font-size: 32px; }

	.stk-heading-wrap.stk-split {
		flex-direction: column;
		align-items: flex-start;
	}
	.stk-split.stk-split-reverse {
		flex-direction: column;
	}

	.stk-icon-side {
		grid-template-columns: 1fr;
	}
	.stk-icon-side .stk-icon-pos-top,
	.stk-icon-side > *:not( .stk-icon-pos-top ) {
		grid-column: 1;
	}
	.stk-icon-side .stk-icon-pos-top {
		grid-row: auto;
		margin-bottom: 16px;
	}

	.stk-dark,
	.stk-card {
		padding: 24px 20px;
	}
}
