/*
 * PowerLand Design System - RDX-10A responsive and accessibility quality layer.
 * This layer improves navigation, focus, reflow and forced-color behavior without
 * changing application permissions, form payloads or WPQA actions.
 */

body.powerland-ui-v2 {
	color-scheme: light;
}

body.powerland-ui-v2.dark-skin,
.dark-skin body.powerland-ui-v2 {
	color-scheme: dark;
}

body.powerland-ui-v2 :where(.screen-reader-text, .pl-sr-only) {
	position: absolute !important;
	inline-size: 1px !important;
	block-size: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

body.powerland-ui-v2 :where(.screen-reader-text, .pl-sr-only):focus {
	inline-size: auto !important;
	block-size: auto !important;
	margin: 0 !important;
	clip-path: none !important;
	white-space: normal !important;
}

body.powerland-ui-v2 :where(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible {
	outline: 3px solid var(--pl-color-focus);
	outline-offset: 3px;
}

body.powerland-ui-v2 :where([aria-disabled="true"], button:disabled, input:disabled, select:disabled, textarea:disabled) {
	cursor: not-allowed;
	opacity: 0.58;
}

body.powerland-ui-v2 :where(h1, h2, h3, h4, [id], article, .comment, .answer) {
	scroll-margin-block-start: 6rem;
}

body.powerland-ui-v2 :where(.post-title, .question-content-text, .post-content-text, .comment-text, .user-data, .group-item, .alert-message) {
	overflow-wrap: anywhere;
}

body.powerland-ui-v2 :where(pre, .wp-block-code) {
	max-inline-size: 100%;
	overflow: auto;
	overscroll-behavior-inline: contain;
	border-radius: var(--pl-radius-md);
}

body.powerland-ui-v2 :where(table) {
	max-inline-size: 100%;
}

body.powerland-ui-v2 :where(.mobile-menu-click, .mobile-aside-close, .mobile-arrows) {
	cursor: pointer;
	touch-action: manipulation;
}

body.powerland-ui-v2 .mobile-menu-click {
	border-radius: var(--pl-radius-sm);
}

body.powerland-ui-v2 .mobile-menu-click:focus-visible {
	background: var(--pl-color-bg-subtle);
}

body.powerland-ui-v2 .mobile-aside[aria-hidden="true"] {
	visibility: hidden;
}

body.powerland-ui-v2 .mobile-aside[aria-hidden="false"] {
	visibility: visible;
}

body.powerland-ui-v2 :where(.mobile-aside-close, .mobile-arrows) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

body.powerland-ui-v2 :where(.pagination a, .page-numbers, .question-navigation a, .comment-reply-link) {
	border-radius: var(--pl-radius-sm);
}

body.powerland-ui-v2 :where(.pagination a, .page-numbers, .question-navigation a):focus-visible {
	position: relative;
	z-index: 1;
}

body.powerland-ui-v2 .wpqa_form input[type="submit"].button-default,
body.powerland-ui-v2 :where(.button-default, .button-default-2) {
	border-color: var(--pl-color-brand-primary);
	/* The legacy bundle forces white text on some CTA variants. The brand-ink
	 * foreground keeps the PowerEn cyan while meeting AA at 14px. */
	color: var(--pl-color-brand-ink) !important;
	background: var(--pl-color-brand-primary);
}

body.powerland-ui-v2 .member__name > a {
	color: var(--pl-color-link) !important;
}

body.powerland-ui-v2 .widget-footer a {
	color: var(--pl-color-text-secondary) !important;
}

@media (max-width: 61.99rem) {
	body.powerland-ui-v2 .site-header__inner {
		min-inline-size: 0;
	}

	body.powerland-ui-v2 :where(.site-content, .the-main-inner, .article-post, .question-article, .page-section) {
		min-inline-size: 0;
	}
}

@media (max-width: 47.99rem) {
	body.powerland-ui-v2 :where(
		.mobile-menu-click,
		.mobile-aside-close,
		.mobile-arrows,
		.go-up,
		.ask-button,
		.dark-light-switcher-2,
		.pagination a,
		.page-numbers,
		.question-navigation a,
		.comment-reply-link,
		.button-default,
		.button-default-2,
		.button-default-3,
		button,
		input[type="button"],
		input[type="submit"]
	) {
		min-inline-size: 2.75rem;
		min-block-size: 2.75rem;
	}

	body.powerland-ui-v2 :where(.post-content-text, .question-content-text, .comment-text) {
		font-size: max(var(--pl-font-size-300), 0.875rem);
	}

	body.powerland-ui-v2 :where(
		.member__name > a,
		.member__stats a,
		.cat-sections > a,
		.cat-sections h6 a
	) {
		display: inline-flex;
		align-items: center;
		min-block-size: 1.5rem;
	}

	body.powerland-ui-v2 :where(.article-post, .question-article, .page-section, .group-item, .user-section) {
		max-inline-size: 100%;
	}
}

@media (max-width: 30rem) {
	body.powerland-ui-v2 :where(.wpqa_form, .answers-form, .post-contact) :where(input[type="submit"], button[type="submit"]) {
		inline-size: 100%;
	}

	body.powerland-ui-v2 :where(.post-meta, .footer-meta, .group_statistics, .user-data ul) {
		gap: var(--pl-space-2);
	}
}

@media (prefers-contrast: more) {
	body.powerland-ui-v2 {
		--pl-color-border-subtle: var(--pl-color-border-strong);
	}

	body.powerland-ui-v2 :where(.article-post, .question-article, .page-section, .widget, .group-item, .user-section) {
		box-shadow: none;
	}
}

@media (forced-colors: active) {
	body.powerland-ui-v2 :where(a, button, input, select, textarea, [role="button"], .article-post, .question-article, .page-section) {
		border-color: CanvasText;
		forced-color-adjust: auto;
	}

	body.powerland-ui-v2 :where(a, button, [role="button"]):focus-visible {
		outline-color: Highlight;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.powerland-ui-v2 :where(.mobile-menu-wrap, .mobile-aside, .mobile-arrows, .accordion-inner) {
		scroll-behavior: auto !important;
		transition: none !important;
		animation: none !important;
	}
}

@media print {
	body.powerland-ui-v2 :where(.site-header, .site-sidebar, .nav_menu_sidebar, .mobile-bar, .mobile-aside, .go-up, .ask-button, .dark-light-switcher-2) {
		display: none !important;
	}

	body.powerland-ui-v2 :where(.site-content, .the-main-inner) {
		inline-size: 100% !important;
		max-inline-size: none !important;
	}
}
