/* =============================================================================
   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;
}

/* ── Style 24: Left + Outline Box ───────────────────────────────────────── */

.stk-outline-box {
	border: 2px solid var(--stk-primary);
	border-radius: 10px;
	padding: 28px 32px;
	background: transparent;
}

/* ── Style 25: Center + Shadow Panel ─────────────────────────────────────── */

.stk-shadow-panel {
	background: var(--stk-white);
	border-radius: 14px;
	padding: 36px 40px;
	box-shadow: 0 14px 40px rgba(0,0,0,0.12);
	border: 1px solid rgba(0,0,0,0.06);
}

/* ── Style 26: Left + Ribbon Badge ───────────────────────────────────────── */

.stk-ribbon .stk-badge {
	position: relative;
	background: var(--stk-accent);
	color: var(--stk-white);
	border-color: var(--stk-accent);
}
.stk-ribbon .stk-badge::before,
.stk-ribbon .stk-badge::after {
	content: '';
	position: absolute;
	top: 100%;
	width: 10px;
	height: 10px;
	background: var(--stk-accent);
}
.stk-ribbon .stk-badge::before { left: 10px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.stk-ribbon .stk-badge::after  { left: 20px; clip-path: polygon(0 0, 100% 0, 0 100%); opacity: .8; }

/* ── Style 27: Center + Brackets ─────────────────────────────────────────── */

.stk-brackets .stk-main { position: relative; display: inline-block; padding: 0 18px; }
.stk-brackets .stk-main::before,
.stk-brackets .stk-main::after {
	content: '';
	position: absolute;
	top: 50%;
	width: 12px; height: 24px;
	border: 3px solid var(--stk-accent);
	border-top: 0; border-bottom: 0;
	transform: translateY(-50%);
}
.stk-brackets .stk-main::before { left: 0; border-right: 0; border-radius: 3px 0 0 3px; }
.stk-brackets .stk-main::after  { right: 0; border-left: 0; border-radius: 0 3px 3px 0; }

/* ── Style 28: Left + Diagonal Accent ────────────────────────────────────── */

.stk-diagonal { padding-left: 18px; }
.stk-diagonal::before {
	content: '';
	position: absolute; left: 0; top: 12px;
	width: 10px; height: 44px;
	background: linear-gradient(135deg, var(--stk-accent), rgba(var(--stk-accent-rgb), .5));
	transform: skewY(-20deg);
	border-radius: 2px;
}

/* ── Style 29: Center + Gradient Pill ────────────────────────────────────── */

.stk-gradient-pill .stk-main {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--stk-accent), #ff6584);
	color: var(--stk-white);
}

/* ── Style 30: Right + Dotted Underline ──────────────────────────────────── */

.stk-dotted-underline .stk-main { display: inline-block; padding-bottom: 8px; border-bottom: 3px dotted var(--stk-accent); }

/* ── Style 31: Left + Double Line ───────────────────────────────────────── */

.stk-double-line .stk-main { position: relative; padding-bottom: 18px; }
.stk-double-line .stk-main::before,
.stk-double-line .stk-main::after {
	content: '';
	position: absolute; left: 0; right: 0; height: 3px;
	background: var(--stk-accent);
	border-radius: 2px;
}
.stk-double-line .stk-main::before { bottom: 6px; opacity: .5; }
.stk-double-line .stk-main::after  { bottom: 0; }

/* ── Style 32: Center + Corner Box ───────────────────────────────────────── */

.stk-corner-box { position: relative; padding: 28px; border: 1px solid var(--stk-border); }
.stk-corner-box::before,
.stk-corner-box::after {
	content: '';
	position: absolute; width: 18px; height: 18px; border: 3px solid var(--stk-accent);
}
.stk-corner-box::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.stk-corner-box::after  { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }

/* ── Style 33: Left + Stamp ──────────────────────────────────────────────── */

.stk-stamp .stk-badge {
	border: 2px dashed var(--stk-accent);
	background: rgba(var(--stk-accent-rgb), 0.06);
	text-transform: uppercase;
	letter-spacing: .2em;
}
.stk-stamp .stk-main { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }

/* ── Style 34: Center + Lifted Card ─────────────────────────────────────── */

.stk-lifted { background: var(--stk-white); border: 1px solid var(--stk-border); border-radius: 10px; padding: 28px 30px; position: relative; }
.stk-lifted::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -8px; height: 16px; background: radial-gradient(ellipse at center, rgba(0,0,0,.15), transparent 70%); filter: blur(6px); z-index: 0; }
.stk-lifted > * { position: relative; z-index: 1; }

/* ── Style 35: Right + Overlap Accent ───────────────────────────────────── */

.stk-overlap .stk-main { position: relative; display: inline-block; padding: 6px 10px; }
.stk-overlap .stk-main::before { content: ''; position: absolute; inset: 0 20% 0 0; background: rgba(var(--stk-accent-rgb), .15); z-index: -1; border-radius: 4px; }

/* ── Style 36: Center + Ruled Notebook ──────────────────────────────────── */

.stk-ruled { background: repeating-linear-gradient( to bottom, #fff, #fff 28px, rgba(0,0,0,.05) 29px, rgba(0,0,0,.05) 30px ); padding: 24px 26px; border-radius: 8px; }
.stk-ruled .stk-pretitle { color: #2d6cdf; }

/* ── Style 37: Left + Mono Tech ─────────────────────────────────────────── */

.stk-mono .stk-main, .stk-mono .stk-sub, .stk-mono .stk-highlight { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; }
.stk-mono { border-left: 4px solid var(--stk-accent); padding-left: 18px; }

/* ── Style 38: Center + Serif Classic ───────────────────────────────────── */

.stk-serif .stk-main, .stk-serif .stk-sub { font-family: Georgia, 'Times New Roman', Times, serif; font-weight: 700; letter-spacing: .01em; }
.stk-serif .stk-pretitle { font-variant: small-caps; letter-spacing: .12em; color: var(--stk-secondary); }

/* ── Style 39: Right + Upper Bar ────────────────────────────────────────── */

.stk-upper-bar { border-top: 6px solid var(--stk-accent); padding-top: 18px; }

/* ── Style 40: Center + Glass Frost ─────────────────────────────────────── */

.stk-glass { background: rgba(255,255,255,.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.4); border-radius: 14px; padding: 30px 34px; box-shadow: 0 8px 30px rgba(0,0,0,.08); }

/* ── 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;
	}
}
