/**
 * Blog post template: banner, sticky table of contents, content area.
 * Loaded only on single posts (see dexset_child_blog_assets()).
 */

.dxb-post {
	/* Banner palette, matched to the /platform/platform-overview/ hero. */
	--dxb-banner-bg: #05070d;   /* Elementor kit: Ink (Background) */
	--dxb-banner-fg: #ffffff;   /* hero heading colour */
	--dxb-banner-meta: #8d96a8; /* Elementor kit: Muted (Secondary text) */
	--dxb-heading: #16224d;
	--dxb-accent: #2f56d9;
	--dxb-body: #4a5568;
	--dxb-muted: #7c8AA0;
	--dxb-border: #e3e8ef;
	--dxb-max: 1180px;
	--dxb-gutter: 24px;
	--dxb-radius: 10px;
	--dxb-sticky-top: 104px; /* clears the sticky site header */

	background: #fff;
}

/* Cancel the parent theme's default single-post spacing. */
.dxb-post {
	margin: 0;
	padding: 0;
}

/* ---------------------------------------------------------------- Banner */

.dxb-banner {
	background: var(--dxb-banner-bg);
	padding: 64px var(--dxb-gutter) 72px;
}

.dxb-banner__inner {
	max-width: var(--dxb-max);
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: 48px;
	align-items: center;
}

/* Fall back to a single, still left aligned column with no featured image. */
.dxb-banner__inner:not(:has(.dxb-banner__media)) {
	grid-template-columns: minmax(0, 1fr);
}

.dxb-banner__title {
	margin: 0;
	color: var(--dxb-banner-fg);
	font-size: clamp(1.9rem, 1.15rem + 2.1vw, 3rem);
	line-height: 1.18;
	font-weight: 600;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.dxb-banner__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 20px;
	color: var(--dxb-banner-meta);
	font-size: 0.875rem;
	line-height: 1.4;
}

.dxb-banner__author {
	color: var(--dxb-banner-fg);
	font-weight: 600;
}

/* Dot separator between byline items. */
.dxb-banner__meta > * + *::before {
	content: "";
	display: inline-block;
	width: 3px;
	height: 3px;
	margin-right: 10px;
	border-radius: 50%;
	background: currentColor;
	vertical-align: middle;
	opacity: 0.6;
}

.dxb-banner__media {
	margin: 0;
}

.dxb-banner__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

/* ---------------------------------------------------------------- Layout */

.dxb-layout {
	max-width: var(--dxb-max);
	margin: 0 auto;
	padding: 56px var(--dxb-gutter) 88px;
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 56px;
	align-items: start;
}

/* No visible table of contents: the content column must not inherit the
   narrow sidebar track. Matches both a removed and a still-hidden panel. */
.dxb-layout:not(:has(.dxb-toc:not([hidden]))) {
	grid-template-columns: minmax(0, 1fr);
}

.dxb-layout:not(:has(.dxb-toc:not([hidden]))) .dxb-content {
	max-width: 820px;
}

/* ------------------------------------------------------ Table of contents */

.dxb-toc {
	position: sticky;
	top: var(--dxb-sticky-top);
	max-height: calc(100vh - (var(--dxb-sticky-top) * 2));
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--dxb-border);
	border-radius: var(--dxb-radius);
}

.dxb-toc[hidden] {
	display: none;
}

.dxb-toc__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 14px 16px;
	margin: 0;
	background: none;
	border: 0;
	font: inherit;
	color: var(--dxb-heading);
	text-align: left;
	cursor: pointer;
}

.dxb-toc__heading {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
}

.dxb-toc__chevron {
	flex: none;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-135deg);
	transform-origin: center;
	transition: transform 0.2s ease;
	opacity: 0.7;
	margin-top: 3px;
}

.dxb-toc__toggle[aria-expanded="false"] .dxb-toc__chevron {
	transform: rotate(45deg);
	margin-top: -3px;
}

.dxb-toc__list {
	list-style: none;
	margin: 0;
	padding: 0 16px 14px;
	counter-reset: dxb-toc;
}

.dxb-toc__list[hidden] {
	display: none;
}

.dxb-toc__item {
	counter-increment: dxb-toc;
	margin: 0;
}

.dxb-toc__link {
	display: flex;
	gap: 8px;
	padding: 7px 0;
	color: var(--dxb-body);
	font-size: 0.82rem;
	line-height: 1.45;
	text-decoration: none;
	transition: color 0.15s ease;
}

.dxb-toc__link::before {
	content: counter(dxb-toc) ".";
	flex: none;
	color: var(--dxb-muted);
	font-variant-numeric: tabular-nums;
}

.dxb-toc__link:hover,
.dxb-toc__link:focus-visible {
	color: var(--dxb-accent);
}

.dxb-toc__link.is-active {
	color: var(--dxb-accent);
	font-weight: 600;
}

.dxb-toc__link.is-active::before {
	color: var(--dxb-accent);
}

/* ---------------------------------------------------------- Content area */

.dxb-content {
	color: var(--dxb-body);
	font-size: 1rem;
	line-height: 1.75;
}

.dxb-content > *:first-child {
	margin-top: 0;
}

.dxb-content > *:last-child {
	margin-bottom: 0;
}

.dxb-content h2 {
	margin: 1.8em 0 0.6em;
	color: var(--dxb-heading);
	font-size: clamp(1.5rem, 1.2rem + 0.7vw, 1.9rem);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	scroll-margin-top: 90px;
}

.dxb-content h3 {
	margin: 1.9em 0 0.6em;
	color: var(--dxb-accent);
	font-size: 1.12rem;
	font-weight: 600;
	line-height: 1.4;
	scroll-margin-top: 90px;
}

.dxb-content h4 {
	margin: 1.6em 0 0.5em;
	color: var(--dxb-heading);
	font-size: 1rem;
	font-weight: 600;
	scroll-margin-top: 90px;
}

.dxb-content p {
	margin: 0 0 1.15em;
}

.dxb-content a {
	color: var(--dxb-accent);
	text-underline-offset: 2px;
}

.dxb-content ul,
.dxb-content ol {
	margin: 0 0 1.3em;
	padding-left: 1.25em;
}

.dxb-content li {
	margin-bottom: 0.5em;
}

.dxb-content img,
.dxb-content iframe,
.dxb-content video {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.dxb-content figure {
	margin: 1.8em 0;
}

.dxb-content figcaption {
	margin-top: 0.6em;
	color: var(--dxb-muted);
	font-size: 0.85rem;
	line-height: 1.5;
}

.dxb-content blockquote {
	margin: 1.6em 0;
	padding: 0.25em 0 0.25em 1.15em;
	border-left: 3px solid var(--dxb-accent);
	color: var(--dxb-heading);
}

.dxb-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.5em;
	font-size: 0.92rem;
}

.dxb-content th,
.dxb-content td {
	padding: 10px 12px;
	border: 1px solid var(--dxb-border);
	text-align: left;
}

.dxb-content th {
	color: var(--dxb-heading);
	font-weight: 600;
	background: #f7f9fc;
}

/* ------------------------------------------------- Elementor-built posts */

/* Elementor renders each heading as its own widget and spaces widgets with
   its container gap. The vertical rhythm above is for plain editor content;
   applied on top of Elementor it stacks, leaving a large void over every
   heading. Let Elementor own the gaps for markup Elementor generated. */
.dxb-content .elementor-widget-heading h1,
.dxb-content .elementor-widget-heading h2,
.dxb-content .elementor-widget-heading h3,
.dxb-content .elementor-widget-heading h4,
.dxb-content .elementor-widget-heading h5,
.dxb-content .elementor-widget-heading h6 {
	margin-top: 0;
	margin-bottom: 0;
}

/* Trailing paragraph margin inside a text widget doubles up with the gap. */
.dxb-content .elementor-widget-text-editor > *:last-child,
.dxb-content .elementor-widget-text-editor p:last-child {
	margin-bottom: 0;
}


.dxb-link-pages {
	margin-top: 2em;
	font-size: 0.9rem;
}

/* Wide/full alignments should not break the content column. */
.dxb-content .alignwide,
.dxb-content .alignfull {
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* ------------------------------------------------------------ Responsive */

@media (max-width: 1024px) {
	.dxb-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
		padding-top: 40px;
		padding-bottom: 64px;
	}

	.dxb-toc {
		position: static;
		max-height: none;
		overflow: visible;
	}
}

@media (max-width: 782px) {
	.dxb-banner {
		padding: 44px 20px 48px;
	}

	.dxb-banner__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.dxb-layout {
		padding-left: 20px;
		padding-right: 20px;
	}

	.dxb-content h2 {
		margin-top: 1.9em;
	}
}

/* --------------------------------------------------- A11y / motion / print */

.dxb-toc__toggle:focus-visible,
.dxb-toc__link:focus-visible,
.dxb-content a:focus-visible {
	outline: 2px solid var(--dxb-accent);
	outline-offset: 2px;
	border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.dxb-toc__chevron,
	.dxb-toc__link {
		transition: none;
	}
}

@media print {
	.dxb-toc {
		display: none;
	}

	.dxb-layout {
		grid-template-columns: minmax(0, 1fr);
		padding: 0;
	}

	.dxb-banner {
		background: none;
		padding: 0 0 24px;
	}

	.dxb-banner__title {
		color: #000;
	}
}


/* Dark CTA container (Next Step section) */
.dxb-content .dxb-cta-dark h2,
.dxb-content .dxb-cta-dark h3 {
	color: #ffffff !important;
}
.dxb-content .dxb-cta-dark p {
	color: #cbd5e1;
}

/* ------------------------------------------------------------ Author box */

.dxb-author-box {
	max-width: var(--dxb-max);
	margin: -48px auto 56px;
	padding: 0 var(--dxb-gutter);
}

.dxb-author-box__inner {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	padding: 28px;
	background: #f7f9fc;
	border: 1px solid var(--dxb-border);
	border-radius: var(--dxb-radius);
}

.dxb-author-box__avatar {
	flex: 0 0 72px;
}

.dxb-author-box__image {
	width: 72px !important;
	height: 72px !important;
	max-width: none;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.dxb-author-box__label {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dxb-muted);
	margin-bottom: 2px;
}

.dxb-author-box__name {
	margin: 0 0 6px;
	color: var(--dxb-heading);
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.3;
}

.dxb-author-box__bio {
	margin: 0;
}

.dxb-author-box__bio p {
	margin: 0 0 0.8em;
	color: var(--dxb-body);
	font-size: 0.95rem;
	line-height: 1.6;
}

.dxb-author-box__bio p:last-child {
	margin-bottom: 0;
	color: var(--dxb-body);
	font-size: 0.95rem;
	line-height: 1.6;
}

@media (max-width: 600px) {
	.dxb-author-box__inner {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
}