/* SmartTOC Builder — frontend styles
   All colors flow through CSS variables so skins, global settings,
   and Elementor controls can each override them. */

.stocb-toc {
	--stocb-bg: #f8f9fa;
	--stocb-border: #e2e4e7;
	--stocb-title: #1e1e1e;
	--stocb-link: #344054;
	--stocb-link-hover: #1a56db;
	--stocb-active: #1a56db;
	--stocb-title-size: 1.05em;
	--stocb-item-size: 0.95em;
	--stocb-radius: 6px;
	--stocb-sticky-offset: 32px;

	box-sizing: border-box;
	margin: 0 0 1.5em;
	padding: 0;
	background: var(--stocb-bg);
	border: 1px solid var(--stocb-border);
	border-radius: var(--stocb-radius);
	max-width: 100%;
}

.stocb-toc *,
.stocb-toc *::before,
.stocb-toc *::after {
	box-sizing: inherit;
}

/* ----- Header ----- */
.stocb-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
}

.stocb-title {
	font-size: var(--stocb-title-size);
	font-weight: 600;
	color: var(--stocb-title);
	line-height: 1.3;
}

.stocb-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	flex-shrink: 0;
}

.stocb-toggle:hover {
	background: rgba(0, 0, 0, 0.06);
}

.stocb-chevron {
	display: block;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--stocb-title);
	border-bottom: 2px solid var(--stocb-title);
	transform: rotate(45deg) translate(-1px, -1px);
	transition: transform 0.2s ease;
}

.stocb-collapsed .stocb-chevron {
	transform: rotate(-45deg) translate(-1px, 1px);
}

/* ----- Body / list ----- */
.stocb-body {
	padding: 4px 16px 14px;
	overflow: hidden;
}

.stocb-collapsed .stocb-body {
	display: none;
}

.stocb-toc ul.stocb-list,
.stocb-toc ul.stocb-sublist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.stocb-toc ul.stocb-sublist {
	margin-top: 4px;
	padding-left: 18px;
}

.stocb-toc li {
	margin: 0 0 4px;
	padding: 0;
	font-size: var(--stocb-item-size);
	line-height: 1.45;
}

.stocb-link {
	color: var(--stocb-link);
	text-decoration: none;
	border-bottom: 0;
	box-shadow: none;
	transition: color 0.15s ease;
}

.stocb-link:hover,
.stocb-link:focus {
	color: var(--stocb-link-hover);
	text-decoration: underline;
}

.stocb-link.stocb-is-active {
	color: var(--stocb-active);
	font-weight: 600;
}

/* Numbered list via CSS counters (1. / 1.1. / 1.1.1.) */
.stocb-list-numbers ul.stocb-list,
.stocb-list-numbers ul.stocb-sublist {
	counter-reset: stocb;
}

.stocb-list-numbers li {
	counter-increment: stocb;
}

.stocb-list-numbers li::before {
	content: counters(stocb, ".") ". ";
	color: var(--stocb-link);
	opacity: 0.75;
	font-variant-numeric: tabular-nums;
}

/* Bulleted */
.stocb-list-bullets li::before {
	content: "\2022\00a0";
	color: var(--stocb-link-hover);
}

/* ----- Alignment ----- */
.stocb-align-left {
	float: left;
	margin: 0 1.5em 1em 0;
}

.stocb-align-right {
	float: right;
	margin: 0 0 1em 1.5em;
}

.stocb-align-center {
	margin-left: auto;
	margin-right: auto;
}

/* ----- Sticky ----- */
.stocb-sticky {
	position: sticky;
	top: var(--stocb-sticky-offset);
	z-index: 10;
}

/* ----- Skins ----- */
.stocb-skin-minimal {
	--stocb-bg: transparent;
	--stocb-border: transparent;
	border: 0;
}

.stocb-skin-minimal .stocb-header {
	padding-left: 0;
	padding-right: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stocb-skin-minimal .stocb-body {
	padding-left: 0;
	padding-right: 0;
}

.stocb-skin-boxed {
	--stocb-bg: #f8f9fa;
	--stocb-border: #dcdfe4;
}

.stocb-skin-modern {
	--stocb-bg: #ffffff;
	--stocb-border: #eceef1;
	--stocb-radius: 10px;
	border-left: 4px solid var(--stocb-active);
	box-shadow: 0 4px 18px rgba(16, 24, 40, 0.08);
}

.stocb-skin-dark {
	--stocb-bg: #1e2430;
	--stocb-border: #2c3444;
	--stocb-title: #f5f7fa;
	--stocb-link: #c3cad6;
	--stocb-link-hover: #7ab5ff;
	--stocb-active: #7ab5ff;
}

.stocb-skin-dark .stocb-toggle:hover {
	background: rgba(255, 255, 255, 0.08);
}

.stocb-skin-accent {
	--stocb-bg: #ffffff;
	--stocb-border: #d8e2f8;
	--stocb-title: #ffffff;
}

.stocb-skin-accent .stocb-header {
	background: var(--stocb-active);
	border-radius: calc(var(--stocb-radius) - 1px) calc(var(--stocb-radius) - 1px) 0 0;
}

.stocb-skin-accent .stocb-chevron {
	border-color: #ffffff;
}

.stocb-skin-accent .stocb-toggle:hover {
	background: rgba(255, 255, 255, 0.15);
}

/* ----- Floating button + panel ----- */
.stocb-floating {
	position: fixed;
	bottom: 24px;
	z-index: 99999;
}

.stocb-floating-right {
	right: 24px;
}

.stocb-floating-left {
	left: 24px;
}

.stocb-floating-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #1a56db;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(16, 24, 40, 0.28);
	transition: transform 0.15s ease;
}

.stocb-floating-toggle:hover {
	transform: scale(1.06);
}

.stocb-floating-icon {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.stocb-floating-icon span {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 2px;
	background: #fff;
}

.stocb-floating-icon span:nth-child(2) {
	width: 13px;
}

.stocb-floating-icon span:nth-child(3) {
	width: 15px;
}

.stocb-floating-wrap {
	position: absolute;
	bottom: 64px;
	width: 300px;
	max-width: calc(100vw - 48px);
	max-height: min(60vh, 480px);
	overflow: auto;
	border-radius: 8px;
	box-shadow: 0 10px 34px rgba(16, 24, 40, 0.24);
}

.stocb-floating-right .stocb-floating-wrap {
	right: 0;
}

.stocb-floating-left .stocb-floating-wrap {
	left: 0;
}

.stocb-floating-wrap .stocb-toc {
	margin: 0;
}

/* ----- Misc ----- */
.stocb-toc .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 767px) {
	.stocb-align-left,
	.stocb-align-right {
		float: none;
		margin: 0 0 1.5em;
		width: 100% !important;
	}

	.stocb-sticky {
		position: static;
	}
}

@media (prefers-reduced-motion: reduce) {
	.stocb-chevron,
	.stocb-link,
	.stocb-floating-toggle {
		transition: none;
	}
}
