/*
Theme Name:        Ethos
Theme URI:         https://ethosresearch.xyz/
Author:            Ethos Research
Description:       Block theme for Ethos Research. Dark, editorial, research-lab design with a live pixel field.
Requires at least: 6.6
Tested up to:      7.1
Requires PHP:      8.1
Version:           1.5.48
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       ethos
*/

/* Most styling lives in theme.json. This file holds only what theme.json cannot express. */

:root {
	--ethos-ivory: #f4f4ef;
	--ethos-ink-dark: #101210;
	--ethos-hover-muted: #4a4a46;
	--ethos-glass: 10 11 10;
	--ethos-glow: 159 216 180;
	--ethos-glow-a: 0.2;
	color-scheme: dark;
}

/* Light mode: the same tokens, re-stepped for a paper background. Set by the header toggle (data-theme on <html>). */
:root[data-theme="light"] {
	--wp--preset--color--base: #f5f4ee;
	--wp--preset--color--surface: #ebeae3;
	--wp--preset--color--line: #d3d2c8;
	--wp--preset--color--muted: #565a53;
	--wp--preset--color--ink: #121412;
	--wp--preset--color--accent: #1b6a47;
	--wp--preset--color--accent-deep: #0f3d2b;
	--ethos-ivory: #121412;
	--ethos-ink-dark: #f5f4ee;
	--ethos-hover-muted: #b9bbb3;
	--ethos-glass: 245 244 238;
	--ethos-glow: 25 158 112;
	--ethos-glow-a: 0.14;
	color-scheme: light;
}

/* Text selection: the Ethos mint on dark pages, the deep green on paper. */
::selection {
	background: #9fd8b4;
	color: #0a0b0a;
	text-shadow: none;
}
:root[data-theme="light"] ::selection {
	background: #1b6a47;
	color: #f5f4ee;
}

:where(.wp-site-blocks) a:where(:not(.wp-element-button)) {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

/* Page content sits above the pixel field. */
.wp-site-blocks {
	position: relative;
	z-index: 1;
}

/* Pixel field: a fixed canvas behind the whole page (drawn by assets/js/ethos.js). */
.ethos-field {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
}

/* Small uppercase label used above headings ("Research", "Notes"). */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

/* Homepage hero. */
.ethos-display {
	font-size: clamp(2.75rem, 6.4vw, 5.25rem);
	font-weight: 500;
	line-height: 1.04;
	letter-spacing: -0.015em;
	text-wrap: balance;
}
.ethos-lead {
	max-width: 36rem;
	margin-inline: auto;
	text-wrap: pretty;
}

/* Card: a bordered panel that turns ivory on hover. */
.is-style-card {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.is-style-card:hover {
	border-color: var(--ethos-ivory);
	background: var(--ethos-ivory);
	color: var(--ethos-ink-dark);
}

/* Lab cards on the homepage: one bordered strip split into cells. */
.ethos-lab-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 0 !important;
	border: 1px solid var(--wp--preset--color--line);
	background: rgb(var(--ethos-glass) / 0.9);
}
.ethos-lab-card {
	position: relative;
	gap: 0.6rem;
	padding: var(--wp--preset--spacing--40);
	border-left: 1px solid var(--wp--preset--color--line);
	transition: background-color 0.25s ease, color 0.25s ease;
}
/* Cards sit three to a row; the first of each row has no left rule, later rows get a top rule. */
.ethos-lab-card:nth-child(3n+1) {
	border-left: 0;
}
.ethos-lab-card:nth-child(n+4) {
	border-top: 1px solid var(--wp--preset--color--line);
}
@media (max-width: 781px) {
	.ethos-lab-grid {
		grid-template-columns: minmax(0, 1fr) !important;
	}
	.ethos-lab-card {
		border-left: 0;
		border-top: 1px solid var(--wp--preset--color--line);
	}
	.ethos-lab-card:first-child {
		border-top: 0;
	}
}
.ethos-pixel-icon {
	display: block;
	width: 144px;
	height: 96px;
	margin: 0 auto var(--wp--preset--spacing--30);
}
.ethos-lab-card__num {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	color: var(--wp--preset--color--accent);
}
.ethos-lab-card h3 {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
}
.ethos-lab-card h3 a {
	color: inherit;
	text-decoration: none;
}
/* A single link covers the whole card. */
.ethos-lab-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}
.ethos-lab-card p {
	margin: 0;
	color: var(--wp--preset--color--muted);
}
.ethos-lab-card__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.25rem;
	margin-top: auto !important;
	padding-top: var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
}
.ethos-lab-card__links a {
	position: relative;
	z-index: 1;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}
.ethos-lab-card__links a:hover {
	text-decoration: underline;
}
/* Card hover (home cards and the Research/Tools windows): the card stays see-through, a soft green
   glow follows the pointer (--mx/--my, set in assets/js/ethos.js) and a thin light runs along the top
   edge. Keyboard focus shows the same, but a click does not leave it lit (:focus-visible, not :focus-within). */
.ethos-lab-card,
.ethos-window {
	--mx: 50%;
	--my: 40%;
	isolation: isolate;
	overflow: hidden;
}
.ethos-lab-card::before,
.ethos-window::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(380px circle at var(--mx) var(--my), rgb(var(--ethos-glow) / var(--ethos-glow-a)), transparent 70%);
	opacity: 0;
	transition: opacity 0.35s ease;
}
.ethos-lab-card::after,
.ethos-window::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	pointer-events: none;
	background: linear-gradient(90deg, transparent, var(--wp--preset--color--accent) 30%, var(--wp--preset--color--accent) 70%, transparent);
	transform: scaleX(0);
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ethos-lab-card:hover::before,
.ethos-lab-card:has(:focus-visible)::before,
.ethos-window:hover::before,
.ethos-window:focus-visible::before {
	opacity: 1;
}
.ethos-lab-card:hover::after,
.ethos-lab-card:has(:focus-visible)::after,
.ethos-window:hover::after,
.ethos-window:focus-visible::after {
	transform: scaleX(1);
}
.ethos-lab-card .ethos-pixel-icon {
	transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ethos-lab-card:hover .ethos-pixel-icon,
.ethos-lab-card:has(:focus-visible) .ethos-pixel-icon {
	transform: translateY(-4px);
}
.ethos-lab-card__link:focus-visible {
	outline: none;
}
@media (prefers-reduced-motion: reduce) {
	.ethos-lab-card::after,
	.ethos-window::after,
	.ethos-lab-card .ethos-pixel-icon {
		transition: none;
	}
	.ethos-lab-card:hover .ethos-pixel-icon {
		transform: none;
	}
}

/* Square windows onto other sites (Bonded page). The live frame renders at 4x the card width
   and is scaled down so it shows the desktop layout. The "Visit" label appears on hover. */
.ethos-preview-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: var(--wp--preset--spacing--40) !important;
}
@media (max-width: 781px) {
	.ethos-preview-grid {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}
.ethos-preview-card {
	gap: 0.5rem;
}
.ethos-preview-card p {
	margin: 0;
}
.ethos-site-preview {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	margin-bottom: var(--wp--preset--spacing--20);
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	text-decoration: none;
}
.ethos-site-preview iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 400%;
	height: 400%;
	border: 0;
	transform: scale(0.25);
	transform-origin: 0 0;
	pointer-events: none;
}
.ethos-site-preview img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ethos-site-preview::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgb(var(--ethos-glass) / 0);
	transition: background-color 0.25s ease;
}
.ethos-site-preview__go {
	position: absolute;
	left: 50%;
	bottom: var(--wp--preset--spacing--40);
	z-index: 1;
	padding: 0.65em 1.1em;
	background: var(--ethos-ivory);
	color: var(--ethos-ink-dark);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	white-space: nowrap;
	opacity: 0;
	transform: translate(-50%, 8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.ethos-site-preview:hover,
.ethos-site-preview:focus-visible {
	border-color: var(--wp--preset--color--accent);
}
.ethos-site-preview:hover::after,
.ethos-site-preview:focus-visible::after {
	background: rgb(var(--ethos-glass) / 0.35);
}
.ethos-site-preview:hover .ethos-site-preview__go,
.ethos-site-preview:focus-visible .ethos-site-preview__go {
	opacity: 1;
	transform: translate(-50%, 0);
}
/* Touch screens have no hover, so the label is always shown there. */
@media (hover: none) {
	.ethos-site-preview__go {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

/* Share row under articles and pages. */
.ethos-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
}
.ethos-share__label {
	margin-right: 0.5rem;
	color: var(--wp--preset--color--accent);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-size: 0.75rem;
}
.ethos-share__link {
	padding: 0.45em 0.85em;
	border: 1px solid var(--wp--preset--color--line);
	background: transparent;
	color: var(--wp--preset--color--ink);
	font: inherit;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ethos-share__link:hover,
.ethos-share__link:focus-visible {
	border-color: var(--ethos-ivory);
	background: var(--ethos-ivory);
	color: var(--ethos-ink-dark);
}
.ethos-share__link[hidden] {
	display: none;
}

/* Tab strip inside a section (Research: Articles | World Monitor). */
.ethos-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin-top: var(--wp--preset--spacing--40);
	border-bottom: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.ethos-tabs__tab {
	position: relative;
	margin-bottom: -1px;
	padding: 0.7em 1.1em;
	border: 1px solid transparent;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}
.ethos-tabs__tab:hover {
	color: var(--wp--preset--color--ink);
}
.ethos-tabs__tab.is-current {
	border-color: var(--wp--preset--color--line);
	border-bottom-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent);
}
/* The same flickering pixel row as the menu tabs. */
.ethos-tabs__tab::before {
	content: "";
	position: absolute;
	left: 1.1em;
	right: 1.1em;
	top: 4px;
	height: 3px;
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--accent) 0 3px, transparent 3px 5px);
	opacity: 0;
}
.ethos-tabs__tab:hover::before,
.ethos-tabs__tab.is-current::before {
	opacity: 1;
	animation: ethos-pixel-flicker 0.9s steps(3) infinite;
}

/* Wide variant of the site preview, for a screenshot of a dashboard. */
.ethos-site-preview--wide {
	aspect-ratio: 20 / 11;
}

/* Portrait on the About page. */
.ethos-portrait img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: 42% center;
}

/* Post list: a hairline between entries, like a journal index. */
.is-style-rule-list > li {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-block: var(--wp--preset--spacing--40);
}
.is-style-rule-list > li:last-child {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

/* Header stays readable over content when sticky. */
.ethos-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgb(var(--ethos-glass) / 0.86);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .ethos-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}
@media (max-width: 600px) {
	.admin-bar .ethos-header {
		top: 0;
	}
}

/* The menu stays on one line: the site name never wraps, and the tabs tighten on small laptops. */
.ethos-header .wp-block-site-title {
	white-space: nowrap;
}
@media (min-width: 1024px) and (max-width: 1240px) {
	.ethos-header .wp-block-navigation,
	.ethos-header .wp-block-navigation .wp-block-navigation__container {
		gap: 0.9rem !important;
		font-size: 0.8125rem;
	}
}
/* Tablets and small laptops get the same menu button as phones, so six tabs never break onto two lines. */
@media (min-width: 600px) and (max-width: 1023px) {
	.ethos-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	.ethos-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}
/* Seven tabs (with COT Reports) plus the face cursor button: measured so the row never wraps. The menu
   button covers up to 1099px, the tabs tighten up to 1279px, and wider screens use a 16px gap. */
@media (min-width: 1024px) and (max-width: 1099px) {
	.ethos-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	.ethos-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}
@media (min-width: 1100px) and (max-width: 1279px) {
	.ethos-header .wp-block-navigation,
	.ethos-header .wp-block-navigation .wp-block-navigation__container {
		gap: 0.65rem !important;
		font-size: 0.75rem;
	}
}
@media (min-width: 1280px) {
	.ethos-header .wp-block-navigation,
	.ethos-header .wp-block-navigation .wp-block-navigation__container {
		gap: 1rem !important;
	}
	/* Spanish labels are longer and the header is capped at the wide width, so they tighten here too. */
	html:lang(es) .ethos-header .wp-block-navigation,
	html:lang(es) .ethos-header .wp-block-navigation .wp-block-navigation__container {
		gap: 0.65rem !important;
		font-size: 0.875rem;
	}
}

/* Menu tabs: a row of pixels flickers in above the tab on hover. */
.ethos-header .wp-block-navigation-item__content {
	position: relative;
}
.ethos-header .wp-block-navigation-item__content::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -9px;
	height: 4px;
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--accent) 0 4px, transparent 4px 7px);
	opacity: 0;
	clip-path: inset(0 100% 0 0);
	transition: opacity 0.15s ease, clip-path 0.35s steps(8);
}
.ethos-header .wp-block-navigation-item__content:hover::before,
.ethos-header .wp-block-navigation-item__content:focus-visible::before,
.ethos-header .current-menu-item > .wp-block-navigation-item__content::before {
	opacity: 1;
	clip-path: inset(0 0 0 0);
	animation: ethos-pixel-flicker 0.9s steps(3) infinite;
}
.ethos-header .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--accent);
}
@keyframes ethos-pixel-flicker {
	0% { background-position: 0 0; opacity: 1; }
	50% { background-position: 7px 0; opacity: 0.55; }
	100% { background-position: 14px 0; opacity: 1; }
}
/* The open menu covers the whole screen in the site's colours. Core paints the overlay white with a more
   specific rule, so this one matches it; and the header's blur would trap the overlay inside the header bar,
   so the blur is switched off while the menu is open. */
.ethos-header .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay),
.ethos-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
}
html.has-modal-open .ethos-header {
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	background: var(--wp--preset--color--base);
}
.ethos-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.125rem;
}

/* Keyboard focus is always visible. */
:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* Contact Form 7 fields match the theme. */
.wpcf7 input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.wpcf7 textarea {
	width: 100%;
	padding: 0.75em 0.9em;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font: inherit;
}
.wpcf7 input[type="submit"] {
	padding: 0.85em 1.6em;
	border: 0;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--accent);
}

/* Tables in articles get hairlines that read on a dark page. */
.wp-block-table td,
.wp-block-table th {
	border-color: var(--wp--preset--color--line);
}

/* Long source URLs in articles wrap instead of widening the page on phones. */
.wp-block-post-content a {
	overflow-wrap: anywhere;
}

/* Compact data tables for research reports; wide ones scroll sideways on phones. */
.wp-block-table.ethos-data-table {
	overflow-x: auto;
	font-size: var(--wp--preset--font-size--small);
}
.ethos-data-table table {
	border-collapse: collapse;
	min-width: 32rem;
}
.ethos-data-table th,
.ethos-data-table td {
	padding: 0.55em 0.8em;
	border-width: 0 0 1px;
	border-style: solid;
	text-align: left;
	vertical-align: top;
}
.ethos-data-table thead {
	border-bottom: 0;
}
.ethos-data-table th {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.85em;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
	border-bottom-color: var(--wp--preset--color--muted);
}

/* Numbered badge lists in older articles (class left by the Canvas plugin, which is no longer active). */
ol.is-style-cnvs-list-styled {
	list-style: none;
	padding-left: 0;
	counter-reset: ol;
}
ol.is-style-cnvs-list-styled > li {
	position: relative;
	padding-left: 2.5rem;
}
ol.is-style-cnvs-list-styled > li:not(:first-child) {
	margin-top: 0.5rem;
}
ol.is-style-cnvs-list-styled > li::before {
	content: counter(ol);
	counter-increment: ol;
	position: absolute;
	left: 0;
	top: 0.15em;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--line);
	color: var(--wp--preset--color--ink);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1;
}

/* Footer link lists and legal line. */
.ethos-footer {
	border-top: 1px solid var(--wp--preset--color--line);
}
.ethos-plain-list {
	list-style: none;
	padding-left: 0;
	line-height: 2;
}
.ethos-footer-legal {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--line);
}
.ethos-footer__brand {
	margin-bottom: var(--wp--preset--spacing--50);
}
.ethos-footer__brand p {
	max-width: 36rem;
}
.ethos-footer__columns .wp-block-column {
	min-width: 9rem;
}
.ethos-footer .is-style-eyebrow {
	margin-bottom: var(--wp--preset--spacing--20);
}
.ethos-footer-legal a {
	text-decoration-color: var(--wp--preset--color--line);
}

/* Cookie notice: a small card above the footer line, shown until the reader chooses. */
.ethos-consent {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 40;
	max-width: 30rem;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--line);
	background: rgb(var(--ethos-glass) / 0.96);
	backdrop-filter: blur(8px);
	box-shadow: 0 12px 40px rgb(0 0 0 / 0.35);
}
.ethos-consent[hidden] {
	display: none;
}
.ethos-consent__text {
	margin: 0 0 var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}
.ethos-consent__text a {
	color: var(--wp--preset--color--ink);
}
.ethos-consent__actions {
	display: flex;
	gap: var(--wp--preset--spacing--30);
	margin: 0;
}
.ethos-consent__btn {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.6em 1em;
	border: 1px solid var(--wp--preset--color--line);
	background: transparent;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}
.ethos-consent__btn--accept {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--ink);
}
.ethos-consent__btn:hover {
	border-color: var(--wp--preset--color--accent);
}
@media (min-width: 640px) {
	.ethos-consent {
		left: auto;
		right: 24px;
		bottom: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.is-style-card,
	.ethos-lab-card,
	.ethos-share__link,
	.ethos-site-preview::after,
	.ethos-site-preview__go {
		transition: none;
	}
	.ethos-header .wp-block-navigation-item__content::before,
	.ethos-tabs__tab::before {
		transition: none;
		animation: none !important;
	}
}

/* Buttons: mono label, an arrow that moves on hover, and a hard green shadow that lifts the button like a pixel block. */
.wp-block-button__link.wp-element-button,
.wpcf7 input[type="submit"] {
	display: inline-flex;
	align-items: center;
	gap: 0.75em;
	border: 1px solid var(--wp--preset--color--ink);
	border-radius: 2px;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	box-shadow: 0 0 0 0 var(--wp--preset--color--accent-deep);
	transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.wp-block-button__link.wp-element-button::after {
	content: "\2192";
	font-family: var(--wp--preset--font-family--sans);
	letter-spacing: 0;
	transition: transform 0.18s ease;
}
.wp-block-button__link.wp-element-button:hover,
.wp-block-button__link.wp-element-button:focus-visible,
.wpcf7 input[type="submit"]:hover,
.wpcf7 input[type="submit"]:focus-visible {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	transform: translate(-3px, -3px);
	box-shadow: 3px 3px 0 0 var(--wp--preset--color--accent-deep);
}
.wp-block-button__link.wp-element-button:hover::after,
.wp-block-button__link.wp-element-button:focus-visible::after {
	transform: translateX(4px);
}
.wp-block-button__link.wp-element-button:active,
.wpcf7 input[type="submit"]:active {
	transform: translate(0, 0);
	box-shadow: 0 0 0 0 var(--wp--preset--color--accent-deep);
}
@media (prefers-reduced-motion: reduce) {
	.wp-block-button__link.wp-element-button,
	.wp-block-button__link.wp-element-button::after,
	.wpcf7 input[type="submit"] {
		transition: none;
	}
}

/* Theme toggle in the header: a pixel sun in dark mode, a pixel moon in light mode. The menu is pushed right so it sits beside the toggle. */
.ethos-header .wp-block-navigation {
	margin-left: auto;
}
.ethos-theme-toggle,
.ethos-face-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin-left: var(--wp--preset--spacing--30);
	padding: 0;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	background: transparent;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	flex-shrink: 0;
	transition: border-color 0.18s ease, color 0.18s ease;
}
.ethos-theme-toggle:hover,
.ethos-face-toggle:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}
.ethos-theme-toggle svg,
.ethos-face-toggle svg {
	width: 1rem;
	height: 1rem;
	shape-rendering: crispEdges;
}
.ethos-theme-toggle .ethos-icon-moon,
:root[data-theme="light"] .ethos-theme-toggle .ethos-icon-sun {
	display: none;
}
:root[data-theme="light"] .ethos-theme-toggle .ethos-icon-moon {
	display: block;
}

/* Face cursor on/off button, beside the theme toggle. Only shown where the face cursor can run (mouse or trackpad).
   The red beams disappear when the reader switches it off (data-face-cursor="off" on <html>, set in <head>). */
.ethos-face-toggle {
	display: none;
}
/* The face cursor button and the theme toggle form one joined pair (.ethos-header-toggles), so the
   header row grows by a single button width. */
.ethos-header-toggles {
	display: inline-flex;
	flex-shrink: 0;
}
.ethos-header-toggles .ethos-face-toggle {
	margin: 0;
}
.ethos-header-toggles > button:hover,
.ethos-header-toggles > button:focus-visible {
	position: relative;
	z-index: 1;
}
@media (hover: hover) and (pointer: fine) {
	.ethos-face-toggle {
		display: inline-flex;
	}
	.ethos-header-toggles .ethos-face-toggle + .ethos-theme-toggle {
		margin: 0;
		margin-inline-start: -1px;
	}
}
.ethos-face-toggle .ethos-icon-beam {
	fill: #ff2b2b;
}
:root[data-face-cursor="off"] .ethos-face-toggle .ethos-icon-beam {
	display: none;
}

/* Article images and charts get a hairline so dark charts sit cleanly on the light page and vice versa. */
.wp-block-post-content .ethos-figure img {
	border: 1px solid var(--wp--preset--color--line);
}

/* Market signal cards in articles: a hairline grid like the homepage lab cards. */
.ethos-signals {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	margin-block: var(--wp--preset--spacing--50);
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--line);
}
.ethos-signal {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--base);
}
.ethos-signal p,
.ethos-signal h4 {
	margin: 0;
}
.ethos-signal__eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.6875rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.ethos-signal__title {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
}
.ethos-signal__note,
.ethos-signal__caption {
	font-size: 0.875rem;
	color: var(--wp--preset--color--muted);
}
.ethos-signal__bars {
	display: grid;
	gap: 0.85rem;
	margin: 0.75rem 0 0.5rem;
	padding: 0;
	list-style: none;
}
.ethos-signal__bars li {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.35rem 1rem;
	margin: 0;
	font-size: 0.875rem;
}
.ethos-signal__bars b {
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 500;
}
/* Bars are drawn as a row of pixel blocks; the value is always written beside them. */
.ethos-signal__bars i {
	grid-column: 1 / -1;
	width: var(--w);
	height: 8px;
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--muted) 0 6px, transparent 6px 8px);
	opacity: 0.55;
}
.ethos-signal__bars li.is-focus i {
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--accent) 0 6px, transparent 6px 8px);
	opacity: 1;
}
.ethos-signal__big {
	margin-top: auto !important;
	padding-top: 0.5rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(2.5rem, 5vw, 3.25rem);
	line-height: 1;
	color: var(--wp--preset--color--ink);
}
.ethos-signal__source {
	padding-top: 0.75rem;
	border-top: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.6875rem;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--muted);
}
.ethos-signal--quote {
	grid-column: 1 / -1;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	border: 0;
}
.ethos-signal--quote .ethos-signal__eyebrow,
.ethos-signal--quote .ethos-signal__source {
	color: var(--wp--preset--color--base);
	border-color: rgb(var(--ethos-glass) / 0.25);
}
.ethos-signal__quote {
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(1.5rem, 3vw, 2rem);
	line-height: 1.2;
}
.ethos-signals--three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 640px) {
	.ethos-signals {
		grid-template-columns: 1fr;
	}
}

/* ---------- Articles ---------- */

/* Reading progress: a thin accent bar at the top of the window, filled by assets/js/ethos.js. */
.ethos-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 30;
	height: 3px;
	pointer-events: none;
}
.admin-bar .ethos-progress {
	top: var(--wp-admin--admin-bar--height, 32px);
}
.ethos-progress span {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--wp--preset--color--accent);
	transform: scaleX(var(--p, 0));
	transform-origin: left;
}

.ethos-article__head .wp-block-post-terms {
	margin-bottom: 0;
}
.ethos-article__dek {
	margin-top: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.45;
	color: var(--wp--preset--color--muted);
}

/* Byline: photo, name, last update, reading time. */
.ethos-byline {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	margin-top: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--40);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.ethos-byline__photo {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}
.ethos-byline__text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	font-size: 0.875rem;
}
.ethos-byline__author {
	font-weight: 600;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.ethos-byline__meta {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	color: var(--wp--preset--color--muted);
}

/* Live Markets: FinancialJuice calendar and headlines side by side, stacked on small screens. */
.ethos-live {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: var(--wp--preset--spacing--50);
	margin-top: var(--wp--preset--spacing--50);
	/* Wider than the text column: the wide page template centres it inside a full-width container. */
	max-width: min(1200px, calc(100vw - 32px));
}
.ethos-live__panel {
	min-width: 0;
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: 1rem;
}
.ethos-live__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}
.ethos-live__hint,
.ethos-live__credit {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	color: var(--wp--preset--color--muted);
}
.ethos-live__hint {
	margin: 0.25rem 0 1rem;
}
.ethos-live__widget {
	min-height: 720px;
	max-width: 100%;
}
.ethos-live__widget iframe {
	display: block;
	max-width: 100%;
	/* Same scheme as the widget page, so the browser does not paint a white backdrop behind it. */
	color-scheme: normal;
}
.ethos-live__credit a {
	color: inherit;
}
@media (max-width: 900px) {
	.ethos-live {
		grid-template-columns: 1fr;
	}
}

/* Bonded call to action in articles about connection. */
.ethos-bonded-cta {
	margin-block: var(--wp--preset--spacing--60);
	padding: 1.5rem;
	border: 1px solid var(--wp--preset--color--line);
	border-left: 2px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--surface);
}
.ethos-bonded-cta p {
	margin: 0;
}
.ethos-bonded-cta__eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.ethos-bonded-cta__title {
	margin-top: 0.5rem !important;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--x-large, 1.75rem);
	line-height: 1.2;
}
.ethos-bonded-cta__text {
	margin-top: 0.75rem !important;
	color: var(--wp--preset--color--muted);
}
.ethos-bonded-cta__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.25rem !important;
}
.ethos-bonded-cta__links a {
	padding: 0.6rem 1rem;
	border: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.ethos-bonded-cta__links a:hover,
.ethos-bonded-cta__links a:focus-visible {
	border-color: var(--wp--preset--color--accent);
}
.ethos-bonded-cta__links .ethos-bonded-cta__primary {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

/* Cover photo under the byline, with the photo credit as a small caption. */
.ethos-cover {
	margin: var(--wp--preset--spacing--40) 0 0;
}
.ethos-cover__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 12 / 5;
	object-fit: cover;
	border: 1px solid var(--wp--preset--color--line);
}
.ethos-cover figcaption {
	margin-top: 0.5rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.6875rem;
	color: var(--wp--preset--color--muted);
}
.ethos-cover figcaption a {
	color: inherit;
}

/* Summary box: written key points (closed by default), the evidence key and "summarise with" links. */
.ethos-summary {
	margin-block: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
}
.ethos-summary__details summary {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}
.ethos-summary__details summary::-webkit-details-marker {
	display: none;
}
.ethos-summary__details summary::before {
	content: "+";
	font-family: var(--wp--preset--font-family--mono);
	color: var(--wp--preset--color--accent);
}
.ethos-summary__details[open] summary::before {
	content: "\2212";
}
.ethos-summary__details summary span {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--wp--preset--color--muted);
}
.ethos-summary__details ul {
	margin: 0;
	padding: 0 1.25rem 1rem 2.6rem;
}
.ethos-summary__details li {
	margin-bottom: 0.5rem;
	line-height: 1.55;
}
.ethos-summary__key,
.ethos-summary__ai {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 0;
	padding: 0.75rem 1.25rem;
	border-top: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	color: var(--wp--preset--color--muted);
}
.ethos-summary__key > span {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}
.ethos-summary__key a,
.ethos-summary__ai a {
	color: var(--wp--preset--color--ink);
}
.ethos-summary__key a {
	margin-left: auto;
}
.ethos-summary__ai a {
	padding: 0.2rem 0.6rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	text-decoration: none;
}
.ethos-summary__ai a:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

/* Table of contents. */
.ethos-toc {
	margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	padding-left: 1.25rem;
	border-left: 2px solid var(--wp--preset--color--accent);
}
.ethos-toc__title {
	margin: 0 0 0.5rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.ethos-toc ol {
	margin: 0;
	padding-left: 1.25rem;
	font-size: 0.9375rem;
	line-height: 1.5;
}
.ethos-toc li {
	margin-bottom: 0.3rem;
}
.ethos-toc a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.ethos-toc a:hover {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
}
.ethos-article h2[id],
.ethos-article h3 {
	scroll-margin-top: 5rem;
}

/* Evidence dots: green verified, orange reported or corroborated, blue analysis, grey secondary.
   The key is in the summary box; the name is in each dot's tooltip and read out by screen readers. */
.ethos-dot {
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin: 0 0.15em 0 0.3em;
	border-radius: 50%;
	vertical-align: 0.12em;
	cursor: help;
}
.ethos-dot + .ethos-dot {
	margin-left: 0.1em;
}
.ethos-dot--verified {
	background: #199e70;
}
.ethos-dot--reported {
	background: #d95926;
}
.ethos-dot--analysis {
	background: #3987e5;
}
.ethos-dot--secondary {
	background: #8d918b;
}
.ethos-signal__source .ethos-dot {
	margin-left: 0.5em;
}

/* Collapsible reference sections (verification logs). */
.wp-block-post-content .wp-block-details {
	margin-block: var(--wp--preset--spacing--40);
	padding: 0.9rem 1.25rem;
	border: 1px solid var(--wp--preset--color--line);
}
.wp-block-post-content .wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
}

/* Author box at the end of every article. */
.ethos-author {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
	margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
}
.ethos-author p {
	margin: 0;
}
.ethos-author__photo {
	flex-shrink: 0;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
}
.ethos-author__eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.6875rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.ethos-author__name {
	margin-top: 0.2rem !important;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
}
.ethos-author__name a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.ethos-author__bio {
	margin-top: 0.4rem !important;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--wp--preset--color--muted);
}
.ethos-author__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1rem;
	margin-top: 0.75rem !important;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
}

/* Related reading. */
.ethos-related {
	margin-top: var(--wp--preset--spacing--60);
}
.ethos-related__title {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.ethos-related ul {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--line);
}
.ethos-related li {
	margin: 0;
	background: var(--wp--preset--color--base);
}
.ethos-related a {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	height: 100%;
	padding: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	transition: background-color 0.2s ease;
}
.ethos-related a:hover {
	background: var(--wp--preset--color--surface);
}
.ethos-related__name {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.25rem;
	line-height: 1.25;
}
.ethos-related__meta {
	margin-top: auto;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	color: var(--wp--preset--color--muted);
}

/* Screen-reader-only text. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (max-width: 640px) {
	.ethos-related ul {
		grid-template-columns: 1fr;
	}
	.ethos-author {
		flex-direction: column;
	}
	.ethos-summary__key a {
		margin-left: 0;
	}
}
@media (prefers-reduced-motion: reduce) {
	.ethos-related a {
		transition: none;
	}
}

/* Topic hubs (Real Estate, Dating App Market): key numbers, start here, topics, data we track. */
.ethos-hub {
	display: grid;
	gap: var(--wp--preset--spacing--50);
	margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
}
.ethos-hub p {
	margin: 0;
}
.ethos-hub__tiles {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--line);
}
.ethos-hub__tile {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	transition: background-color 0.2s ease;
}
.ethos-hub__tile:hover {
	background: var(--wp--preset--color--surface);
}
.ethos-hub__num {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 2.25rem;
	line-height: 1;
}
.ethos-hub__label {
	font-size: 0.875rem;
	line-height: 1.4;
}
.ethos-hub__src {
	margin-top: auto;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.6875rem;
	color: var(--wp--preset--color--muted);
}
.ethos-hub__eyebrow {
	margin-bottom: 0.6rem !important;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.ethos-hub__start {
	padding: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--line);
	border-left: 3px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--surface);
}
.ethos-hub__title {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.75rem;
	line-height: 1.2;
}
.ethos-hub__title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.ethos-hub__title a:hover {
	color: var(--wp--preset--color--accent);
}
.ethos-hub__dek {
	margin-top: 0.5rem !important;
	color: var(--wp--preset--color--muted);
}
.ethos-hub__topics ul {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem 2rem;
	margin: 0;
	padding-left: 1.1rem;
}
.ethos-hub__topics a {
	color: var(--wp--preset--color--ink);
}
.ethos-hub__list-title {
	margin-top: 0;
	font-size: var(--wp--preset--font-size--x-large);
}
@media (max-width: 900px) {
	.ethos-hub__tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 560px) {
	.ethos-hub__tiles,
	.ethos-hub__topics ul {
		grid-template-columns: 1fr;
	}
}
@media (prefers-reduced-motion: reduce) {
	.ethos-hub__tile {
		transition: none;
	}
}

/* Charts: the dark version shows by default, the light one in light mode. */
.ethos-figure .ethos-figure__light {
	display: none;
}
:root[data-theme="light"] .ethos-figure .ethos-figure__dark {
	display: none;
}
:root[data-theme="light"] .ethos-figure .ethos-figure__light {
	display: block;
}
.wp-block-post-content .ethos-figure img.ethos-figure__light {
	border: 1px solid var(--wp--preset--color--line);
}

/* Image captions: the note under a chart or photo, set small in the mono face directly beneath it
   (inc/article.php turns the italic note paragraph after an image into this figcaption). */
.wp-block-post-content .wp-block-image figcaption,
.wp-block-post-content .wp-block-image .wp-element-caption {
	margin: 0.5rem 0 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	font-style: normal;
	line-height: 1.55;
	text-align: left;
	color: var(--wp--preset--color--muted);
}
.wp-block-post-content .wp-block-image figcaption a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Image viewer (assets/js/ethos.js): images in the page body open larger on click or Enter. */
.ethos-zoomable {
	cursor: zoom-in;
}
.ethos-zoomable:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #9fd8b4);
	outline-offset: 3px;
}
html.ethos-lightbox-open {
	overflow: hidden;
}
.ethos-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: clamp(12px, 3vw, 40px);
	background: rgba(6, 8, 6, 0.94);
}
.ethos-lightbox[hidden] {
	display: none;
}
.ethos-lightbox__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	max-width: 100%;
}
.ethos-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 8rem);
	width: auto;
	height: auto;
	object-fit: contain;
	cursor: zoom-in;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.ethos-lightbox__caption {
	max-width: 72rem;
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	line-height: 1.55;
	text-align: center;
	color: #c9cbc4;
}
.ethos-lightbox__caption a {
	color: inherit;
	text-decoration: underline;
}
.ethos-lightbox__close {
	position: absolute;
	top: clamp(8px, 2vw, 20px);
	right: clamp(8px, 2vw, 20px);
	width: 2.5rem;
	height: 2.5rem;
	display: grid;
	place-items: center;
	padding: 0;
	font-size: 1.5rem;
	line-height: 1;
	color: #f2f2ee;
	background: rgba(17, 20, 17, 0.8);
	border: 1px solid rgba(242, 242, 238, 0.35);
	cursor: pointer;
}
.ethos-lightbox__close:hover,
.ethos-lightbox__close:focus-visible {
	border-color: #9fd8b4;
	color: #9fd8b4;
	outline: none;
}
.ethos-lightbox.is-actual {
	display: block;
	overflow: auto;
}
.ethos-lightbox.is-actual .ethos-lightbox__stage {
	display: block;
	max-width: none;
}
.ethos-lightbox.is-actual .ethos-lightbox__img {
	max-width: none;
	max-height: none;
	cursor: zoom-out;
}
.ethos-lightbox.is-actual .ethos-lightbox__caption {
	margin: 0.75rem auto 0;
}
@media (prefers-reduced-motion: no-preference) {
	.ethos-lightbox:not([hidden]) {
		animation: ethos-lightbox-in 0.16s ease-out;
	}
	@keyframes ethos-lightbox-in {
		from {
			opacity: 0;
		}
	}
}

/* Research page: one window per section, three to a row. The whole window is the link. */
.ethos-windows {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	margin-block: 0 var(--wp--preset--spacing--60);
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--line);
}
.ethos-window {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-height: 11rem;
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}
.ethos-window__num {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	color: var(--wp--preset--color--accent);
}
.ethos-window__title {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	line-height: 1.15;
}
.ethos-window__dek {
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--wp--preset--color--muted);
}
.ethos-window__go {
	margin-top: auto;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.875rem;
	color: var(--wp--preset--color--accent);
	transition: transform 0.25s ease;
}
/* Hover: the glow and top light shared with the home cards (see .ethos-lab-card). */
.ethos-window:hover .ethos-window__go,
.ethos-window:focus-visible .ethos-window__go {
	transform: translateX(4px);
}
.ethos-window:focus-visible {
	outline: none;
}
/* A last card alone on its row spans the row, so no empty cells show the grid's hairline background. */
.ethos-window:last-child:nth-child(3n + 1) {
	grid-column: 1 / -1;
	min-height: 0;
}
@media (max-width: 900px) {
	.ethos-windows {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.ethos-window:last-child:nth-child(3n + 1) {
		grid-column: auto;
	}
	.ethos-window:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}
@media (max-width: 560px) {
	.ethos-windows {
		grid-template-columns: 1fr;
	}
	.ethos-window {
		min-height: 0;
	}
}
@media (prefers-reduced-motion: reduce) {
	.ethos-window,
	.ethos-window__go {
		transition: none;
	}
}
[dir="rtl"] .ethos-window__go {
	transform: scaleX(-1);
	align-self: flex-start;
}

/* Markets hub on the Research page: four topic groups, two by two. */
.ethos-hub__groups {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--line);
}
.ethos-hub__group {
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--base);
}
.ethos-hub__group-title {
	margin-bottom: 0.4rem !important;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.375rem;	line-height: 1.2;
}
.ethos-hub__group-dek {
	margin-bottom: 0.9rem !important;
	font-size: 0.875rem;
	color: var(--wp--preset--color--muted);
}
.ethos-hub__group ol,
.ethos-hub__group ul {
	margin: 0;
	padding-left: 1.2rem;
	font-size: 0.9375rem;
	line-height: 1.45;
}
.ethos-hub__group li {
	margin-bottom: 0.5rem;
}
.ethos-hub__group a {
	color: var(--wp--preset--color--ink);
}
.ethos-hub__more {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	color: var(--wp--preset--color--muted);
}
.ethos-hub__more a {
	margin-left: 0.75rem;
	color: var(--wp--preset--color--ink);
}
@media (max-width: 900px) {
	.ethos-hub__groups {
		grid-template-columns: 1fr;
	}
}

/* Newsletter box. The form is the theme's own (sent to Hostinger Reach from the server), so it follows the light and
   dark tokens; .ethos-newsletter__form iframe only applies when the theme falls back to Reach's hosted iframe. */
.ethos-newsletter {
	margin-top: var(--wp--preset--spacing--60);
	padding: var(--wp--preset--spacing--50);
	border: 1px solid var(--wp--preset--color--line);
	background: rgb(var(--ethos-glass) / 0.6);
}
.ethos-newsletter__eyebrow {
	margin: 0 0 var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.ethos-newsletter__title {
	margin: 0 0 var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.1;
}
.ethos-newsletter__text {
	margin: 0 0 var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}
.ethos-newsletter__form iframe {
	display: block;
	min-height: 120px;
	color-scheme: normal;
}
.ethos-subscribe {
	margin: 0;
}
.ethos-subscribe__fields {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--wp--preset--spacing--20);
}
.ethos-subscribe__field {
	display: flex;
	flex: 1 1 11rem;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
}
.ethos-subscribe__field--email {
	flex-grow: 1.6;
}
.ethos-subscribe__label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
.ethos-subscribe__input {
	width: 100%;
	box-sizing: border-box;
	min-height: 2.75rem;
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: 1rem;
}
.ethos-subscribe__input::placeholder {
	color: var(--wp--preset--color--muted);
	opacity: 0.8;
}
.ethos-subscribe__input:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--accent);
}
.ethos-subscribe__button {
	flex: 0 0 auto;
	min-height: 2.75rem;
	padding: 0.55rem 1.3rem;
	border: 1px solid var(--wp--preset--color--ink);
	border-radius: 2px;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.ethos-subscribe__button:hover,
.ethos-subscribe__button:focus-visible {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}
.ethos-subscribe__button[disabled] {
	opacity: 0.6;
	cursor: wait;
}
.ethos-subscribe__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.ethos-subscribe__note {
	margin: var(--wp--preset--spacing--20) 0 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}
.ethos-subscribe__note a {
	color: var(--wp--preset--color--accent);
}
.ethos-subscribe__status {
	margin: var(--wp--preset--spacing--20) 0 0;
	font-size: var(--wp--preset--font-size--small);
}
.ethos-subscribe__status:empty {
	display: none;
}
.ethos-subscribe__status.is-error {
	color: #d2553f;
}
.ethos-subscribe.is-done .ethos-subscribe__fields {
	display: none;
}
.ethos-subscribe.is-done .ethos-subscribe__status {
	color: var(--wp--preset--color--accent);
	font-size: 1rem;
}
.ethos-newsletter--compact {
	margin-top: var(--wp--preset--spacing--40);
	padding: 0;
	border: 0;
	background: none;
	max-width: 36rem;
}
.ethos-newsletter--compact .ethos-newsletter__title {
	font-size: var(--wp--preset--font-size--large);
}
.ethos-newsletter--compact .ethos-newsletter__text {
	display: none;
}

/* ---------- Languages ---------- */
.ethos-langs {
	position: relative;
	margin-inline-start: var(--wp--preset--spacing--30);
	z-index: 30;
}
/* Same box as the face cursor and theme toggles beside it: 2.25rem square, thin line border, no fill. */
.ethos-langs__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	background: transparent;
	cursor: pointer;
	list-style: none;
	transition: border-color 0.18s ease;
}
.ethos-langs__toggle::-webkit-details-marker {
	display: none;
}
.ethos-langs__toggle::marker {
	content: "";
}
.ethos-langs__toggle:hover,
.ethos-langs__details[open] .ethos-langs__toggle {
	border-color: var(--wp--preset--color--accent);
}
.ethos-langs__flag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: system-ui, sans-serif;
	font-size: 1.25rem;
	line-height: 1;
}
.ethos-langs__toggle .ethos-langs__flag {
	font-size: 1rem;
}
.ethos-langs__menu {
	position: absolute;
	top: calc(100% + 0.4rem);
	inset-inline-end: 0;
	z-index: 40;
	min-width: 10rem;
	margin: 0;
	padding: 0.35rem;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
	list-style: none;
}
.ethos-langs__item {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.6rem 0.7rem;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	white-space: nowrap;
}
.ethos-langs__item:hover,
.ethos-langs__item:focus-visible,
.ethos-langs__item.is-current {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent);
}
.ethos-langs__name {
	font-size: 0.9rem;
}
.ethos-notice {
	margin: 0 0 var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	border-inline-start: 2px solid var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.78rem;
	color: var(--wp--preset--color--muted);
}

/* Footer columns rendered by patterns/footer.php. */
.ethos-footer__columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: var(--wp--preset--spacing--40);
}
.ethos-footer__column .is-style-eyebrow {
	margin-bottom: var(--wp--preset--spacing--20);
}

/* Greek, Russian and Hebrew pages: the Latin-only body and mono files are joined by Noto subsets
   (declared in theme.json), and Hebrew gets its own serif. The stacks fall through per glyph. */
html[lang^="el"],
html[lang^="ru"] {
	--wp--preset--font-family--sans: "Noto Sans", "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
}
html[lang^="he"] {
	--wp--preset--font-family--serif: "Noto Serif Hebrew", "EB Garamond", Georgia, serif;
	--wp--preset--font-family--sans: "Noto Sans Hebrew", "Noto Sans", Arial, sans-serif;
}

/* Right-to-left (Hebrew): mirror the handful of rules that are written left-to-right. */
[dir="rtl"] .ethos-lab-card {
	border-left: 0;
	border-right: 1px solid var(--wp--preset--color--line);
}
[dir="rtl"] .ethos-lab-card:nth-child(3n+1) {
	border-right: 0;
}
[dir="rtl"] .ethos-share__label {
	margin-right: 0;
	margin-left: 0.5rem;
}
[dir="rtl"] .ethos-data-table td,
[dir="rtl"] .ethos-data-table th {
	text-align: right;
}
[dir="rtl"] .ethos-header .wp-block-navigation {
	margin-left: 0;
	margin-right: auto;
}
[dir="rtl"] .ethos-theme-toggle {
	margin-left: 0;
	margin-right: var(--wp--preset--spacing--30);
}
[dir="rtl"] .ethos-bonded-cta,
[dir="rtl"] .ethos-toc,
[dir="rtl"] .ethos-hub__start {
	border-left: 0;
	border-right-width: 2px;
	border-right-style: solid;
	border-right-color: var(--wp--preset--color--accent);
}
[dir="rtl"] .ethos-hub__start {
	border-right-width: 3px;
}
[dir="rtl"] .ethos-toc {
	padding-left: 0;
	padding-right: 1.25rem;
}
[dir="rtl"] .ethos-toc ol,
[dir="rtl"] .ethos-hub__topics ul,
[dir="rtl"] .ethos-hub__group ul {
	padding-left: 0;
	padding-right: 1.2rem;
}
[dir="rtl"] .ethos-summary__key a,
[dir="rtl"] .ethos-hub__more a {
	margin-left: 0;
	margin-right: auto;
}
[dir="rtl"] .ethos-hub__more a {
	margin-right: 0.75rem;
}
[dir="rtl"] .ethos-dot + .ethos-dot {
	margin-left: 0;
	margin-right: 0.1em;
}
[dir="rtl"] .ethos-signal__source .ethos-dot {
	margin-left: 0;
	margin-right: 0.5em;
}
[dir="rtl"] .ethos-langs {
	margin-inline-start: 0;
	margin-inline-end: var(--wp--preset--spacing--30);
}
@media (min-width: 640px) {
	[dir="rtl"] .ethos-consent {
		right: auto;
		left: 24px;
	}
}

/* Face cursor (assets/js/face-cursor.js; settings in CONFIG there).
   The script adds .has-face-cursor to <html> only on hover-capable fine pointers,
   after the face image has loaded and the pointer has moved. */
html.has-face-cursor,
html.has-face-cursor * {
	cursor: none !important;
}
/* Text fields keep the native caret. */
html.has-face-cursor :is(input:not([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"]), textarea, select, [contenteditable]:not([contenteditable="false"]), [contenteditable]:not([contenteditable="false"]) *) {
	cursor: auto !important;
}
.ethos-face-cursor {
	position: fixed;
	top: 0;
	left: 0;
	max-width: none;
	margin: 0;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
	opacity: 0;
	transition: opacity 120ms ease;
	will-change: transform;
	filter: drop-shadow(0 2px 5px rgb(0 0 0 / 0.35));
}
.ethos-face-cursor.is-visible {
	opacity: 1;
}
.ethos-face-lasers {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	display: none;
	overflow: visible;
	pointer-events: none;
}
.ethos-face-lasers.is-firing {
	display: block;
}

/* Chart hover labels (every Plotly chart on the site, from any plugin). The charts draw on a transparent background,
   which makes Plotly paint the hover box white while the text takes the theme's ink colour, so in dark mode the text
   vanished. The box, its border and its text follow the theme tokens instead, in both themes and after a toggle. */
.js-plotly-plot .hoverlayer .hovertext path,
.js-plotly-plot .hoverlayer .legend rect.bg,
.js-plotly-plot .hoverlayer .axistext path {
	fill: var(--wp--preset--color--surface) !important;
	fill-opacity: 0.97 !important;
}
.js-plotly-plot .hoverlayer .legend rect.bg,
.js-plotly-plot .hoverlayer .axistext path {
	stroke: var(--wp--preset--color--line) !important;
}
.js-plotly-plot .hoverlayer text {
	fill: var(--wp--preset--color--ink) !important;
}
