HEX
Server: nginx/1.24.0
System: Linux 0c1023d6c65e 6.8.0-137-generic #137-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 17 20:28:23 UTC 2026 x86_64
User: root (0)
PHP: 8.3.33
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/ethnic-single-post-layout/bootstrap.php
<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! function_exists( 'ethnic_single_post_layout_is_target' ) ) {
	function ethnic_single_post_layout_is_target() {
		return ! is_admin() && is_singular( 'post' );
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_body_class' ) ) {
	function ethnic_single_post_layout_body_class( $classes ) {
		if ( ethnic_single_post_layout_is_target() ) {
			$classes[] = 'ethnic-single-post-active';
		}

		return $classes;
	}
	add_filter( 'body_class', 'ethnic_single_post_layout_body_class' );
}

if ( ! function_exists( 'ethnic_single_post_layout_template_include' ) ) {
	function ethnic_single_post_layout_template_include( $template ) {
		if ( ! ethnic_single_post_layout_is_target() ) {
			return $template;
		}

		$custom_template = __DIR__ . '/template.php';

		return file_exists( $custom_template ) ? $custom_template : $template;
	}
	add_filter( 'template_include', 'ethnic_single_post_layout_template_include', 99 );
}

if ( ! function_exists( 'ethnic_single_post_layout_comments_template' ) ) {
	function ethnic_single_post_layout_comments_template( $theme_template ) {
		if ( ! ethnic_single_post_layout_is_target() ) {
			return $theme_template;
		}

		$custom_template = __DIR__ . '/comments.php';

		return file_exists( $custom_template ) ? $custom_template : $theme_template;
	}
	add_filter( 'comments_template', 'ethnic_single_post_layout_comments_template', 99 );
}

if ( ! function_exists( 'ethnic_single_post_layout_styles' ) ) {
	function ethnic_single_post_layout_styles() {
		if ( ! ethnic_single_post_layout_is_target() ) {
			return;
		}
		?>
		<style id="ethnic-single-post-layout">
			body.single-post.ethnic-single-post-active {
				--ethnic-bg: #ffffff;
				--ethnic-surface: rgba(255, 255, 255, 0.92);
				--ethnic-panel: #ffffff;
				--ethnic-panel-strong: #ffffff;
				--ethnic-ink: #16202b;
				--ethnic-muted: #5f6974;
				--ethnic-border: rgba(22, 32, 43, 0.12);
				--ethnic-border-strong: rgba(22, 32, 43, 0.18);
				--ethnic-accent: #ad5c28;
				--ethnic-accent-strong: #89461b;
				--ethnic-accent-soft: rgba(173, 92, 40, 0.08);
				--ethnic-shadow: 0 18px 54px rgba(17, 24, 39, 0.05);
				background: #ffffff;
				color: var(--ethnic-ink);
			}

			body.single-post.ethnic-single-post-active #main {
				background: transparent;
			}

			body.single-post.ethnic-single-post-active #main.page__top-shadow::before {
				display: none !important;
			}

			body.single-post.ethnic-single-post-active .block-content:last-of-type {
				padding-bottom: 0 !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-shell {
				width: min(1240px, calc(100% - 56px));
				margin: 0 auto;
			}

			body.single-post.ethnic-single-post-active .ethnic-shell--article {
				width: min(1140px, calc(100% - 56px));
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__main .ethnic-shell--article-with-toc {
				width: min(1440px, calc(100% - 56px));
			}

			body.single-post.ethnic-single-post-active .ethnic-shell--wide {
				width: min(1220px, calc(100% - 56px));
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post {
				padding: 34px 0 88px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__hero {
				padding: 6px 0 28px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__back-link {
				display: inline-flex;
				align-items: center;
				gap: 12px;
				margin-bottom: 24px;
				color: var(--ethnic-muted);
				font-size: 13px;
				font-weight: 700;
				letter-spacing: 0.08em;
				text-decoration: none;
				text-transform: uppercase;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__back-link::before {
				content: "";
				width: 22px;
				height: 1px;
				background: currentColor;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__back-link:hover {
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__eyebrow {
				display: flex;
				flex-wrap: wrap;
				align-items: center;
				gap: 12px;
				margin-bottom: 20px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__eyebrow-link,
			body.single-post.ethnic-single-post-active .ethnic-single-post__pill,
			body.single-post.ethnic-single-post-active .ethnic-single-post__tag,
			body.single-post.ethnic-single-post-active .ethnic-single-post__topic-pill,
			body.single-post.ethnic-single-post-active .ethnic-single-post__share-link {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				min-height: 36px;
				padding: 8px 15px;
				border-radius: 999px;
				border: 1px solid transparent;
				font-size: 13px;
				font-weight: 700;
				line-height: 1;
				text-decoration: none;
				transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__eyebrow-link,
			body.single-post.ethnic-single-post-active .ethnic-single-post__pill {
				background: var(--ethnic-accent-soft);
				border-color: rgba(173, 92, 40, 0.16);
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__eyebrow-link:hover,
			body.single-post.ethnic-single-post-active .ethnic-single-post__pill:hover {
				background: rgba(173, 92, 40, 0.14);
				border-color: rgba(173, 92, 40, 0.24);
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__eyebrow-meta {
				color: var(--ethnic-muted);
				font-size: 13px;
				font-weight: 600;
				line-height: 1.4;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__eyebrow-separator {
				width: 4px;
				height: 4px;
				border-radius: 999px;
				background: rgba(95, 105, 116, 0.42);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__title,
			body.single-post.ethnic-single-post-active .ethnic-single-post__related-title,
			body.single-post.ethnic-single-post-active .ethnic-single-post__cta-title,
			body.single-post.ethnic-single-post-active .ethnic-single-post__related-heading,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content h2,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content h3,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content h4 {
				color: var(--ethnic-ink);
				font-family: "Plus Jakarta Sans", "Figtree", sans-serif;
				font-style: normal;
				font-weight: 700;
				text-transform: none !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__title {
				max-width: 860px;
				margin: 0;
				font-size: clamp(34px, 4.6vw, 56px);
				line-height: 0.96;
				letter-spacing: -0.055em !important;
				text-wrap: balance;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__excerpt {
				max-width: 780px;
				margin: 24px 0 0;
				color: #4e5965;
				font-size: clamp(16px, 1.2vw, 18px);
				line-height: 1.58;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__hero-footer {
				display: block;
				max-width: 860px;
				margin-top: 18px;
				padding-top: 0;
				border-top: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__byline {
				display: inline-flex;
				flex-wrap: wrap;
				align-items: center;
				gap: 10px;
				color: var(--ethnic-muted);
				font-size: 13px;
				font-weight: 500;
				line-height: 1.35;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__byline-item {
				display: inline-flex;
				align-items: center;
				gap: 4px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__byline-link {
				color: var(--ethnic-ink);
				font-weight: 700;
				text-decoration: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__byline-link:hover {
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__byline-separator {
				width: 18px;
				height: 1px;
				background: rgba(22, 32, 43, 0.25);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar-heading,
			body.single-post.ethnic-single-post-active .ethnic-single-post__section-kicker,
			body.single-post.ethnic-single-post-active .ethnic-single-post__cta-kicker,
			body.single-post.ethnic-single-post-active .ethnic-single-post__fact-label {
				display: block;
				margin: 0;
				color: var(--ethnic-muted);
				font-size: 11px;
				font-weight: 700;
				letter-spacing: 0.12em;
				line-height: 1.4;
				text-transform: uppercase;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__topic-list,
			body.single-post.ethnic-single-post-active .ethnic-single-post__meta-pills,
			body.single-post.ethnic-single-post-active .ethnic-single-post__share-list {
				display: flex;
				flex-wrap: wrap;
				gap: 10px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__topic-pill,
			body.single-post.ethnic-single-post-active .ethnic-single-post__tag {
				border-color: var(--ethnic-border);
				background: rgba(22, 32, 43, 0.04);
				color: var(--ethnic-ink);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__topic-pill:hover,
			body.single-post.ethnic-single-post-active .ethnic-single-post__tag:hover {
				border-color: rgba(173, 92, 40, 0.24);
				background: rgba(173, 92, 40, 0.08);
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__hero-media {
				margin-top: 32px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__hero-media-frame {
				overflow: hidden;
				border: 1px solid rgba(22, 32, 43, 0.08);
				border-radius: 32px;
				background: #ffffff;
				box-shadow: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__featured-image {
				display: block;
				width: 100%;
				max-height: 680px;
				object-fit: cover;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__main {
				padding-top: 18px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__main-grid {
				display: grid;
				grid-template-columns: 260px minmax(0, 1fr);
				gap: 56px;
				align-items: start;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__main-grid--has-toc {
				grid-template-columns: minmax(220px, 250px) minmax(0, 1fr) minmax(210px, 250px);
				gap: 44px;
				justify-content: start;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar {
				position: sticky;
				top: 124px;
				display: grid;
				gap: 24px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-sidebar {
				position: sticky;
				top: 124px;
				min-width: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar-block,
			body.single-post.ethnic-single-post-active .ethnic-single-post__article-card,
			body.single-post.ethnic-single-post-active .ethnic-single-post__cta,
			body.single-post.ethnic-single-post-active .ethnic-single-post__related-card {
				border: 0;
				border-radius: 0;
				background: transparent;
				box-shadow: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar-block {
				padding: 0 0 24px;
				border-bottom: 1px solid rgba(22, 32, 43, 0.1);
				backdrop-filter: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar-block:last-child {
				padding-bottom: 0;
				border-bottom: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar-block--toc {
				padding-bottom: 24px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-sidebar .ethnic-single-post__sidebar-block--toc {
				padding-bottom: 0;
				border-bottom: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar-heading,
			body.single-post.ethnic-single-post-active .ethnic-single-post__cta-kicker,
			body.single-post.ethnic-single-post-active .ethnic-single-post__section-kicker {
				margin-bottom: 14px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__fact-list {
				display: grid;
				gap: 16px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__fact {
				padding-top: 16px;
				border-top: 1px solid rgba(22, 32, 43, 0.08);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__fact:first-child {
				padding-top: 0;
				border-top: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__fact-value {
				margin-top: 8px;
				color: var(--ethnic-ink);
				font-size: 14px;
				font-weight: 600;
				line-height: 1.45;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-posts {
				display: grid;
				gap: 8px;
				max-height: 436px;
				margin-top: 14px;
				padding-right: 4px;
				overflow-y: auto;
				scrollbar-color: rgba(22, 32, 43, 0.28) transparent;
				scrollbar-width: thin;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-posts::-webkit-scrollbar {
				width: 4px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-posts::-webkit-scrollbar-track {
				background: transparent;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-posts::-webkit-scrollbar-thumb {
				border-radius: 999px;
				background: rgba(22, 32, 43, 0.22);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-link {
				display: grid;
				grid-template-columns: 92px minmax(0, 1fr);
				align-items: center;
				gap: 12px;
				min-height: 86px;
				padding: 0 12px 0 0;
				border: 1px solid rgba(22, 32, 43, 0.08);
				border-radius: 10px;
				background: rgba(22, 32, 43, 0.025);
				color: var(--ethnic-ink);
				text-decoration: none;
				transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-link:hover,
			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-link:focus-visible {
				border-color: rgba(173, 92, 40, 0.24);
				background: rgba(173, 92, 40, 0.08);
				color: var(--ethnic-accent-strong);
				outline: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-link.is-current {
				border-color: rgba(173, 92, 40, 0.22);
				background: rgba(173, 92, 40, 0.1);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-thumb {
				display: flex;
				align-items: center;
				justify-content: center;
				align-self: stretch;
				width: 92px;
				height: 100%;
				overflow: hidden;
				border-radius: 10px 0 0 10px;
				background: #f4f8fc;
				flex: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-image {
				display: block;
				width: 100%;
				height: 100%;
				object-fit: cover;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-placeholder-logo {
				display: block;
				width: 64px;
				max-width: 68%;
				height: auto;
				filter: grayscale(1);
				opacity: 0.26;
				object-fit: contain;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-copy {
				display: grid;
				gap: 5px;
				min-width: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-title {
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
				overflow: hidden;
				font-size: 13px;
				font-weight: 700;
				line-height: 1.25;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__category-post-date {
				color: var(--ethnic-muted);
				font-size: 10px;
				font-weight: 700;
				letter-spacing: 0.1em;
				line-height: 1.2;
				text-transform: uppercase;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-dropdown {
				border: 1px solid rgba(22, 32, 43, 0.1);
				border-radius: 12px;
				background: #ffffff;
				overflow: hidden;
				transition: border-color 180ms ease, box-shadow 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-dropdown[open] {
				border-color: rgba(22, 32, 43, 0.18);
				box-shadow: 0 14px 34px rgba(17, 24, 39, 0.06);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-sidebar .ethnic-single-post__toc-dropdown[open] {
				max-height: calc(100vh - 150px);
				overflow-y: auto;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary {
				display: flex;
				align-items: center;
				justify-content: space-between;
				gap: 14px;
				min-height: 46px;
				padding: 13px 15px;
				cursor: pointer;
				list-style: none;
				user-select: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary::-webkit-details-marker {
				display: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary .ethnic-single-post__sidebar-heading {
				margin: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary-icon {
				position: relative;
				width: 18px;
				height: 18px;
				border: 1px solid rgba(22, 32, 43, 0.2);
				border-radius: 999px;
				flex: none;
				transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary-icon::before {
				content: "";
				position: absolute;
				left: 50%;
				top: 47%;
				width: 6px;
				height: 6px;
				border-right: 1.8px solid currentColor;
				border-bottom: 1.8px solid currentColor;
				color: var(--ethnic-ink);
				transform: translate(-50%, -60%) rotate(45deg);
				transition: color 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-dropdown[open] .ethnic-single-post__toc-summary-icon {
				border-color: rgba(173, 92, 40, 0.28);
				background: rgba(173, 92, 40, 0.08);
				transform: rotate(180deg);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary:hover .ethnic-single-post__toc-summary-icon,
			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary:focus-visible .ethnic-single-post__toc-summary-icon {
				border-color: rgba(173, 92, 40, 0.34);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary:hover .ethnic-single-post__toc-summary-icon::before,
			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary:focus-visible .ethnic-single-post__toc-summary-icon::before {
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-summary:focus-visible {
				outline: 2px solid rgba(173, 92, 40, 0.24);
				outline-offset: 3px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc {
				padding: 0 15px 15px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-dropdown:not([open]) .ethnic-single-post__toc {
				display: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-list {
				margin: 0;
				padding: 0;
				list-style: none;
				counter-reset: ethnic-outline;
				display: grid;
				gap: 10px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-item {
				counter-increment: ethnic-outline;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-link {
				display: flex;
				gap: 12px;
				align-items: flex-start;
				color: var(--ethnic-ink);
				font-size: 13px;
				font-weight: 600;
				line-height: 1.4;
				text-decoration: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-link::before {
				content: counter(ethnic-outline, decimal-leading-zero);
				color: var(--ethnic-accent-strong);
				font-size: 11px;
				font-weight: 700;
				letter-spacing: 0.08em;
				line-height: 1.8;
				flex: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-link[data-level="3"] {
				padding-left: 18px;
				color: #42505d;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-link:hover {
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__share-link {
				min-width: 42px;
				min-height: 42px;
				padding: 0;
				border-color: var(--ethnic-border);
				background: rgba(255, 255, 255, 0.9);
				color: var(--ethnic-ink);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__share-icon {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				width: 14px;
				height: 14px;
				flex: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__share-icon svg {
				display: block;
				width: 14px;
				height: 14px;
				fill: currentColor;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__share-link:hover {
				transform: translateY(-1px);
				border-color: rgba(173, 92, 40, 0.24);
				background: rgba(173, 92, 40, 0.08);
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__article {
				max-width: 760px;
				min-width: 0;
				display: grid;
				gap: 40px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__article-card {
				padding: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content {
				color: #394653;
				font-size: 16px;
				line-height: 1.52;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content > :first-child {
				margin-top: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content > :last-child {
				margin-bottom: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content > p:first-of-type {
				color: var(--ethnic-ink);
				font-size: clamp(18px, 1.7vw, 21px);
				line-height: 1.46;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content h2,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content h3,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content h4 {
				margin: 54px 0 18px;
				line-height: 1.06;
				scroll-margin-top: 132px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content h2 {
				font-size: clamp(26px, 2.4vw, 34px);
				letter-spacing: -0.045em !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content h3 {
				font-size: clamp(22px, 2vw, 28px);
				letter-spacing: -0.04em !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content h4 {
				font-size: clamp(18px, 1.7vw, 22px);
				letter-spacing: -0.03em !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq {
				margin-top: 28px;
				counter-reset: ethnic-faq;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq > h2 {
				margin-bottom: 22px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq .faq-item {
				position: relative;
				margin: 0 0 14px;
				padding: 0 0 16px 54px;
				border-bottom: 1px solid rgba(22, 32, 43, 0.1);
				counter-increment: ethnic-faq;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq .faq-item:last-child {
				margin-bottom: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq .faq-item::before {
				content: counter(ethnic-faq, decimal-leading-zero);
				position: absolute;
				left: 0;
				top: 2px;
				display: inline-flex;
				align-items: center;
				justify-content: center;
				width: 34px;
				height: 20px;
				color: var(--ethnic-accent-strong);
				font-size: 11px;
				font-weight: 700;
				letter-spacing: 0.08em;
				line-height: 1;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq .faq-item h3 {
				margin: 0 0 10px !important;
				font-size: clamp(17px, 1.4vw, 20px);
				line-height: 1.14;
				letter-spacing: -0.03em !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq .faq-item p {
				margin: 0 !important;
				color: #536172;
				font-size: 15px;
				line-height: 1.58;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq .faq-item p br {
				display: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content p {
				margin: 0 0 14px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content strong {
				color: var(--ethnic-ink);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content a {
				color: var(--ethnic-accent-strong);
				text-decoration-thickness: 1px;
				text-underline-offset: 4px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content ul,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content ol {
				margin: 0 0 18px;
				padding: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content ul {
				list-style: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content ul li,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content ol li {
				position: relative;
				margin: 0 0 8px;
				padding-left: 28px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content ul li::before {
				content: "";
				position: absolute;
				left: 0;
				top: 0.8em;
				width: 9px;
				height: 9px;
				border-radius: 999px;
				background: var(--ethnic-accent);
				transform: translateY(-50%);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content ol {
				list-style: none;
				counter-reset: ethnic-post-list;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content ol li::before {
				counter-increment: ethnic-post-list;
				content: counter(ethnic-post-list) ".";
				position: absolute;
				left: 0;
				top: 0;
				color: var(--ethnic-accent-strong);
				font-weight: 700;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content img {
				display: block;
				max-width: 100%;
				height: auto;
				border-radius: 22px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content figure {
				margin: 34px 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content figcaption {
				margin-top: 10px;
				color: var(--ethnic-muted);
				font-size: 12px;
				line-height: 1.45;
				text-align: center;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content blockquote {
				margin: 36px 0;
				padding: 26px 28px;
				border-left: 3px solid var(--ethnic-accent);
				border-radius: 0 22px 22px 0;
				background: #f8f9fb;
				color: var(--ethnic-ink);
				font-size: 18px;
				line-height: 1.58;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content .code-block,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content pre,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content .wp-block-code {
				position: relative;
				margin: 24px 0;
				padding: 34px 64px 12px 16px;
				border: 1px solid #25364a;
				border-radius: 16px;
				background: #132132;
				color: #edf3fb;
				overflow: auto;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content .code-block::before,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content pre::before,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content .wp-block-code::before {
				content: "";
				position: absolute;
				left: 14px;
				top: 12px;
				width: 8px;
				height: 8px;
				border-radius: 999px;
				background: #ff6b6b;
				box-shadow: 14px 0 0 #f7b955, 28px 0 0 #67d56d;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content .code-block code,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content pre code,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content .wp-block-code code {
				display: block;
				margin: 0;
				padding: 0;
				background: transparent;
				color: inherit;
				font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
				font-size: 13px;
				line-height: 1.45;
				white-space: pre-wrap;
				word-break: break-word;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content pre code {
				white-space: pre;
				word-break: normal;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content .code-block code br:first-child {
				display: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content .code-block code br:last-of-type {
				display: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content .ethnic-code-copy {
				position: absolute;
				top: 10px;
				right: 10px;
				display: inline-flex;
				align-items: center;
				justify-content: center;
				min-width: 44px;
				height: 28px;
				padding: 0 10px;
				border: 1px solid rgba(255, 255, 255, 0.14);
				border-radius: 999px;
				background: rgba(255, 255, 255, 0.06);
				color: rgba(237, 243, 251, 0.92);
				font-size: 11px;
				font-weight: 700;
				letter-spacing: 0.06em;
				line-height: 1;
				text-transform: uppercase;
				cursor: pointer;
				transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content .ethnic-code-copy:hover,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content .ethnic-code-copy:focus-visible {
				border-color: rgba(173, 92, 40, 0.5);
				background: rgba(173, 92, 40, 0.16);
				color: #ffffff;
				outline: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content .ethnic-code-copy.is-copied {
				border-color: rgba(125, 220, 122, 0.45);
				background: rgba(125, 220, 122, 0.16);
				color: #dfffe0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content code {
				font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
				font-size: 0.92em;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content table {
				width: 100%;
				margin: 24px 0 30px;
				border-collapse: collapse;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content th,
			body.single-post.ethnic-single-post-active .ethnic-single-post__content td {
				padding: 14px 16px;
				border: 1px solid rgba(22, 32, 43, 0.1);
				text-align: left;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content th {
				background: #f7f8fa;
				color: var(--ethnic-ink);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__content hr {
				margin: 42px 0;
				border: 0;
				border-top: 1px solid rgba(22, 32, 43, 0.08);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__article-footer {
				display: flex;
				flex-wrap: wrap;
				gap: 20px 28px;
				margin-top: 30px;
				padding-top: 24px;
				border-top: 1px solid rgba(22, 32, 43, 0.08);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__meta-group {
				flex: 1 1 220px;
				min-width: 220px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__cta {
				display: flex;
				flex-wrap: wrap;
				align-items: end;
				justify-content: space-between;
				gap: 24px;
				padding: 28px 0 0;
				border-top: 1px solid rgba(22, 32, 43, 0.1);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__cta-title {
				margin: 0;
				font-size: clamp(24px, 1.9vw, 30px);
				line-height: 1.08;
				letter-spacing: -0.04em !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__cta-text {
				max-width: 610px;
				margin: 12px 0 0;
				color: var(--ethnic-muted);
				font-size: 15px;
				line-height: 1.62;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__cta-actions {
				display: flex;
				flex-wrap: wrap;
				gap: 12px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__button {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				min-height: 48px;
				padding: 12px 22px;
				border-radius: 999px;
				border: 1px solid transparent;
				font-size: 13px;
				font-weight: 700;
				line-height: 1;
				text-decoration: none;
				transition: transform 180ms ease, color 180ms ease, background-color 180ms ease, border-color 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__button:hover {
				transform: translateY(-1px);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__button--primary {
				background: var(--ethnic-ink);
				color: #ffffff;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__button--primary:hover {
				background: #26313d;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__button--secondary {
				border-color: var(--ethnic-border-strong);
				background: transparent;
				color: var(--ethnic-ink);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__button--secondary:hover {
				border-color: rgba(173, 92, 40, 0.24);
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments {
				padding: 40px 0 0;
				border-top: 1px solid rgba(22, 32, 43, 0.1);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comments-area {
				margin: 0;
				padding: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments {
				display: grid;
				gap: 24px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__head {
				display: flex;
				align-items: center;
				justify-content: space-between;
				gap: 18px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__title {
				margin: 0;
				color: var(--ethnic-ink);
				font-family: "Plus Jakarta Sans", "Figtree", sans-serif;
				font-size: clamp(24px, 2vw, 32px);
				font-weight: 700;
				line-height: 1.08;
				letter-spacing: -0.04em;
				text-transform: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__count {
				color: var(--ethnic-muted);
				font-weight: 600;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list {
				display: grid;
				gap: 12px;
				margin: 0;
				padding: 0;
				list-style: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__item {
				margin: 0;
				padding: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list .children {
				position: relative;
				display: grid;
				gap: 12px;
				margin: 14px 0 20px 66px;
				padding: 0 0 0 22px;
				list-style: none;
				counter-reset: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list .children::before {
				content: "";
				position: absolute;
				left: 0;
				top: -14px;
				bottom: 18px;
				width: 1px;
				background: linear-gradient(180deg, rgba(22, 32, 43, 0.08), rgba(173, 92, 40, 0.22), rgba(22, 32, 43, 0.04));
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list .children .ethnic-single-post-comments__item {
				position: relative;
				list-style: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list .children .ethnic-single-post-comments__item::marker {
				content: "";
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list .children .ethnic-single-post-comments__item::before {
				content: "";
				position: absolute;
				left: -22px;
				top: 28px;
				width: 22px;
				height: 1px;
				background: rgba(173, 92, 40, 0.22);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__card {
				display: grid;
				grid-template-columns: 42px minmax(0, 1fr);
				gap: 14px;
				padding: 18px;
				border: 1px solid rgba(22, 32, 43, 0.08);
				border-radius: 14px;
				background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
				box-shadow: 0 10px 30px rgba(17, 24, 39, 0.04);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list .children .ethnic-single-post-comments__card {
				border-color: rgba(173, 92, 40, 0.12);
				background: #fffdfb;
				box-shadow: 0 10px 26px rgba(17, 24, 39, 0.035);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__avatar {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				width: 42px;
				height: 42px;
				border-radius: 50%;
				background: var(--ethnic-ink);
				color: #ffffff;
				font-family: "Plus Jakarta Sans", "Figtree", sans-serif;
				font-size: 14px;
				font-weight: 800;
				letter-spacing: 0.04em;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__body {
				min-width: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__header {
				display: flex;
				align-items: center;
				justify-content: space-between;
				gap: 14px;
				margin-bottom: 14px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__author {
				margin: 0;
				color: var(--ethnic-ink);
				font-family: "Plus Jakarta Sans", "Figtree", sans-serif;
				font-size: 16px;
				font-weight: 700;
				line-height: 1.2;
				text-transform: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__date {
				display: inline-flex;
				margin-top: 4px;
				color: var(--ethnic-muted);
				font-size: 12px;
				font-weight: 600;
				line-height: 1.4;
				text-decoration: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__date:hover {
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__reply {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				min-height: 32px;
				padding: 8px 14px;
				border: 1px solid rgba(22, 32, 43, 0.12);
				border-radius: 10px;
				background: #ffffff;
				color: var(--ethnic-ink);
				font-size: 12px;
				font-weight: 700;
				line-height: 1;
				text-decoration: none;
				transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__reply:hover,
			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__reply:focus-visible {
				border-color: var(--ethnic-ink);
				background: var(--ethnic-ink);
				color: #ffffff;
				transform: translateY(-1px);
				outline: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__moderation {
				margin: 0 0 12px;
				padding: 10px 12px;
				border: 1px solid rgba(173, 92, 40, 0.18);
				border-radius: 10px;
				background: var(--ethnic-accent-soft);
				color: var(--ethnic-accent-strong);
				font-size: 13px;
				font-weight: 700;
				line-height: 1.4;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__content {
				color: #40516b;
				font-size: 15px;
				line-height: 1.6;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__content p {
				margin: 0 0 12px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__content p:last-child {
				margin-bottom: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__navigation {
				display: flex;
				justify-content: space-between;
				gap: 12px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__navigation a {
				color: var(--ethnic-ink);
				font-size: 13px;
				font-weight: 700;
				text-decoration: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__closed {
				margin: 0;
				color: var(--ethnic-muted);
				font-size: 15px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-reply-title::before,
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comments-title::before {
				display: none !important;
				content: none !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post-comments__respond {
				margin-top: 12px;
				padding: 20px;
				border: 1px solid rgba(22, 32, 43, 0.08);
				border-radius: 16px;
				background: #ffffff;
				box-shadow: 0 14px 34px rgba(17, 24, 39, 0.04);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-reply-title,
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comments-title {
				display: flex;
				flex-wrap: wrap;
				align-items: center;
				gap: 12px;
				margin: 0;
				color: var(--ethnic-ink);
				font-family: "Plus Jakarta Sans", "Figtree", sans-serif;
				font-size: clamp(24px, 2vw, 30px);
				font-weight: 700;
				line-height: 1.08;
				letter-spacing: -0.04em;
				text-transform: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-reply-title {
				margin: 24px 0 16px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-reply-title a:not(#cancel-comment-reply-link) {
				color: var(--ethnic-ink);
				text-decoration: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-reply-title a:not(#cancel-comment-reply-link):hover {
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments #cancel-comment-reply-link {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				min-height: 32px;
				padding: 7px 13px;
				border: 1px solid rgba(173, 92, 40, 0.16);
				border-radius: 999px;
				background: var(--ethnic-accent-soft);
				color: var(--ethnic-accent-strong);
				font-size: 12px;
				font-weight: 800;
				line-height: 1;
				letter-spacing: 0.02em;
				text-decoration: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments #cancel-comment-reply-link:hover,
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments #cancel-comment-reply-link:focus-visible {
				border-color: rgba(173, 92, 40, 0.28);
				background: rgba(173, 92, 40, 0.14);
				color: var(--ethnic-accent-strong);
				outline: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form-message {
				margin: 0;
				color: #40516b;
				font-size: 15px;
				line-height: 1.5;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form-message a {
				color: var(--ethnic-accent-strong);
				font-weight: 700;
				text-decoration: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form {
				display: grid;
				gap: 14px;
				margin: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form .row {
				display: flex;
				flex-wrap: wrap;
				gap: 14px;
				margin: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form .row > [class*="col-"],
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form > [class*="comment-"] {
				flex: 1 1 220px;
				width: auto;
				min-width: 0;
				padding: 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-author-input::after,
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-email-input::after,
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-url-input::after {
				display: none !important;
				content: none !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments input[type="text"],
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments input[type="email"],
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments input[type="url"],
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments textarea {
				width: 100%;
				border: 1px solid rgba(22, 32, 43, 0.14);
				border-radius: 12px;
				background: #ffffff;
				color: var(--ethnic-ink);
				font-size: 15px;
				line-height: 1.45;
				box-shadow: none;
				outline: none;
				transition: border-color 180ms ease, box-shadow 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments input[type="text"],
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments input[type="email"],
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments input[type="url"] {
				min-height: 48px;
				padding: 0 15px !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments textarea {
				min-height: 150px;
				padding: 14px 15px;
				resize: vertical;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments input:focus,
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments textarea:focus {
				border-color: rgba(173, 92, 40, 0.36);
				box-shadow: 0 0 0 3px rgba(173, 92, 40, 0.08);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form-cookies-consent {
				align-items: center;
				gap: 10px;
				margin: 14px 0 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form-cookies-consent .checkbox-sign {
				position: relative;
				width: 22px;
				height: 22px;
				margin-right: 0;
				border-color: rgba(22, 32, 43, 0.18);
				border-radius: 4px;
				background: #ffffff;
				box-sizing: border-box;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form-cookies-consent .checkbox-sign.checked {
				border-color: var(--ethnic-ink);
				background: var(--ethnic-ink);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form-cookies-consent .checkbox-sign.checked::before {
				content: "" !important;
				position: absolute;
				left: 50%;
				top: 45%;
				width: 6px;
				height: 11px;
				border: solid #ffffff;
				border-width: 0 2px 2px 0;
				margin: 0;
				font-size: 0;
				line-height: 1;
				transform: translate(-50%, -50%) rotate(45deg);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .comment-form-cookies-consent label {
				color: #40516b;
				font-size: 16px;
				line-height: 1.45;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .form-submit {
				margin: 12px 0 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .submit {
				display: inline-flex;
				position: relative;
				align-items: center;
				justify-content: center;
				min-height: 48px;
				padding: 12px 22px;
				border: 1px solid var(--ethnic-ink);
				border-radius: 999px;
				background: var(--ethnic-ink);
				color: #ffffff;
				font-size: 13px;
				font-weight: 700;
				line-height: 1;
				text-decoration: none;
				cursor: pointer;
				transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .submit:hover,
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .submit:focus-visible {
				border-color: #26313d;
				background: #26313d;
				transform: translateY(-1px);
				outline: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .submit.is-submitting,
			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .submit:disabled {
				padding-right: 46px;
				opacity: 0.9;
				cursor: progress;
				pointer-events: none;
				transform: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__comments .submit.is-submitting::after {
				content: "";
				position: absolute;
				right: 20px;
				top: 50%;
				width: 14px;
				height: 14px;
				border: 2px solid rgba(255, 255, 255, 0.38);
				border-top-color: #ffffff;
				border-radius: 50%;
				transform: translateY(-50%);
				animation: ethnicCommentSubmitSpin 720ms linear infinite;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related {
				padding-top: 54px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-head {
				margin-bottom: 24px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-title {
				margin: 0;
				font-size: clamp(28px, 2.2vw, 38px);
				line-height: 1.06;
				letter-spacing: -0.04em !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-grid {
				display: grid;
				grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
				gap: 30px 24px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-card {
				display: grid;
				grid-template-rows: auto 1fr;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-image {
				display: block;
				aspect-ratio: 1.55 / 1;
				background: #f5f6f8;
				overflow: hidden;
				border-radius: 24px;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-image img,
			body.single-post.ethnic-single-post-active .ethnic-single-post__related-placeholder {
				display: block;
				width: 100%;
				height: 100%;
				object-fit: cover;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-placeholder {
				background: linear-gradient(135deg, #f5f6f8, #fafbfc);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-body {
				padding: 18px 0 0;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-meta {
				display: flex;
				flex-wrap: wrap;
				gap: 12px;
				margin-bottom: 14px;
				color: var(--ethnic-muted);
				font-size: 11px;
				font-weight: 700;
				letter-spacing: 0.08em;
				line-height: 1.5;
				text-transform: uppercase;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-heading {
				margin: 0;
				font-size: 21px;
				line-height: 1.1;
				letter-spacing: -0.03em !important;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-link {
				color: var(--ethnic-ink);
				text-decoration: none;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-link:hover {
				color: var(--ethnic-accent-strong);
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__related-excerpt {
				margin: 12px 0 0;
				color: var(--ethnic-muted);
				font-size: 14px;
				line-height: 1.56;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__hero-copy,
			body.single-post.ethnic-single-post-active .ethnic-single-post__hero-media,
			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar,
			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-sidebar,
			body.single-post.ethnic-single-post-active .ethnic-single-post__article,
			body.single-post.ethnic-single-post-active .ethnic-single-post__related-card {
				animation: ethnicPostFadeUp 640ms ease-out both;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__hero-media {
				animation-delay: 60ms;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar {
				animation-delay: 90ms;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__article {
				animation-delay: 120ms;
			}

			body.single-post.ethnic-single-post-active .ethnic-single-post__toc-sidebar {
				animation-delay: 150ms;
			}

			@keyframes ethnicPostFadeUp {
				from {
					opacity: 0;
					transform: translate3d(0, 20px, 0);
				}

				to {
					opacity: 1;
					transform: translate3d(0, 0, 0);
				}
			}

			@keyframes ethnicCommentSubmitSpin {
				to {
					transform: translateY(-50%) rotate(360deg);
				}
			}

			@media (max-width: 1180px) {
				body.single-post.ethnic-single-post-active .ethnic-single-post__main-grid {
					grid-template-columns: minmax(0, 1fr);
					gap: 30px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar {
					position: static;
					order: 3;
					grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__article {
					order: 1;
					max-width: none;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__toc-sidebar {
					position: static;
					order: 2;
				}
			}

			@media (max-width: 1024px) {
				body.single-post.ethnic-single-post-active .ethnic-shell,
				body.single-post.ethnic-single-post-active .ethnic-shell--article,
				body.single-post.ethnic-single-post-active .ethnic-shell--wide {
					width: min(100% - 42px, 100%);
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post {
					padding: 28px 0 74px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__article-card {
					padding: 0;
				}
			}

			@media (max-width: 767px) {
				body.single-post.ethnic-single-post-active .ethnic-shell,
				body.single-post.ethnic-single-post-active .ethnic-shell--article,
				body.single-post.ethnic-single-post-active .ethnic-shell--wide {
					width: min(100% - 28px, 100%);
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post {
					padding: 22px 0 58px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__title {
					font-size: 34px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__hero-footer {
					align-items: flex-start;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__featured-image {
					max-height: 460px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__sidebar {
					grid-template-columns: minmax(0, 1fr);
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__content {
					font-size: 15px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__content .code-block,
				body.single-post.ethnic-single-post-active .ethnic-single-post__content pre,
				body.single-post.ethnic-single-post-active .ethnic-single-post__content .wp-block-code {
					padding: 30px 58px 10px 14px;
					border-radius: 14px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__content .code-block code,
				body.single-post.ethnic-single-post-active .ethnic-single-post__content pre code,
				body.single-post.ethnic-single-post-active .ethnic-single-post__content .wp-block-code code {
					font-size: 12px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq .faq-item {
					padding: 0 0 14px 46px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__content #faq .faq-item::before {
					left: 0;
					top: 1px;
					width: 30px;
					height: 18px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__cta {
					padding: 24px 0 0;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post__related-heading {
					font-size: 20px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post-comments {
					gap: 24px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post-comments__card {
					grid-template-columns: 44px minmax(0, 1fr);
					gap: 12px;
					padding: 16px;
					border-radius: 14px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list .children {
					margin-left: 18px;
					padding-left: 18px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post-comments__list .children .ethnic-single-post-comments__item::before {
					left: -18px;
					width: 18px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post-comments__avatar {
					width: 44px;
					height: 44px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post-comments__header {
					flex-direction: column;
					gap: 10px;
				}

				body.single-post.ethnic-single-post-active .ethnic-single-post-comments__reply {
					min-height: 32px;
					padding: 8px 13px;
				}
			}
		</style>
		<?php
	}
	add_action( 'wp_head', 'ethnic_single_post_layout_styles', 100 );
}

if ( ! function_exists( 'ethnic_single_post_layout_code_block_script' ) ) {
	function ethnic_single_post_layout_code_block_script() {
		if ( ! ethnic_single_post_layout_is_target() ) {
			return;
		}
		?>
		<script id="ethnic-single-post-code-copy">
			document.addEventListener('DOMContentLoaded', function () {
				var blocks = document.querySelectorAll('.ethnic-single-post__content .code-block, .ethnic-single-post__content pre, .ethnic-single-post__content .wp-block-code');
				var commentForm = document.getElementById('commentform');

				blocks.forEach(function (block) {
					if (block.dataset.ethnicCodeReady === '1') {
						return;
					}

					var codeNode = block.querySelector('code') || block;
					var button = document.createElement('button');

					button.type = 'button';
					button.className = 'ethnic-code-copy';
					button.setAttribute('aria-label', 'Copy code');
					button.textContent = 'Copy';

					button.addEventListener('click', function () {
						var clone = codeNode.cloneNode(true);

						clone.querySelectorAll('br').forEach(function (lineBreak) {
							lineBreak.replaceWith('\n');
						});

						clone.querySelectorAll('.ethnic-code-copy').forEach(function (copyButton) {
							copyButton.remove();
						});

						var text = clone.textContent
							.replace(/\u00a0/g, ' ')
							.replace(/^\s*\n/, '')
							.replace(/\n\s*$/, '')
							.trim();

						if (!text) {
							return;
						}

						var complete = function () {
							button.textContent = 'Copied';
							button.classList.add('is-copied');

							window.setTimeout(function () {
								button.textContent = 'Copy';
								button.classList.remove('is-copied');
							}, 1600);
						};

						if (navigator.clipboard && navigator.clipboard.writeText) {
							navigator.clipboard.writeText(text).then(complete).catch(function () {});
							return;
						}

						var textArea = document.createElement('textarea');
						textArea.value = text;
						textArea.setAttribute('readonly', 'readonly');
						textArea.style.position = 'absolute';
						textArea.style.left = '-9999px';
						document.body.appendChild(textArea);
						textArea.select();

						try {
							document.execCommand('copy');
							complete();
						} catch (error) {
						}

						document.body.removeChild(textArea);
					});

					block.appendChild(button);
					block.dataset.ethnicCodeReady = '1';
				});

				if (!commentForm) {
					return;
				}

				commentForm.addEventListener('submit', function (event) {
					var submitButton = commentForm.querySelector('.submit');

					if (commentForm.dataset.submitting === '1') {
						event.preventDefault();
						return;
					}

					if (!submitButton || event.defaultPrevented) {
						return;
					}

					if (typeof commentForm.checkValidity === 'function' && !commentForm.checkValidity()) {
						return;
					}

					if (window.ethnicRecaptcha && typeof window.ethnicRecaptcha.validateForm === 'function' && !window.ethnicRecaptcha.validateForm(commentForm)) {
						event.preventDefault();
						return;
					}

					if (submitButton.dataset.originalText === undefined) {
						submitButton.dataset.originalText = submitButton.textContent;
					}

					submitButton.textContent = 'Submitting...';
					submitButton.classList.add('is-submitting');
					submitButton.disabled = true;
					submitButton.setAttribute('aria-busy', 'true');
					commentForm.dataset.submitting = '1';

					window.setTimeout(function () {
						if (commentForm.dataset.submitting !== '1') {
							return;
						}

						submitButton.disabled = false;
						submitButton.classList.remove('is-submitting');
						submitButton.removeAttribute('aria-busy');
						submitButton.textContent = submitButton.dataset.originalText || 'Send Comment';
						delete commentForm.dataset.submitting;
					}, 30000);
				});
			});
		</script>
		<?php
	}
	add_action( 'wp_footer', 'ethnic_single_post_layout_code_block_script', 100 );
}

if ( ! function_exists( 'ethnic_single_post_layout_reading_minutes' ) ) {
	function ethnic_single_post_layout_reading_minutes( $post_id ) {
		$post = get_post( $post_id );

		if ( ! $post instanceof WP_Post ) {
			return 1;
		}

		$word_count = str_word_count( wp_strip_all_tags( strip_shortcodes( (string) $post->post_content ) ) );

		return max( 1, (int) ceil( $word_count / 200 ) );
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_clean_text' ) ) {
	function ethnic_single_post_layout_clean_text( $text ) {
		return trim( preg_replace( '/\s+/', ' ', html_entity_decode( wp_strip_all_tags( (string) $text ), ENT_QUOTES, 'UTF-8' ) ) );
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_strip_leading_title' ) ) {
	function ethnic_single_post_layout_strip_leading_title( $content, $title ) {
		if ( ! is_string( $content ) || '' === trim( $content ) ) {
			return $content;
		}

		if ( preg_match( '/^\s*<h1\b[^>]*>(.*?)<\/h1>/is', $content, $matches ) ) {
			$leading_heading = ethnic_single_post_layout_clean_text( $matches[1] );
			$target_title    = ethnic_single_post_layout_clean_text( $title );

			if ( '' !== $leading_heading && 0 === strcasecmp( $leading_heading, $target_title ) ) {
				$content = preg_replace( '/^\s*<h1\b[^>]*>.*?<\/h1>\s*/is', '', $content, 1 );
			}
		}

		return $content;
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_unique_anchor' ) ) {
	function ethnic_single_post_layout_unique_anchor( $text, &$used_ids ) {
		$base = sanitize_title( $text );

		if ( '' === $base ) {
			$base = 'section';
		}

		$anchor_id = $base;
		$suffix    = 2;

		while ( isset( $used_ids[ $anchor_id ] ) ) {
			$anchor_id = $base . '-' . $suffix;
			$suffix++;
		}

		$used_ids[ $anchor_id ] = true;

		return $anchor_id;
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_prepare_content_outline' ) ) {
	function ethnic_single_post_layout_prepare_content_outline( $html ) {
		if ( ! is_string( $html ) || '' === trim( $html ) ) {
			return array(
				'html'    => '',
				'outline' => array(),
			);
		}

		$outline = array();
		$used_ids = array();
		$pattern = '/<h([23])\b([^>]*)>(.*?)<\/h\1>/is';

		$updated_html = preg_replace_callback(
			$pattern,
			static function ( $matches ) use ( &$outline, &$used_ids ) {
				$level            = isset( $matches[1] ) ? (int) $matches[1] : 2;
				$attribute_string = isset( $matches[2] ) ? (string) $matches[2] : '';
				$inner_html       = isset( $matches[3] ) ? (string) $matches[3] : '';
				$heading_text     = ethnic_single_post_layout_clean_text( $inner_html );

				if ( '' === $heading_text ) {
					return $matches[0];
				}

				$anchor_id = '';

				if ( preg_match( '/\sid=(["\'])(.*?)\1/i', $attribute_string, $id_matches ) && ! empty( $id_matches[2] ) ) {
					$anchor_id = trim( (string) $id_matches[2] );
				}

				if ( '' === $anchor_id || isset( $used_ids[ $anchor_id ] ) ) {
					$anchor_id = ethnic_single_post_layout_unique_anchor( $heading_text, $used_ids );

					if ( preg_match( '/\sid=(["\'])(.*?)\1/i', $attribute_string ) ) {
						$attribute_string = preg_replace( '/\sid=(["\'])(.*?)\1/i', ' id="' . esc_attr( $anchor_id ) . '"', $attribute_string, 1 );
					} else {
						$attribute_string .= ' id="' . esc_attr( $anchor_id ) . '"';
					}
				} else {
					$used_ids[ $anchor_id ] = true;
				}

				if ( 2 === $level ) {
					$outline[] = array(
						'id'    => $anchor_id,
						'text'  => $heading_text,
						'level' => $level,
					);
				}

				return '<h' . $level . $attribute_string . '>' . $inner_html . '</h' . $level . '>';
			},
			$html
		);

		if ( ! is_string( $updated_html ) ) {
			$updated_html = $html;
		}

		return array(
			'html'    => $updated_html,
			'outline' => $outline,
		);
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_prepare_content_markup' ) ) {
	function ethnic_single_post_layout_prepare_content_markup( $post_id ) {
		$post = get_post( $post_id );

		if ( ! $post instanceof WP_Post ) {
			return array(
				'html'    => '',
				'outline' => array(),
			);
		}

		$content = ethnic_single_post_layout_strip_leading_title( (string) $post->post_content, get_the_title( $post ) );
		$html    = apply_filters( 'the_content', $content );

		return ethnic_single_post_layout_prepare_content_outline( $html );
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_content_html' ) ) {
	function ethnic_single_post_layout_content_html( $post_id ) {
		$content_payload = ethnic_single_post_layout_prepare_content_markup( $post_id );

		return isset( $content_payload['html'] ) ? (string) $content_payload['html'] : '';
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_excerpt_text' ) ) {
	function ethnic_single_post_layout_excerpt_text( $post_id ) {
		$post = get_post( $post_id );

		if ( ! $post instanceof WP_Post ) {
			return '';
		}

		if ( has_excerpt( $post ) ) {
			return ethnic_single_post_layout_clean_text( get_the_excerpt( $post ) );
		}

		return wp_trim_words( ethnic_single_post_layout_clean_text( $post->post_content ), 28, '...' );
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_normalize_terms' ) ) {
	function ethnic_single_post_layout_normalize_terms( $terms ) {
		if ( empty( $terms ) || is_wp_error( $terms ) ) {
			return array();
		}

		return array_values( array_filter( $terms ) );
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_term_url' ) ) {
	function ethnic_single_post_layout_term_url( $term ) {
		$term_link = get_term_link( $term );

		if ( is_wp_error( $term_link ) ) {
			return '';
		}

		return $term_link;
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_placeholder_logo_payload' ) ) {
	function ethnic_single_post_layout_placeholder_logo_payload() {
		if ( function_exists( 'ethnic_news_archive_enhancer_placeholder_logo_payload' ) ) {
			$payload = ethnic_news_archive_enhancer_placeholder_logo_payload();

			if ( ! empty( $payload['url'] ) ) {
				return $payload;
			}
		}

		$uploads = wp_get_upload_dir();

		if ( empty( $uploads['baseurl'] ) || empty( $uploads['basedir'] ) ) {
			return array(
				'url'    => '',
				'srcset' => '',
			);
		}

		$relative_path = '2026/03/main_logo_dark-256x85.png';
		$baseurl       = trailingslashit( $uploads['baseurl'] );
		$basedir       = trailingslashit( $uploads['basedir'] );

		if ( ! file_exists( $basedir . $relative_path ) ) {
			return array(
				'url'    => '',
				'srcset' => '',
			);
		}

		return array(
			'url'    => esc_url_raw( $baseurl . $relative_path ),
			'srcset' => esc_attr( $baseurl . $relative_path . ' 1x' ),
		);
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_share_icon_svg' ) ) {
	function ethnic_single_post_layout_share_icon_svg( $icon ) {
		$icon = sanitize_key( (string) $icon );
		$svg  = '';

		switch ( $icon ) {
			case 'linkedin':
				$svg = '<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3.34 2.44a1.06 1.06 0 1 1 0 2.12 1.06 1.06 0 0 1 0-2.12Zm1 3.12H2.35v8h1.99v-8Zm3.18 0H5.58v8h1.94V9.37c0-2.32 2.99-2.51 2.99 0v4.19h1.95V8.7c0-3.78-4.22-3.64-4.94-1.78V5.56Z"/></svg>';
				break;
			case 'x':
				$svg = '<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3 2.5h2.58l2.56 3.42L11.2 2.5H13L8.98 7.2 13.2 13.5h-2.58l-2.8-3.83L4.52 13.5H2.7l4.27-4.98L3 2.5Zm2.16 1.36 5.5 8.28h1.15L6.3 3.86H5.16Z"/></svg>';
				break;
			case 'facebook':
				$svg = '<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M9.04 13.5V8.74h1.62l.24-1.86H9.04V5.69c0-.54.15-.91.92-.91h.98V3.11c-.17-.02-.75-.07-1.43-.07-1.41 0-2.38.86-2.38 2.45v1.39H5.5v1.86h1.63v4.76h1.91Z"/></svg>';
				break;
			case 'email':
				$svg = '<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3.5 3A1.5 1.5 0 0 0 2 4.5v7A1.5 1.5 0 0 0 3.5 13h9a1.5 1.5 0 0 0 1.5-1.5v-7A1.5 1.5 0 0 0 12.5 3h-9Zm0 1.25h9c.06 0 .12.01.17.03L8 7.82 3.33 4.28a.5.5 0 0 1 .17-.03Zm-.25 1.58 3.99 3.02a1.25 1.25 0 0 0 1.51 0l4-3.02v5.67a.25.25 0 0 1-.25.25h-9a.25.25 0 0 1-.25-.25V5.83Z"/></svg>';
				break;
		}

		if ( '' === $svg ) {
			return '';
		}

		return wp_kses(
			$svg,
			array(
				'svg'  => array(
					'viewBox'     => true,
					'aria-hidden' => true,
					'focusable'   => true,
				),
				'path' => array(
					'd' => true,
				),
			)
		);
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_share_links' ) ) {
	function ethnic_single_post_layout_share_links( $post_id ) {
		$permalink = get_permalink( $post_id );
		$title     = get_the_title( $post_id );
		$excerpt   = ethnic_single_post_layout_excerpt_text( $post_id );

		if ( ! $permalink ) {
			return array();
		}

		return array(
			array(
				'label' => 'LinkedIn',
				'icon'  => 'linkedin',
				'url'   => 'https://www.linkedin.com/shareArticle?mini=true&url=' . rawurlencode( $permalink ) . '&title=' . rawurlencode( $title ),
			),
			array(
				'label' => 'X',
				'icon'  => 'x',
				'url'   => 'https://twitter.com/intent/tweet?url=' . rawurlencode( $permalink ) . '&text=' . rawurlencode( $title ),
			),
			array(
				'label' => 'Facebook',
				'icon'  => 'facebook',
				'url'   => 'https://www.facebook.com/sharer/sharer.php?u=' . rawurlencode( $permalink ),
			),
			array(
				'label' => 'Email',
				'icon'  => 'email',
				'url'   => 'mailto:?subject=' . rawurlencode( $title ) . '&body=' . rawurlencode( $excerpt . "\n\n" . $permalink ),
			),
		);
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_term_posts' ) ) {
	function ethnic_single_post_layout_term_posts( $term, $exclude_post_id = 0, $fields = '' ) {
		if ( ! $term instanceof WP_Term || empty( $term->taxonomy ) || ! taxonomy_exists( $term->taxonomy ) ) {
			return array();
		}

		$args = array(
			'post_type'           => 'post',
			'post_status'         => 'publish',
			'posts_per_page'      => -1,
			'ignore_sticky_posts' => true,
			'orderby'             => 'date',
			'order'               => 'DESC',
			'suppress_filters'    => false,
			'tax_query'           => array(
				array(
					'taxonomy' => $term->taxonomy,
					'field'    => 'term_id',
					'terms'    => array( (int) $term->term_id ),
				),
			),
		);

		$exclude_post_id = absint( $exclude_post_id );

		if ( $exclude_post_id ) {
			$args['post__not_in'] = array( $exclude_post_id );
		}

		if ( 'ids' === $fields ) {
			$args['fields'] = 'ids';
		}

		return get_posts( $args );
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_sidebar_term' ) ) {
	function ethnic_single_post_layout_sidebar_term( $post_id, $terms ) {
		$post_id = absint( $post_id );
		$terms   = ethnic_single_post_layout_normalize_terms( $terms );

		if ( ! $post_id || empty( $terms ) ) {
			return null;
		}

		$best_term  = null;
		$best_count = -1;

		foreach ( $terms as $term ) {
			if ( ! $term instanceof WP_Term ) {
				continue;
			}

			$related_count = count( ethnic_single_post_layout_term_posts( $term, $post_id, 'ids' ) );

			if ( $related_count > $best_count ) {
				$best_term  = $term;
				$best_count = $related_count;
			}
		}

		return $best_term;
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_category_posts' ) ) {
	function ethnic_single_post_layout_category_posts( $term_id, $exclude_post_id = 0 ) {
		$term_id = absint( $term_id );

		if ( ! $term_id ) {
			return array();
		}

		$term = get_term( $term_id, 'category' );

		if ( is_wp_error( $term ) || ! $term instanceof WP_Term ) {
			return array();
		}

		return ethnic_single_post_layout_term_posts( $term, $exclude_post_id );
	}
}

if ( ! function_exists( 'ethnic_single_post_layout_related_posts' ) ) {
	function ethnic_single_post_layout_related_posts( $post_id ) {
		$categories = wp_get_post_categories( $post_id );
		$args       = array(
			'post_type'           => 'post',
			'post_status'         => 'publish',
			'posts_per_page'      => 3,
			'post__not_in'        => array( $post_id ),
			'ignore_sticky_posts' => true,
			'orderby'             => 'date',
			'order'               => 'DESC',
		);

		if ( ! empty( $categories ) ) {
			$args['category__in'] = $categories;
		}

		$query = new WP_Query( $args );

		if ( $query->have_posts() || empty( $categories ) ) {
			return $query;
		}

		wp_reset_postdata();

		return new WP_Query(
			array(
				'post_type'           => 'post',
				'post_status'         => 'publish',
				'posts_per_page'      => 3,
				'post__not_in'        => array( $post_id ),
				'ignore_sticky_posts' => true,
				'orderby'             => 'date',
				'order'               => 'DESC',
			)
		);
	}
}