/**
 * JSYK Astra – Base Styles
 *
 * Document defaults, box model, typography baseline, links,
 * media, focus states, accessibility utilities, and
 * reduced-motion support.
 *
 * Does NOT aggressively reset Astra or Elementor.
 * Uses design tokens from tokens.css exclusively.
 *
 * @since 0.2.0
 */

/* ==========================================================================
   1. BOX MODEL
   ========================================================================== */

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

/* ==========================================================================
   2. DOCUMENT DEFAULTS
   ========================================================================== */

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--jsyk-font-body);
	font-size: var(--jsyk-text-base);
	font-weight: var(--jsyk-weight-normal);
	line-height: var(--jsyk-leading-relaxed);
	color: var(--jsyk-color-text);
	background-color: var(--jsyk-color-bg);
	overflow-x: hidden;
}

/* ==========================================================================
   3. TYPOGRAPHY BASELINE
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
	margin-block-start: 0;
	margin-block-end: var(--jsyk-space-4);
	font-family: var(--jsyk-font-heading);
	font-weight: var(--jsyk-weight-bold);
	line-height: var(--jsyk-leading-tight);
	letter-spacing: var(--jsyk-tracking-tight);
	color: var(--jsyk-color-heading);
}

h1 { font-size: var(--jsyk-text-3xl); }
h2 { font-size: var(--jsyk-text-2xl); }
h3 { font-size: var(--jsyk-text-xl);  }
h4 { font-size: var(--jsyk-text-lg);  }
h5 { font-size: var(--jsyk-text-md);  }
h6 { font-size: var(--jsyk-text-base); font-weight: var(--jsyk-weight-semibold); }

p {
	margin-block-start: 0;
	margin-block-end: var(--jsyk-space-4);
}

small {
	font-size: var(--jsyk-text-sm);
}

strong, b {
	font-weight: var(--jsyk-weight-semibold);
}

/* ==========================================================================
   4. LINKS
   ========================================================================== */

a {
	color: var(--jsyk-color-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
	transition: color var(--jsyk-transition);
}

a:hover {
	color: var(--jsyk-color-accent-hover);
}

/* ==========================================================================
   5. IMAGES & MEDIA
   ========================================================================== */

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

img {
	border-style: none;
}

figure {
	margin: 0 0 var(--jsyk-space-6);
}

figcaption {
	margin-block-start: var(--jsyk-space-2);
	font-size: var(--jsyk-text-sm);
	color: var(--jsyk-color-text-muted);
}

/* ==========================================================================
   6. LISTS
   ========================================================================== */

ul, ol {
	padding-inline-start: var(--jsyk-space-6);
	margin-block-start: 0;
	margin-block-end: var(--jsyk-space-4);
}

li {
	margin-block-end: var(--jsyk-space-1);
}

li::marker {
	color: var(--jsyk-color-text-muted);
}

/* ==========================================================================
   7. CODE
   ========================================================================== */

code, kbd, samp, pre {
	font-family: var(--jsyk-font-mono);
	font-size: 0.9em;
}

code {
	padding: 0.15em 0.35em;
	background-color: var(--jsyk-color-code-bg);
	color: var(--jsyk-color-code-text);
	border-radius: var(--jsyk-radius-sm);
}

pre {
	overflow-x: auto;
	padding: var(--jsyk-space-4);
	background-color: var(--jsyk-color-code-bg);
	border-radius: var(--jsyk-radius-md);
	margin-block-end: var(--jsyk-space-6);
}

pre code {
	padding: 0;
	background: none;
	border-radius: 0;
}

/* ==========================================================================
   8. HORIZONTAL RULE
   ========================================================================== */

hr {
	border: none;
	border-block-start: 1px solid var(--jsyk-color-border);
	margin-block: var(--jsyk-space-8);
}

/* ==========================================================================
   9. SELECTION
   ========================================================================== */

::selection {
	background-color: var(--jsyk-color-accent);
	color: var(--jsyk-color-accent-contrast);
}

/* ==========================================================================
   10. FORM BASELINE
   ========================================================================== */

input, button, textarea, select {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

fieldset {
	border: 1px solid var(--jsyk-color-border);
	padding: var(--jsyk-space-4);
	margin: 0 0 var(--jsyk-space-4);
}

legend {
	font-weight: var(--jsyk-weight-semibold);
	padding-inline: var(--jsyk-space-2);
}

/* ==========================================================================
   11. ACCESSIBLE FOCUS
   ========================================================================== */

:focus-visible {
	outline: 2px solid var(--jsyk-color-focus-ring);
	outline-offset: 2px;
	border-radius: var(--jsyk-radius-sm);
}

/* Don't show focus ring on mouse click (browsers supporting :focus-visible) */
:focus:not(:focus-visible) {
	outline: none;
}

/* ==========================================================================
   12. SKIP LINK
   ========================================================================== */

.jsyk-skip-link {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	background: var(--jsyk-color-accent);
	color: var(--jsyk-color-accent-contrast);
	font-size: var(--jsyk-text-sm);
	font-weight: var(--jsyk-weight-semibold);
	text-decoration: none;
	z-index: 100000;
}

.jsyk-skip-link:focus {
	position: fixed !important;
	top: var(--jsyk-space-2) !important;
	left: var(--jsyk-space-2) !important;
	width: auto !important;
	height: auto !important;
	padding: var(--jsyk-space-2) var(--jsyk-space-4) !important;
	margin: 0 !important;
	overflow: visible !important;
	clip: auto !important;
	white-space: normal !important;
	border-radius: var(--jsyk-radius-md);
	outline: 2px solid var(--jsyk-color-focus-ring);
	outline-offset: 2px;
}

/* ==========================================================================
   13. SCREEN READER ONLY
   ========================================================================== */

.jsyk-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   14. REDUCED MOTION
   ========================================================================== */

@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;
	}

	html {
		scroll-behavior: auto;
	}
}

/* ==========================================================================
   15. TABLE BASELINE
   ========================================================================== */

table {
	border-collapse: collapse;
	border-spacing: 0;
	width: 100%;
}

th, td {
	text-align: start;
	vertical-align: top;
}
