/* ==========================================================================
   Motv4k SEO & UX Optimizer — front-end styles (RTL first)
   Variables injected by Assets::inject_dynamic_css():
     --motv4k-accent        #6d28d9
     --motv4k-accent-dark
     --motv4k-accent-light
     --motv4k-radius        16px
   ========================================================================== */

:root {
	--motv4k-accent: #6d28d9;
	--motv4k-accent-dark: #5b21b6;
	--motv4k-accent-light: #ede9fe;
	--motv4k-radius: 16px;
	--motv4k-ink: #1f2430;
	--motv4k-muted: #6b7280;
	--motv4k-line: #e8eaf0;
	--motv4k-bg: #ffffff;
	--motv4k-shadow: 0 6px 24px rgba(20, 20, 50, 0.07);
	--motv4k-shadow-hover: 0 14px 40px rgba(109, 40, 217, 0.16);
}

/* Override only what the plugin renders; never touch theme chrome. */
.motv4k-articles-section,
.motv4k-related,
.motv4k-toc,
.motv4k-article-meta,
.motv4k-share,
.motv4k-author-box,
.motv4k-faq,
.motv4k-progress,
.motv4k-totop {
	box-sizing: border-box;
	font-family: inherit;
}

/* ----------------------------------------------------------------------
   Article meta row (date · reading time · author)
   ---------------------------------------------------------------------- */
.motv4k-article-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--motv4k-muted);
	margin: 0 0 1.25em;
	padding: 10px 0;
	border-bottom: 1px solid var(--motv4k-line);
}
.motv4k-article-meta .motv4k-meta-sep { opacity: .4; }
.motv4k-meta-readtime,
.motv4k-meta-author { font-weight: 600; color: var(--motv4k-ink); }
.motv4k-meta-author::before { content: "✍︎ "; opacity: .6; }

/* ----------------------------------------------------------------------
   Table of contents
   ---------------------------------------------------------------------- */
.motv4k-toc {
	background: var(--motv4k-accent-light);
	border: 1px solid color-mix(in srgb, var(--motv4k-accent) 18%, transparent);
	border-radius: var(--motv4k-radius);
	padding: 16px 18px;
	margin: 1.5em 0;
}
.motv4k-toc-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: transparent;
	border: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--motv4k-accent-dark);
	cursor: pointer;
	padding: 0;
}
.motv4k-toc-chevron { transition: transform .25s ease; }
.motv4k-toc[aria-expanded="false"] .motv4k-toc-chevron,
.motv4k-toc.collapsed .motv4k-toc-chevron { transform: rotate(-90deg); }
.motv4k-toc-list {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	counter-reset: toc;
}
.motv4k-toc-item { margin: 0; padding: 4px 0; }
.motv4k-toc-item::before {
	counter-increment: toc;
	content: counter(toc) ".";
	color: var(--motv4k-accent);
	font-weight: 700;
	margin-inline-end: 8px;
}
.motv4k-toc-level-3 {
	padding-inline-start: 22px;
	font-size: .92em;
}
.motv4k-toc-item::before { content: ""; }
.motv4k-toc-level-2::before {
	content: counter(toc) ".";
	counter-increment: toc;
	color: var(--motv4k-accent);
	font-weight: 700;
	margin-inline-end: 8px;
}
.motv4k-toc-item a {
	color: var(--motv4k-ink);
	text-decoration: none;
	transition: color .15s;
}
.motv4k-toc-item a:hover { color: var(--motv4k-accent); }
.motv4k-toc.collapsed .motv4k-toc-list { display: none; }

/* ----------------------------------------------------------------------
   Articles grid (homepage + shortcode)
   ---------------------------------------------------------------------- */
.motv4k-articles-section {
	margin: 3em 0;
	padding: 0;
}
.motv4k-articles-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}
.motv4k-articles-title {
	font-size: clamp(20px, 3vw, 28px);
	font-weight: 800;
	margin: 0;
	color: var(--motv4k-ink);
	position: relative;
	padding-inline-start: 14px;
}
.motv4k-articles-title::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 5px;
	height: 70%;
	background: linear-gradient(var(--motv4k-accent), var(--motv4k-accent-dark));
	border-radius: 4px;
}
.motv4k-articles-viewall {
	font-size: 14px;
	font-weight: 700;
	color: var(--motv4k-accent);
	text-decoration: none;
	white-space: nowrap;
}
.motv4k-articles-viewall:hover { text-decoration: underline; }

.motv4k-articles-grid-inner {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 22px;
}

.motv4k-card {
	background: var(--motv4k-bg);
	border: 1px solid var(--motv4k-line);
	border-radius: var(--motv4k-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.motv4k-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--motv4k-shadow-hover);
	border-color: transparent;
}
.motv4k-card-link { display: block; }
.motv4k-card-thumb {
	width: 100%;
	aspect-ratio: 16 / 9;
	background-size: cover;
	background-position: center;
	background-color: var(--motv4k-accent-light);
}
.motv4k-card-thumb--empty {
	background: linear-gradient(135deg, var(--motv4k-accent-light), color-mix(in srgb, var(--motv4k-accent) 20%, white));
}
.motv4k-card-body {
	padding: 16px 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}
.motv4k-card-cat {
	display: inline-block;
	align-self: flex-start;
	font-size: 11px;
	font-weight: 700;
	color: var(--motv4k-accent-dark);
	background: var(--motv4k-accent-light);
	padding: 3px 10px;
	border-radius: 99px;
	text-transform: uppercase;
	letter-spacing: .04em;
}
.motv4k-card-title {
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	line-height: 1.4;
	color: var(--motv4k-ink);
}
.motv4k-card-title a { color: inherit; text-decoration: none; }
.motv4k-card-title a:hover { color: var(--motv4k-accent); }
.motv4k-card-excerpt {
	font-size: 14px;
	color: var(--motv4k-muted);
	margin: 0;
	line-height: 1.6;
	flex: 1;
}
.motv4k-card-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: var(--motv4k-muted);
	margin-top: 6px;
}
.motv4k-card-arrow {
	color: var(--motv4k-accent);
	font-weight: 700;
	font-size: 16px;
	transition: transform .2s;
}
.motv4k-card:hover .motv4k-card-arrow { transform: translateX(-4px); }

/* ----------------------------------------------------------------------
   Related posts (under articles)
   ---------------------------------------------------------------------- */
.motv4k-related {
	margin: 2.5em 0 1em;
	padding-top: 1.5em;
	border-top: 2px solid var(--motv4k-line);
}
.motv4k-related-title {
	font-size: 20px;
	font-weight: 800;
	margin: 0 0 16px;
	color: var(--motv4k-ink);
}
.motv4k-related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
}
.motv4k-related-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px;
	border-radius: calc(var(--motv4k-radius) - 4px);
	background: #fafafe;
	border: 1px solid var(--motv4k-line);
	text-decoration: none;
	color: inherit;
	transition: transform .2s, box-shadow .2s;
}
.motv4k-related-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--motv4k-shadow);
}
.motv4k-related-thumb {
	width: 100%;
	aspect-ratio: 16 / 9;
	background-size: cover;
	background-position: center;
	background-color: var(--motv4k-accent-light);
	border-radius: 10px;
}
.motv4k-related-text { display: flex; flex-direction: column; gap: 4px; padding: 0 4px 4px; }
.motv4k-related-card-title { font-size: 15px; font-weight: 700; color: var(--motv4k-ink); line-height: 1.4; }
.motv4k-related-card:hover .motv4k-related-card-title { color: var(--motv4k-accent); }
.motv4k-related-text time { font-size: 12px; color: var(--motv4k-muted); }

/* ----------------------------------------------------------------------
   Auto-internal-links styling
   ---------------------------------------------------------------------- */
a.motv4k-autolink {
	color: var(--motv4k-accent-dark);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: color-mix(in srgb, var(--motv4k-accent) 35%, transparent);
	transition: text-decoration-color .15s;
}
a.motv4k-autolink:hover { text-decoration-color: var(--motv4k-accent); }

/* ----------------------------------------------------------------------
   Share buttons
   ---------------------------------------------------------------------- */
.motv4k-share {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 1.5em 0;
	padding: 14px 16px;
	background: #fafafe;
	border: 1px solid var(--motv4k-line);
	border-radius: var(--motv4k-radius);
}
.motv4k-share-label { font-size: 14px; font-weight: 700; color: var(--motv4k-ink); margin-inline-end: 4px; }
.motv4k-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 1px solid var(--motv4k-line);
	background: #fff;
	color: var(--motv4k-ink);
	cursor: pointer;
	text-decoration: none;
	transition: all .2s ease;
	position: relative;
}
.motv4k-share-btn:hover { transform: translateY(-2px); box-shadow: var(--motv4k-shadow); }
.motv4k-share-whatsapp:hover { background: #25d366; color: #fff; border-color: #25d366; }
.motv4k-share-telegram:hover { background: #229ed9; color: #fff; border-color: #229ed9; }
.motv4k-share-x:hover { background: #000; color: #fff; border-color: #000; }
.motv4k-share-facebook:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.motv4k-share-copy:hover { background: var(--motv4k-accent); color: #fff; border-color: var(--motv4k-accent); }
.motv4k-share-copy-ok { display: none; color: #fff; font-size: 14px; }
.motv4k-share-copy.copied .motv4k-share-copy-ok { display: inline; }
.motv4k-share-copy.copied svg { display: none; }

/* ----------------------------------------------------------------------
   Author box
   ---------------------------------------------------------------------- */
.motv4k-author-box {
	display: flex;
	gap: 16px;
	align-items: center;
	background: linear-gradient(135deg, var(--motv4k-accent-light), #fff);
	border: 1px solid var(--motv4k-line);
	border-radius: var(--motv4k-radius);
	padding: 20px;
	margin: 1.5em 0;
}
.motv4k-author-avatar {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #fff;
	box-shadow: var(--motv4k-shadow);
	flex-shrink: 0;
}
.motv4k-author-avatar--initial {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--motv4k-accent), var(--motv4k-accent-dark));
	color: #fff;
	font-size: 30px;
	font-weight: 800;
}
.motv4k-author-content { flex: 1; }
.motv4k-author-label { font-size: 12px; color: var(--motv4k-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.motv4k-author-name { font-size: 18px; font-weight: 700; margin: 2px 0 4px; color: var(--motv4k-ink); }
.motv4k-author-name a { color: inherit; text-decoration: none; }
.motv4k-author-name a:hover { color: var(--motv4k-accent); }
.motv4k-author-bio { font-size: 14px; color: var(--motv4k-muted); margin: 0; line-height: 1.6; }

/* ----------------------------------------------------------------------
   FAQ accordion
   ---------------------------------------------------------------------- */
.motv4k-faq { margin: 1em 0; }
.motv4k-faq-item {
	background: #fff;
	border: 1px solid var(--motv4k-line);
	border-radius: 12px;
	margin-bottom: 10px;
	overflow: hidden;
	transition: border-color .2s;
}
.motv4k-faq-item[open] { border-color: var(--motv4k-accent); }
.motv4k-faq-q {
	font-weight: 700;
	color: var(--motv4k-ink);
	cursor: pointer;
	padding: 16px 18px;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}
.motv4k-faq-q::-webkit-details-marker { display: none; }
.motv4k-faq-q::after {
	content: "+";
	font-size: 22px;
	color: var(--motv4k-accent);
	font-weight: 400;
	transition: transform .25s;
}
.motv4k-faq-item[open] .motv4k-faq-q::after { transform: rotate(45deg); }
.motv4k-faq-a {
	padding: 0 18px 16px;
	color: var(--motv4k-muted);
	line-height: 1.7;
}
.motv4k-faq-a p { margin: 0 0 .6em; }
.motv4k-faq-a p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------------
   Reading progress bar
   ---------------------------------------------------------------------- */
.motv4k-progress {
	position: fixed;
	top: 0;
	inset-inline-start: 0;
	width: 100%;
	height: 4px;
	background: transparent;
	z-index: 9999;
	pointer-events: none;
}
.motv4k-progress-bar {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--motv4k-accent), var(--motv4k-accent-dark));
	transition: width .1s linear;
}

/* ----------------------------------------------------------------------
   Back to top
   ---------------------------------------------------------------------- */
.motv4k-totop {
	position: fixed;
	inset-block-end: 24px;
	inset-inline-start: 24px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	background: var(--motv4k-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(109, 40, 217, 0.4);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .25s, transform .25s, visibility .25s, background .2s;
	z-index: 9998;
}
.motv4k-totop.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.motv4k-totop:hover { background: var(--motv4k-accent-dark); transform: translateY(-2px); }

/* ----------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */
@media (max-width: 600px) {
	.motv4k-articles-grid-inner { grid-template-columns: 1fr; gap: 16px; }
	.motv4k-related-grid { grid-template-columns: 1fr; }
	.motv4k-articles-header { flex-wrap: wrap; }
	.motv4k-author-box { flex-direction: column; text-align: center; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}
