/* =================================================================
   MODERN CSS RESET & BASE STYLES
   Spielmannszug Rhede 2025 - Mobile First
   ================================================================= */

/* === CSS RESET === */
/* Moderne, performance-optimierte Reset-Regeln */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* Mobile-first font size */
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic Viewport Height für moderne Browser */
  overflow-x: hidden;
}

/* === TYPOGRAPHY RESET === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-gray-900);
  margin: 0;
}

h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

h5, h6 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

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

/* === LISTS === */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  margin: 0;
}

/* Content Lists (mit Style) */
.content ul {
  list-style-type: disc;
  margin-left: var(--space-5);
  margin-bottom: var(--space-4);
}

.content ol {
  list-style-type: decimal;
  margin-left: var(--space-5);
  margin-bottom: var(--space-4);
}

.content li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

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

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

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

/* === IMAGES === */
img {
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: var(--radius-md);
}

/* === FORMS === */
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

input,
textarea,
select {
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(52, 98, 63, 0.1);
}

/* === TABLES === */
table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-gray-200);
}

th {
  font-weight: var(--font-semibold);
  background-color: var(--color-gray-50);
}

/* === UTILITY CLASSES === */
.visually-hidden {
  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;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* === RESPONSIVE UTILITIES === */
/* Hide/Show auf verschiedenen Breakpoints */
.mobile-only {
  display: block;
}

.tablet-up {
  display: none;
}

.desktop-up {
  display: none;
}

@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }
  
  .tablet-up {
    display: block;
  }
}

@media (min-width: 992px) {
  .desktop-up {
    display: block;
  }
  
  .tablet-up.desktop-hidden {
    display: none;
  }
}

/* === LAYOUT HELPERS === */
.page-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding-bottom: var(--bottom-nav-height); /* Platz für Bottom Navigation */
}

/* Desktop: Kein Bottom Navigation Padding */
@media (min-width: 768px) {
  .main-content {
    padding-bottom: 0;
  }
}

/* === ACCESSIBILITY === */
/* Respektiert Nutzer-Präferenzen für Animationen */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #2a4f32;
    --color-primary-light: #1a3d26;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  }
}