/**
 * BASE STYLES
 * ===========
 *
 * Grundlegende Styles: Reset-Ergänzungen, Typografie, Links, etc.
 */

/* ============================
   RESET ERGÄNZUNGEN
   ============================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html, body {
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Smooth scroll für anchor links, aber respektiert reduced motion */
@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;
  }
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  text-decoration: none;
  border-radius: var(--radius);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ============================
   TYPOGRAFIE
   ============================ */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: var(--space-4);
}

h1, .h1 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

h2, .h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.01em;
}

h3, .h3 {
  font-size: var(--text-2xl);
}

h4, .h4 {
  font-size: var(--text-xl);
}

h5, .h5 {
  font-size: var(--text-lg);
  font-family: var(--font-accent);
  font-weight: var(--weight-semibold);
}

h6, .h6 {
  font-size: var(--text-base);
  font-family: var(--font-accent);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

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

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

/* Small Text */
small,
.small {
  font-size: var(--text-sm);
}

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

/* Muted Text */
.text-muted {
  color: var(--color-text-muted) !important;
}

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

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

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

/* Content Links (in Text) */
.content a,
article a:not(.btn) {
  text-decoration: underline;
  text-decoration-color: var(--color-secondary);
  text-underline-offset: 3px;
}

.content a:hover,
article a:not(.btn):hover {
  text-decoration-color: var(--color-primary);
}

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

ul, ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}

li {
  margin-bottom: var(--space-2);
}

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

/* Unstyled List */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}

/* Check List */
.list-check {
  padding-left: 0;
  list-style: none;
}

.list-check li {
  position: relative;
  padding-left: var(--space-6);
}

.list-check li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 1em;
  height: 1em;
  background: var(--color-secondary);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
}

/* ============================
   IMAGES
   ============================ */

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

figure {
  margin: 0;
}

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

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

::selection {
  background-color: var(--color-secondary);
  color: var(--color-primary-dark);
}

/* ============================
   UTILITY CLASSES
   ============================ */

/* Background Colors */
.bg-primary { background-color: var(--color-primary) !important; }
.bg-secondary { background-color: var(--color-secondary) !important; }
.bg-accent { background-color: var(--color-accent) !important; }
.bg-alt { background-color: var(--color-bg-alt) !important; }
.bg-dark { background-color: var(--color-bg-dark) !important; }

/* Text Colors */
.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-light { color: var(--color-text-light) !important; }
.text-inverse { color: var(--color-text-inverse) !important; }

/* Font Families */
.font-heading { font-family: var(--font-heading) !important; }
.font-body { font-family: var(--font-body) !important; }
.font-accent { font-family: var(--font-accent) !important; }

/* ============================
   ICONS
   ============================ */

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Stars */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--color-secondary);
}

.star {
  width: 1em;
  height: 1em;
}

.star-empty {
  opacity: 0.3;
}
