/* =============================================================================
   ERGOTHERAPIEPRAXIS LEA FREIBOTT — Global Design System
   Version: 1.0.0
   Description: Brand tokens, typography, resets, and utility classes.
   ============================================================================= */

/* =============================================================================
   1. GOOGLE FONTS IMPORT
   ============================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* =============================================================================
   2. CSS CUSTOM PROPERTIES (BRAND TOKENS)
   ============================================================================= */
:root {
  /* --- Brand Colors --- */
  --color-primary: #FDB87D;
  /* Pastel Orange */
  --color-primary-dark: #F5A05A;
  /* Hover state for primary */
  --color-primary-light: #FDDBB5;
  /* Light tint of primary */
  --color-primary-subtle: #FEF3E8;
  /* Ultra-light tint for backgrounds */

  --color-secondary: #F4A5AE;
  /* Soft Pink */
  --color-secondary-dark: #E88895;
  /* Hover state for secondary */
  --color-secondary-light: #FAD0D4;
  /* Light tint of secondary */

  --color-accent: #8DBCB0;
  /* Muted Sage/Teal — calming accent */
  --color-accent-light: #C4DDD8;
  /* Light tint of accent */

  /* --- Neutral Palette --- */
  --color-bg: #FAF5F0;
  /* Warm Off-White / Beige */
  --color-surface: #FFFFFF;
  /* Card / Surface White */
  --color-surface-alt: #F7F0EA;
  /* Slightly warm surface alt */
  --color-border: #EDE0D4;
  /* Soft warm border */
  --color-border-light: #F5ECE4;
  /* Very subtle border */

  /* --- Text --- */
  --color-text: #2D2D2D;
  /* Dark Charcoal — primary text */
  --color-text-secondary: #6B6560;
  /* Muted secondary text */
  --color-text-light: #9B928C;
  /* Light tertiary text */
  --color-text-on-primary: #2D2D2D;
  /* Text on primary-colored backgrounds */
  --color-text-on-dark: #FAF5F0;
  /* Text on dark backgrounds */

  /* --- Semantic Colors --- */
  --color-success: #7DB88B;
  --color-warning: #F5C875;
  --color-error: #E07676;
  --color-info: #7DB0CC;

  /* --- Typography --- */
  --font-heading: 'Lora', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;

  /* Fluid type scale — clamp(min, preferred, max) */
  --text-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  /* 12–14px */
  --text-sm: clamp(0.875rem, 1.8vw, 1rem);
  /* 14–16px */
  --text-base: clamp(1rem, 2vw, 1.125rem);
  /* 16–18px */
  --text-md: clamp(1.125rem, 2.2vw, 1.25rem);
  /* 18–20px */
  --text-lg: clamp(1.25rem, 2.5vw, 1.5rem);
  /* 20–24px */
  --text-xl: clamp(1.5rem, 3vw, 1.875rem);
  /* 24–30px */
  --text-2xl: clamp(1.875rem, 4vw, 2.25rem);
  /* 30–36px */
  --text-3xl: clamp(2.25rem, 5vw, 3rem);
  /* 36–48px */
  --text-4xl: clamp(3rem, 6vw, 4rem);
  /* 48–64px */

  /* Font weights */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semi: 600;
  --fw-bold: 700;

  /* Line heights */
  --lh-tight: 1.2;
  --lh-snug: 1.4;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;
  --lh-loose: 2;

  /* Letter spacing */
  --ls-tight: -0.02em;
  --ls-normal: 0em;
  --ls-wide: 0.04em;
  --ls-wider: 0.08em;
  --ls-widest: 0.16em;

  /* --- Spacing Scale (8px grid) --- */
  --space-1: 0.25rem;
  /* 4px  */
  --space-2: 0.5rem;
  /* 8px  */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */
  --space-32: 8rem;
  /* 128px */

  /* --- Layout --- */
  --container-max: 1200px;
  --container-wide: 1400px;
  --container-sm: 720px;
  --container-pad: clamp(1rem, 5vw, 2.5rem);

  /* --- Border Radius --- */
  --radius-sm: 0.25rem;
  /* 4px  */
  --radius-md: 0.5rem;
  /* 8px  */
  --radius-lg: 1rem;
  /* 16px */
  --radius-xl: 1.5rem;
  /* 24px */
  --radius-2xl: 2rem;
  /* 32px */
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 2px rgba(45, 45, 45, 0.06);
  --shadow-sm: 0 2px 8px rgba(45, 45, 45, 0.08);
  --shadow-md: 0 4px 16px rgba(45, 45, 45, 0.10);
  --shadow-lg: 0 8px 32px rgba(45, 45, 45, 0.12);
  --shadow-xl: 0 16px 64px rgba(45, 45, 45, 0.14);
  --shadow-primary: 0 4px 20px rgba(253, 184, 125, 0.35);

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z-index Scale --- */
  --z-below: -1;
  --z-base: 0;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* --- Header --- */
  --header-height: 72px;
  --header-height-sm: 64px;

  /* --- Focus Ring --- */
  --focus-ring: 0 0 0 3px rgba(253, 184, 125, 0.6);
}

/* =============================================================================
   3. MODERN CSS RESET
   ============================================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  /* 16px base */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

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

/* Remove default list styles when lists have a role */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Better image defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* Remove all animations, transitions and smooth scroll for 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;
    scroll-behavior: auto !important;
  }
}

/* =============================================================================
   4. BASE TYPOGRAPHY
   ============================================================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  color: var(--color-text);
  letter-spacing: var(--ls-tight);
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

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

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

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-md);
}

p {
  max-width: 72ch;
  line-height: var(--lh-relaxed);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

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

strong {
  font-weight: var(--fw-semi);
}

em {
  font-style: italic;
}

/* =============================================================================
   5. FOCUS STYLES (Accessibility)
   ============================================================================= */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* =============================================================================
   6. LAYOUT UTILITIES
   ============================================================================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--sm {
  max-width: var(--container-sm);
}

/* Skip to main content link (Accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-text);
  font-weight: var(--fw-semi);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}

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

/* =============================================================================
   7. BUTTON SYSTEM
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wide);
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-spring);

  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition-fast);
  border-radius: inherit;
}

.btn:hover::after {
  background: rgba(255, 255, 255, 0.12);
}

.btn:active {
  transform: scale(0.97);
}

/* Primary Button */
.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: 0 6px 24px rgba(253, 184, 125, 0.45);
  transform: translateY(-1px);
  color: var(--color-text-on-primary);
}

/* Secondary Button */
.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-primary-subtle);
  border-color: var(--color-primary);
  color: var(--color-text);
  transform: translateY(-1px);
}

/* Ghost Button */
.btn--ghost {
  background: transparent;
  color: var(--color-primary-dark);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--color-primary-subtle);
  color: var(--color-primary-dark);
}

/* Sizes */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-md);
}

/* =============================================================================
   8. CARD SYSTEM
   ============================================================================= */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base),
    border-color var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary-light);
}

/* =============================================================================
   9. SECTION UTILITIES
   ============================================================================= */
.section {
  padding-block: var(--space-20);
}

.section--lg {
  padding-block: var(--space-32);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-12);
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-primary-dark);
  background: var(--color-primary-subtle);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
  max-width: 100%;
}

/* =============================================================================
   10. VISUAL DECORATORS
   ============================================================================= */
/* Soft gradient divider */
.divider {
  height: 1px;
  background: linear-gradient(to right,
      transparent,
      var(--color-border),
      transparent);
  border: none;
  margin-block: var(--space-8);
}

/* Decorative blob / organic shape backgrounds */
.blob-bg {
  position: relative;
  overflow: hidden;
}

.blob-bg::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-primary-subtle) 0%, transparent 70%);
  border-radius: var(--radius-full);
  pointer-events: none;
  z-index: var(--z-below);
}

/* =============================================================================
   11. ACCESSIBILITY UTILITIES
   ============================================================================= */
.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;
}

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

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

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

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

/* =============================================================================
   13. SELECTION STYLE
   ============================================================================= */
::selection {
  background: var(--color-primary-light);
  color: var(--color-text);
}

/* =============================================================================
   14. COMPREHENSIVE MOBILE OVERRIDES
   ============================================================================= */

@media (max-width: 768px) {
  /* 1. Flexbox & Grid Stacking */
  .termin-hero-grid,
  .booking-section-grid,
  .galerie-grid,
  .accessibility-grid,
  .datenschutz-layout,
  .kontakt-hero-grid,
  .praxis-grid,
  .service-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--space-6) !important;
  }

  /* 2. Kill Horizontal Overflow */
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
  }

  img:not(.site-logo img), video {
    max-width: 100% !important;
    height: auto !important;
  }
  
  iframe {
    max-width: 100% !important;
  }

  h1, h2, h3, h4, h5, h6, p, a {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* 3. Typography & White Space Scaling */
  h1 { font-size: clamp(2rem, 8vw, 2.5rem) !important; }
  h2 { font-size: clamp(1.75rem, 6vw, 2.25rem) !important; }

  .section,
  .legal-section,
  .barrierefrei-hero,
  .galerie-hero,
  .kontakt-hero,
  .termin-hero {
    padding-block: 40px !important;
  }

  /* 4. Accessible Touch Targets */
  .btn, button, input, select, summary, .toc-list a, .filter-btn, .footer-links a, .nav-links a {
    min-height: 44px;
  }
  
  /* 5. CRITICAL BRAND STANDARD ENFORCEMENT */
  .info-card,
  .booking-card,
  .access-card,
  figure,
  .galerie-item,
  .termin-hero-media,
  .kontakt-hero-media,
  .service-media {
    background: #ffffff !important;
  }
}

@media (max-width: 480px) {
  /* Extra tight constraints for small screens */
  .section,
  .legal-section,
  .barrierefrei-hero,
  .galerie-hero,
  .kontakt-hero,
  .termin-hero {
    padding-block: 32px !important;
  }
  
  .container {
    padding-inline: 16px !important;
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
}