/* ========================================
   MODERN CSS RESET & BASE STYLES
   MysteryErlebnis Foundation
   ======================================== */

/* ======================================== 
   BOX SIZING & SMOOTH SCROLL 
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  width: 100%;
  overflow-x: hidden; /* harte Kante: kein horizontales Scrollen */
  overscroll-behavior-x: none; /* verhindert horizontales Panning/Swipe-Navigation */
}

/* ======================================== 
   BODY DEFAULTS 
   ======================================== */
body {
  min-height: 100vh;
  line-height: var(--leading-normal);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--color-gray-900);
  background-color: var(--color-secondary);
  overflow-x: hidden;
  overscroll-behavior-x: none; /* Safety: keine horizontale Scrollverkettung */
  position: relative;
  width: 100%;
  touch-action: pan-y; /* verhindert horizontales Panning auf Touch-Geräten */
}

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

p {
  line-height: var(--leading-relaxed);
}

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

em, i {
  font-style: italic;
}

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

/* ======================================== 
   LINKS 
   ======================================== */
a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-base);
}

a:hover {
  opacity: 0.8;
}

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

img {
  font-style: italic;
  background-repeat: no-repeat;
  background-size: cover;
  shape-margin: 0.75rem;
  vertical-align: middle;
}

/* ======================================== 
   FORMS 
   ======================================== */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Autofill Styles */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-gray-900);
  -webkit-box-shadow: 0 0 0px 1000px var(--color-secondary) inset;
  transition: background-color 5000s ease-in-out 0s;
}

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

/* ======================================== 
   DETAILS/SUMMARY 
   ======================================== */
details summary {
  cursor: pointer;
  user-select: none;
}

details summary::-webkit-details-marker {
  display: none;
}

/* ======================================== 
   SELECTION 
   ======================================== */
::selection {
  background-color: var(--color-primary);
  color: var(--color-secondary);
}

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

/* ======================================== 
   FOCUS VISIBLE 
   ======================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* ======================================== 
   UTILITY CLASSES 
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

/* ======================================== 
   SCROLLBAR STYLING 
   ======================================== */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-gray-100);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--color-gray-100);
}
