/*
 * Onliner SEO Setup – content boxes:
 * Easy Table of Contents, kk Star Ratings, Simple Author Box.
 * Accent color: --oss-accent (plugin setting › theme primary color › blue).
 */

#ez-toc-container,
.kk-star-ratings,
.saboxplugin-wrap {
	--oss-accent: var(--wd-primary-color, var(--e-global-color-primary, #2563eb));
	--oss-soft: #f4f5f7;
	--oss-soft: color-mix(in srgb, var(--oss-accent) 9%, #fff);
	--oss-text: #1f2937;
	--oss-muted: #4b5563;
	--oss-line: #eceef2;
	--oss-shadow: 0 10px 30px -18px rgba(16, 24, 40, 0.28);
}

/* ======================================================================
   Table of contents
   ====================================================================== */

#ez-toc-container {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 28px 0 32px;
	padding: 18px 22px 14px;
	direction: inherit;
	font-family: inherit;
	background: #fff;
	border: 1px solid var(--oss-line);
	border-inline-start: 4px solid var(--oss-accent);
	border-radius: 14px;
	box-shadow: var(--oss-shadow);
}

#ez-toc-container * {
	box-sizing: border-box;
}

/* Header ---------------------------------------------------------------- */

#ez-toc-container .ez-toc-title-container {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}

#ez-toc-container p.ez-toc-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.5;
	text-align: start;
	color: var(--oss-text);
}

#ez-toc-container p.ez-toc-title {
	position: relative;
	min-height: 34px;
	padding-inline-start: 44px;
}

/* Soft square + list icon in the accent color. */
#ez-toc-container p.ez-toc-title::before,
#ez-toc-container p.ez-toc-title::after {
	content: "";
	position: absolute;
	top: 50%;
	inset-inline-start: 0;
	width: 34px;
	height: 34px;
	margin-top: -17px;
	border-radius: 10px;
}

#ez-toc-container p.ez-toc-title::before {
	background: var(--oss-soft);
}

#ez-toc-container p.ez-toc-title::after {
	background: var(--oss-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h2v2H4zm4 0h12v2H8zm-4 5h2v2H4zm4 0h12v2H8zm-4 5h2v2H4zm4 0h12v2H8z'/%3E%3C/svg%3E") center / 18px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h2v2H4zm4 0h12v2H8zm-4 5h2v2H4zm4 0h12v2H8zm-4 5h2v2H4zm4 0h12v2H8z'/%3E%3C/svg%3E") center / 18px no-repeat;
}

#ez-toc-container .ez-toc-title-toggle {
	display: block;
	margin-inline-start: auto;
}

#ez-toc-container a.ez-toc-toggle,
#ez-toc-container a.ez-toc-toggle:hover,
#ez-toc-container a.ez-toc-toggle:focus {
	float: none !important;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
	text-shadow: none;
}

#ez-toc-container .ez-toc-js-icon-con,
#ez-toc-container .ez-toc-toggle label,
#ez-toc-container .ez-toc-cssicon {
	float: none;
	left: auto;
	display: block;
	width: auto;
	border: 1px solid var(--oss-line);
	border-radius: 10px;
	background: #fff;
	transition: border-color 0.2s, background-color 0.2s;
}

#ez-toc-container a.ez-toc-toggle:hover .ez-toc-js-icon-con,
#ez-toc-container a.ez-toc-toggle:focus-visible .ez-toc-js-icon-con {
	border-color: var(--oss-accent);
	background: var(--oss-soft);
}

#ez-toc-container .ez-toc-icon-toggle-span {
	width: 40px;
	height: 34px;
}

#ez-toc-container .ez-toc-icon-toggle-span svg {
	fill: var(--oss-accent) !important;
	color: var(--oss-accent) !important;
}

/* List ------------------------------------------------------------------ */

#ez-toc-container nav {
	margin-top: 14px;
	padding-top: 10px;
	border-top: 1px solid var(--oss-line);
}

#ez-toc-container ul,
#ez-toc-container ul li {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
	overflow: visible;
	line-height: 1.7;
}

#ez-toc-container ul.ez-toc-list {
	margin: 0;
	counter-reset: oss-toc;
}

#ez-toc-container ul.ez-toc-list::before,
#ez-toc-container ul li::before,
#ez-toc-container ul li::after {
	content: none;
}

#ez-toc-container ul.ez-toc-list > li + li {
	margin-top: 2px;
}

div#ez-toc-container nav ul li a,
div#ez-toc-container nav ul li a:visited {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	padding: 7px 10px;
	border-radius: 10px;
	color: var(--oss-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.7;
	text-align: start;
	text-decoration: none;
	box-shadow: none;
	border: 0;
	transition: background-color 0.2s, color 0.2s;
}

div#ez-toc-container nav ul li a:hover,
div#ez-toc-container nav ul li a:focus-visible {
	background: var(--oss-soft);
	color: var(--oss-accent);
	text-decoration: none;
	outline: none;
}

/* Number badge for main headings (replaces the plugin's "1.1." counters). */
#ez-toc-container nav ul li a::before {
	content: none;
	counter-increment: none;
	float: none;
	margin: 0;
}

#ez-toc-container nav ul.ez-toc-list > li > a::before {
	content: counter(oss-toc);
	counter-increment: oss-toc;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	margin-top: 0.05em;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--oss-soft);
	color: var(--oss-accent);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	transition: background-color 0.2s, color 0.2s;
}

[dir="rtl"] #ez-toc-container nav ul.ez-toc-list > li > a::before,
.rtl #ez-toc-container nav ul.ez-toc-list > li > a::before {
	content: counter(oss-toc, persian);
}

#ez-toc-container nav ul.ez-toc-list > li > a:hover::before {
	background: var(--oss-accent);
	color: #fff;
}

/* Sub headings: guide line + dot. */
div#ez-toc-container nav ul ul {
	margin: 2px 0 6px;
	margin-inline-start: 22px;
	padding-inline-start: 10px;
	border-inline-start: 2px solid var(--oss-line);
}

div#ez-toc-container nav ul ul li a,
div#ez-toc-container nav ul ul li a:visited {
	padding: 5px 10px;
	color: var(--oss-muted);
	font-size: 14px;
	font-weight: 500;
}

#ez-toc-container nav ul ul li a::before {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	margin-top: calc(0.85em - 3px);
	border-radius: 50%;
	background: #c7ccd4;
	transition: background-color 0.2s;
}

#ez-toc-container nav ul ul li a:hover::before {
	background: var(--oss-accent);
}

div#ez-toc-container nav ul ul ul li a,
div#ez-toc-container nav ul ul ul li a:visited {
	font-size: 13.5px;
}

/* Mobile ---------------------------------------------------------------- */

@media (max-width: 600px) {
	#ez-toc-container {
		margin: 20px 0 24px;
		padding: 14px 14px 10px;
		border-radius: 12px;
	}

	#ez-toc-container p.ez-toc-title {
		font-size: 16px;
	}

	div#ez-toc-container nav ul li a,
	div#ez-toc-container nav ul li a:visited {
		padding: 6px 8px;
		font-size: 14px;
	}

	div#ez-toc-container nav ul ul {
		margin-inline-start: 14px;
		padding-inline-start: 6px;
	}

	div#ez-toc-container nav ul ul li a,
	div#ez-toc-container nav ul ul li a:visited {
		font-size: 13.5px;
	}
}

/* ======================================================================
   kk Star Ratings
   Star sizes and gaps stay untouched: the plugin measures them in JS.
   ====================================================================== */

.kk-star-ratings {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	width: fit-content;
	max-width: 100%;
	box-sizing: border-box;
	margin-top: 2.25rem;
	margin-bottom: 1.5rem;
	padding: 10px 12px 10px 18px;
	background: #fff;
	border: 1px solid var(--oss-line);
	border-radius: 999px;
	box-shadow: var(--oss-shadow);
	font-family: inherit;
}

[dir="rtl"] .kk-star-ratings,
.rtl .kk-star-ratings {
	padding: 10px 18px 10px 12px;
}

.kk-star-ratings.kksr-align-center {
	margin-inline: auto;
}

.kk-star-ratings.kksr-align-left {
	margin-inline: 0 auto;
}

.kk-star-ratings.kksr-align-right {
	margin-inline: auto 0;
}

.kk-star-ratings.kksr-shortcode {
	display: inline-flex;
}

.kk-star-ratings .kksr-stars {
	flex: none;
}

.kk-star-ratings .kksr-legend {
	margin: 0;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--oss-soft);
	color: var(--oss-text);
	font-size: 14px !important;
	font-weight: 600;
	line-height: 1.6;
	white-space: nowrap;
}

.kk-star-ratings .kksr-legend .kksr-muted {
	opacity: 1;
	color: var(--oss-muted);
}

/* ======================================================================
   Simple Author Box
   ====================================================================== */

body .entry-content .saboxplugin-wrap,
body .saboxplugin-wrap {
	position: relative;
	margin-top: 1.5rem;
	margin-bottom: 2rem;
	padding: 0;
	background: #fff;
	border: 1px solid var(--oss-line);
	border-radius: 16px;
	box-shadow: var(--oss-shadow);
	overflow: hidden;
	font-family: inherit;
}

body .saboxplugin-wrap::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 4px;
	background: var(--oss-accent);
}

body .saboxplugin-wrap .saboxplugin-tab {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	column-gap: 22px;
	align-items: start;
	padding: 26px 26px 20px;
	background: linear-gradient(180deg, var(--oss-soft), #fff 70%);
}

body .saboxplugin-wrap .saboxplugin-tab .clearfix {
	display: none;
}

body .saboxplugin-wrap .saboxplugin-gravatar,
body.rtl .saboxplugin-wrap .saboxplugin-gravatar {
	grid-row: 1 / span 3;
	float: none;
	margin: 0;
	padding: 0;
	text-align: center;
}

body .saboxplugin-wrap .saboxplugin-gravatar img {
	display: block;
	width: 96px;
	height: 96px;
	max-width: 96px;
	object-fit: cover;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 0 0 2px var(--oss-accent), 0 8px 18px -8px rgba(16, 24, 40, 0.35);
}

body .saboxplugin-wrap .saboxplugin-authorname,
body.rtl .saboxplugin-wrap .saboxplugin-authorname {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.5;
}

body .saboxplugin-wrap .saboxplugin-authorname::before {
	content: "Written by";
	color: var(--oss-accent);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

[dir="rtl"] body .saboxplugin-wrap .saboxplugin-authorname::before,
body.rtl .saboxplugin-wrap .saboxplugin-authorname::before {
	content: "نویسنده مطلب";
	letter-spacing: 0;
}

body .saboxplugin-wrap .saboxplugin-authorname a,
body .saboxplugin-wrap .saboxplugin-authorname a:visited {
	color: var(--oss-text);
	text-decoration: none;
	transition: color 0.2s;
}

body .saboxplugin-wrap .saboxplugin-authorname a:hover {
	color: var(--oss-accent);
}

body .saboxplugin-wrap .saboxplugin-desc {
	margin: 0;
}

body .saboxplugin-wrap .saboxplugin-desc,
body .saboxplugin-wrap .saboxplugin-desc p {
	color: var(--oss-muted);
	font-size: 14.5px !important;
	font-weight: 400;
	line-height: 2 !important;
	text-align: justify;
}

body .saboxplugin-wrap .saboxplugin-desc p {
	margin: 0 0 8px;
}

body .saboxplugin-wrap .saboxplugin-desc p:last-child {
	margin-bottom: 0;
}

body .saboxplugin-wrap .saboxplugin-desc a {
	color: var(--oss-accent);
}

body .saboxplugin-wrap .saboxplugin-web {
	grid-column: 2;
	margin: 6px 0 0;
	text-align: start;
}

body .saboxplugin-wrap .saboxplugin-web a {
	color: var(--oss-accent);
}

body .saboxplugin-wrap .saboxplugin-socials {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px 26px;
	background: #fff;
	border-top: 1px solid var(--oss-line);
}

body .saboxplugin-wrap .saboxplugin-socials a {
	margin: 0 !important;
}

/* ======================================================================
   Mobile
   ====================================================================== */

@media (max-width: 600px) {
	.kk-star-ratings,
	[dir="rtl"] .kk-star-ratings,
	.rtl .kk-star-ratings {
		justify-content: center;
		padding: 10px 14px;
		border-radius: 16px;
	}

	body .saboxplugin-wrap .saboxplugin-tab {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		padding: 24px 18px 18px;
		text-align: center;
	}

	body .saboxplugin-wrap .saboxplugin-gravatar,
	body.rtl .saboxplugin-wrap .saboxplugin-gravatar {
		grid-row: auto;
		margin-bottom: 12px;
	}

	body .saboxplugin-wrap .saboxplugin-authorname,
	body.rtl .saboxplugin-wrap .saboxplugin-authorname {
		align-items: center;
	}

	body .saboxplugin-wrap .saboxplugin-web {
		grid-column: auto;
		text-align: center;
	}

	body .saboxplugin-wrap .saboxplugin-desc,
	body .saboxplugin-wrap .saboxplugin-desc p {
		text-align: center;
	}

	body .saboxplugin-wrap .saboxplugin-socials {
		justify-content: center;
		padding: 10px 18px;
	}
}

@media print {
	#ez-toc-container,
	.kk-star-ratings,
	body .saboxplugin-wrap {
		box-shadow: none;
	}
}
