/**
 * SpacePanel UI — Base Styles
 *
 * Reset, Body, Typografie, Links, Formulare.
 * Referenziert ausschließlich Tokens aus tokens.css.
 */

/* ===========================
   Reset
   =========================== */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 100%;
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

ul,
ol {
	list-style: none;
}

a {
	text-decoration: none;
	color: inherit;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* ===========================
   Body
   =========================== */
body {
	font-family: var(--sp-font-base);
	font-size: var(--sp-text-base);
	font-weight: var(--sp-weight-medium);
	line-height: var(--sp-leading-normal);
	letter-spacing: 0.02em;
	color: var(--sp-color-text);
	background-color: var(--sp-color-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Typografie
   =========================== */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--sp-font-heading);
	font-weight: var(--sp-weight-bold);
	line-height: var(--sp-leading-tight);
	color: var(--sp-color-text-heading);
	margin-bottom: var(--sp-space-sm);
}

h1 {
	font-size: var(--sp-text-4xl);
}

h2 {
	font-size: var(--sp-text-3xl);
}

h3 {
	font-size: var(--sp-text-2xl);
}

h4 {
	font-size: var(--sp-text-xl);
}

h5 {
	font-size: var(--sp-text-lg);
}

h6 {
	font-size: var(--sp-text-md);
}

p {
	margin-bottom: var(--sp-space-md);
	font-family: var(--sp-font-base);
}

p:last-child {
	margin-bottom: 0;
}

/* Sicherstellen dass Antonio überall greift */
li, td, th, dd, dt, label, span, div,
.entry-content, .entry-content p,
.entry-content li, .entry-content td,
.sp-content, .sp-content p,
.sp-content li, .sp-content td,
.sp-article-content, .sp-article-content p {
	font-family: var(--sp-font-base);
}

strong, b {
	font-weight: var(--sp-weight-semibold);
}

small {
	font-size: var(--sp-text-sm);
}

blockquote {
	border-left: 3px solid var(--sp-color-accent);
	padding-left: var(--sp-space-md);
	margin: var(--sp-space-lg) 0;
	color: var(--sp-color-text-muted);
	font-style: italic;
}

code, kbd, samp, pre {
	font-family: var(--sp-font-mono);
	font-size: var(--sp-text-sm);
}

code {
	background-color: var(--sp-color-panel);
	padding: var(--sp-space-2xs) var(--sp-space-xs);
	border-radius: var(--sp-radius-sm);
	color: var(--sp-color-accent);
}

pre {
	background-color: var(--sp-color-panel);
	padding: var(--sp-space-md);
	border-radius: var(--sp-radius-panel);
	overflow-x: auto;
	margin-bottom: var(--sp-space-lg);
	border: 1px solid var(--sp-color-panel-border);
}

pre code {
	background: none;
	padding: 0;
	border-radius: 0;
}

hr {
	border: none;
	height: 1px;
	background-color: var(--sp-color-divider);
	margin: var(--sp-space-xl) 0;
}

/* ===========================
   Links
   =========================== */
.sp-content a,
.entry-content a {
	color: var(--sp-color-link);
	text-decoration: underline;
	text-decoration-color: var(--sp-color-accent-muted);
	text-underline-offset: 2px;
	transition: color var(--sp-transition-fast),
	            text-decoration-color var(--sp-transition-fast);
}

.sp-content a:hover,
.entry-content a:hover {
	color: var(--sp-color-link-hover);
	text-decoration-color: var(--sp-color-link-hover);
}

.sp-content a:focus-visible,
.entry-content a:focus-visible {
	outline: 2px solid var(--sp-color-accent);
	outline-offset: 2px;
	border-radius: var(--sp-radius-sm);
}

/* ===========================
   Listen (innerhalb Content)
   =========================== */
.sp-content ul,
.entry-content ul {
	list-style: disc;
	padding-left: var(--sp-space-lg);
	margin-bottom: var(--sp-space-md);
}

.sp-content ol,
.entry-content ol {
	list-style: decimal;
	padding-left: var(--sp-space-lg);
	margin-bottom: var(--sp-space-md);
}

.sp-content li,
.entry-content li {
	margin-bottom: var(--sp-space-xs);
}

/* ===========================
   Formulare — Basis
   =========================== */
label {
	display: block;
	font-size: var(--sp-text-sm);
	font-weight: var(--sp-weight-medium);
	color: var(--sp-color-text-muted);
	margin-bottom: var(--sp-space-2xs);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
	width: 100%;
	padding: var(--sp-space-xs) var(--sp-space-sm);
	background-color: var(--sp-color-surface);
	border: 1px solid var(--sp-color-panel-border);
	border-radius: var(--sp-radius-md);
	color: var(--sp-color-text);
	font-size: var(--sp-text-base);
	transition: border-color var(--sp-transition-fast),
	            box-shadow var(--sp-transition-fast);
}

input:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--sp-color-accent);
	box-shadow: 0 0 0 2px var(--sp-color-accent-muted);
}

textarea {
	min-height: 120px;
	resize: vertical;
}

/* ===========================
   Accessibility
   =========================== */
:focus-visible {
	outline: 2px solid var(--sp-color-accent);
	outline-offset: 2px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--sp-color-panel);
	clip: auto !important;
	clip-path: none;
	color: var(--sp-color-accent);
	display: block;
	font-size: var(--sp-text-sm);
	font-weight: var(--sp-weight-semibold);
	height: auto;
	left: var(--sp-space-xs);
	padding: var(--sp-space-sm) var(--sp-space-lg);
	text-decoration: none;
	top: var(--sp-space-xs);
	width: auto;
	z-index: var(--sp-z-modal);
}

/* ===========================
   Selection
   =========================== */
::selection {
	background-color: var(--sp-color-accent-muted);
	color: var(--sp-color-text-heading);
}

/* ===========================
   Scrollbar (Console-Stil)
   =========================== */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: var(--sp-color-bg);
}

::-webkit-scrollbar-thumb {
	background: var(--sp-color-plum);
	border-radius: var(--sp-radius-endcap);
}

::-webkit-scrollbar-thumb:hover {
	background: var(--sp-color-lavender);
}
