/* =========================================================
 * PsalMix Blog — Base Layer
 * Resets, body, typography, links, prose defaults.
 * ========================================================= */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	background: var(--psx-bg);
	color-scheme: light;
}
[data-theme="dark"] html { color-scheme: dark; }

body,
body.wp-theme-kadence,
body.wp-child-theme-psalmix-blog {
	margin: 0;
	min-height: 100vh;
	background: var(--psx-bg) !important;
	color: var(--psx-text-secondary) !important;
	font-family: var(--psx-font-sans) !important;
	font-size: var(--psx-text-md);
	line-height: var(--psx-leading-relaxed);
	font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
	overflow-x: hidden;
}

/* Kadence wraps content in #wrapper / .site / .content-area — force inherits */
.wp-site-blocks,
#wrapper, .site, .content-area, .site-main, .entry-content,
.site-container, .site-content {
	background: transparent !important;
	color: inherit !important;
}

/* Kill Kadence's default header/footer wrappers since we use our own */
#masthead, #colophon { display: none !important; }

/* Clean — no body wash. Background is pure --psx-bg. */
.site, .psx-header, .psx-footer, main {
	position: relative;
	z-index: var(--psx-z-base);
}

/* ── Headings ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--psx-font-sans);
	color: var(--psx-text);
	letter-spacing: var(--psx-tracking-tight);
	line-height: var(--psx-leading-tight);
	margin: 0 0 var(--psx-space-md);
	font-weight: 800;
	text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 4.5vw, 3.25rem); letter-spacing: var(--psx-tracking-tighter); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.375rem); font-weight: 750; }
h3 { font-size: var(--psx-text-2xl); font-weight: 700; }
h4 { font-size: var(--psx-text-xl); font-weight: 700; }
h5 { font-size: var(--psx-text-lg); font-weight: 600; }
h6 {
	font-size: var(--psx-text-xs);
	font-weight: 700;
	letter-spacing: var(--psx-tracking-widest);
	text-transform: uppercase;
	color: var(--psx-accent);
}

p {
	margin: 0 0 var(--psx-space-md);
	color: var(--psx-text-tertiary);
	text-wrap: pretty;
}

/* ── Links ───────────────────────────────────────────── */
a {
	color: var(--psx-accent);
	text-decoration: none;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color var(--psx-duration-base) var(--psx-ease);
}
a:hover {
	color: var(--psx-accent-hover);
	text-decoration: underline;
	text-decoration-color: var(--psx-accent-light);
}
a:focus-visible {
	outline: none;
	box-shadow: var(--psx-focus-ring);
	border-radius: var(--psx-radius-xs);
}

strong, b { color: var(--psx-text); font-weight: 700; }
em, i { color: var(--psx-text-secondary); }

ul, ol {
	margin: 0 0 var(--psx-space-md);
	padding-left: var(--psx-space-lg);
}
li {
	margin-bottom: var(--psx-space-xs);
	color: var(--psx-text-tertiary);
}
li::marker { color: var(--psx-accent); }

blockquote {
	margin: var(--psx-space-2xl) 0;
	padding: var(--psx-space-lg) var(--psx-space-xl);
	border-left: 3px solid var(--psx-accent);
	background: var(--psx-accent-soft);
	border-radius: 0 var(--psx-radius-md) var(--psx-radius-md) 0;
	color: var(--psx-text-secondary);
	font-style: italic;
	font-size: var(--psx-text-lg);
	line-height: var(--psx-leading-snug);
}
blockquote p:last-child { margin-bottom: 0; }
blockquote cite {
	display: block;
	margin-top: var(--psx-space-sm);
	font-size: var(--psx-text-sm);
	color: var(--psx-text-muted);
	font-style: normal;
}

hr {
	border: none;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--psx-border-secondary), transparent);
	margin: var(--psx-space-2xl) 0;
}

code, kbd, samp, pre { font-family: var(--psx-font-mono); font-size: 0.92em; }
code {
	padding: 0.15em 0.4em;
	background: var(--psx-surface-alt);
	border: 1px solid var(--psx-border);
	border-radius: var(--psx-radius-xs);
	color: var(--psx-accent);
}
pre {
	background: var(--psx-surface-alt);
	border: 1px solid var(--psx-border);
	border-radius: var(--psx-radius-md);
	padding: var(--psx-space-lg);
	overflow-x: auto;
	margin: 0 0 var(--psx-space-lg);
	color: var(--psx-text-secondary);
	line-height: var(--psx-leading-snug);
}
pre code { padding: 0; background: transparent; border: none; color: inherit; }

img, video, iframe, svg {
	max-width: 100%;
	height: auto;
	display: block;
}

figure { margin: var(--psx-space-xl) 0; }
figcaption {
	margin-top: var(--psx-space-sm);
	font-size: var(--psx-text-sm);
	color: var(--psx-text-muted);
	text-align: center;
	font-style: italic;
}

/* ── Tables ──────────────────────────────────────────── */
table {
	width: 100%;
	border-collapse: collapse;
	margin: var(--psx-space-xl) 0;
	font-size: var(--psx-text-sm);
}
th, td {
	padding: var(--psx-space-sm) var(--psx-space-md);
	text-align: left;
	border-bottom: 1px solid var(--psx-border);
}
th {
	font-weight: 700;
	color: var(--psx-text);
	background: var(--psx-surface-alt);
}
tr:hover td { background: var(--psx-accent-soft); }

::selection {
	background: var(--psx-accent);
	color: #fff;
}

/* ── Layout containers ───────────────────────────────── */
.psx-container {
	width: 100%;
	max-width: var(--psx-page-max);
	margin: 0 auto;
	padding-inline: clamp(var(--psx-space-md), 4vw, var(--psx-space-2xl));
}
.psx-container--wide  { max-width: var(--psx-wide-max); }
.psx-container--prose { max-width: var(--psx-content-max); }

/* ── Skip link ───────────────────────────────────────── */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.psx-skip-link {
	position: absolute;
	top: -100px; left: var(--psx-space-md);
	z-index: var(--psx-z-modal);
	padding: var(--psx-space-sm) var(--psx-space-md);
	background: var(--psx-accent);
	color: #fff;
	border-radius: var(--psx-radius-sm);
	font-weight: 600;
	transition: top var(--psx-duration-base) var(--psx-ease);
}
.psx-skip-link:focus {
	top: var(--psx-space-md);
	color: #fff;
	text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
