/**
 * Global ADAM theme integration.
 *
 * Low-specificity selectors preserve existing layouts while replacing shared
 * UI colours with semantic design tokens. Theme files remain token-only.
 */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) {
	--theme-heading-color: var(--adam-heading);
	--theme-headings-color: var(--adam-heading);
	--theme-text-color: var(--adam-text);
	--theme-link-initial-color: var(--adam-link);
	--theme-link-hover-color: var(--adam-link-hover);
	color: var(--adam-text);
	background-color: var(--adam-bg);
	font-family: var(--adam-font-family);
	color-scheme: var(--adam-color-scheme);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content),
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	header,
	footer,
	nav,
	form,
	table,
	th,
	td,
	input,
	select,
	textarea,
	button,
	a,
	details,
	.card,
	.widget,
	.panel,
	.menu,
	.sub-menu,
	.dropdown-menu,
	[role="dialog"],
	.adam-icon,
	.adam-icon *
) :not(.adam-digital-card-section *) {
	transition-duration: var(--adam-transition-duration);
	transition-property: background-color, border-color, box-shadow, color, fill, stroke;
	transition-timing-function: var(--adam-transition-timing);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(p, li, dt, dd, label, legend):not(.adam-digital-card-section *) {
	color: var(--adam-text);
}

/*
 * Headings need normal framework specificity. Wrapping both sides in
 * :where() allowed a theme's bare h1 rule to win even though ADAM UI loaded
 * later. Component and classified-surface rules below remain more specific.
 */
body.adam-theme-dark:not(.wp-admin) :is(h1, h2, h3, h4, h5, h6):not(.adam-digital-card-section *),
body.wp-admin.adam-theme-dark #wpbody-content :is(h1, h2, h3, h4, h5, h6):not(.adam-digital-card-section *) {
	color: var(--adam-heading);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(small, figcaption, caption, .description, .meta, .entry-meta, .wp-block-post-date):not(.adam-digital-card-section *) {
	color: var(--adam-text-muted);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(a):not(.adam-digital-card-section *) {
	color: var(--adam-link);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(a:hover, a:focus-visible):not(.adam-digital-card-section *) {
	color: var(--adam-link-hover);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) ::selection {
	color: var(--adam-selection-text);
	background-color: var(--adam-selection-bg);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(:focus-visible):not(.adam-digital-card-section *) {
	outline: 2px solid var(--adam-focus-ring);
	outline-offset: 2px;
}

/* Site chrome and navigation. */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(body > header, .site-header, .ct-header, #masthead, header.wp-block-template-part) {
	color: var(--adam-header-text);
	background: var(--adam-header-bg);
	border-bottom-width: var(--adam-header-border-width, 1px);
	border-bottom-style: solid;
	border-color: var(--adam-header-border);
	box-shadow: var(--adam-header-shadow, none);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(body > footer, .site-footer, #colophon, footer.wp-block-template-part) {
	color: var(--adam-footer-text);
	background: var(--adam-footer-bg);
	border-color: var(--adam-border);
}

:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-header, .site-header, #masthead) :where(nav, .menu, .sub-menu) {
	color: var(--adam-header-nav-text);
	background: var(--adam-header-nav-bg);
}

:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-header, .site-header, #masthead) :where(.menu-item > a, .wp-block-navigation-item__content) {
	color: var(--adam-header-nav-text);
}

:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-header, .site-header, #masthead) :where(.menu-item > a, .wp-block-navigation-item__content):hover {
	color: var(--adam-header-hover-text);
	background-color: var(--adam-header-hover-bg);
}

:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-header, .site-header, #masthead) :where(.current-menu-item > a, .current_page_item > a) {
	color: var(--adam-header-active-text);
	background-color: var(--adam-header-active-bg);
}

:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-header, .site-header, #masthead) :where([data-id="logo"], .site-branding) {
	background-color: var(--adam-header-logo-bg);
}

:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-header, .site-header, #masthead) :where(.ct-header-search, .ct-search-item, [data-id="search"]) :where(svg, .ct-icon) {
	color: var(--adam-header-search-icon);
	fill: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(nav, .navigation, .main-navigation, .wp-block-navigation, .wp-block-navigation__responsive-container) {
	color: var(--adam-text);
	background-color: var(--adam-surface);
	border-color: var(--adam-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.menu, .sub-menu, .dropdown-menu, .wp-block-navigation__submenu-container) {
	color: var(--adam-text);
	background-color: var(--adam-surface);
	border-color: var(--adam-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.menu-item > a, .wp-block-navigation-item__content):hover,
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.current-menu-item > a, .current_page_item > a) {
	color: var(--adam-link-hover);
	background-color: var(--adam-nav-hover);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(body > footer, .site-footer, #colophon, footer.wp-block-template-part) :where(nav, .menu) {
	color: var(--adam-footer-text);
	background-color: inherit;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(body > footer, .site-footer, #colophon, footer.wp-block-template-part) :where(a) {
	color: var(--adam-footer-link);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(body > footer, .site-footer, #colophon, footer.wp-block-template-part) :where(a:hover, a:focus-visible) {
	color: var(--adam-footer-link-hover);
}

body.adam-theme-dark .ct-footer {
	color: var(--adam-footer-text);
	background: var(--adam-footer-bg);
	border-color: var(--adam-border);
}

/*
 * Blocksy paints header/footer rows independently. Reset the complete
 * background shorthand so theme gradients and images cannot split the Night
 * canvas into separate colour bands.
 */
body.adam-theme-dark:not(.wp-admin) .ct-header [data-row] {
	background: var(--adam-header-bg);
}

body.adam-theme-dark:not(.wp-admin) .ct-footer [data-row] {
	background: var(--adam-footer-bg);
}

body.adam-theme-dark .ct-footer :where(h1, h2, h3, h4, h5, h6, p, li, nav, .menu) {
	color: var(--adam-footer-text);
}

body.adam-theme-dark .ct-footer :where(a) {
	color: var(--adam-footer-link);
}

body.adam-theme-dark .ct-footer :where(a:hover, a:focus-visible) {
	color: var(--adam-footer-link-hover);
}

:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-footer, .site-footer, #colophon) :where(h1, h2, h3, h4, h5, h6) { color: var(--adam-footer-heading); }
:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-footer-socials, .site-footer .socials) :where(svg, .ct-icon) { color: var(--adam-footer-social); fill: currentColor; }
:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-footer, .site-footer, #colophon) :where([data-row], hr) { border-color: var(--adam-footer-divider); }
:where(body.adam-theme-dark:not(.wp-admin)) :where(.ct-footer-copyright, .site-info, .footer-copyright) { color: var(--adam-footer-copyright); }

/* ADAM-owned chrome tokens intentionally outrank the active theme's generic rules. */
body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(nav, .menu, .sub-menu) {
	color: var(--adam-header-nav-text);
	background: var(--adam-header-nav-bg);
}
body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(.menu-item > a, .wp-block-navigation-item__content) { color: var(--adam-header-nav-text); }
body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(.menu-item > a, .wp-block-navigation-item__content):hover {
	color: var(--adam-header-hover-text);
	background-color: var(--adam-header-hover-bg);
}
body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(.current-menu-item > a, .current_page_item > a) {
	color: var(--adam-header-active-text);
	background-color: var(--adam-header-active-bg);
}
body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is([data-id="logo"], .site-branding) { background-color: var(--adam-header-logo-bg); }
body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(.ct-header-search, .ct-search-item, [data-id="search"]) :is(svg, .ct-icon) {
	color: var(--adam-header-search-icon);
	fill: currentColor;
}

/*
 * Blocksy's desktop arrow is an inline SVG inside the menu link. Its mobile
 * arrow lives in a sibling toggle button, while desktop keyboard interaction
 * uses a separate transparent ghost button. Each control inherits the colour
 * from the Blocksy link/parent that already owns normal, hover and active
 * states. The same structure is used recursively in nested submenus.
 */
body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(
	.ct-menu-link > .ct-toggle-dropdown-desktop,
	.ct-sub-menu-parent > .ct-toggle-dropdown-mobile
) {
	color: inherit;
}

body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(
	.ct-toggle-dropdown-mobile,
	.ct-toggle-dropdown-desktop-ghost
) {
	background: transparent;
	border-color: transparent;
}

body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(
	.ct-toggle-dropdown-desktop,
	.ct-toggle-dropdown-mobile
) .ct-icon {
	color: inherit;
}

body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(
	.ct-toggle-dropdown-desktop,
	.ct-toggle-dropdown-mobile
) .ct-icon:not([fill="none"]) {
	fill: currentColor;
}

body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(
	.ct-toggle-dropdown-desktop,
	.ct-toggle-dropdown-mobile
) .ct-icon[stroke]:not([stroke="none"]) {
	stroke: currentColor;
}

body.adam-theme-dark:not(.wp-admin) :is(.ct-header, .site-header, #masthead) :is(
	.ct-toggle-dropdown-mobile,
	.ct-toggle-dropdown-desktop-ghost
):focus-visible {
	outline: 2px solid var(--adam-header-search-icon);
	outline-offset: 2px;
}
body.adam-theme-dark:not(.wp-admin) :is(.ct-footer, .site-footer, #colophon) :is(h1, h2, h3, h4, h5, h6) { color: var(--adam-footer-heading); }
body.adam-theme-dark:not(.wp-admin) :is(.ct-footer-socials, .site-footer .socials) :is(svg, .ct-icon) { color: var(--adam-footer-social); fill: currentColor; }
body.adam-theme-dark:not(.wp-admin) :is(.ct-footer, .site-footer, #colophon) :is([data-row], hr) { border-color: var(--adam-footer-divider); }
body.adam-theme-dark:not(.wp-admin) :is(.ct-footer-copyright, .site-info, .footer-copyright) { color: var(--adam-footer-copyright); }

/* Shared surfaces and cards. */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	.card,
	.widget,
	.panel,
	.entry-card,
	.wp-block-group.is-style-card,
	.wp-block-query .wp-block-post
) {
	color: var(--adam-card-text);
	background-color: color-mix(in srgb, var(--adam-card-bg) var(--adam-card-surface-opacity, 100%), transparent);
	border-color: var(--adam-card-border);
	border-width: var(--adam-card-border-width);
	box-shadow: var(--adam-card-shadow);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.card, .widget, .panel, .entry-card, .wp-block-group.is-style-card, .wp-block-query .wp-block-post) :where(h1, h2, h3, h4, h5, h6) { color: var(--adam-card-heading); }
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.card, .widget, .panel, .entry-card, .wp-block-group.is-style-card, .wp-block-query .wp-block-post) a:not(.wp-element-button):not(.adam-button):not(.adam-card-link) { color: var(--adam-card-link); }

/*
 * Native and progressively enhanced form controls are first-class Night
 * components. These selectors intentionally carry normal specificity so a
 * plugin's Light palette cannot beat the global frontend contract merely by
 * using a class-qualified input rule.
 */
body.adam-theme-dark:not(.wp-admin) :is(
	input:not(:is([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="hidden"])),
	select,
	textarea,
	.ct-pseudo-input,
	[role="combobox"],
	.select2-selection,
	.select2-search__field,
	.choices__inner,
	.choices__input,
	.ts-control,
	.selectize-input
),
body.wp-admin.adam-theme-dark #wpbody-content :is(
	input:not(:is([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="hidden"])),
	select,
	textarea,
	.ct-pseudo-input,
	[role="combobox"]
) {
	color: var(--adam-form-input-text);
	background-color: color-mix(in srgb, var(--adam-form-input-bg) var(--adam-form-surface-opacity, 100%), transparent);
	border-color: var(--adam-form-border);
	border-width: var(--adam-form-border-width, 1px);
	box-shadow: var(--adam-form-shadow, none);
	color-scheme: dark;
}

body.adam-theme-dark:not(.wp-admin) :is(input, textarea, .select2-search__field, .choices__input, .ts-control input, .selectize-input input)::placeholder,
body.wp-admin.adam-theme-dark #wpbody-content :is(input, textarea)::placeholder,
body.adam-theme-dark:not(.wp-admin) :is(.select2-selection__placeholder, .choices__placeholder) {
	color: var(--adam-form-placeholder);
	opacity: 1;
}

body.adam-theme-dark:not(.wp-admin) select:is(:invalid, :has(option:checked[value=""])),
body.wp-admin.adam-theme-dark #wpbody-content select:is(:invalid, :has(option:checked[value=""])) {
	color: var(--adam-form-placeholder);
}

body.adam-theme-dark:not(.wp-admin) :is(
	input,
	select,
	textarea,
	.ct-pseudo-input,
	[role="combobox"],
	.select2-selection,
	.choices__inner,
	.ts-control,
	.selectize-input
):not(:disabled):not([aria-disabled="true"]):hover,
body.wp-admin.adam-theme-dark #wpbody-content :is(input, select, textarea, .ct-pseudo-input, [role="combobox"]):not(:disabled):not([aria-disabled="true"]):hover {
	background-color: color-mix(in srgb, var(--adam-form-input-bg) 90%, var(--adam-global-text) 10%);
	border-color: var(--adam-border-strong);
}

body.adam-theme-dark:not(.wp-admin) :is(
	input,
	select,
	textarea,
	.ct-pseudo-input,
	[role="combobox"],
	.select2-selection,
	.choices__inner,
	.ts-control,
	.selectize-input
):is(:focus, :focus-visible, :focus-within),
body.wp-admin.adam-theme-dark #wpbody-content :is(input, select, textarea, .ct-pseudo-input, [role="combobox"]):is(:focus, :focus-visible, :focus-within) {
	border-color: var(--adam-form-focus);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--adam-form-focus) 38%, transparent);
	outline-color: var(--adam-form-focus);
}

body.adam-theme-dark:not(.wp-admin) :is(
	option,
	optgroup,
	.select2-dropdown,
	.select2-results__options,
	.choices__list--dropdown,
	.ts-dropdown,
	.selectize-dropdown
),
body.wp-admin.adam-theme-dark #wpbody-content :is(option, optgroup) {
	color: var(--adam-form-input-text);
	background-color: var(--adam-form-input-bg);
	border-color: var(--adam-form-border);
	color-scheme: dark;
}

body.adam-theme-dark:not(.wp-admin) :is(
	option[value=""],
	option:disabled,
	.select2-results__option[aria-disabled="true"],
	.choices__placeholder
) {
	color: var(--adam-form-placeholder);
}

body.adam-theme-dark:not(.wp-admin) :is(
	.select2-results__option[aria-selected="true"],
	.select2-results__option--highlighted,
	.choices__item--choice.is-highlighted,
	.ts-dropdown .active,
	.selectize-dropdown .active
) {
	color: var(--adam-form-input-text);
	background-color: var(--adam-surface-hover);
}

/*
 * WordPress rich-text editors are a compound form component. TinyMCE's
 * editable canvas is an iframe and is synchronised by ui.js; this parent-page
 * contract covers its chrome and the QuickTags/Code textarea fallback.
 */
:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(.wp-editor-wrap, .wp-editor-container, .mce-tinymce, .tox-tinymce) {
	color: var(--adam-form-input-text);
	background-color: var(--adam-form-input-bg);
	border-color: var(--adam-form-border);
	color-scheme: dark;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap :is(
	.wp-editor-container,
	.mce-panel,
	.mce-toolbar-grp,
	.mce-statusbar,
	.quicktags-toolbar,
	.tox-editor-header,
	.tox-toolbar,
	.tox-toolbar__primary,
	.tox-statusbar
) {
	color: var(--adam-form-input-text);
	background: var(--adam-form-input-bg);
	border-color: var(--adam-form-border);
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap.wp-core-ui :is(.wp-switch-editor, .mce-btn, .quicktags-toolbar .button, .ed_button, .tox-tbtn) {
	color: var(--adam-form-input-text);
	background: var(--adam-form-input-bg);
	border-color: var(--adam-form-border);
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap.wp-core-ui :is(.mce-btn, .quicktags-toolbar .button, .ed_button, .tox-tbtn):is(:hover, :focus-visible),
:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap.wp-core-ui :is(.mce-btn.mce-active, .tox-tbtn--enabled) {
	color: var(--adam-form-input-text);
	background: var(--adam-surface-hover);
	border-color: var(--adam-form-focus);
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap :is(.mce-ico, .mce-btn button, .tox-tbtn, .tox-icon, svg) {
	color: currentColor;
	fill: currentColor;
	stroke: currentColor;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap.wp-core-ui.tmce-active .switch-tmce,
:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap.wp-core-ui.html-active .switch-html {
	color: var(--adam-form-input-text);
	background: var(--adam-form-input-bg);
	border-color: var(--adam-form-focus);
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap :is(iframe, textarea.wp-editor-area) {
	color: var(--adam-form-input-text);
	background-color: var(--adam-form-input-bg);
	border-color: var(--adam-form-border);
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap:is(:focus-within, .adam-ui-editor-focus) :is(.wp-editor-container, .mce-tinymce, .tox-tinymce) {
	border-color: var(--adam-form-focus);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--adam-form-focus) 38%, transparent);
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) .wp-editor-wrap :is(.mce-resizehandle, .mce-resizehandle i, .tox-statusbar__resize-handle) {
	color: var(--adam-form-placeholder);
	border-color: transparent var(--adam-form-placeholder) var(--adam-form-placeholder) transparent;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(fieldset) {
	color: var(--adam-text);
	background-color: var(--adam-input-bg);
	border-color: var(--adam-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(input[type="checkbox"], input[type="radio"], input[type="range"]) {
	accent-color: var(--adam-primary);
}

body.adam-theme-dark:not(.wp-admin) :is(
	input,
	select,
	textarea,
	.ct-pseudo-input,
	[role="combobox"]
):is(:disabled, [disabled], [aria-disabled="true"]),
body.adam-theme-dark:not(.wp-admin) :is(
	.select2-container--disabled .select2-selection,
	.choices.is-disabled .choices__inner,
	.ts-wrapper.disabled .ts-control,
	.selectize-control.disabled .selectize-input
),
body.wp-admin.adam-theme-dark #wpbody-content :is(input, select, textarea, .ct-pseudo-input, [role="combobox"]):is(:disabled, [disabled], [aria-disabled="true"]) {
	color: var(--adam-form-disabled-text);
	background-color: var(--adam-form-disabled-bg);
	border-color: var(--adam-form-border);
	cursor: not-allowed;
	opacity: 1;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) button:disabled {
	color: var(--adam-button-disabled-text);
	background-color: var(--adam-button-disabled-bg);
	border-color: var(--adam-button-disabled-bg);
	cursor: not-allowed;
	opacity: 1;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.search-form, .wp-block-search) {
	color: var(--adam-text);
	background-color: var(--adam-surface);
	border-color: var(--adam-border);
}

/*
 * Buttons.
 *
 * This is deliberately a low-specificity fallback. A button that already
 * has an authored class/style must keep its foreground/background pairing;
 * semantic ADAM UI buttons below opt into the managed palettes explicitly.
 * In particular, do not use !important here: it made light-green plugin
 * buttons inherit the Night link colour and then repeated that mistake on
 * hover.
 */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	input[type="button"],
	input[type="submit"],
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
):not(.adam-theme-switcher__choice):not(.ct-toggle-dropdown-mobile):not(.ct-toggle-dropdown-desktop-ghost):not([role="combobox"]):not(.mce-btn):not(.ed_button):not(.tox-tbtn):not(.wp-switch-editor):not(.adam-digital-card-section *):not(.adam-digital-card-section) {
	--adam-current-button-focus: var(--adam-button-focus);
	color: var(--adam-night-button-text);
	background-color: var(--adam-night-button-bg);
	border-color: var(--adam-night-button-border);
	outline-color: var(--adam-button-focus);
	-webkit-text-fill-color: currentColor;
}

/*
 * Legacy ADAM button implementations commonly use --adam-text-inverse for
 * their label while deriving the fill from --adam-primary. In Night mode
 * that fill is the bright primary surface, so the paired foreground must be
 * the primary on-colour. The shared .adam-card-link surface is included here
 * because it is an action component, but is not named "button" and therefore
 * was missed by the generic button selectors. Keep this scoped to controls;
 * preserved visual compositions such as the digital card retain their own
 * inherited palette.
 */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"],
	a.adam-card-link:not(.adam-card-download-button):not([data-adam-card-download])
):not(.adam-theme-switcher__choice):not(.ct-toggle-dropdown-mobile):not(.ct-toggle-dropdown-desktop-ghost):not([role="combobox"]):not(.mce-btn):not(.ed_button):not(.tox-tbtn):not(.wp-switch-editor):not(.adam-digital-card-section):not(.adam-digital-card-section *):not(.adam-digital-card *) {
	--adam-text-inverse: var(--adam-btn-primary-hover-text);
}

/*
 * .adam-card-link is ADAM's shared legacy primary action surface. Its
 * authored fill resolves to the bright Night primary, while its authored
 * foreground uses --adam-text-inverse. Keep the pairing explicit here so
 * component-link rules cannot turn the bright-surface label back into a light
 * link colour. Explicit dark variants retain their authored pairing.
 */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(a.adam-card-link:not(.adam-card-download-button):not([data-adam-card-download])):not(.adam-digital-card-section):not(.adam-digital-card-section *):not(.adam-digital-card *) {
	color: var(--adam-btn-primary-hover-text) !important;
	-webkit-text-fill-color: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(a.adam-card-link:not(.adam-card-download-button):not([data-adam-card-download])):not(.adam-digital-card-section):not(.adam-digital-card-section *):not(.adam-digital-card *):is(:hover, :focus, :focus-visible, :active) {
	color: var(--adam-btn-primary-hover-text) !important;
	-webkit-text-fill-color: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(a.adam-card-link:not(.adam-card-download-button):not([data-adam-card-download])):not(.adam-digital-card-section):not(.adam-digital-card-section *):not(.adam-digital-card *):is(:disabled, [disabled], [aria-disabled="true"]) {
	color: var(--adam-button-disabled-text) !important;
	-webkit-text-fill-color: currentColor;
}

/* Explicit dark action surface: retain a light, readable foreground. */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(button.adam-card-link, .adam-card-download-button, [data-adam-card-download]):not(.adam-digital-card-section):not(.adam-digital-card-section *):not(.adam-digital-card *) {
	color: var(--adam-global-text) !important;
	-webkit-text-fill-color: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(button.adam-card-link, .adam-card-download-button, [data-adam-card-download]):not(.adam-digital-card-section):not(.adam-digital-card-section *):not(.adam-digital-card *):is(:hover, :focus, :focus-visible, :active) {
	color: var(--adam-global-text) !important;
	-webkit-text-fill-color: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(button.adam-card-link, .adam-card-download-button, [data-adam-card-download]):not(.adam-digital-card-section):not(.adam-digital-card-section *):not(.adam-digital-card *):is(:disabled, [disabled], [aria-disabled="true"]) {
	color: var(--adam-button-disabled-text) !important;
	-webkit-text-fill-color: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	input[type="button"],
	input[type="submit"],
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
):not(.adam-theme-switcher__choice):not(.ct-toggle-dropdown-mobile):not(.ct-toggle-dropdown-desktop-ghost):not([role="combobox"]):not(.mce-btn):not(.ed_button):not(.tox-tbtn):not(.wp-switch-editor):is(:hover, :focus-visible, :active) {
	color: var(--adam-night-button-hover-text);
	background-color: var(--adam-night-button-hover-bg);
	border-color: var(--adam-night-button-hover-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	input[type="reset"],
	.button-secondary,
	.adam-button-secondary,
	.adam-button--secondary
) {
	--adam-current-button-focus: var(--adam-btn-secondary-focus);
	color: var(--adam-btn-secondary-text) !important;
	background-color: var(--adam-btn-secondary-bg) !important;
	border-color: var(--adam-btn-secondary-border) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(
	input[type="reset"],
	.button-secondary,
	.adam-button-secondary,
	.adam-button--secondary
):is(:hover, :focus-visible, :active) {
	color: var(--adam-btn-secondary-hover-text) !important;
	background-color: var(--adam-btn-secondary-hover-bg) !important;
	border-color: var(--adam-btn-secondary-hover-border) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(
	.wp-block-button.is-style-outline .wp-block-button__link,
	.adam-button-outline,
	.adam-button--outline,
	.button-outline,
	.is-outline
) {
	--adam-current-button-focus: var(--adam-btn-outline-focus);
	color: var(--adam-night-accent) !important;
	background-color: transparent !important;
	border-color: var(--adam-night-accent) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(
	.adam-button-ghost,
	.adam-button--ghost,
	.button-ghost,
	.is-ghost,
	.wp-block-button.is-style-ghost .wp-block-button__link
) {
	--adam-current-button-focus: var(--adam-btn-outline-focus);
	color: var(--adam-night-accent) !important;
	background-color: transparent !important;
	border-color: transparent !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(
	.wp-block-button.is-style-fill .wp-block-button__link,
	.adam-button-accent,
	.adam-button--accent,
	.button-accent,
	.is-accent
) {
	--adam-current-button-focus: var(--adam-btn-primary-focus);
	color: var(--adam-night-on-accent) !important;
	background-color: var(--adam-btn-primary-bg) !important;
	border-color: var(--adam-btn-primary-border) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(
	.wp-block-button.is-style-fill .wp-block-button__link,
	.adam-button-accent,
	.adam-button--accent,
	.button-accent,
	.is-accent
):is(:hover, :focus-visible, :active) {
	color: var(--adam-btn-primary-hover-text) !important;
	background-color: var(--adam-btn-primary-hover-bg) !important;
	border-color: var(--adam-btn-primary-hover-border) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(.button-danger, .adam-button-danger, .adam-button--danger, .is-danger) {
	--adam-current-button-focus: var(--adam-btn-danger-focus);
	color: var(--adam-btn-danger-text) !important;
	background-color: var(--adam-btn-danger-bg) !important;
	border-color: var(--adam-btn-danger-border) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(.button-danger, .adam-button-danger, .adam-button--danger, .is-danger):is(:hover, :focus-visible, :active) {
	color: var(--adam-btn-danger-hover-text) !important;
	background-color: var(--adam-btn-danger-hover-bg) !important;
	border-color: var(--adam-btn-danger-hover-border) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(.button-success, .adam-button-success, .adam-button--success, .is-success) {
	--adam-current-button-focus: var(--adam-btn-success-focus);
	color: var(--adam-btn-success-text) !important;
	background-color: var(--adam-btn-success-bg) !important;
	border-color: var(--adam-btn-success-border) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(.button-success, .adam-button-success, .adam-button--success, .is-success):is(:hover, :focus-visible, :active) {
	color: var(--adam-btn-success-hover-text) !important;
	background-color: var(--adam-btn-success-hover-bg) !important;
	border-color: var(--adam-btn-success-hover-border) !important;
}

:is(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :is(
	button,
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
):not(.adam-theme-switcher__choice):not(.ct-toggle-dropdown-mobile):not(.ct-toggle-dropdown-desktop-ghost):not([role="combobox"]):not(.mce-btn):not(.ed_button):not(.tox-tbtn):not(.wp-switch-editor):focus-visible {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--adam-current-button-focus) 42%, transparent);
	outline: 2px solid var(--adam-current-button-focus);
	outline-offset: 2px;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
):not(.adam-theme-switcher__choice):not(.ct-toggle-dropdown-mobile):not(.ct-toggle-dropdown-desktop-ghost):not([role="combobox"]):not(.mce-btn):not(.ed_button):not(.tox-tbtn):not(.wp-switch-editor):is(:disabled, [disabled], [aria-disabled="true"], .is-disabled, .disabled) {
	color: var(--adam-button-disabled-text);
	background-color: var(--adam-button-disabled-bg);
	border-color: var(--adam-button-disabled-bg);
	opacity: 1;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
) :where(span, strong, em, b, i, svg, svg *) {
	color: inherit;
	-webkit-text-fill-color: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
) svg:not([fill="none"]) {
	fill: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
) svg[stroke]:not([stroke="none"]) {
	stroke: currentColor;
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
)::before,
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(
	button,
	.button,
	.ct-button,
	.wp-element-button,
	.wp-block-button__link,
	[role="button"],
	a[class*="button"]
)::after {
	color: inherit;
}

/* Tables. */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(table) {
	color: var(--adam-text);
	background-color: var(--adam-table-row-bg);
	border-color: var(--adam-table-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(table thead, table tfoot) {
	color: var(--adam-table-header-text);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(th, td) {
	border-color: var(--adam-table-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(thead, tfoot) {
	background-color: var(--adam-table-header-bg);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(tbody tr:nth-child(even)) {
	background-color: var(--adam-table-alt-row-bg);
}

/* Notices and status messages. */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.notice, .alert, .message, .woocommerce-message, .woocommerce-info) {
	color: var(--adam-notice-info-text);
	background-color: var(--adam-notice-info-bg);
	border-color: var(--adam-notice-info-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.notice-success, .alert-success, .woocommerce-message) {
	color: var(--adam-notice-success-text);
	background-color: var(--adam-notice-success-bg);
	border-color: var(--adam-notice-success-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.notice-warning, .alert-warning) {
	color: var(--adam-notice-warning-text);
	background-color: var(--adam-notice-warning-bg);
	border-color: var(--adam-notice-warning-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.notice-error, .alert-error, .alert-danger, .woocommerce-error) {
	color: var(--adam-notice-error-text);
	background-color: var(--adam-notice-error-bg);
	border-color: var(--adam-notice-error-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.badge, .tag, .status, .post-state) {
	color: var(--adam-on-secondary);
	background-color: var(--adam-secondary);
	border-color: var(--adam-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.badge-success, .status-success) {
	color: var(--adam-success);
	background-color: var(--adam-success-bg);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.badge-warning, .status-warning) {
	color: var(--adam-warning);
	background-color: var(--adam-warning-bg);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.badge-danger, .status-danger) {
	color: var(--adam-danger);
	background-color: var(--adam-danger-bg);
}

/* Pagination and breadcrumbs. */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.pagination, .nav-links, .page-numbers, .breadcrumb, .breadcrumbs) {
	color: var(--adam-text-muted);
	border-color: var(--adam-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.page-numbers.current, [aria-current="page"]) {
	color: var(--adam-on-primary);
	background-color: var(--adam-primary);
	border-color: var(--adam-primary);
}

/* Accordions, tabs, dropdowns, and modals. */
:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(details, .accordion, .tabs, [role="tablist"], [role="tabpanel"]) {
	color: var(--adam-text);
	background-color: var(--adam-surface);
	border-color: var(--adam-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(summary, .accordion-header, [role="tab"]) {
	color: var(--adam-text);
	background-color: var(--adam-surface-2);
	border-color: var(--adam-border);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where([role="tab"][aria-selected="true"], details[open] > summary) {
	color: var(--adam-link);
	border-color: var(--adam-primary);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.modal, .dialog, [role="dialog"], [role="alertdialog"]) {
	color: var(--adam-text);
	background-color: var(--adam-surface);
	border-color: var(--adam-border);
	box-shadow: var(--adam-shadow-lg);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(.modal-backdrop, .dialog-backdrop, [data-modal-overlay]) {
	background-color: var(--adam-overlay);
}

:where(body.adam-theme-dark:not(.wp-admin), body.wp-admin.adam-theme-dark #wpbody-content) :where(code, pre, kbd, samp) {
	color: var(--adam-text);
	background-color: var(--adam-code-bg);
	border-color: var(--adam-border);
}

/*
 * ADAM website Night Theme.
 *
 * These decisions follow the purpose of each live page section. They are
 * intentionally scoped to Night mode so the Light Theme remains unchanged.
 * Photographs and graphics are deliberately absent from every selector.
 */
body.adam-theme-dark:not(.wp-admin) :where(#main-container, main, .site-main, .content-area, .entries) {
	color: var(--adam-text);
	background-color: var(--adam-section-canvas);
}

body.adam-theme-dark:not(.wp-admin) .entry-content :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, label, legend) {
	color: var(--adam-text);
}

/*
 * Background classifier.
 *
 * Standard WordPress and Blocksy classes receive an immediate semantic
 * fallback. The controller adds data-adam-night-background for inline colours,
 * plugin blocks, and decorative gradients discovered from computed styles.
 */
body.adam-theme-dark:not(.wp-admin) :is(
	.has-white-background-color,
	.has-base-background-color,
	.has-palette-color-8-background-color,
	.has-theme-palette-color-8-background-color
):not(.wp-block-cover):not(.has-background-image):not([style*="url(" i]) {
	color: var(--adam-section-standard-text);
	background-color: var(--adam-night-surface) !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	.has-palette-color-6-background-color,
	.has-palette-color-7-background-color,
	.has-theme-palette-color-6-background-color,
	.has-theme-palette-color-7-background-color,
	.is-style-alternate,
	.is-style-muted
):not(.wp-block-cover):not(.has-background-image):not([style*="url(" i]) {
	color: var(--adam-section-alternate-text);
	background-color: var(--adam-night-surface-alt) !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	.has-palette-color-1-background-color,
	.has-palette-color-2-background-color,
	.has-palette-color-5-background-color,
	.has-theme-palette-color-1-background-color,
	.has-theme-palette-color-2-background-color,
	.has-theme-palette-color-5-background-color
):not(.wp-block-cover):not(.has-background-image):not([style*="url(" i]) {
	color: var(--adam-section-feature-text);
	background-color: var(--adam-night-accent-surface) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-background="content"] {
	--adam-night-surface-heading: var(--adam-section-standard-heading);
	--adam-night-surface-text: var(--adam-section-standard-text);
	--adam-night-surface-link: var(--adam-section-standard-link);
	--theme-heading-color: var(--adam-night-surface-heading);
	--theme-headings-color: var(--adam-night-surface-heading);
	--theme-text-color: var(--adam-night-surface-text);
	--theme-link-initial-color: var(--adam-night-surface-link);
	--theme-link-hover-color: var(--adam-link-hover);
	color: var(--adam-section-standard-text);
	background: var(--adam-night-surface) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-background="alternate"] {
	--adam-night-surface-heading: var(--adam-section-alternate-heading);
	--adam-night-surface-text: var(--adam-section-alternate-text);
	--adam-night-surface-link: var(--adam-section-alternate-link);
	--theme-heading-color: var(--adam-night-surface-heading);
	--theme-headings-color: var(--adam-night-surface-heading);
	--theme-text-color: var(--adam-night-surface-text);
	--theme-link-initial-color: var(--adam-night-surface-link);
	--theme-link-hover-color: var(--adam-link-hover);
	color: var(--adam-section-alternate-text);
	background: var(--adam-night-surface-alt) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-background="accent"] {
	--adam-night-surface-heading: var(--adam-section-feature-heading);
	--adam-night-surface-text: var(--adam-section-feature-text);
	--adam-night-surface-link: var(--adam-section-feature-link);
	--theme-heading-color: var(--adam-night-surface-heading);
	--theme-headings-color: var(--adam-night-surface-heading);
	--theme-text-color: var(--adam-night-surface-text);
	--theme-link-initial-color: var(--adam-night-surface-link);
	--theme-link-hover-color: var(--adam-link-hover);
	color: var(--adam-section-feature-text);
	background: var(--adam-night-accent-surface) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-background="overlay"] {
	background: var(--adam-night-overlay) !important;
}

/*
 * Footer is a terminal surface. These rules intentionally follow the generic
 * classifier so nested Blocksy rows and containers cannot be promoted to a
 * card or alternate section colour.
 */
body.adam-theme-dark:not(.wp-admin) :is(
	footer,
	.ct-footer,
	.site-footer,
	#colophon,
	footer.wp-block-template-part
):not([data-adam-ui-ignore]):not([data-adam-ui-ignore] *):not(.adam-digital-card-section):not(.adam-digital-card-section *),
body.adam-theme-dark:not(.wp-admin) :is(
	footer,
	.ct-footer,
	.site-footer,
	#colophon,
	footer.wp-block-template-part
) :is(
	.ct-container,
	.ct-container-fluid,
	[data-row],
	[data-row] > div,
	[data-column],
	.footer-container,
	.footer-inner,
	.footer-content,
	.footer-main,
	.footer-top,
	.footer-middle,
	.footer-bottom,
	.footer-widgets,
	.footer-widget-area,
	.footer-navigation,
	.footer-menu,
	.widget-area,
	.site-info,
	.ct-footer-copyright,
	.wp-block-group,
	[data-adam-night-background="footer"]
):not([data-adam-ui-ignore]):not([data-adam-ui-ignore] *):not(.adam-digital-card-section):not(.adam-digital-card-section *) {
	background: var(--adam-footer-bg) !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	footer,
	.ct-footer,
	.site-footer,
	#colophon,
	.ct-footer [data-row],
	.site-footer .footer-widgets,
	.site-footer .footer-bottom
):not([data-adam-ui-ignore]):not([data-adam-ui-ignore] *):not(.adam-digital-card-section):not(.adam-digital-card-section *)::before,
body.adam-theme-dark:not(.wp-admin) :is(
	footer,
	.ct-footer,
	.site-footer,
	#colophon,
	.ct-footer [data-row],
	.site-footer .footer-widgets,
	.site-footer .footer-bottom
):not([data-adam-ui-ignore]):not([data-adam-ui-ignore] *):not(.adam-digital-card-section):not(.adam-digital-card-section *)::after {
	background: transparent !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	.ct-footer [data-row],
	.site-footer .footer-widgets,
	.site-footer .footer-bottom,
	#colophon .site-info
) {
	border-color: var(--adam-footer-divider);
}

/*
 * A converted surface owns its foreground system as well as its background.
 * The explicit colour declarations prevent Blocksy/Gutenberg Light values
 * (including inline block colours) from leaking into Night mode. Semantic
 * badges, statuses, and notices retain their component-specific contrast.
 */
body.adam-theme-dark:not(.wp-admin) :is(
	[data-adam-night-background="content"],
	[data-adam-night-background="alternate"],
	[data-adam-night-background="accent"]
) :where(h1, h2, h3, h4, h5, h6):not(:where(
	.adam-badge,
	.adam-badge *,
	.adam-status,
	.adam-status *,
	.adam-notice,
	.adam-notice *,
	.adam-alert,
	.adam-alert *,
	[role="status"],
	[role="status"] *,
	[role="alert"],
	[role="alert"] *
)) {
	color: var(--adam-night-surface-heading) !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	[data-adam-night-background="content"],
	[data-adam-night-background="alternate"],
	[data-adam-night-background="accent"]
) :where(p, li, dt, dd, figcaption, caption, .wp-element-caption, label, legend, blockquote):not(:where(
	.adam-button *,
	.wp-element-button *,
	button *,
	.adam-badge,
	.adam-badge *,
	.adam-status,
	.adam-status *,
	.adam-notice,
	.adam-notice *,
	.adam-alert,
	.adam-alert *,
	[role="status"],
	[role="status"] *,
	[role="alert"],
	[role="alert"] *
)) {
	color: var(--adam-night-surface-text) !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	[data-adam-night-background="content"],
	[data-adam-night-background="alternate"],
	[data-adam-night-background="accent"]
) a:not(.adam-button):not(.wp-element-button):not(.adam-card-link):not(:where(
	.adam-badge,
	.adam-badge *,
	.adam-status,
	.adam-status *,
	.adam-notice,
	.adam-notice *,
	.adam-alert,
	.adam-alert *,
	[role="status"],
	[role="status"] *,
	[role="alert"],
	[role="alert"] *
)) {
	color: var(--adam-night-surface-link) !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	[data-adam-night-background="content"],
	[data-adam-night-background="alternate"],
	[data-adam-night-background="accent"]
) a:not(.adam-button):not(.wp-element-button):not(.adam-card-link):not(:where(
	.adam-badge,
	.adam-badge *,
	.adam-status,
	.adam-status *,
	.adam-notice,
	.adam-notice *,
	.adam-alert,
	.adam-alert *,
	[role="status"],
	[role="status"] *,
	[role="alert"],
	[role="alert"] *
)):hover {
	color: var(--adam-link-hover) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-background="accent"] :where(
	h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, label, legend,
	a:not(.wp-element-button):not(.adam-button):not(.adam-card-link), svg
) {
	color: var(--adam-section-feature-text);
}

body.adam-theme-dark:not(.wp-admin) :is(.has-palette-color-1-background-color, .has-palette-color-5-background-color) :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, label, legend, a:not(.wp-element-button):not(.adam-button):not(.adam-card-link), svg) { color: var(--adam-section-feature-text); }
body.adam-theme-dark:not(.wp-admin) .has-palette-color-2-background-color :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, label, legend, a:not(.wp-element-button):not(.adam-button):not(.adam-card-link), svg) { color: var(--adam-section-cta-text); }
body.adam-theme-dark:not(.wp-admin) .has-palette-color-4-background-color :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, label, legend, a:not(.wp-element-button):not(.adam-button):not(.adam-card-link), svg) { color: var(--adam-section-overlay-text); }

/*
 * Semantic ADAM component bridge.
 *
 * ADAM plugins may retain structural class names while migrating to the
 * component library. The controller recognises generic component semantics
 * from those names and assigns this stable data contract. No plugin or page
 * name is required here.
 */
body.adam-theme-dark:not(.wp-admin) :is(
	[data-adam-night-component="card"],
	[data-adam-night-component="empty"],
	[data-adam-night-component="stat"]
) {
	--adam-night-component-heading: var(--adam-card-heading);
	--adam-night-component-text: var(--adam-card-text);
	--adam-night-component-link: var(--adam-card-link);
	color: var(--adam-card-text) !important;
	background: var(--adam-card-bg) !important;
	border-color: var(--adam-card-border) !important;
	box-shadow: var(--adam-card-shadow);
}

/* Standard surfaced content panels share one stable Night treatment. */
body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="panel"] {
	--adam-night-component-heading: var(--adam-section-standard-heading);
	--adam-night-component-text: var(--adam-section-standard-text);
	--adam-night-component-link: var(--adam-section-standard-link);
	color: var(--adam-section-standard-text) !important;
	background: var(--adam-night-surface) !important;
	border-color: var(--adam-global-border) !important;
}

/*
 * Typography is never promoted to a Night surface by computed-colour
 * classification. Disclosure headings inside standard panels also remain
 * part of the panel surface instead of becoming standalone accordion bars.
 */
body.adam-theme-dark:not(.wp-admin) [data-adam-night-background="typography"] {
	background: transparent !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="panel"] > summary[data-adam-night-background="transparent"] {
	background: transparent;
	border-color: transparent;
}

/*
 * Compact feature tiles may be unclassed children of a semantic component
 * collection. The classifier assigns this contract only when the child is a
 * visibly surfaced box, so transparent grid and positioning wrappers remain
 * transparent.
 */
body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="feature"] {
	--adam-night-component-heading: var(--adam-global-heading);
	--adam-night-component-text: var(--adam-global-text);
	--adam-night-component-link: var(--adam-global-link);
	color: var(--adam-global-text) !important;
	background: var(--adam-night-surface-alt) !important;
	border-color: var(--adam-global-border) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="feature"] :where(
	h1, h2, h3, h4, h5, h6, p, strong, span:not([role="status"]), li, dt, dd
) {
	color: var(--adam-global-text) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="feature"] :where(
	.adam-icon,
	[class*="icon"],
	svg
) {
	color: var(--adam-night-accent) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="feature"] svg:not([fill="none"]) {
	fill: currentColor !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="feature"] svg[stroke]:not([stroke="none"]) {
	stroke: currentColor !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="form"] {
	--adam-night-component-heading: var(--adam-global-heading);
	--adam-night-component-text: var(--adam-global-text);
	--adam-night-component-link: var(--adam-global-link);
	color: var(--adam-global-text) !important;
	background: var(--adam-form-input-bg) !important;
	border-color: var(--adam-form-border) !important;
	box-shadow: var(--adam-form-shadow, none);
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="hero"] {
	--adam-night-component-heading: var(--adam-hero-heading);
	--adam-night-component-text: var(--adam-hero-text);
	--adam-night-component-link: var(--adam-global-link);
	color: var(--adam-hero-text);
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="hero"]:is(
	:not([data-adam-night-background]),
	[data-adam-night-background="content"],
	[data-adam-night-background="alternate"],
	[data-adam-night-background="accent"]
) {
	background: var(--adam-hero-bg) !important;
	border-color: var(--adam-global-border);
}

body.adam-theme-dark:not(.wp-admin) :is(
	[data-adam-night-component="card"],
	[data-adam-night-component="empty"],
	[data-adam-night-component="stat"],
	[data-adam-night-component="panel"],
	[data-adam-night-component="feature"],
	[data-adam-night-component="form"],
	[data-adam-night-component="hero"]
) :where(h1, h2, h3, h4, h5, h6) {
	color: var(--adam-night-component-heading) !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	[data-adam-night-component="card"],
	[data-adam-night-component="empty"],
	[data-adam-night-component="stat"],
	[data-adam-night-component="panel"],
	[data-adam-night-component="feature"],
	[data-adam-night-component="form"],
	[data-adam-night-component="hero"]
) :where(p, li, dt, dd, figcaption, caption, label, legend, blockquote) {
	color: var(--adam-night-component-text) !important;
}

body.adam-theme-dark:not(.wp-admin) :is(
	[data-adam-night-component="card"],
	[data-adam-night-component="empty"],
	[data-adam-night-component="stat"],
	[data-adam-night-component="panel"],
	[data-adam-night-component="feature"],
	[data-adam-night-component="form"],
	[data-adam-night-component="hero"]
) a:not(.adam-button):not(.wp-element-button):not(.adam-card-link):not([class*="button"]) {
	color: var(--adam-night-component-link) !important;
}

/*
 * ADAM-owned forms can load structural CSS after the framework. Important
 * declarations are deliberately limited to classified form components so
 * third-party forms and native WordPress screens remain untouched.
 */
body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="form"] :is(
	input:not(:is([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="hidden"])),
	select,
	textarea,
	.ct-pseudo-input,
	[role="combobox"],
	.select2-selection,
	.select2-search__field,
	.choices__inner,
	.choices__input,
	.ts-control,
	.selectize-input
) {
	color: var(--adam-form-input-text) !important;
	background-color: var(--adam-form-input-bg) !important;
	border-color: var(--adam-form-border) !important;
	box-shadow: var(--adam-form-shadow, none) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="form"] :is(input, select, textarea)::placeholder {
	color: var(--adam-form-placeholder) !important;
	opacity: 1;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="form"] :is(
	input,
	select,
	textarea,
	.ct-pseudo-input,
	[role="combobox"],
	.select2-selection,
	.choices__inner,
	.ts-control,
	.selectize-input
):not(:disabled):not([aria-disabled="true"]):hover {
	background-color: color-mix(in srgb, var(--adam-form-input-bg) 90%, var(--adam-global-text) 10%) !important;
	border-color: var(--adam-border-strong) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="form"] :is(
	input,
	select,
	textarea,
	.ct-pseudo-input,
	[role="combobox"],
	.select2-selection,
	.choices__inner,
	.ts-control,
	.selectize-input
):is(:focus, :focus-visible, :focus-within) {
	border-color: var(--adam-form-focus) !important;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--adam-form-focus) 38%, transparent) !important;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="form"] :is(input, select, textarea, .ct-pseudo-input, [role="combobox"]):is(
	:disabled,
	[disabled],
	[aria-disabled="true"]
),
body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="form"] :is(
	.select2-container--disabled .select2-selection,
	.choices.is-disabled .choices__inner,
	.ts-wrapper.disabled .ts-control,
	.selectize-control.disabled .selectize-input
) {
	color: var(--adam-form-disabled-text) !important;
	background-color: var(--adam-form-disabled-bg) !important;
	border-color: var(--adam-form-border) !important;
	cursor: not-allowed;
	opacity: 1;
}

body.adam-theme-dark:not(.wp-admin) [data-adam-night-component="form"] :is(option, optgroup) {
	color: var(--adam-form-input-text) !important;
	background-color: var(--adam-form-input-bg) !important;
}
body.adam-theme-dark:not(.wp-admin) .has-palette-color-6-background-color :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, label, legend, a:not(.wp-element-button):not(.adam-button):not(.adam-card-link), svg) { color: var(--adam-section-alternate-text); }
body.adam-theme-dark:not(.wp-admin) :is(.has-palette-color-7-background-color, .has-palette-color-8-background-color) :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, label, legend, a:not(.wp-element-button):not(.adam-button):not(.adam-card-link), svg) { color: var(--adam-section-standard-text); }

/* ADAM Sócios: account pages use one focused hero and stable card surfaces. */
body.adam-theme-dark .adam-member-area {
	color: var(--adam-text);
}

body.adam-theme-dark .adam-member-area .adam-member-hero {
	color: var(--adam-on-section-feature);
	background: var(--adam-section-feature);
	border-color: var(--adam-section-accent);
}

body.adam-theme-dark .adam-member-area .adam-member-hero :where(h1, h2, h3, p, li) {
	color: var(--adam-on-section-feature);
}

body.adam-theme-dark .adam-member-area :where(.adam-card, .adam-login-panel, .adam-form-card):not(.adam-digital-card-section) {
	color: var(--adam-text);
	background: var(--adam-section-base);
	border-color: var(--adam-border);
}

body.adam-theme-dark .adam-member-area :where(.adam-card, .adam-login-panel, .adam-form-card):not(.adam-digital-card-section) :where(h1, h2, h3, h4, p, label):not(.adam-digital-card-section *) {
	color: var(--adam-text);
}

/*
 * ADAM Sócios uses .adam-card-link for filled primary actions, including the
 * shared success-confirmation action. It is an action surface, not a prose
 * link: keep its foreground paired with the primary fill in every mode/state.
 */
.adam-member-area :where(a.adam-card-link, button.adam-card-link, .adam-button-primary, .adam-button--primary):is(:link, :visited, :hover, :focus, :focus-visible, :active) {
	color: var(--adam-btn-primary-text);
	-webkit-text-fill-color: currentColor;
}

body.adam-theme-dark .adam-member-area :where(a.adam-card-link, button.adam-card-link, .adam-button-primary, .adam-button--primary):is(:link, :visited, :hover, :focus, :focus-visible, :active) {
	color: var(--adam-btn-primary-hover-text);
	-webkit-text-fill-color: currentColor;
}

/*
 * Digital card isolation boundary.
 *
 * ADAM Sócios owns this visual composition. Its stylesheet intentionally
 * consumes the legacy --adam-* names with local fallbacks; Night must not
 * change those values through inheritance. Reset only the shared inputs at
 * the component boundary so the card resolves the same authored fallbacks
 * it has in Light mode. Card-local --adam-card-* cosmetics remain untouched.
 */
body.adam-theme-dark .adam-digital-card-section {
	--adam-bg: initial;
	--adam-surface: initial;
	--adam-surface-2: initial;
	--adam-primary: initial;
	--adam-primary-hover: initial;
	--adam-primary-soft: initial;
	--adam-success-bg: initial;
	--adam-highlight: initial;
	--adam-shadow-color: initial;
	--adam-shadow: initial;
	--adam-border: initial;
	--adam-overlay: initial;
	--adam-text: initial;
	--adam-text-muted: initial;
	--adam-text-inverse: initial;
	--adam-link: initial;
	--adam-link-hover: initial;
	color-scheme: light;
}

/* ADAM BOT follows the selected website mode, not only the operating system. */
body.adam-theme-dark .adam-bot {
	--adam-accent: var(--adam-primary);
	--adam-accent-strong: var(--adam-primary-hover);
	--adam-accent-soft: var(--adam-primary-soft);
	--adam-ink: var(--adam-text);
	--adam-ink-muted: var(--adam-text-muted);
	--adam-surface: var(--adam-section-base);
	--adam-surface-soft: var(--adam-section-muted);
	--adam-surface-raised: var(--adam-section-base);
	--adam-border: var(--adam-border-strong);
	--adam-user-bubble: var(--adam-primary);
	--adam-user-text: var(--adam-on-primary);
	--adam-bot-bubble: var(--adam-section-soft);
	--adam-bot-text: var(--adam-text);
}

body.adam-theme-dark :where(.adam-bot__launcher, .adam-bot__header) {
	color: var(--adam-on-section-feature);
	background: var(--adam-section-feature);
}

body.adam-theme-dark .adam-bot__conversation {
	background: var(--adam-section-muted);
}

body.adam-theme-dark .adam-bot__message--user .adam-bot__bubble {
	color: var(--adam-on-primary);
	background: var(--adam-primary);
}
