/**
 * OYROPA Reset & Normalize
 * Moderne CSS Reset kombiniert mit Normalize-Prinzipien
 * Version 1.0
 */

/* ================================ */
/* MODERN CSS RESET                */
/* ================================ */

/* Box-sizing für alle Elemente */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Entfernung von Standard-Margins */
* {
  margin: 0;
}

/* Bessere Typografie & Accessibility */
html {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* Körper-Reset */
body {
  line-height: inherit;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--gray-900);
  background-color: var(--oyropa-white);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  text-rendering: optimizeSpeed;
}

/* Media-Elemente responsive machen */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Input- und Form-Elemente normalisieren */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Buttons normalieren */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Text-Overflow für lange Texte */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Liste-Stile entfernen wo nötig */
ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

/* Link-Stile normalisieren */
a {
  color: inherit;
  text-decoration: inherit;
}

/* Table-Reset */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Fieldset-Reset */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Legend-Reset */
legend {
  padding: 0;
}

/* ================================ */
/* FOCUS & ACCESSIBILITY            */
/* ================================ */

/* Entfernung von Standard-Outline, ersetzt durch Custom Focus */
*:focus {
  outline: none;
}

/* Custom Focus-Ring für Keyboard-Navigation */
*:focus-visible {
  outline: 2px solid var(--oyropa-gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Screen Reader Support */
.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;
}

/* ================================ */
/* REDUCED MOTION                   */
/* ================================ */

/* Respektiere Benutzer-Präferenzen für reduzierte Bewegung */
@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;
    scroll-behavior: auto !important;
  }
}

/* ================================ */
/* HIGH CONTRAST SUPPORT            */
/* ================================ */

@media (prefers-contrast: high) {
  * {
    border-color: currentColor;
  }
}

/* ================================ */
/* PRINT OPTIMIERUNG                */
/* ================================ */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }

  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

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

/* Visually Hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip Link für Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--oyropa-navy);
  color: var(--oyropa-white);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: var(--z-max);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}

/* Clearfix (falls benötigt für Legacy-Support) */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

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

/* Responsive Images mit korrektem Aspect Ratio */
.responsive-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Image Container für Aspect Ratios */
.image-container {
  position: relative;
  overflow: hidden;
}

.image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Standard Aspect Ratios */
.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-photo {
  aspect-ratio: 4 / 3;
}

/* ================================ */
/* SAFE AREA SUPPORT (Mobile)      */
/* ================================ */

/* iOS Safe Area Support */
.safe-area-inset-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-inset-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-inset-left {
  padding-left: env(safe-area-inset-left);
}

.safe-area-inset-right {
  padding-right: env(safe-area-inset-right);
}