/**
 * Wosol Theme - CSS Reset & Base Styles
 *
 * Modern, opinionated reset. Normalizes browser defaults, sets sensible
 * base styles that inherit design tokens from variables.css, and defines
 * accessible focus states.
 */

/* =============================================
   BOX SIZING
   ============================================= */

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

/* Remove default margins/padding from all elements. */
* {
	margin: 0;
	padding: 0;
}

/* =============================================
   ROOT & BODY
   ============================================= */

html {
	font-size: 100%;                    /* 16px */
	line-height: var(--line-height-normal);
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
	scroll-behavior: smooth;
}

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

body {
	min-height: 100vh;
	font-family: var(--font-primary);
	font-size: var(--font-size-base);
	font-weight: var(--font-weight-regular);
	line-height: var(--line-height-normal);
	color: var(--color-text);
	background-color: var(--color-background);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

/* =============================================
   HEADINGS (base — full styles live in typography.css)
   ============================================= */

h1, h2, h3, h4, h5, h6 {
	font-family: inherit;
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
	color: inherit;
	margin: 0 0 var(--spacing-md);
	text-wrap: balance;
}

/* =============================================
   TEXT ELEMENTS
   ============================================= */

p {
	margin: 0 0 var(--spacing-md);
	text-wrap: pretty;
}

p:last-child {
	margin-bottom: 0;
}

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

em, i {
	font-style: italic;
}

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

mark {
	background-color: var(--color-warning-bg);
	color: inherit;
	padding: 0 var(--spacing-xs);
	border-radius: var(--radius-sm);
}

abbr[title] {
	text-decoration: underline dotted;
	cursor: help;
}

sub, sup {
	font-size: 0.75em;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

sup { top: -0.5em; }
sub { bottom: -0.25em; }

/* =============================================
   LINKS
   ============================================= */

a {
	color: var(--color-primary);
	text-decoration: none;
	background-color: transparent;
	transition: color var(--transition-fast), background-color var(--transition-fast);
}

a:hover {
	color: var(--color-primary-dark);
	text-decoration: underline;
}

a:focus {
	outline: 2px solid var(--color-secondary);
	outline-offset: 2px;
}

a:focus:not(:focus-visible) {
	outline: none;
}

a:focus-visible {
	outline: 2px solid var(--color-secondary);
	outline-offset: 2px;
}

/* =============================================
   BUTTONS (base — variants live in components.css)
   ============================================= */

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
	display: inline-block;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	background: none;
	border: none;
	cursor: pointer;
	-webkit-appearance: button;
	appearance: button;
}

button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible {
	outline: 2px solid var(--color-secondary);
	outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* =============================================
   FORMS
   ============================================= */

input,
textarea,
select {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: var(--color-text);
	background-color: var(--color-white);
	border: var(--border-width-thin) solid var(--color-border);
	border-radius: var(--radius-md);
	padding: var(--spacing-sm) var(--spacing-md);
	width: 100%;
	transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--color-secondary);
	box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.15);
}

input::placeholder,
textarea::placeholder {
	color: var(--color-text-muted);
	opacity: 1;
}

textarea {
	resize: vertical;
	min-height: 100px;
}

label {
	display: inline-block;
	font-weight: var(--font-weight-medium);
	color: var(--color-text);
	margin-bottom: var(--spacing-xs);
}

fieldset {
	border: var(--border-width-thin) solid var(--color-border);
	border-radius: var(--radius-md);
	padding: var(--spacing-md);
	margin: 0 0 var(--spacing-md);
}

legend {
	padding: 0 var(--spacing-sm);
	font-weight: var(--font-weight-semibold);
}

/* =============================================
   MEDIA
   ============================================= */

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

img,
video {
	object-fit: cover;
}

svg {
	fill: currentColor;
}

/* =============================================
   LISTS
   ============================================= */

ul, ol {
	margin: 0 0 var(--spacing-md);
	padding-left: var(--spacing-lg);
}

li {
	margin-bottom: var(--spacing-xs);
}

li:last-child {
	margin-bottom: 0;
}

ul ul,
ul ol,
ol ol,
ol ul {
	margin-top: var(--spacing-xs);
	margin-bottom: 0;
}

/* Reset list styles for navigation menus. */
nav ul,
nav ol {
	list-style: none;
	padding: 0;
	margin: 0;
}

nav li {
	margin: 0;
}

/* =============================================
   HORIZONTAL RULE
   ============================================= */

hr {
	border: 0;
	border-top: var(--border-width-thin) solid var(--color-border);
	margin: var(--spacing-xl) 0;
	height: 0;
}

/* =============================================
   TABLES
   ============================================= */

table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	margin: 0 0 var(--spacing-lg);
}

th, td {
	padding: var(--spacing-sm) var(--spacing-md);
	text-align: left;
	vertical-align: top;
	border-bottom: var(--border-width-thin) solid var(--color-border);
}

th {
	background-color: var(--color-surface);
	font-weight: var(--font-weight-semibold);
	color: var(--color-text);
}

/* =============================================
   CODE
   ============================================= */

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

code {
	padding: 2px 6px;
	background-color: var(--color-surface);
	border-radius: var(--radius-sm);
	color: var(--color-primary-dark);
}

pre {
	display: block;
	padding: var(--spacing-md);
	background-color: var(--color-surface);
	border-radius: var(--radius-md);
	overflow-x: auto;
	margin: 0 0 var(--spacing-md);
	line-height: var(--line-height-normal);
}

pre code {
	padding: 0;
	background: transparent;
}

kbd {
	padding: 2px 6px;
	background-color: var(--color-surface-alt);
	border: var(--border-width-thin) solid var(--color-border);
	border-radius: var(--radius-sm);
	font-size: 0.85em;
}

/* =============================================
   BLOCKQUOTES
   ============================================= */

blockquote {
	margin: 0 0 var(--spacing-md);
	padding: var(--spacing-md) var(--spacing-lg);
	border-left: 4px solid var(--color-primary);
	font-style: italic;
	color: var(--color-text-light);
	background-color: var(--color-surface);
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

blockquote cite {
	display: block;
	margin-top: var(--spacing-sm);
	font-size: var(--font-size-sm);
	font-style: normal;
	color: var(--color-text-muted);
}

/* =============================================
   DETAILS / SUMMARY
   ============================================= */

details {
	margin: 0 0 var(--spacing-md);
}

summary {
	cursor: pointer;
	font-weight: var(--font-weight-semibold);
}

/* =============================================
   ACCESSIBILITY HELPERS
   ============================================= */

/* Visually hidden but accessible to screen readers. */
.screen-reader-text,
.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Focus-visible for skip-links & similar. */
.screen-reader-text:focus,
.sr-only:focus {
	position: absolute !important;
	top: var(--spacing-md);
	left: var(--spacing-md);
	width: auto;
	height: auto;
	padding: var(--spacing-sm) var(--spacing-md);
	background-color: var(--color-primary);
	color: var(--color-text-inverse);
	border-radius: var(--radius-md);
	clip: auto;
	z-index: var(--z-tooltip);
	text-decoration: none;
}

/* Skip link container. */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: var(--z-tooltip);
}

.skip-link:focus {
	left: var(--spacing-md);
}

/* =============================================
   SELECTION
   ============================================= */

::selection {
	background-color: var(--color-primary);
	color: var(--color-text-inverse);
}

::-moz-selection {
	background-color: var(--color-primary);
	color: var(--color-text-inverse);
}

/* =============================================
   WORDPRESS SPECIFIC OVERRIDES
   ============================================= */

/* Ensure block editor content has consistent spacing with theme. */
.wp-block-paragraph,
.wp-block-heading {
	margin-bottom: var(--spacing-md);
}

/* WordPress alignment classes. */
.alignleft {
	float: left;
	margin: 0 var(--spacing-md) var(--spacing-md) 0;
}

.alignright {
	float: right;
	margin: 0 0 var(--spacing-md) var(--spacing-md);
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* Clear floats. */
.clearfix::after {
	content: '';
	display: block;
	clear: both;
}
