/**
 * Base element styles -- Parenting Journal Nepal
 * Typography, links, focus states, and layout primitives built on the
 * tokens in design-tokens.css. No component or page-specific styling
 * lives here (see components.css); templates are out of scope until
 * Development Roadmap Phase 4.
 */

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-body);
	font-size: var(--text-body-size);
	line-height: var(--text-body-line);
	color: var(--color-gray-700);
	background-color: var(--color-bg);
}

h1,
h2,
h3 {
	font-family: var(--font-heading);
	font-weight: 600;
	color: var(--color-gray-900);
	margin: 0 0 var(--space-4);
}

h4,
h5,
h6 {
	font-family: var(--font-body);
	font-weight: 700;
	color: var(--color-gray-900);
	margin: 0 0 var(--space-3);
}

h1 {
	font-size: var(--text-h1-size);
	line-height: var(--text-h1-line);
}

h2 {
	font-size: var(--text-h2-size);
	line-height: var(--text-h2-line);
}

h3 {
	font-size: var(--text-h3-size);
	line-height: var(--text-h3-line);
}

h4 {
	font-size: var(--text-h4-size);
	line-height: var(--text-h4-line);
}

p {
	margin: 0 0 var(--space-4);
}

small,
.pjn-text-sm {
	font-size: var(--text-body-sm-size);
	line-height: var(--text-body-sm-line);
	color: var(--color-gray-600);
}

a {
	color: var(--color-primary-600);
	text-decoration: underline;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--color-primary-700);
}

/* Visible keyboard focus state -- WCAG 2.1 AA (Design System 5) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--color-primary-400);
	outline-offset: 2px;
}

img {
	max-width: 100%;
	height: auto;
}

/* Layout primitives */
.pjn-container {
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--space-4);
}

.pjn-article-body {
	max-width: var(--article-max);
	margin-inline: auto;
}

/* Accessibility utilities */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
	border: 0;
}

.pjn-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	background: var(--color-primary-700);
	color: #FFFFFF;
	padding: var(--space-3) var(--space-4);
	border-radius: 0 0 var(--radius-sm) 0;
	text-decoration: none;
}

.pjn-skip-link:focus {
	left: 0;
	width: auto;
	height: auto;
	clip: auto;
	overflow: visible;
}

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