/* Xyod Single — dynamic post widgets */

/* Featured image as container background (class: xyod-post-featured-bg) */
.xyod-post-featured-bg--active {
	position: relative;
	isolation: isolate;
	background-color: transparent;
}

/* Legacy CSS-class mode: image stays on the host element */
.xyod-post-featured-bg--legacy-host {
	background-size: var(--xyod-post-featured-bg-size, cover);
	background-position: var(--xyod-post-featured-bg-position, center center);
	background-repeat: var(--xyod-post-featured-bg-repeat, no-repeat);
}

/*
 * Full-bleed featured image layer (real DOM node — Elementor uses ::before/::after).
 */
.xyod-post-featured-bg__layer {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 100vw;
	margin-left: -50vw;
	z-index: 0;
	pointer-events: none;
	background-image: var(--xyod-post-featured-bg-image);
	background-size: var(--xyod-post-featured-bg-size, cover);
	background-position: var(--xyod-post-featured-bg-position, center center);
	background-repeat: var(--xyod-post-featured-bg-repeat, no-repeat);
}

/* Parallax media replaces the static layer once JS boots */
.xyod-parallax-bg[data-xyod-parallax-ready='1'] > .xyod-post-featured-bg__layer,
.xyod-parallax-bg.xyod-parallax-bg--active > .xyod-post-featured-bg__layer {
	display: none !important;
}

/*
 * Tablet/mobile: parallax is off — paint featured image on the host from the
 * per-page CSS variable (survives parallax teardown + deferred URL cache).
 */
@media (max-width: 1024px) {
	[data-xyod-post-featured-bg='1']:not([data-xyod-parallax-ready='1']):not(.xyod-parallax-bg--active),
	[data-xyod-featured-bg-deferred='1']:not([data-xyod-parallax-ready='1']):not(.xyod-parallax-bg--active) {
		background-image: var(--xyod-post-featured-bg-image) !important;
		background-size: var(--xyod-post-featured-bg-size, cover) !important;
		background-position: var(--xyod-post-featured-bg-position, center center) !important;
		background-repeat: var(--xyod-post-featured-bg-repeat, no-repeat) !important;
		background-color: transparent !important;
	}
}

/* Editor canvas — keep featured layer visible under Elementor overlay */
.elementor-editor-active .xyod-post-featured-bg__layer,
.elementor-editor-preview .xyod-post-featured-bg__layer {
	display: block !important;
	z-index: 0 !important;
}

.elementor-editor-active [data-xyod-featured-bg-deferred='1'],
.elementor-editor-preview [data-xyod-featured-bg-deferred='1'] {
	background-image: var(--xyod-post-featured-bg-image) !important;
	background-size: var(--xyod-post-featured-bg-size, cover) !important;
	background-position: var(--xyod-post-featured-bg-position, center center) !important;
	background-repeat: var(--xyod-post-featured-bg-repeat, no-repeat) !important;
}

.elementor-editor-active .xyod-post-featured-bg--active::before,
.elementor-editor-preview .xyod-post-featured-bg--active::before {
	z-index: 1 !important;
}

.xyod-post-featured-bg--active > *:not(.xyod-parallax-bg__media):not(.xyod-post-featured-bg__layer) {
	position: relative;
	z-index: 2;
}

/*
 * Elementor Background Overlay uses ::before; legacy Xyod tint presets use ::after.
 * Must sit above the featured image layer (z-index 0) on all viewports — not only
 * when parallax is active (tablet/mobile tear down removes xyod-parallax-bg--active).
 */
.xyod-post-featured-bg--active::before,
.xyod-post-featured-bg--active::after {
	z-index: 1 !important;
}

/* Overlay tint — add class xyod-post-featured-bg--overlay (or a preset below) */
.xyod-post-featured-bg--active:is(
	.xyod-post-featured-bg--overlay,
	.xyod-post-featured-bg--overlay-dark,
	.xyod-post-featured-bg--overlay-light,
	.xyod-post-featured-bg--overlay-20,
	.xyod-post-featured-bg--overlay-30,
	.xyod-post-featured-bg--overlay-40,
	.xyod-post-featured-bg--overlay-50,
	.xyod-post-featured-bg--overlay-60,
	.xyod-post-featured-bg--overlay-70,
	.xyod-post-featured-bg--overlay-80
)::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: var(--xyod-post-featured-bg-overlay, rgba(0, 0, 0, 0.45));
}

.xyod-post-featured-bg--overlay,
.xyod-post-featured-bg--overlay-dark {
	--xyod-post-featured-bg-overlay: rgba(0, 0, 0, 0.45);
}

.xyod-post-featured-bg--overlay-light {
	--xyod-post-featured-bg-overlay: rgba(255, 255, 255, 0.35);
}

.xyod-post-featured-bg--overlay-20 {
	--xyod-post-featured-bg-overlay: rgba(0, 0, 0, 0.2);
}

.xyod-post-featured-bg--overlay-30 {
	--xyod-post-featured-bg-overlay: rgba(0, 0, 0, 0.3);
}

.xyod-post-featured-bg--overlay-40 {
	--xyod-post-featured-bg-overlay: rgba(0, 0, 0, 0.4);
}

.xyod-post-featured-bg--overlay-50 {
	--xyod-post-featured-bg-overlay: rgba(0, 0, 0, 0.5);
}

.xyod-post-featured-bg--overlay-60 {
	--xyod-post-featured-bg-overlay: rgba(0, 0, 0, 0.6);
}

.xyod-post-featured-bg--overlay-70 {
	--xyod-post-featured-bg-overlay: rgba(0, 0, 0, 0.7);
}

.xyod-post-featured-bg--overlay-80 {
	--xyod-post-featured-bg-overlay: rgba(0, 0, 0, 0.8);
}

/* Size (default: cover) */
.xyod-post-featured-bg--contain {
	--xyod-post-featured-bg-size: contain;
}

.xyod-post-featured-bg--size-auto {
	--xyod-post-featured-bg-size: auto;
}

/* Position (default: center center) */
.xyod-post-featured-bg--top {
	--xyod-post-featured-bg-position: center top;
}

.xyod-post-featured-bg--bottom {
	--xyod-post-featured-bg-position: center bottom;
}

.xyod-post-featured-bg--left {
	--xyod-post-featured-bg-position: left center;
}

.xyod-post-featured-bg--right {
	--xyod-post-featured-bg-position: right center;
}

.xyod-post-featured-bg--top-left {
	--xyod-post-featured-bg-position: left top;
}

.xyod-post-featured-bg--top-right {
	--xyod-post-featured-bg-position: right top;
}

.xyod-post-featured-bg--bottom-left {
	--xyod-post-featured-bg-position: left bottom;
}

.xyod-post-featured-bg--bottom-right {
	--xyod-post-featured-bg-position: right bottom;
}

/* Repeat (default: no-repeat) */
.xyod-post-featured-bg--repeat {
	--xyod-post-featured-bg-repeat: repeat;
}

.xyod-post-featured-bg--repeat-x {
	--xyod-post-featured-bg-repeat: repeat-x;
}

.xyod-post-featured-bg--repeat-y {
	--xyod-post-featured-bg-repeat: repeat-y;
}

.xyod-post-featured-bg--empty {
	background-color: #e8e8e8;
	min-height: 120px;
}

.xyod-post-featured-image {
	line-height: 0;
}

.xyod-post-featured-image img,
.xyod-post-featured-image__img {
	display: inline-block;
	width: auto;
	max-width: 100%;
	height: auto;
}

/* Beat leftover Elementor Style→Width:100% so Image Resolution controls display size */
.elementor-widget-xyod-post-featured-image .xyod-post-featured-image img[data-xyod-sized="1"] {
	width: var(--xyod-fi-w, auto) !important;
	max-width: 100% !important;
	height: auto !important;
}

.xyod-author-box {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
}

.xyod-author-box--above {
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.xyod-author-box--right {
	flex-direction: row-reverse;
}

.xyod-author-box__avatar img {
	display: block;
	border-radius: 50%;
	object-fit: cover;
}

.xyod-author-box__name {
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.xyod-author-box__name a {
	text-decoration: none;
	color: inherit;
}

.xyod-author-box__bio {
	font-size: 0.95em;
	line-height: 1.5;
	opacity: 0.85;
}

.xyod-author-box__bio p:last-child {
	margin-bottom: 0;
}

.xyod-post-nav {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1.5rem;
	width: 100%;
}

.xyod-post-nav__prev,
.xyod-post-nav__next {
	display: flex;
	flex-direction: column;
	flex: 1 1 50%;
	min-width: 0;
	align-self: flex-start;
}

.xyod-post-nav__next {
	align-items: flex-end;
	text-align: right;
}

.xyod-post-nav a,
.xyod-post-nav__link {
	display: inline-flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 0.75rem;
	text-decoration: none;
	color: inherit;
	max-width: 100%;
}

.xyod-post-nav--has-thumbs .xyod-post-nav__prev .xyod-post-nav__link {
	width: 100%;
}

.xyod-post-nav--has-thumbs .xyod-post-nav__next .xyod-post-nav__link {
	flex-direction: row-reverse;
	justify-content: flex-start;
	width: auto;
	max-width: 100%;
	margin-left: auto;
}

.xyod-post-nav__next > .xyod-post-nav__link {
	margin-left: auto;
}

.xyod-post-nav__body {
	display: inline-flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.xyod-post-nav__next .xyod-post-nav__body {
	align-items: flex-end;
	text-align: right;
}

.xyod-post-nav__thumb {
	display: block;
	flex: 0 0 auto;
	width: 72px;
	overflow: hidden;
	line-height: 0;
}

.xyod-post-nav__thumb img,
.xyod-post-nav__thumb-img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

.xyod-post-nav__label {
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.65;
}

.xyod-post-nav__title {
	font-weight: 600;
	line-height: 1.35;
}

@media (max-width: 767px) {
	.xyod-post-nav {
		flex-direction: column;
		align-items: stretch;
		gap: 1.25rem;
	}

	.xyod-post-nav__prev,
	.xyod-post-nav__next {
		flex: 1 1 100%;
		width: 100%;
		max-width: 100%;
	}

	.xyod-post-nav__next {
		text-align: left;
	}

	.xyod-post-nav__next > .xyod-post-nav__link {
		margin-left: 0;
	}

	.xyod-post-nav--has-thumbs .xyod-post-nav__next .xyod-post-nav__link {
		flex-direction: row;
		justify-content: flex-start;
	}

	.xyod-post-nav__next .xyod-post-nav__body {
		align-items: flex-start;
		text-align: left;
	}
}

.xyod-progress-tracker {
	display: block;
	width: 100%;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.08);
}

.xyod-progress-tracker--fixed-top {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	width: 100%;
}

.admin-bar .xyod-progress-tracker--fixed-top {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .xyod-progress-tracker--fixed-top {
		top: 46px;
	}
}

.xyod-progress-tracker__bar {
	display: block;
	width: 0;
	height: 100%;
	background: #111;
	transition: width 0.05s linear;
}

.xyod-toc__title {
	font-weight: 600;
	margin-bottom: 0.75rem;
}

.xyod-toc__list {
	margin: 0;
	padding-left: 1.25rem;
}

.xyod-toc__list--fallback + .xyod-toc__list:not(.xyod-toc__list--fallback),
.xyod-toc__list:not(.xyod-toc__list--fallback):not(:empty) ~ .xyod-toc__list--fallback {
	display: none;
}

.xyod-toc__item {
	margin: 0.35rem 0;
}

.xyod-toc__item--h3 {
	margin-left: 0.75rem;
}

.xyod-toc__item--h4,
.xyod-toc__item--h5,
.xyod-toc__item--h6 {
	margin-left: 1.5rem;
}

.xyod-toc__list a {
	text-decoration: none;
	color: inherit;
}

.xyod-toc__list a:hover {
	text-decoration: underline;
}

/* Post Comments widget */
.xyod-post-comments .comment-reply-title small {
	display: inline-block;
	margin-left: 0.65em;
}

.xyod-post-comments .comment-form input[type='text'],
.xyod-post-comments .comment-form input[type='email'],
.xyod-post-comments .comment-form input[type='url'],
.xyod-post-comments .comment-form textarea,
.xyod-post-comments #commentform input[type='text'],
.xyod-post-comments #commentform input[type='email'],
.xyod-post-comments #commentform input[type='url'],
.xyod-post-comments #commentform textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.65em 0.85em;
	border: 1px solid #d4d4d4;
	border-radius: 2px;
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.5;
}

.xyod-post-comments .comment-form textarea,
.xyod-post-comments #commentform textarea {
	min-height: 140px;
	resize: vertical;
}

.xyod-post-comments .comment-form input:focus,
.xyod-post-comments .comment-form textarea:focus,
.xyod-post-comments #commentform input:focus,
.xyod-post-comments #commentform textarea:focus {
	border-color: #b0b0b0;
	outline: none;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Post Content column — add class xyod-post-content on the template Container */
.xyod-post-content {
	--xyod-prose-spacing: 1em;
	--xyod-image-margin-top: 1.75em;
	--xyod-caption-font-size: 14px;
	--xyod-caption-line-height: 1.45;
	--xyod-caption-padding-top: 0.65em;
	--xyod-caption-color: inherit;
	--xyod-caption-opacity: 0.85;
}

.xyod-post-content .elementor-widget-xyod-post-content .elementor-widget-container > :first-child {
	margin-block-start: 0;
}

.xyod-post-content > :last-child {
	margin-bottom: 0;
}

.xyod-post-content p {
	margin-block-start: 0;
	margin-block-end: var(--xyod-prose-spacing);
}

/* Headings — restore blog prose spacing (kit zeros margins sitewide on pages) */
.xyod-post-content h1,
.xyod-post-content h2,
.xyod-post-content h3,
.xyod-post-content h4,
.xyod-post-content h5,
.xyod-post-content h6 {
	margin-block-start: 1.05em;
	margin-block-end: 0.75em;
	line-height: 1.25;
}

.xyod-post-content ul,
.xyod-post-content ol {
	margin-block-start: 0;
	margin-block-end: var(--xyod-prose-spacing);
	padding-left: 1.35em;
}

.xyod-post-content ul {
	list-style: disc;
}

.xyod-post-content ol {
	list-style: decimal;
}

.xyod-post-content ul ul {
	list-style: circle;
	margin-top: 0.35rem;
}

.xyod-post-content ol ol {
	list-style: lower-alpha;
	margin-top: 0.35rem;
}

.xyod-post-content li {
	margin: 0.35rem 0;
}

.xyod-post-content li > ul,
.xyod-post-content li > ol {
	margin-top: 0.35rem;
	margin-bottom: 0.35rem;
}

.xyod-post-content strong,
.xyod-post-content b {
	font-weight: 700;
}

.xyod-post-content em,
.xyod-post-content i {
	font-style: italic;
}

/* Beat Elementor kit / theme resets that zero list markers */
.xyod-post-content ul {
	list-style-type: disc !important;
}

.xyod-post-content ol {
	list-style-type: decimal !important;
}

.xyod-post-content ul ul {
	list-style-type: circle !important;
}

.xyod-post-content ol ol {
	list-style-type: lower-alpha !important;
}

/* Beat Elementor kit heading margin resets inside post content only */
.xyod-post-content h1,
.xyod-post-content h2,
.xyod-post-content h3,
.xyod-post-content h4,
.xyod-post-content h5,
.xyod-post-content h6 {
	margin-block-end: 0.75em !important;
	margin-block-start: 1.05em !important;
}

/* First block in a widget — no extra top margin (classic + atomic Elementor) */
.xyod-post-content .elementor-widget-xyod-post-content .elementor-widget-container > :first-child,
.xyod-post-content .elementor-widget-text-editor .elementor-widget-container > :first-child,
.xyod-post-content .elementor-widget-theme-text-editor .elementor-widget-container > :first-child,
.xyod-post-content .elementor-text-editor > :first-child,
.xyod-post-content .elementor-widget-container > .elementor-text-editor:first-child > :first-child,
.xyod-post-content .elementor-element > h1:first-child,
.xyod-post-content .elementor-element > h2:first-child,
.xyod-post-content .elementor-element > h3:first-child,
.xyod-post-content .elementor-element > h4:first-child,
.xyod-post-content .elementor-element > h5:first-child,
.xyod-post-content .elementor-element > h6:first-child,
.xyod-post-content .elementor-widget-container > h1:first-child,
.xyod-post-content .elementor-widget-container > h2:first-child,
.xyod-post-content .elementor-widget-container > h3:first-child,
.xyod-post-content .elementor-widget-container > h4:first-child,
.xyod-post-content .elementor-widget-container > h5:first-child,
.xyod-post-content .elementor-widget-container > h6:first-child,
.xyod-post-content .e-con-inner > .elementor-element:first-child > h1:first-child,
.xyod-post-content .e-con-inner > .elementor-element:first-child > h2:first-child,
.xyod-post-content .e-con-inner > .elementor-element:first-child > h3:first-child,
.xyod-post-content .e-con-inner > .elementor-element:first-child > h4:first-child,
.xyod-post-content .e-con-inner > .elementor-element:first-child > h5:first-child,
.xyod-post-content .e-con-inner > .elementor-element:first-child > h6:first-child,
.xyod-post-content > h1:first-child,
.xyod-post-content > h2:first-child,
.xyod-post-content > h3:first-child,
.xyod-post-content > h4:first-child,
.xyod-post-content > h5:first-child,
.xyod-post-content > h6:first-child {
	margin-block-start: 0 !important;
}

.xyod-post-content p,
.xyod-post-content ul,
.xyod-post-content ol {
	margin-block-end: var(--xyod-prose-spacing, 1em) !important;
}

/* CTA / custom blocks — opt out of blog prose (class on Container) */
.xyod-post-content .xyod-no-prose p,
.xyod-post-content .xyod-no-prose ul,
.xyod-post-content .xyod-no-prose ol,
.xyod-post-content .xyod-no-prose h1,
.xyod-post-content .xyod-no-prose h2,
.xyod-post-content .xyod-no-prose h3,
.xyod-post-content .xyod-no-prose h4,
.xyod-post-content .xyod-no-prose h5,
.xyod-post-content .xyod-no-prose h6 {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
	line-height: unset;
}

.xyod-post-content .xyod-no-prose ul,
.xyod-post-content .xyod-no-prose ol {
	padding-left: unset;
	list-style-type: unset !important;
}

/* Post images — alignment, spacing, captions (beat Elementor figure { margin: 0 }) */
.xyod-post-content img {
	max-width: 100%;
	height: auto;
}

.xyod-post-content figure.wp-caption,
.xyod-post-content .wp-caption,
.xyod-post-content figure.wp-block-image,
.xyod-post-content .elementor-text-editor figure,
.xyod-post-content .elementor-widget-container figure {
	max-width: 100%;
	margin-block-start: var(--xyod-image-margin-top, 1.75em) !important;
	margin-block-end: var(--xyod-prose-spacing, 1em) !important;
}

.xyod-post-content figure.wp-caption img,
.xyod-post-content .wp-caption img,
.xyod-post-content figure.wp-block-image img,
.xyod-post-content .elementor-text-editor figure img,
.xyod-post-content .elementor-widget-container figure img {
	display: block;
	width: 100%;
	height: auto;
	margin-block: 0 !important;
}

.xyod-post-content img.aligncenter,
.xyod-post-content figure.aligncenter,
.xyod-post-content .wp-caption.aligncenter,
.xyod-post-content figure.wp-block-image.aligncenter {
	display: block;
	clear: both;
	float: none !important;
	margin-block-start: var(--xyod-image-margin-top, 1.75em) !important;
	margin-block-end: var(--xyod-prose-spacing, 1em) !important;
	margin-inline: auto !important;
}

.xyod-post-content img.alignleft,
.xyod-post-content figure.alignleft,
.xyod-post-content .wp-caption.alignleft,
.xyod-post-content figure.wp-block-image.alignleft {
	display: block;
	float: left !important;
	clear: none;
	margin-block-start: var(--xyod-image-margin-top, 1.75em) !important;
	margin-block-end: var(--xyod-prose-spacing, 1em) !important;
	margin-inline: 0 1.25em !important;
}

.xyod-post-content img.alignright,
.xyod-post-content figure.alignright,
.xyod-post-content .wp-caption.alignright,
.xyod-post-content figure.wp-block-image.alignright {
	display: block;
	float: right !important;
	clear: none;
	margin-block-start: var(--xyod-image-margin-top, 1.75em) !important;
	margin-block-end: var(--xyod-prose-spacing, 1em) !important;
	margin-inline: 1.25em 0 !important;
}

.xyod-post-content .wp-caption-text,
.xyod-post-content figcaption,
.xyod-post-content .wp-block-image figcaption {
	margin: 0;
	padding-block-start: var(--xyod-caption-padding-top, 0.65em);
	font-size: var(--xyod-caption-font-size, 14px);
	line-height: var(--xyod-caption-line-height, 1.45);
	color: var(--xyod-caption-color, inherit);
	opacity: var(--xyod-caption-opacity, 0.85);
}

.xyod-post-content figure.aligncenter .wp-caption-text,
.xyod-post-content .wp-caption.aligncenter .wp-caption-text,
.xyod-post-content figure.wp-block-image.aligncenter figcaption {
	text-align: center;
}

.xyod-post-content figure.alignleft .wp-caption-text,
.xyod-post-content .wp-caption.alignleft .wp-caption-text,
.xyod-post-content figure.wp-block-image.alignleft figcaption {
	text-align: left;
}

.xyod-post-content figure.alignright .wp-caption-text,
.xyod-post-content .wp-caption.alignright .wp-caption-text,
.xyod-post-content figure.wp-block-image.alignright figcaption {
	text-align: right;
}
