/*
 * Help Center presentation layer (loaded after help-center-text.css).
 *
 * All rules are scoped to .mhct. Logical properties keep EN/ES/AR in the same
 * stylesheet, and the RTL block flips only directional chrome. No external
 * fonts, images, preconnects or provider requests: the video frame paints a CSS
 * placeholder until the visitor presses play.
 */

.mhct {
	/* Meerath site tokens (same values as the lean Contact/Features pages:
	 * heading #020817, text #334155, muted #64748b, border #e2e8f0, navy
	 * #092839, gold #bb933f, Open Sans, 8px radius, flat cards). */
	--mhct-heading: #020817;
	--mhct-text: #334155;
	--mhct-muted: #5b6b80;
	--mhct-border: #e2e8f0;
	/* Form-control outline: >= 3:1 on white and #f8fafc (WCAG 1.4.11). */
	--mhct-control-border: #64748b;
	--mhct-accent: #092839;
	--mhct-accent-ink: #ffffff;
	--mhct-link: #092839;
	--mhct-link-hover: #092839;
	/* Site gold-hover token: 3.9:1 on white, so the underline is a visible boundary. */
	--mhct-link-line: #9e7c35;
	--mhct-focus: #092839;
	--mhct-skip-ring: #9e7c35;
	--mhct-surface: #ffffff;
	--mhct-soft: #f8fafc;
	--mhct-input-bg: #ffffff;
	--mhct-tag-bg: #f8f5ec;
	--mhct-tag-text: #5b4614;
	--mhct-radius: 8px;
	--mhct-shadow: none;
	color: var(--mhct-text);
	font-family: "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	max-width: 68rem;
	padding-block-end: 4rem;
}

/* Dark mode follows the site's own switch (header.js toggles html.dark-mode
 * from the stored choice or the system setting), the same hook the lean
 * Contact and Features pages use. Values match their dark tokens. */
html.dark-mode .mhct,
html.b8v-theme-dark .mhct {
	--mhct-heading: #f8fafc;
	--mhct-text: #e2e8f0;
	--mhct-muted: #b6c2d1;
	--mhct-border: #334155;
	--mhct-control-border: #94a3b8;
	--mhct-link: #f8fafc;
	--mhct-link-hover: #d4b45a;
	--mhct-link-line: #d4b45a;
	--mhct-focus: #d4b45a;
	--mhct-skip-ring: #d4b45a;
	--mhct-surface: #1e293b;
	--mhct-soft: #162033;
	--mhct-input-bg: #0f172a;
	--mhct-tag-bg: #2a2412;
	--mhct-tag-text: #e7d29a;
	color-scheme: dark;
}

.mhct-title,
.mhct h1,
.mhct h2,
.mhct h3,
.mhct-search__label {
	color: var(--mhct-heading);
}

.mhct-title {
	font-weight: 700;
}

.mhct[dir="rtl"] .mhct-title {
	letter-spacing: 0;
	line-height: 1.4;
}

.mhct[dir="rtl"] {
	line-height: 1.85;
}

.mhct[dir="rtl"] .mhct-body h2,
.mhct[dir="rtl"] .mhct-category > h2 {
	line-height: 1.5;
}

/* Links: brand ink with a gold underline instead of browser blue. The
 * underline stays in every state so links never rely on colour alone.
 * State selectors use :where() so they stay at .mhct a specificity and never
 * beat the skip link's own two-class rules. */
.mhct a {
	color: var(--mhct-link);
	text-decoration-line: underline;
	text-decoration-color: var(--mhct-link-line);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	transition: color 120ms ease, text-decoration-thickness 120ms ease;
}

.mhct a:where(:visited) {
	color: var(--mhct-link);
}

.mhct a:where(:hover, :active) {
	color: var(--mhct-link-hover);
	text-decoration-thickness: 2px;
}

/* Plain :focus-visible (not :where) so it outranks help-center-text.css's
 * navy .mhct a:focus-visible ring, which vanished on dark backgrounds. The
 * skip link's three-part focus rules still win over it. */
.mhct a:focus-visible,
.mhct .mhct-search__input:focus-visible,
.mhct .mhct-search__clear:focus-visible,
.mhct .mhct-video__preferences:focus-visible {
	outline: 2px solid var(--mhct-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

.mhct-breadcrumbs li,
.mhct-locales [aria-current="true"] {
	color: var(--mhct-muted);
}

.mhct-hero {
	padding-block: 0.5rem 1.25rem;
	border-block-end: 1px solid var(--mhct-border);
	margin-block-end: 1.5rem;
}

.mhct-title {
	font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.35rem);
	line-height: 1.25;
	letter-spacing: -0.01em;
	margin-block: 0.25rem 0.5rem;
}

.mhct-lede,
.mhct-excerpt {
	color: var(--mhct-muted);
	font-size: 1.05rem;
	max-width: 46rem;
}

.mhct-kicker {
	color: var(--mhct-muted);
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.mhct-editorial-note {
	background: var(--mhct-soft);
	border-inline-start: 3px solid #b26a00;
	color: var(--mhct-tag-text);
	font-size: 0.85rem;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
}

/* Skip link ------------------------------------------------------------- *
 * Visually hidden until focused, then pinned to the viewport above the fixed
 * site header (.meerath-batch6a-header__bar is position:fixed, z-index 9991),
 * which otherwise hit-tests over it. Selectors are two-class scoped so they
 * beat the module's own .mhct a / .mhct a:focus-visible link rules: without
 * that, the label inherited the accent color and disappeared into the accent
 * background (computed text and background both rgb(11,95,255)). */
.mhct .mhct-skip {
	position: absolute;
	inset-inline-start: -9999px;
	inset-block-start: 0;
	background: var(--mhct-accent);
	color: var(--mhct-accent-ink);
	padding: 0.5rem 0.75rem;
	z-index: 20;
}

.mhct .mhct-skip:focus,
.mhct .mhct-skip:focus-visible {
	position: fixed;
	inset-block-start: 0.5rem;
	inset-inline-start: 0.5rem;
	background: var(--mhct-accent);
	color: var(--mhct-accent-ink);
	/* Theme-aware ring: >= 3:1 on the navy pill and on the surrounding page
	 * (light #9e7c35: 3.92 navy, 3.72 on #f8fafc; dark #d4b45a: 7.62, 8.91). */
	outline: 3px solid var(--mhct-skip-ring);
	outline-offset: 2px;
	z-index: 10000;
}

/* Logged-in visitors carry the WordPress admin bar: #wpadminbar is position:
 * fixed at z-index 99999 and 32px tall (46px at <=782px), so a focused skip
 * link pinned at 0.5rem sits underneath it and hit-tests on the bar instead.
 * Core publishes its own height as --wp-admin--admin-bar--height; the media
 * query fallback covers a bar rendered without that custom property. The
 * admin-bar scoping keeps the anonymous geometry exactly as it was. */
body.admin-bar .mhct .mhct-skip:focus,
body.admin-bar .mhct .mhct-skip:focus-visible {
	inset-block-start: calc(0.5rem + var(--wp-admin--admin-bar--height, 32px));
	z-index: 100001;
}

@media screen and (max-width: 782px) {
	body.admin-bar .mhct .mhct-skip:focus,
	body.admin-bar .mhct .mhct-skip:focus-visible {
		inset-block-start: calc(0.5rem + var(--wp-admin--admin-bar--height, 46px));
	}
}

/* Search --------------------------------------------------------------- */

.mhct-search {
	background: var(--mhct-surface);
	border: 1px solid var(--mhct-border);
	border-radius: var(--mhct-radius);
	box-shadow: var(--mhct-shadow);
	margin-block: 0 1.75rem;
	padding: 1rem;
}

.mhct-search__label {
	display: block;
	font-weight: 600;
	margin-block-end: 0.5rem;
}

.mhct-search__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* .mhct + element prefix outranks Astra's input[type=search] / button rules. */
.mhct input.mhct-search__input {
	appearance: none;
	background: var(--mhct-input-bg);
	color: var(--mhct-heading);
	border: 1px solid var(--mhct-control-border);
	border-radius: 10px;
	flex: 1 1 16rem;
	font-size: 1rem;
	min-height: 44px;
	padding: 0.55rem 0.8rem;
}

.mhct input.mhct-search__input::placeholder {
	color: var(--mhct-muted);
	opacity: 1;
}

.mhct input.mhct-search__input:focus-visible {
	border-color: var(--mhct-focus);
}

.mhct button.mhct-search__clear {
	background: var(--mhct-soft);
	color: var(--mhct-heading);
	border: 1px solid var(--mhct-control-border);
	border-radius: 10px;
	cursor: pointer;
	min-height: 44px;
	padding-inline: 0.9rem;
}

.mhct-search__status,
.mhct-search__empty {
	color: var(--mhct-muted);
	font-size: 0.85rem;
	margin-block: 0.5rem 0;
}

.mhct-search__noscript {
	color: var(--mhct-muted);
	font-size: 0.8rem;
	margin-block: 0.25rem 0;
}

/* Cards ---------------------------------------------------------------- */

.mhct-category {
	margin-block-end: 2rem;
}

.mhct-category > h2 {
	border-block-end: 1px solid var(--mhct-border);
	color: var(--mhct-heading);
	font-size: 1.2rem;
	font-weight: 700;
	padding-block-end: 0.5rem;
}

.mhct-cards {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.mhct-card {
	background: var(--mhct-surface);
	border: 1px solid var(--mhct-border);
	border-radius: var(--mhct-radius);
	box-shadow: var(--mhct-shadow);
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 1rem 1.1rem;
	transition: box-shadow 120ms ease, transform 120ms ease;
}

/* player.js filters search results by setting [hidden] on cards; the
 * display:flex above out-specifies the UA [hidden] rule, so filtered cards
 * stayed visible while the count said otherwise. */
.mhct .mhct-card[hidden],
.mhct [data-mhct-section][hidden] {
	display: none;
}

.mhct-card:hover,
.mhct-card:focus-within {
	border-color: var(--mhct-link-line);
}

.mhct .mhct-card__title {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.4;
}

.mhct-card__excerpt {
	color: var(--mhct-muted);
	font-size: 0.92rem;
	margin: 0;
}

.mhct-audience-tag {
	align-self: flex-start;
	background: var(--mhct-soft);
	border: 1px solid var(--mhct-border);
	border-radius: 999px;
	background: var(--mhct-tag-bg);
	border-color: transparent;
	color: var(--mhct-tag-text);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 0.1rem 0.5rem;
}

/* Article -------------------------------------------------------------- */

.mhct-body {
	font-size: 1.02rem;
	max-width: 46rem;
}

.mhct-body > h2 {
	margin-block-start: 2rem;
}

.mhct-body > ul,
.mhct-body > ol {
	padding-inline-start: 1.35rem;
}

.mhct-related,
.mhct-support {
	background: var(--mhct-soft);
	border: 1px solid var(--mhct-border);
	border-radius: var(--mhct-radius);
	margin-block-start: 1.75rem;
	padding: 1rem 1.15rem;
}

.mhct-related ul,
.mhct-support ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mhct-related__item,
.mhct-support-links li {
	padding-block: 0.3rem;
}

.mhct-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	font-size: 0.85rem;
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
}

.mhct-breadcrumbs li {
	display: inline-flex;
	gap: 0.35rem;
}

.mhct-locales ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	font-size: 0.9rem;
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
}

/* Video ---------------------------------------------------------------- */

.mhct-video {
	margin-block-start: 2rem;
	max-width: 46rem;
}

.mhct-video__heading {
	font-size: 1.15rem;
	margin-block: 0 0.35rem;
}

.mhct-video__intro,
.mhct-video__note {
	color: var(--mhct-muted);
	font-size: 0.85rem;
}

.mhct-video__frame {
	aspect-ratio: 16 / 9;
	background:
		radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12), transparent 60%),
		linear-gradient(135deg, #1b2a3a, #0d1620);
	border-radius: var(--mhct-radius);
	display: grid;
	place-items: center;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.mhct-video__iframe {
	border: 0;
	block-size: 100%;
	inline-size: 100%;
}

/* player.js hides controls by setting the [hidden] attribute. The author-level
 * display:inline-flex on .mhct-video__start out-specifies the UA [hidden] rule,
 * so a loaded player kept the start pill in the grid: it stayed painted above
 * the iframe and pushed the iframe into a second row. Two classes deep, so it
 * wins without !important. */
.mhct .mhct-video [hidden] {
	display: none;
}

.mhct-video__start {
	align-items: center;
	background: rgba(255, 255, 255, 0.94);
	border: 0;
	border-radius: 999px;
	color: #101c28;
	cursor: pointer;
	display: inline-flex;
	font-size: 0.98rem;
	font-weight: 600;
	gap: 0.55rem;
	min-height: 48px;
	padding: 0.6rem 1.15rem;
}

/* The theme's own button rules won over the single-class colour above and left
 * white text on this white pill, worst on native touch where :hover sticks
 * after focus. Re-assert the ink, scoped two classes deep, in every state. */
.mhct .mhct-video__start,
.mhct .mhct-video__start-label {
	color: #101c28;
}

.mhct .mhct-video__start:hover,
.mhct .mhct-video__start:focus,
.mhct .mhct-video__start:focus-visible,
.mhct .mhct-video__start:active {
	background: #ffffff;
	color: #101c28;
}

/* Focus ring contrast. The old 3px #ffd166 ring measured 1.44:1 on the white
 * pill and the pill sits on the dark .mhct-video__frame gradient
 * (#1b2a3a -> #0d1620), so one colour cannot satisfy both. Two tones: a dark
 * outline tight on the pill and a light shadow just outside it, each >= 3:1
 * against the surface it touches. Three classes deep so it out-specifies the
 * .mhct .mhct-video__start hover/focus paint block above. */
.mhct .mhct-video .mhct-video__start:focus-visible {
	outline: 3px solid #101c28;
	outline-offset: 0;
	box-shadow: 0 0 0 6px #ffd166;
}

.mhct-video__icon {
	border-block: 8px solid transparent;
	border-inline-start: 13px solid #101c28;
	block-size: 0;
	inline-size: 0;
}

.mhct-video__status {
	font-size: 0.85rem;
	margin-block: 0.5rem 0;
	min-height: 1.2em;
}

.mhct button.mhct-video__preferences {
	background: var(--mhct-surface);
	color: var(--mhct-heading);
	border: 1px solid var(--mhct-control-border);
	border-radius: 10px;
	cursor: pointer;
	min-height: 44px;
	padding-inline: 0.9rem;
}

/* RTL ------------------------------------------------------------------ */

.mhct[dir="rtl"] .mhct-body > ul,
.mhct[dir="rtl"] .mhct-body > ol {
	padding-inline-start: 1.35rem;
	padding-inline-end: 0;
}

.mhct[dir="rtl"] .mhct-kicker {
	letter-spacing: 0;
}

.mhct[dir="rtl"] .mhct-video__icon {
	border-inline-start: 0;
	border-inline-end: 13px solid #101c28;
}

/* Motion and print ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.mhct-card,
	.mhct-card:hover {
		transition: none;
		transform: none;
	}
}

@media (max-width: 40rem) {
	.mhct {
		padding-inline: 1rem;
	}
	.mhct-card {
		padding: 0.9rem;
	}
}

@media print {
	.mhct-video,
	.mhct-search,
	.mhct-skip,
	.mhct-locales {
		display: none;
	}
}
