/* Fixed TOC - [fixed_toc] shortcode styles */

.fixed-toc-shortcode {
	background: #f9fafb;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Position variants */
.toc-position-inline {
	width: 100%;
	max-width: 100%;
}

.fixed-toc-shortcode.toc-position-inline {
	border: 1px solid var(--toc-sc-accent, #ccb271);
	border-radius: 4px;
	background: var(--toc-sc-bg, #fff);
	padding: 12px;
	position: relative; /* anchor for the absolutely-positioned icon */
}

/* Sticky is optional (Settings > Fixed TOC or sticky="yes|no") */
.fixed-toc-shortcode.toc-position-inline.toc-sticky {
	position: sticky;
	top: var(--toc-sc-top, 115px);
}

.toc-position-float-right {
	float: right;
	width: 300px;
	margin: 0 0 20px 30px;
}

.toc-position-float-left {
	float: left;
	width: 300px;
	margin: 0 30px 20px 0;
}

/* Header */
.toc-shortcode-header {
	display: flex;
	justify-content: center;
	align-items: center;
	align-content: center;
	border-bottom: 2px solid var(--toc-sc-accent, #ccb271);
	padding-bottom: 10px;
	margin-bottom: 15px;
}

h3.toc-shortcode-title {
	margin: 0;
	display: flex;
	align-items: center;
	font-family: "Open Sans", sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 600;
	line-height: 24px;
	color: var(--toc-sc-accent, #ccb271);
	text-transform: uppercase;
}

.toc-shortcode-title svg {
	margin-right: 10px;
}

/* Inline variant: icon is pinned to the top-left corner of the sticky box */
.toc-position-inline h3.toc-shortcode-title {
	padding-left: 30px;
}

.toc-position-inline h3.toc-shortcode-title svg {
	position: absolute;
	top: 14px;
	left: 12px;
}

/* List */
.toc-shortcode-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.toc-shortcode-list li {
	list-style: none;
	margin: 3px 0;
	line-height: 1.6;
}

.toc-shortcode-list a {
	color: #4b5563;
	text-decoration: none;
	display: inline-block;
	padding: 5px 10px;
	border-radius: 4px;
	transition: all 0.2s ease;
	position: relative;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 20px;
}

.toc-shortcode-list a:hover {
	color: var(--toc-sc-accent, #ccb271);
	background: #ede9fe;
	transform: translateX(5px);
}

.toc-shortcode-list a:focus-visible {
	outline: 2px solid var(--toc-sc-accent, #ccb271);
	outline-offset: 2px;
}

.toc-shortcode-list a:before {
	content: "\203A"; /* single right-pointing angle quote */
	margin-right: 8px;
	color: var(--toc-sc-accent, #ccb271);
	font-weight: bold;
}

/* Active link highlight */
.toc-shortcode-list a.active {
	color: var(--toc-sc-accent, #ccb271);
	font-weight: 600;
	border-left: 3px solid var(--toc-sc-accent, #ccb271);
	padding-left: 7px;
	background: #f3f4f6;
}

/* Numbering */
.toc-numbered .toc-shortcode-list a:before {
	display: none;
}

.toc-numbered .toc-number {
	display: inline-block;
	min-width: 25px;
	color: var(--toc-sc-accent, #ccb271);
	font-weight: bold;
}

/* Level indentation */
.toc-level-1 { padding-left: 0;    font-weight: 600; font-size: 16px; }
.toc-level-2 { padding-left: 0;    font-size: 15px; }
.toc-level-3 { padding-left: 0;    font-size: 14px; }
.toc-level-4 { padding-left: 60px; font-size: 13px; }
.toc-level-5 { padding-left: 80px; font-size: 12px; }
.toc-level-6 { padding-left: 100px; font-size: 12px; }

/* Smooth anchor scrolling (respects reduced-motion preference) */
html {
	scroll-padding-top: 100px;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

@media (prefers-reduced-motion: reduce) {
	.toc-shortcode-list a {
		transition: none;
	}
}

/* Responsive */
@media (max-width: 768px) {
	.toc-position-float-right,
	.toc-position-float-left {
		float: none;
		width: 100%;
		margin: 20px 0;
	}

	.toc-level-3,
	.toc-level-4,
	.toc-level-5,
	.toc-level-6 {
		padding-left: 0;
	}

	/* Theme-specific: sticky TOC column (Flatsome "col_toc") on mobile */
	.large-3.col.col_toc {
		position: sticky;
		top: 75px; /* adjust to your header height */
		z-index: 999;
		background: #fff;
		border: 1px solid #eee;
		border-radius: 8px;
		margin: 10px;
		padding: 0;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	}

	.fixed-toc-shortcode .toc-shortcode-header {
		cursor: pointer;
		padding: 10px;
		background: #f8f8f8;
		border-bottom: 1px solid #eee;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.fixed-toc-shortcode .toc-shortcode-title {
		margin: 0;
		font-size: 16px;
		display: flex;
		align-items: center;
		gap: 6px;
	}

	.fixed-toc-shortcode .toc-shortcode-list {
		max-height: 300px;
		overflow-y: auto;
		transition: all 0.3s ease;
		padding: 10px 15px;
	}

	/* Collapsed */
	.fixed-toc-shortcode.collapsed .toc-shortcode-list {
		display: none;
	}
}

/* Print */
@media print {
	.fixed-toc-shortcode {
		background: #fff;
		border: 1px solid #000;
	}
}
