/*
 * Elastos Blog Design System
 * Tokens (--ela-*) are printed inline from includes/tokens.php, the single source.
 *
 * 1. Site-wide base
 * 2. Prose: article body (.ela-prose, added around the main post content)
 * 3. Components: code, callout, figure, embeds
 * 4. Tables (responsive region and mobile cards)
 * 5. Archive cards (Blocksy fallback templates)
 * 6. Site chrome (header and footer)
 * 7. Classic editor
 */

/* 1. Site-wide base ------------------------------------------------------- */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

::selection {
	background: color-mix(in srgb, var(--ela-accent) 35%, transparent);
	color: var(--ela-text);
}

:where(a, button, [role="button"], input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--ela-accent);
	outline-offset: 2px;
}

.ela-text-accent {
	color: var(--ela-accent);
}

.ela-reading-time {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Blocksy paints code with palette colour 6 (light grey) under the site's white text.
   The palette itself stays as is because legacy pages use that slot, so code is fixed
   here, everywhere, at the same specificity and later in the cascade. */
pre,
code,
kbd,
samp {
	background-color: var(--ela-inset);
	color: var(--ela-text);
}

pre code {
	background-color: transparent;
}

/* Core's striped table style paints odd rows #f0f0f0 under the site's white text. */
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: var(--ela-surface);
}

.wp-block-table.is-style-stripes {
	border-bottom-color: var(--ela-border);
}

/* 2. Prose ------------------------------------------------------------------ */

.ela-prose {
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-base);
	font-weight: 400;
	line-height: var(--ela-leading-body);
	letter-spacing: 0;
	/* A step below bold and headings: on a dark page weight alone barely shows emphasis. */
	color: var(--ela-text-body);
	overflow-wrap: break-word;
	font-kerning: normal;
}

/* Every block sits in the reading measure, left-aligned so it shares an edge with the
   title and featured image above it. Wide content opts out below. */
.ela-prose > * {
	max-width: var(--ela-measure);
	margin-block: 0;
	margin-inline: 0 auto;
}

.ela-prose > * + * {
	margin-block-start: 1.25em;
}

.ela-prose > :first-child {
	margin-block-start: 0;
}

.ela-prose :is(p, li, dd, blockquote) {
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	color: inherit;
	text-wrap: pretty;
}

.ela-prose :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--ela-font-sans);
	color: var(--ela-text-strong);
	text-wrap: balance;
	margin-block-end: 0;
}

.ela-prose h2 {
	font-size: var(--ela-text-h2);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: -0.005em;
}

.ela-prose h3 {
	font-size: var(--ela-text-h3);
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.005em;
}

.ela-prose :is(h4, h5, h6) {
	font-size: var(--ela-text-base);
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0;
}

/* Space above a heading is relative to its own size and at least three times the space
   below it, so each heading reads as the start of its section (64, 54 and 40px above, 14px
   below on desktop). */
.ela-prose > h2 {
	margin-block-start: 2em;
}

/* The floor covers headings authored at body size (inline font-size: 1em). */
.ela-prose > :is(h3, h4, h5, h6) {
	margin-block-start: max(2.25em, 2.5rem);
}

.ela-prose > :is(h2, h3, h4, h5, h6) + * {
	margin-block-start: 0.75em;
}

.ela-prose :is(strong, b) {
	font-weight: 700;
	color: var(--ela-text-strong);
}

/* Bold inside a link stays the link colour; bold in a caption stays muted. */
.ela-prose :is(a, figcaption, .wp-caption-text, .wp-element-caption, cite) :is(strong, b) {
	color: inherit;
}

.ela-prose a {
	color: var(--ela-accent);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	text-decoration-color: color-mix(in srgb, var(--ela-accent) 55%, transparent);
	transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.ela-prose a:hover {
	color: var(--ela-accent-hover);
	text-decoration-color: currentColor;
	text-decoration-thickness: 2px;
}

.ela-prose a:focus-visible {
	border-radius: 2px;
}

.ela-prose :is(ul, ol) {
	padding-inline-start: 1.25em;
}

.ela-prose ul {
	list-style: disc;
}

.ela-prose ol {
	list-style: decimal;
}

/* List items are often several lines long; a clear gap keeps them apart. */
.ela-prose li + li,
.ela-prose li > :is(ul, ol) {
	margin-block-start: 0.75em;
}

.ela-prose li > p {
	margin-block: 0;
}

.ela-prose :is(ul, ol) ul {
	list-style: circle;
}

/* Orange marks only what can be clicked; bullets are quiet. */
.ela-prose ul > li::marker {
	color: var(--ela-text-muted);
}

.ela-prose ol > li::marker {
	color: var(--ela-text-muted);
	font-variant-numeric: tabular-nums;
}

.ela-prose blockquote {
	border: 0;
	border-inline-start: 3px solid var(--ela-rule);
	padding: 0 0 0 1.25em;
	font-style: normal;
	background: none;
}

.ela-prose blockquote > * + * {
	margin-block-start: 0.75em;
}

.ela-prose blockquote > * {
	margin-block-end: 0;
}

.ela-prose blockquote cite {
	display: block;
	margin-block-start: 0.5em;
	font-size: var(--ela-text-small);
	font-style: normal;
	color: var(--ela-text-muted);
}

.ela-prose hr {
	height: 0;
	border: 0;
	border-block-start: 1px solid var(--ela-rule);
	margin-block: var(--ela-space-7);
}

.ela-prose sup {
	font-size: 0.75em;
	line-height: 0;
	vertical-align: super;
}

.ela-prose sup a {
	text-decoration: none;
	padding-inline: 0.15em;
}

/* 3. Components ------------------------------------------------------------- */

/* Media and code may run wider than the text measure. */
.ela-prose > :is(figure, pre, .ela-code, .wp-block-image, .wp-block-gallery, .wp-block-embed, .wp-block-media-text, .wp-caption, video, iframe),
.ela-prose > p:has(> img:only-child),
.ela-prose > p:has(> a:only-child > img:only-child) {
	max-width: min(100%, var(--ela-wide));
}

.ela-prose img {
	max-width: 100%;
	height: auto;
	border-radius: var(--ela-radius);
}

.ela-prose img.emoji {
	border-radius: 0;
}

.ela-prose a:has(> img) {
	text-decoration: none;
}

.ela-prose a.ela-zoom {
	cursor: zoom-in;
}

.ela-prose :is(figure, .wp-caption) {
	width: auto !important; /* the [caption] shortcode writes a fixed inline width */
}

.ela-prose :is(figcaption, .wp-caption-text, .wp-element-caption) {
	margin-block-start: 0.75em;
	font-size: var(--ela-text-small);
	line-height: 1.5;
	color: var(--ela-text-muted);
	text-align: center;
}

.ela-prose :is(iframe[src*="youtube"], iframe[src*="youtu.be"], iframe[src*="vimeo"]) {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--ela-radius);
}

.ela-prose video {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--ela-radius);
}

.ela-prose pre {
	box-sizing: border-box;
	padding: 1rem 1.25rem;
	border: 1px solid var(--ela-border);
	border-radius: var(--ela-radius);
	background: var(--ela-inset);
	color: var(--ela-text);
	font-family: var(--ela-font-mono);
	font-size: var(--ela-text-code);
	line-height: 1.6;
	tab-size: 4;
	white-space: pre;
	overflow-x: auto;
	overflow-wrap: normal;
	word-break: normal;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--ela-border-strong) transparent;
}

.ela-prose pre code {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	white-space: inherit;
	overflow-wrap: normal;
	word-break: normal;
}

/* Copy button: the script wraps each code block in .ela-code so the button stays put
   while the code scrolls sideways. */
.ela-code {
	position: relative;
}

.ela-code > pre {
	margin: 0;
}

.ela-code__copy {
	position: absolute;
	inset-block-start: 0.5rem;
	inset-inline-end: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 0 0.625rem;
	border: 1px solid var(--ela-border-strong);
	border-radius: var(--ela-radius-sm);
	background: var(--ela-surface);
	color: var(--ela-text-muted);
	font-family: var(--ela-font-sans);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.ela-code__copy:hover,
.ela-code__copy[data-copied] {
	color: var(--ela-text);
	border-color: var(--ela-rule);
}

.ela-code__copy:focus-visible {
	outline: 2px solid var(--ela-accent);
	outline-offset: 2px;
}

.ela-sr-status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Classic galleries: WordPress's own gallery styles are not loaded on this site, so the
   images stacked at full size. A grid with the gallery's column count and one shared
   frame keeps rows even; images fit whole inside it (they are mostly app screenshots,
   where a crop cuts off labels) and open full size on click. */
.ela-prose .gallery {
	display: grid;
	grid-template-columns: repeat(var(--ela-gallery-cols, 3), minmax(0, 1fr));
	gap: var(--ela-space-2);
}

.ela-prose .gallery-columns-1 { --ela-gallery-cols: 1; }
.ela-prose .gallery-columns-2 { --ela-gallery-cols: 2; }
.ela-prose .gallery-columns-3 { --ela-gallery-cols: 3; }
.ela-prose .gallery-columns-4 { --ela-gallery-cols: 4; }
.ela-prose .gallery-columns-5 { --ela-gallery-cols: 5; }
.ela-prose .gallery-columns-6 { --ela-gallery-cols: 6; }

.ela-prose .gallery > br {
	display: none;
}

.ela-prose :is(.gallery-item, .gallery-icon) {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
}

.ela-prose .gallery-icon a {
	display: block;
}

.ela-prose .gallery-item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: contain;
	background: var(--ela-inset);
	border: 1px solid var(--ela-border);
	border-radius: var(--ela-radius-sm);
}

.ela-prose .gallery-caption {
	margin-block-start: var(--ela-space-1);
	font-size: var(--ela-text-small);
	color: var(--ela-text-muted);
}

@media (max-width: 767px) {
	.ela-prose .gallery:not(.gallery-columns-1) {
		--ela-gallery-cols: 2;
	}
}

.ela-prose :is(:not(pre) > code, kbd, samp) {
	padding: 0.1em 0.35em;
	border: 1px solid var(--ela-border);
	border-radius: var(--ela-radius-sm);
	background: rgb(255 255 255 / 0.06);
	color: var(--ela-text);
	font-family: var(--ela-font-mono);
	font-size: 0.875em;
	overflow-wrap: anywhere;
}

.ela-callout {
	--ela-callout-tone: var(--ela-accent);
	box-sizing: border-box;
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--ela-border);
	border-inline-start: 3px solid var(--ela-callout-tone);
	border-radius: var(--ela-radius);
	background: var(--ela-surface);
	background: color-mix(in srgb, var(--ela-callout-tone) 8%, var(--ela-surface));
	color: var(--ela-text);
}

.ela-callout--warning {
	--ela-callout-tone: var(--ela-warning);
}

.ela-callout > * {
	margin-block: 0;
}

.ela-callout > * + * {
	margin-block-start: 0.75em;
}

.ela-prose .ela-callout__title,
.ela-callout__title {
	font-weight: 700;
}

/* 4. Tables ----------------------------------------------------------------- */

.ela-table-scroll {
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--ela-border-strong) transparent;
}

.ela-prose > .ela-table-scroll {
	max-width: 100%;
}

.ela-table-scroll::-webkit-scrollbar {
	height: 6px;
	-webkit-appearance: none;
}

.ela-table-scroll::-webkit-scrollbar-thumb {
	border-radius: 3px;
	background: var(--ela-border-strong);
}

.ela-table-scroll::-webkit-scrollbar-track {
	background: var(--ela-surface);
}

/* Fallback for tables Elementor renders outside the_content (Text Editor widgets),
   which the PHP filter never sees: the table itself becomes the scroller. */
.elementor-widget-theme-post-content table,
.elementor-widget-text-editor table {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
}

.ela-table-scroll > table {
	display: table;
	width: 100%;
	max-width: none;
	margin: 0;
	overflow: visible;
}

.ela-prose table {
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: var(--ela-text-table);
	line-height: 1.55;
	font-variant-numeric: tabular-nums;
	color: var(--ela-text-body);
}

.ela-prose :is(th, td) {
	padding: 0.75rem 1rem;
	border: 0;
	border-block-end: 1px solid var(--ela-border);
	vertical-align: top;
	text-align: start;
}

.ela-prose thead th,
.ela-prose tr.ela-head > * {
	font-size: var(--ela-text-small);
	font-weight: 700;
	color: var(--ela-text-muted);
	border-block-end-color: var(--ela-border-strong);
}

.ela-table-hint {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--ela-text-muted);
}

@media (min-width: 768px) {
	.ela-table-hint {
		display: none;
	}

	/* Dates, block heights and header labels (marked by the tables step) stay on one line. */
	.ela-prose :is(th, td).ela-nowrap {
		white-space: nowrap;
	}
}

@media (max-width: 767px) {
	.ela-table-scroll :is(th, td) {
		min-width: 11ch;
		white-space: normal;
		overflow-wrap: normal;
		hyphens: none;
	}

	.ela-table-scroll :is(th, td):last-child {
		min-width: 22ch;
	}

	/* Mobile cards: each row becomes a card with its column headers repeated as
	   labels. ARIA roles from the PHP step keep the table semantics. */
	.ela-table-scroll.ela-stack {
		overflow-x: visible;
	}

	.ela-stack > table,
	.ela-stack > table > tbody,
	.ela-stack > table > tbody > tr,
	.ela-stack > table > tbody > tr > :is(td, th) {
		display: block;
		width: auto;
		min-width: 0;
	}

	/* Hidden visually, not removed: screen readers still reach the header row. */
	.ela-stack > table .ela-head {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.ela-stack > table > tbody > tr {
		margin: 0 0 0.75rem;
		padding: 0.125rem 1rem;
		border: 1px solid var(--ela-border-strong);
		border-radius: var(--ela-radius);
		background: var(--ela-surface);
	}

	.ela-stack > table > tbody > tr > :is(td, th) {
		display: grid;
		grid-template-columns: 7.5rem minmax(0, 1fr);
		gap: 0.25rem 1rem;
		align-items: baseline;
		padding: 0.625rem 0;
		border: 0;
		border-block-end: 1px solid var(--ela-border);
		overflow-wrap: anywhere;
		/* Authors right-aligned some numeric cells inline; in a card every value
		   starts at the same edge, so the inline alignment has to yield. */
		text-align: start !important;
	}

	.ela-stack > table > tbody > tr > :is(td, th):last-child {
		border-block-end: 0;
	}

	.ela-stack > table > tbody > tr > :is(td, th)::before {
		content: attr(data-label);
		font-size: 0.75rem;
		font-weight: 700;
		line-height: 1.5;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		text-align: start;
		color: var(--ela-text-muted);
	}

	/* Prose and 64-character hashes take the full card width under their label. */
	.ela-stack > table > tbody > tr > td[data-long] {
		display: block;
	}

	.ela-stack > table > tbody > tr > td[data-long]::before {
		display: block;
		margin-block-end: 0.25rem;
	}
}

/* 5. Archive cards (Blocksy fallback templates) ---------------------------- */

/* Archive pages share the header's side margins (16/24/32px) and its 1920px cap. Blocksy
   sizes .ct-container and the hero from these two variables. */
html body.archive {
	--theme-normal-container-max-width: 1856px;
	--theme-container-width: calc(100% - 32px);
}

@media (min-width: 768px) {
	html body.archive {
		--theme-container-width: calc(100% - 48px);
	}
}

@media (min-width: 1025px) {
	html body.archive {
		--theme-container-width: calc(100% - 64px);
	}
}

/* The hero sits inside .ct-container; without this it would subtract the margins twice. */
html body.archive .ct-container .is-width-constrained {
	--theme-container-width: 100%;
}

html body.archive .entries[data-layout*="grid"] {
	column-gap: 32px;
	row-gap: 48px;
}

/* Blocksy prints its card rules inline after this file with up to three attribute/class
   points, so these selectors carry html plus .entries to win regardless of order. Card
   contents (banner, date, title, summary) are set in Customizer, Categories, Card Options.
   The look matches the Elementor card (.ela-card). */
html [data-prefix] .entries .entry-card {
	position: relative;
	gap: 0;
	padding: 0;
	border: 0;
	border-radius: var(--ela-radius);
	background: transparent;
	font-family: var(--ela-font-sans);
	overflow: visible;
}

html [data-prefix] .entries .entry-card:has(a:focus-visible) {
	outline: 2px solid var(--ela-accent);
	outline-offset: 6px;
}

/* Blocksy widens "boundless" images by its card padding; this card has none. */
html [data-prefix] .entries .entry-card > .ct-media-container {
	position: relative;
	width: 100%;
	margin: 0 0 16px;
	overflow: hidden;
	border-radius: var(--ela-radius);
}

html [data-prefix] .entries .entry-card > .ct-media-container::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
	pointer-events: none;
}

html [data-prefix] .entries .entry-card > .ct-media-container img {
	width: 100%;
	height: auto;
	aspect-ratio: 5 / 3;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.3s ease-out;
}

html [data-prefix] .entries .entry-card:hover > .ct-media-container img {
	transform: scale(1.03);
}

html [data-prefix] .entries .entry-card > :is(.entry-meta, .entry-title, .entry-excerpt) {
	margin: 0;
	padding: 0;
}

html [data-prefix] .entries .entry-card > .entry-meta {
	margin-block-start: 12px;
}

html [data-prefix] .entries .entry-card .entry-meta :is(li, a, time) {
	font-family: var(--ela-font-sans);
	font-size: 0.8125rem;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ela-text-muted);
	font-variant-numeric: tabular-nums;
}

html [data-prefix] .entries .entry-card .entry-title {
	font-family: var(--ela-font-sans);
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
}

html [data-prefix] .entries .entry-card .entry-title a {
	color: var(--ela-text);
	transition: color 0.15s ease-out;
}

html [data-prefix] .entries .entry-card:hover .entry-title a {
	color: var(--ela-accent);
}

/* The title link covers the card: one link per card, named by the title. */
html [data-prefix] .entries .entry-card .entry-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

html [data-prefix] .entries .entry-card .entry-title a:focus-visible {
	outline: none;
}

html [data-prefix] .entries .entry-card > .entry-excerpt {
	margin-top: 8px;
}

html [data-prefix] .entries .entry-card > .entry-excerpt :is(p, .ct-excerpt) {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-family: var(--ela-font-sans);
	font-size: 0.9375rem;
	line-height: 1.6;
	letter-spacing: 0;
	color: var(--ela-text-muted);
}

/* Two columns on tablets, as on the blog home; Blocksy switches at a different width. */
@media (min-width: 768px) and (max-width: 1024px) {
	html body.archive .entries[data-layout*="grid"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1600px) {
	html body.archive .entries[data-layout*="grid"] {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Phones: compact rows, as on the blog home. */
@media (max-width: 767px) {
	html body.archive .entries[data-layout*="grid"] {
		row-gap: 0;
	}

	html [data-prefix] .entries .entry-card {
		display: grid;
		grid-template-columns: 112px minmax(0, 1fr);
		align-content: center;
		column-gap: 16px;
		padding-block: 16px;
		border-top: 1px solid var(--ela-border);
		border-radius: 0;
	}

	html [data-prefix] .entries .entry-card:first-child {
		padding-top: 0;
		border-top: 0;
	}

	html [data-prefix] .entries .entry-card > .ct-media-container {
		grid-row: 1 / span 2;
		align-self: center;
		margin: 0;
		border-radius: 8px;
	}

	html [data-prefix] .entries .entry-card > .entry-title {
		align-self: end;
		font-size: 1rem;
	}

	html [data-prefix] .entries .entry-card > .entry-meta {
		align-self: start;
		margin: 4px 0 0;
	}

	html [data-prefix] .entries .entry-card > .entry-excerpt {
		display: none;
	}
}

/* Archive heading: "Category" as a small muted label above the name, at page-title size. */
html .hero-section .page-title {
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-page);
	font-weight: 300;
	line-height: 1.25;
	letter-spacing: 0;
	color: var(--ela-text);
}

html .hero-section .page-title .ct-title-label {
	display: block;
	margin-block-end: 6px;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ela-text-muted);
}

/* Not-found page (Blocksy): Manrope text and the design-system search box. */
html body.error404 .page-description,
html body.error404 .page-description p {
	font-family: var(--ela-font-sans);
	font-size: 1rem;
	line-height: 1.6;
	letter-spacing: 0;
	color: var(--ela-text-muted);
}

html body.error404 .ct-search-form {
	--theme-form-field-height: 48px;
	--theme-form-field-border-radius: var(--ela-radius-pill);
	--theme-form-field-border-initial-color: var(--ela-border-strong);
	--theme-form-field-border-focus-color: var(--ela-accent);
	--theme-form-field-background-initial-color: var(--ela-surface);
	--theme-form-field-background-focus-color: var(--ela-surface);
	--theme-form-text-initial-color: var(--ela-text);
	--theme-form-text-focus-color: var(--ela-text);
	max-width: 560px;
	margin-inline: auto;
}

html body.error404 .ct-search-form input {
	padding-inline: 20px 56px;
	font-family: var(--ela-font-sans);
	font-size: 1rem;
	letter-spacing: 0;
}

html body.error404 .ct-search-form input::placeholder {
	color: var(--ela-text-muted);
	opacity: 1;
}

html body.error404 .ct-search-form button {
	color: var(--ela-accent);
}

/* Blocksy's current page number is white on its orange (2.96:1); dark text gives 6:1. */
html .ct-pagination .page-numbers.current {
	color: var(--ela-bg);
}

/* 6. Site chrome: header and footer (structure lives in Elementor templates) */

.ela-site-header {
	position: relative;
	z-index: 50;
}

/* Matches elastos.net: content stops at 1920px on very wide screens. */
@media (min-width: 1921px) {
	html .elementor :is(.ela-site-header, .ela-footer-brand, .ela-footer-nav, .ela-footer-bar, .ela-band).e-con {
		--padding-left: max(32px, calc((100% - 1920px) / 2 + 32px));
		--padding-right: max(32px, calc((100% - 1920px) / 2 + 32px));
	}
}

/* Elementor loads its image widget styles late on some pages; the widget class outranks them. */
.ela-site-logo.elementor-widget-image a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.ela-site-logo.elementor-widget-image img {
	display: block;
}

.ela-site-nav .elementor-nav-menu--main .elementor-item {
	color: var(--ela-text);
	letter-spacing: 0;
	transition: color 0.15s ease;
}

.ela-site-nav .elementor-nav-menu--main .elementor-item:is(:hover, :focus-visible, .elementor-item-active) {
	color: var(--ela-accent);
}

.ela-site-nav .elementor-menu-toggle {
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 10px;
	border-radius: var(--ela-radius);
	background: transparent;
	color: var(--ela-text);
}

.ela-site-nav .elementor-menu-toggle:hover {
	background: var(--ela-surface);
}

.ela-site-nav .elementor-nav-menu--dropdown {
	border-block: 1px solid var(--ela-border);
	background: var(--ela-surface);
}

.ela-site-nav .elementor-nav-menu--dropdown .elementor-item {
	min-height: 44px;
	align-items: center;
}

.ela-pill .elementor-button {
	min-height: 40px;
	padding: 10px 16px;
	border: 1px solid color-mix(in srgb, var(--ela-accent) 50%, transparent);
	border-radius: var(--ela-radius-pill);
	background: color-mix(in srgb, var(--ela-accent) 5%, transparent);
	color: var(--ela-text);
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-small);
	font-weight: 300;
	line-height: 1.2;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ela-pill .elementor-button:hover {
	border-color: var(--ela-accent);
	background: color-mix(in srgb, var(--ela-accent) 10%, transparent);
	color: var(--ela-text);
}

.ela-footer-title .elementor-heading-title {
	font-family: var(--ela-font-sans);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1rem;
	letter-spacing: 0.025em;
	color: var(--ela-accent);
}

.ela-footer-links .elementor-icon-list-text {
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-small);
	font-weight: 400;
	line-height: 1.25rem;
	letter-spacing: 0;
	color: var(--ela-text-muted);
	transition: color 0.15s ease;
}

.ela-footer-links a:is(:hover, :focus-visible) .elementor-icon-list-text {
	color: var(--ela-text);
}

.ela-footer-links .elementor-icon-list-item > a {
	min-height: 24px;
}

.ela-footer-legal-links .elementor-icon-list-text {
	font-size: 0.75rem;
}

.ela-footer-legal,
.ela-footer-legal p {
	margin: 0;
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-small);
	line-height: 1.5;
	letter-spacing: 0;
	color: var(--ela-text-muted);
	text-align: start;
}

/* 7. Listing pages: page titles, cards, filters, buttons ------------------- */

/* Page title: the first words bright, the rest muted, as elastos.net writes its headings. */
html .ela-page-title .elementor-heading-title {
	max-width: 30ch;
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-page);
	font-weight: 300;
	line-height: 1.25;
	letter-spacing: 0;
	text-wrap: balance;
	color: var(--ela-text);
}

html .ela-page-title .elementor-heading-title span {
	color: var(--ela-text-muted);
}

html .ela-section-title .elementor-heading-title {
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-h2);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
	color: var(--ela-text);
}

/* Post card: banner, meta line, title, summary. No box around it. The title link covers the
   card, so each card is one link named by its title. */
html .ela-card.e-con {
	position: relative;
	gap: 0;
	padding: 0;
	border: 0;
	border-radius: var(--ela-radius);
	background: transparent;
	overflow: visible;
}

/* Elementor adds its kit widget spacing under every widget; the card sets its own spacing. */
html .ela-card :is(.ela-card-meta-widget, .elementor-widget-heading, .ela-card-summary-widget) {
	margin-block-end: 0;
}

html .ela-card.e-con:has(a:focus-visible) {
	outline: 2px solid var(--ela-accent);
	outline-offset: 6px;
}

/* Spacing sits on the top of each following part: Elementor zeroes every widget's bottom
   margin inside containers with a rule this file should not have to outrank. */
html .ela-card .elementor-widget-image {
	position: relative;
	margin: 0;
	overflow: hidden;
	border-radius: var(--ela-radius);
}

/* A 1px light edge: most banners are dark and would melt into the page without it. */
html .ela-card .elementor-widget-image::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
	pointer-events: none;
}

html .ela-card .elementor-widget-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 5 / 3;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	transition: transform 0.3s ease-out;
}

html .ela-card:hover .elementor-widget-image img {
	transform: scale(1.03);
}

/* Date only, after the title and summary: the title is the first thing read. */
html .ela-card .ela-card-meta {
	margin: 12px 0 0;
	font-family: var(--ela-font-sans);
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--ela-text-muted);
	font-variant-numeric: tabular-nums;
}

html .ela-card .elementor-widget-heading {
	margin-top: 16px;
}

html .ela-card .elementor-heading-title {
	font-family: var(--ela-font-sans);
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--ela-text);
	transition: color 0.15s ease-out;
}

html .ela-card:hover .elementor-heading-title {
	color: var(--ela-accent);
}

html .ela-card .elementor-heading-title a {
	color: inherit;
	text-decoration: none;
}

html .ela-card .elementor-heading-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

html .ela-card .elementor-heading-title a:focus-visible {
	outline: none;
}

html .ela-card .ela-card-summary-widget {
	margin-top: 8px;
}

html .ela-card .ela-card-summary {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-family: var(--ela-font-sans);
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 0;
	color: var(--ela-text-muted);
}

/* Lead story: the same card, larger. */
html .ela-lead .ela-card .elementor-widget-image {
	border-radius: var(--ela-radius-lg);
}

html .ela-lead .ela-card .elementor-widget-heading {
	margin-top: 20px;
}

html .ela-lead .ela-card .ela-card-meta {
	margin-top: 16px;
}

html .ela-lead .ela-card .elementor-heading-title {
	font-size: var(--ela-text-lead);
	font-weight: 400;
	line-height: 1.25;
}

html .ela-lead .ela-card .ela-card-summary-widget {
	margin-top: 10px;
}

html .ela-lead .ela-card .ela-card-summary {
	-webkit-line-clamp: 3;
	font-size: 1rem;
}

/* Rows: a small banner beside the title and date, separated by thin lines. Used beside the
   lead story, under articles, and for every list on phones. */
/* Elementor gives every loop row the tallest item's height; a list sizes each row to itself. */
html .elementor .ela-rows.elementor-widget-loop-grid .elementor-loop-container {
	grid-auto-rows: auto;
}

html .ela-rows .ela-card.e-con {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	align-content: center;
	column-gap: 16px;
	padding-block: 16px;
	border-top: 1px solid var(--ela-border);
	border-radius: 0;
}

html .ela-rows .e-loop-item:first-of-type .ela-card.e-con {
	padding-top: 0;
	border-top: 0;
}

html .ela-rows .ela-card .elementor-widget-image {
	grid-row: 1 / span 2;
	align-self: center;
	margin: 0;
	border-radius: 8px;
}

html .ela-rows .ela-card .elementor-widget-heading {
	align-self: end;
	margin-top: 0;
}

html .ela-rows .ela-card .ela-card-meta-widget {
	align-self: start;
}

html .ela-rows .ela-card .ela-card-meta {
	margin: 4px 0 0;
}

html .ela-rows .ela-card .elementor-heading-title {
	font-size: 1rem;
}

html .ela-rows .ela-card .ela-card-summary-widget {
	display: none;
}

@media (max-width: 767px) {
	/* Outranks the per-element rule of Elementor's "equal height" option. */
	html .elementor .ela-grid.elementor-widget-loop-grid .elementor-loop-container {
		grid-auto-rows: auto;
	}

	html .ela-grid .ela-card.e-con {
		display: grid;
		grid-template-columns: 112px minmax(0, 1fr);
		align-content: center;
		column-gap: 16px;
		padding-block: 16px;
		border-top: 1px solid var(--ela-border);
		border-radius: 0;
	}

	html .ela-grid .e-loop-item:first-of-type .ela-card.e-con {
		padding-top: 0;
		border-top: 0;
	}

	html .ela-grid .ela-card .elementor-widget-image {
		grid-row: 1 / span 2;
		align-self: center;
		margin: 0;
		border-radius: 8px;
	}

	html .ela-grid .ela-card .elementor-widget-heading {
		align-self: end;
		margin-top: 0;
	}

	html .ela-grid .ela-card .ela-card-meta-widget {
		align-self: start;
	}

	html .ela-grid .ela-card .ela-card-meta {
		margin: 4px 0 0;
	}

	html .ela-grid .ela-card .elementor-heading-title {
		font-size: 1rem;
	}

	html .ela-grid .ela-card .ela-card-summary-widget {
		display: none;
	}
}

/* Four columns on wide screens. Elementor sets columns with an elementor-grid-N class. */
@media (min-width: 1600px) {
	html .elementor .ela-grid.elementor-widget-loop-grid .elementor-loop-container {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Category tabs: one row, an orange line under the current one. Slides sideways on phones. */
html .ela-filter .e-filter {
	display: flex;
	flex-wrap: nowrap;
	gap: 24px;
	overflow-x: auto;
	border-bottom: 1px solid var(--ela-border);
	scrollbar-width: none;
}

html .ela-filter .e-filter::-webkit-scrollbar {
	display: none;
}

html .ela-filter .e-filter-item {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--ela-text-muted);
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-small);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	transition: color 0.15s ease-out;
}

/* A category gets a tab once it has three posts; Events has one (November 2026). */
html .ela-filter .e-filter-item[data-filter="events"] {
	display: none;
}

html .ela-filter .e-filter-item:hover {
	background: none;
	color: var(--ela-text);
}

html .ela-filter .e-filter-item[aria-pressed="true"] {
	background: none;
	color: var(--ela-text);
	font-weight: 500;
}

html .ela-filter .e-filter-item[aria-pressed="true"]::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 2px;
	background: var(--ela-accent);
}

html .ela-filter .e-filter-item:focus-visible {
	outline: 2px solid var(--ela-accent);
	outline-offset: -2px;
	border-radius: 4px;
}

/* Load-more and archive pagination: the header's Blog pill. */
html .ela-more .e-loop__load-more .elementor-button,
html .ct-pagination :is(.next, .prev) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid color-mix(in srgb, var(--ela-accent) 50%, transparent);
	border-radius: var(--ela-radius-pill);
	background: color-mix(in srgb, var(--ela-accent) 5%, transparent);
	color: var(--ela-text);
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-small);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

html .ela-more .e-loop__load-more .elementor-button:hover,
html .ct-pagination :is(.next, .prev):hover {
	border-color: var(--ela-accent);
	background: color-mix(in srgb, var(--ela-accent) 14%, transparent);
	color: var(--ela-text);
}

/* Search box (UAE search widget, input layout). UAE writes its defaults per element with
   four classes; .elementor and .elementor-element lift these one point above. */
html .elementor .ela-search.elementor-element .hfe-search-button-wrapper {
	max-width: 560px;
}

html .elementor .ela-page-head .ela-search.elementor-element {
	width: 280px;
	max-width: 100%;
}

@media (max-width: 767px) {
	html .elementor .ela-page-head .ela-search.elementor-element {
		width: 100%;
	}
}

html .elementor .ela-search.elementor-element .hfe-search-form__container {
	display: flex;
	align-items: center;
	min-height: 48px;
	border: 1px solid var(--ela-border-strong);
	border-radius: var(--ela-radius-pill);
	background: var(--ela-surface);
	overflow: hidden;
}

html .elementor .ela-search.elementor-element .hfe-search-form__container:focus-within {
	border-color: var(--ela-accent);
}

html .elementor .ela-search.elementor-element .hfe-search-form__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	padding: 0 20px;
	border: 0;
	background: transparent;
	color: var(--ela-text);
	font-family: var(--ela-font-sans);
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: 0;
}

html .elementor .ela-search.elementor-element .hfe-search-form__input::placeholder {
	color: var(--ela-text-muted);
	opacity: 1;
}

html .elementor .ela-search.elementor-element :is(.hfe-search-submit, button[type="reset"]) {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border: 0;
	background: transparent;
	color: var(--ela-accent);
}

/* Live search: results as you type, under the search box (assets/js/live-search.js). */
html .ela-search.elementor-element {
	position: relative;
}

html .ela-search .ela-kbd {
	flex: 0 0 auto;
	padding: 2px 6px;
	border: 1px solid var(--ela-border-strong);
	border-radius: var(--ela-radius-sm);
	color: var(--ela-text-muted);
	font-family: var(--ela-font-sans);
	font-size: 0.75rem;
	line-height: 1.4;
}

html .ela-search .hfe-search-form__container:focus-within .ela-kbd,
html .ela-search input:not(:placeholder-shown) + .ela-kbd {
	display: none;
}

.ela-live {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 60;
	width: min(440px, calc(100vw - 32px));
	max-height: min(70vh, 560px);
	padding: 8px;
	overflow-y: auto;
	border: 1px solid var(--ela-border-strong);
	border-radius: var(--ela-radius-lg);
	background: var(--ela-surface);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.ela-live.is-end {
	right: 0;
	left: auto;
}

.ela-live__status {
	margin: 0;
	padding: 12px 8px;
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-small);
	color: var(--ela-text-muted);
}

.ela-live__status.is-quiet {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ela-live__list {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ela-live__opt {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: var(--ela-radius);
	color: var(--ela-text);
	text-decoration: none;
}

.ela-live__opt[aria-selected="true"] {
	background: rgba(255, 255, 255, 0.06);
}

.ela-live__opt[aria-selected="true"] .ela-live__title {
	color: var(--ela-accent);
}

.ela-live__thumb {
	position: relative;
	display: block;
	aspect-ratio: 5 / 3;
	overflow: hidden;
	border-radius: var(--ela-radius-sm);
	background: var(--ela-inset);
}

.ela-live__thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.ela-live__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ela-live__text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.ela-live__title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-small);
	font-weight: 500;
	line-height: 1.35;
	transition: color 0.15s ease-out;
}

.ela-live__title mark {
	background: none;
	color: var(--ela-accent);
}

.ela-live__date {
	font-family: var(--ela-font-sans);
	font-size: 0.75rem;
	color: var(--ela-text-muted);
	font-variant-numeric: tabular-nums;
}

.ela-live__all {
	display: block;
	margin-top: 4px;
	padding: 12px 8px 6px;
	border-top: 1px solid var(--ela-border);
	color: var(--ela-accent);
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-small);
	text-decoration: none;
}

.ela-live__all:hover,
.ela-live__all:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* "Keep reading" under an article: three related posts as rows, in the article column. */
html .ela-related.e-con > .e-con-inner {
	padding-top: 32px;
	border-top: 1px solid var(--ela-border);
}

html .ela-related-title .elementor-heading-title {
	font-family: var(--ela-font-sans);
	font-size: var(--ela-text-h3);
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0;
	color: var(--ela-text);
}

html .ela-more .e-loop-nothing-found-message,
html .ela-more .e-loop-nothing-found-message__text {
	text-align: start;
}

html .ela-more .e-loop-nothing-found-message__text {
	margin: 0;
	font-family: var(--ela-font-sans);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 0;
	color: var(--ela-text-muted);
}

html .elementor-widget-loop-carousel .swiper-pagination-bullet-active {
	background: var(--ela-accent);
	opacity: 1;
}

/* Carousel arrows at either end read as unavailable. */
html .elementor-swiper-button.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* 8. Classic editor --------------------------------------------------------- */

/* Classic editor writing area: the light palette comes from Tokens\editor_css(); the text
   column is centred with at least 32px on every side, like a page. Margins, not padding:
   WordPress's auto-resize forces the body's padding with !important. */
body.ela-editor {
	max-width: none;
	margin-block: 2rem;
	margin-inline: max(2rem, calc((100% - var(--ela-measure)) / 2));
	background: var(--ela-bg);
}

@media (prefers-reduced-motion: reduce) {
	html .ela-card .elementor-widget-image img,
	html .ela-card .elementor-heading-title,
	html .ela-filter .e-filter-item,
	.ela-live__title {
		transition: none;
	}

	html .ela-card:hover .elementor-widget-image img,
	html [data-prefix] .entries .entry-card:hover > .ct-media-container img {
		transform: none;
	}

	html [data-prefix] .entries .entry-card > .ct-media-container img,
	html [data-prefix] .entries .entry-card .entry-title a {
		transition: none;
	}

	.ela-prose a {
		transition: none;
	}
}
