/* ==========================================================================
   AllWispr - CSS Reset + Typography
   Mobile-first Base Styles
   ========================================================================== */

/* ------------------------------------------------------------------
   RESET (Modern CSS Reset - inspiriert von Andy Bell)
   ------------------------------------------------------------------ */

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

html {
    font-size: 100%; /* 16px Basis */
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

/* Bilder & Medien */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Formulare erben Schrift */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Listen-Reset */
ul,
ol {
    list-style: none;
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

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

/* Textauswahl */
::selection {
    background-color: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-text);
}

/* Scrollbar (Webkit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ------------------------------------------------------------------
   TYPOGRAPHY
   ------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.03em;
}

h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

/* Responsive Headings */
@media (min-width: 768px) {
    h1 { font-size: var(--font-size-4xl); }
    h2 { font-size: var(--font-size-3xl); }
    h3 { font-size: var(--font-size-2xl); }
}

@media (min-width: 1024px) {
    h1 { font-size: var(--font-size-5xl); }
    h2 { font-size: var(--font-size-3xl); }
}

/* Paragraphen */
p {
    margin-bottom: var(--space-4);
    line-height: var(--line-height-normal);
}

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

.lead {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-light);
    font-weight: var(--font-weight-normal);
}

@media (min-width: 768px) {
    .lead {
        font-size: var(--font-size-xl);
    }
}

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

.text-xs {
    font-size: var(--font-size-xs);
}

/* Text Styling */
strong,
b {
    font-weight: var(--font-weight-semibold);
}

em,
i {
    font-style: italic;
}

mark {
    background-color: rgba(var(--color-warning-rgb), 0.3);
    padding: 0.1em 0.3em;
    border-radius: var(--radius-sm);
}

code {
    font-family: var(--font-family-mono);
    font-size: 0.875em;
    background-color: var(--color-bg-alt);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--color-accent);
}

pre {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    background-color: var(--color-bg-dark);
    color: var(--color-bg);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: var(--space-6);
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

blockquote {
    border-left: 4px solid var(--color-primary);
    padding: var(--space-4) var(--space-6);
    margin: var(--space-6) 0;
    background-color: rgba(var(--color-primary-rgb), 0.04);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

blockquote p {
    font-size: var(--font-size-md);
    color: var(--color-text-light);
    font-style: italic;
}

/* Horizontal Rule */
hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-8) 0;
}

/* ------------------------------------------------------------------
   TEXT UTILITIES
   ------------------------------------------------------------------ */

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent    { color: var(--color-accent); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-error     { color: var(--color-error); }
.text-muted     { color: var(--color-text-muted); }
.text-light     { color: var(--color-text-light); }
.text-white     { color: var(--color-white); }

.font-light     { font-weight: var(--font-weight-light); }
.font-normal    { font-weight: var(--font-weight-normal); }
.font-medium    { font-weight: var(--font-weight-medium); }
.font-semibold  { font-weight: var(--font-weight-semibold); }
.font-bold      { font-weight: var(--font-weight-bold); }

.uppercase      { text-transform: uppercase; }
.lowercase      { text-transform: lowercase; }
.capitalize     { text-transform: capitalize; }

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ------------------------------------------------------------------
   SPACING UTILITIES
   ------------------------------------------------------------------ */

.mt-0  { margin-top: 0; }
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.py-4  { padding-top: var(--space-4);  padding-bottom: var(--space-4); }
.py-6  { padding-top: var(--space-6);  padding-bottom: var(--space-6); }
.py-8  { padding-top: var(--space-8);  padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-16 { padding-top: var(--space-16); padding-bottom: var(--space-16); }

.px-4  { padding-left: var(--space-4);  padding-right: var(--space-4); }
.px-6  { padding-left: var(--space-6);  padding-right: var(--space-6); }

/* ------------------------------------------------------------------
   VISIBILITY
   ------------------------------------------------------------------ */

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

.hidden {
    display: none !important;
}

.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}
