/**
 * Psy Theme — Scoped Reset
 *
 * Neutralizes theme defaults INSIDE plugin/theme containers only.
 * NEVER touches body/html or shared layout — only descendants of `.psy-*` roots.
 *
 * All aggressive selectors are wrapped in `:where()` so their specificity is 0.
 * Component CSS (.psy-home__title, .psy-account__nav-link, etc.) wins by
 * default; the reset only fills in when the component sets nothing.
 *
 * Load AFTER tokens.css, BEFORE components.css.
 */

/* =========================================================
   Root containers — each plugin surface gets a clean slate
========================================================= */
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-header, .psy-footer, .psy-search, .psy-auth, .psy-section) {
	font-family: var(--font-body);
	color: var(--color-text);
	box-sizing: border-box;
	line-height: var(--text-body-lh);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* =========================================================
   Box-sizing on all descendants — zero specificity so anything wins
========================================================= */
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-header, .psy-footer, .psy-search, .psy-auth, .psy-section) *,
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-header, .psy-footer, .psy-search, .psy-auth, .psy-section) *::before,
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-header, .psy-footer, .psy-search, .psy-auth, .psy-section) *::after {
	box-sizing: border-box;
}

/* =========================================================
   Typography — neutralize theme heading/p defaults
========================================================= */
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-section) :where(h1, h2, h3, h4, h5, h6) {
	margin: 0;
	font-weight: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	letter-spacing: inherit;
	text-transform: none;
}

:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-section) :where(p) {
	margin: 0;
	color: inherit;
}

:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-section) :where(ul, ol) {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* =========================================================
   Links — neutralize theme link defaults
========================================================= */
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-section) :where(a) {
	color: inherit;
	text-decoration: none;
	background: none;
	border: 0;
}

:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-section) :where(a:hover) {
	text-decoration: none;
	background: none;
}

/* =========================================================
   Buttons — targeted properties only, NEVER `all: unset`
========================================================= */
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-search, .psy-auth, .psy-header, .psy-section) :where(button) {
	background: transparent;
	border: 0;
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	line-height: inherit;
	cursor: pointer;
	box-sizing: border-box;
}

/* =========================================================
   Form fields — kill theme defaults
========================================================= */
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-section) :where(input, textarea, select) {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	background: transparent;
	border: 0;
	outline: 0;
	margin: 0;
	box-sizing: border-box;
}

/* =========================================================
   Images / media — fluid by default
========================================================= */
:where(.psy-home, .psy-explore, .psy-account, .psy-single, .psy-route, .psy-section) :where(img, svg, video) {
	display: block;
	max-width: 100%;
	height: auto;
}

/* =========================================================
   Hide non-plugin headers/footers when plugin header is active.
   This rule kept its `!important` on purpose: theme/Elementor
   headers may use high-specificity selectors that wouldn't lose
   to a `:where()` zero-specificity hide.
========================================================= */
body.psy-has-header .elementor-location-header,
body.psy-has-header > header:not(.psy-header),
body.psy-has-header .site-header {
	display: none !important;
}
