/* ==========================================================================
   base.css - Perls Holzschmiede
   Reset, Custom Properties, Typografie
   Standard-Theme: "Natur" (warme Erdtoene)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties (CSS-Variablen)
   Alle Farben und Designwerte werden hier zentral definiert.
   Themes ueberschreiben diese Werte via [data-theme="X"] Selektor.
   -------------------------------------------------------------------------- */

:root {
  /* --- Farben: Natur-Theme (Standard) --- */
  --color-primary: #8B6914;
  --color-primary-light: #A88A3D;
  --color-primary-dark: #6B4F0E;
  --color-secondary: #2D5016;
  --color-secondary-light: #3D6B20;
  --color-secondary-dark: #1E3A0E;
  --color-accent: #D4A017;
  --color-accent-light: #E4B84A;
  --color-accent-dark: #B08512;

  --color-bg: #FAF6F0;
  --color-bg-alt: #F0E8D8;
  --color-text: #2C1810;
  --color-text-light: #5C4033;
  --color-text-muted: #8B7355;
  --color-border: #D4C5A9;
  --color-surface: #FFFFFF;
  --color-surface-hover: #F5F0E6;

  --color-success: #2D7A3A;
  --color-error: #B33A3A;
  --color-warning: #C68A17;

  /* --- Typografie --- */
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', Consolas, monospace;

  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */

  --line-height-tight: 1.25;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* --- Abstands-Skala (Spacing) --- */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */

  /* --- Rahmen (Border Radius) --- */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-full: 9999px;

  /* --- Schatten --- */
  --shadow-sm: 0 1px 2px rgba(44, 24, 16, 0.06);
  --shadow-md: 0 4px 6px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 10px 20px rgba(44, 24, 16, 0.1);
  --shadow-xl: 0 20px 40px rgba(44, 24, 16, 0.14);

  /* --- Uebergaenge (Transitions) --- */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* --- Z-Index Skala --- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* --- Layout --- */
  --container-max: 1200px;
  --header-height: 4rem;
  --theme-bar-height: 2.5rem;
}


/* ==========================================================================
   CSS Reset
   Einheitliche Grundlage fuer alle Browser
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

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

/* Button-Reset */
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Input-Reset */
input,
textarea,
select {
  font: inherit;
  color: inherit;
}


/* ==========================================================================
   Typografie
   Ueberschriften, Fliesstext, Links
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  font-weight: 700;
}

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

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

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

h4 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

h5 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

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

p {
  margin-bottom: var(--space-md);
}

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

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

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

/* Hervorhebungen */
strong, b {
  font-weight: 700;
}

em, i {
  font-style: italic;
}

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

/* Code (Inline) */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-bg-alt);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

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

/* Horizontale Linie */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}


/* ==========================================================================
   Textauswahl (Selection)
   ========================================================================== */

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

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


/* ==========================================================================
   Barrierefreiheit (Accessibility)
   ========================================================================== */

/* Visuell versteckt, aber fuer Screenreader zugaenglich */
.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;
}

/* Focus-Stile fuer Tastaturnavigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduzierte Bewegung respektieren */
@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;
  }
}
