/* ==========================================================================
   BUREAU PREIS — DESIGN SYSTEM v4.0 (Clean CSS, No Inline Styles)
   ========================================================================== */

/* ==========================================================================
   1. TOKENS & VARIABLES
   ========================================================================== */
:root {
  /* --- BRAND CORE --- */
  --brand-h: 212;     /* Hue */
  --brand-s: 47%;     /* Saturation */
  --brand-l: 23%;     /* Lightness */

  /* --- COLORS (Generated) --- */
  --c-brand: hsl(var(--brand-h) var(--brand-s) var(--brand-l));
  --c-white: #ffffff;
  --c-black: #050505;

  /* --- SEMANTIC COLORS --- */
  --c-info:    hsl(var(--brand-h) 80% 60%);
  --c-success: hsl(calc(var(--brand-h) + 270) 60% 50%);
  --c-warning: hsl(calc(var(--brand-h) + 180) 80% 60%);
  --c-danger:  hsl(calc(var(--brand-h) + 150) 70% 55%);

  /* --- SEMANTIC BACKGROUNDS (Alpha) --- */
  --c-info-bg:    hsla(var(--brand-h) 80% 60% / 0.14);
  --c-success-bg: hsla(calc(var(--brand-h) + 270) 60% 50% / 0.14);
  --c-warning-bg: hsla(calc(var(--brand-h) + 180) 80% 60% / 0.14);
  --c-danger-bg:  hsla(calc(var(--brand-h) + 150) 70% 55% / 0.14);

  /* --- THEME DEFAULT (Dark Mode) --- */
  --theme-bg:      var(--c-brand);
  --theme-text:    rgba(255, 255, 255, 0.75);
  --theme-heading: #ffffff;
  --theme-link:    #ffffff;
  --theme-border:  rgba(255, 255, 255, 0.15);
  --theme-surface: rgba(255, 255, 255, 0.06);
  --theme-hover:   rgba(255, 255, 255, 0.10);

  /* --- SPACING SCALE --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 5rem; /* Sektions-Abstand */
  --space-8: 8rem; /* Großer Abstand */

  /* --- TYPOGRAPHY --- */
  --font-heading: system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --lh-tight: 1.1;
  --lh-base: 1.6;
  
  /* --- UI ELEMENTS --- */
  --radius-0: 0px;
  --border-w-1: 1px;
  --container-width: 1200px;
  
  /* --- Z-INDEX --- */
  --z-hero: 0;
  --z-content: 5;
  --z-nav: 999;
  --z-overlay: 10000;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-top: 6rem; /* Standard für Unterseiten (Header Platz) */
  background: var(--theme-bg);
  color: var(--theme-text);
  font-family: var(--font-body);
  line-height: var(--lh-base);
}

/* WICHTIG: Kein Padding auf der Startseite wegen Hero */
body.home {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4) 0;
  color: var(--theme-heading);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--lh-tight);
}

a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
p a { text-decoration: underline; text-underline-offset: 4px; color: var(--theme-link); font-weight: 600; }

/* ==========================================================================
   3. LAYOUT & CONTAINERS (RESPONSIVE)
   ========================================================================== */

/* Haupt-Container (ersetzt max-width: 1200px Inline Styles) */
.container, 
.wp-block-group.container-width {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto; /* Zentriert */
  padding-inline: var(--space-5); /* Innerer Abstand links/rechts */
  position: relative;
  z-index: var(--z-content);
}

/* Responsive Padding für Mobile */
@media (max-width: 768px) {
  .container, 
  .wp-block-group.container-width {
    padding-inline: var(--space-3);
  }
}

/* Standard Sektions-Abstände (Vertikaler Rhythmus) */
.section-spacing {
  padding-block: var(--space-6);
  margin-bottom: var(--space-6);
}
@media (min-width: 768px) {
  .section-spacing {
    padding-block: var(--space-7);
    margin-bottom: var(--space-7);
  }
}

/* Border Bottom Utility */
.border-bottom {
  border-bottom: 1px solid var(--theme-border);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-5);
}

/* ==========================================================================
   4. GRID SYSTEMS (RESPONSIVE)
   ========================================================================== */

/* Ersetzt wp-block-columns für bessere Kontrolle */
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: var(--space-4);
  width: 100%;
}

/* Mobile First: 1 Spalte (Standard) */
.grid-2, .grid-3, .grid-4 {
  grid-template-columns: 1fr;
}

/* Tablet: 2 Spalten */
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); } /* Auf Tablet evtl auch schon 3 */
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* Desktop: Volle Spaltenzahl */
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Flex Helper */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
/* ==========================================================================
   LAYOUT WRAPPER FIX
   ========================================================================== */

/* 1. Haupt-Wrapper für normalen Content */
.site-content,
.container {
  width: 100%;
  max-width: var(--container-width, 1200px); /* Nutzt Theme.json Standard oder Fallback */
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
  position: relative;
  z-index: 5;
}

/* 2. Mobile Padding Anpassung */
@media (max-width: 768px) {
  .site-content,
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* 3. Helper für Fullwidth Ausbrüche */
/* Damit Sektionen wie Scroll-FX aus dem Wrapper ausbrechen können, 
   wenn sie versehentlich IM Wrapper landen */
.alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  max-width: 100vw;
}

.alignwide {
  width: 100%;
  max-width: 1400px; /* Etwas breiter als Content */
  margin-left: auto;
  margin-right: auto;
}


/* ==========================================================================
   5. HEADER (GLASSMORPHISM)
   ========================================================================== */
.site-header {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  background-color: transparent !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem 2rem;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  transition: all 0.4s ease;
}

.site-header.is-scrolled {
  padding: 0.5rem 2rem;
  background-color: rgba(5, 5, 5, 0.4) !important;
  backdrop-filter: blur(20px);
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

/* Logo Resize */
.site-logo img, .site-header svg { height: 60px; width: auto; transition: all 0.4s ease; }
.site-header.is-scrolled .site-logo img, 
.site-header.is-scrolled .site-header svg { height: 40px; }

/* Mobile Menu Adjustment */
@media (max-width: 768px) {
  .site-header { padding: 1rem; }
  .site-logo img { height: 40px; }
}

/* ==========================================================================
   6. HERO HEADER (STARTSEITE)
   ========================================================================== */
.hero-blur-header {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  z-index: var(--z-hero);
}

.hero-bg {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 1;
  filter: blur(var(--hero-blur, 0px));
  will-change: filter, transform;
}
.hero-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); }

.hero-overlay {
  position: absolute; inset: 0; background: #000;
  opacity: var(--hero-dim, 0.3); z-index: 2;
}

.hero-content {
  position: relative; z-index: 10;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; color: #fff;
  padding: 0 var(--space-4);
  opacity: var(--hero-content-op, 1);
  transform: translateY(var(--hero-content-y, 0px));
}

.hero-title {
  font-size: clamp(3rem, 10vw, 8rem); /* Responsive Font Size */
  line-height: 1;
  margin-bottom: var(--space-4);
  text-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.hero-spacer { height: 100vh; width: 100%; pointer-events: none; }


/* ==========================================================================
   7. SCROLL BLUR SECTIONS (APPLE STYLE)
   ========================================================================== */
.scroll-blur-section {
  position: relative;
  background: #000;
  width: 100vw; margin-left: calc(50% - 50vw); padding: 0;
  z-index: var(--z-content);
}

.scroll-blur-bg {
  position: sticky; top: 0; height: 100vh; width: 100%;
  overflow: hidden; z-index: 1;
}
.scroll-blur-bg img {
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(var(--blur-value, 0px)); transform: scale(1.05);
}
.scroll-blur-overlay {
  position: absolute; inset: 0; background: #000; opacity: var(--dim-value, 0.2); z-index: 2;
}

.scroll-blur-content {
  position: relative; z-index: 10;
  max-width: var(--container-width); 
  margin: -100vh auto 0;
  color: #fff; pointer-events: none;
}
.scroll-blur-content > * { pointer-events: auto; }

.blur-text-block {
  min-height: 80vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 2rem;
}


/* ==========================================================================
   8. COMPONENT CLASSES (Design System)
   ========================================================================== */

/* Intro Lead Text */
.intro-lead {
  max-width: 800px; margin: 0 auto var(--space-7) auto;
  text-align: center;
}
.intro-lead h2 { font-size: clamp(2rem, 4vw, 3rem); }

/* Table of Contents Nav */
.ds-toc nav {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.9rem;
}
.ds-toc a { border-bottom: 1px solid var(--theme-border); padding-bottom: 2px; }

/* Design System Sections */
.ds-section-title {
  font-size: 2.5rem;
  border-bottom: 1px solid var(--theme-border);
  padding-bottom: 1rem;
  margin-bottom: var(--space-5);
}

/* Color Swatches Grid */
.color-scale-grid {
  display: flex; width: 100%;
}
.color-swatch {
  flex: 1; height: 100px; padding: 1rem;
  display: flex; align-items: flex-end;
  color: #fff; font-size: 0.85rem;
}
.color-swatch.base { background: var(--c-brand); }
.color-swatch.light { background: hsl(var(--brand-h), var(--brand-s), 40%); }
.color-swatch.dark { background: hsl(var(--brand-h), var(--brand-s), 10%); }

/* Visual Language Grid */
.visual-grid {
  display: grid; 
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .visual-grid { grid-template-columns: 1fr 1fr; }
}

/* Cards */
.card-simple {
  position: relative; display: flex; flex-direction: column;
  padding: var(--space-4); height: 100%;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  transition: transform 0.2s;
}
.card-simple:hover {
  transform: translateY(-4px);
  background: var(--theme-hover);
  border-color: var(--theme-heading);
}

/* Buttons */
.wp-block-button__link {
  padding: 0.85rem 1.5rem; border-radius: var(--radius-0);
  border: 1px solid var(--theme-heading);
  background: transparent; color: var(--theme-heading);
  text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem;
}
.wp-block-button__link:hover { opacity: 0.8; background: var(--theme-hover); }

/* Inputs */
input, select, textarea {
  width: 100%; padding: 0.8rem 1rem;
  background: var(--theme-surface); border: 1px solid var(--theme-border);
  color: var(--theme-text); border-radius: 0;
}

/* Alerts */
.alert-box {
  padding: 1rem; margin-bottom: 1rem;
  border-left: 4px solid var(--theme-border);
  background: var(--theme-surface);
  display: flex; gap: 1rem; align-items: center;
}
.alert-box.is-info { border-color: var(--c-info); background: var(--c-info-bg); color: var(--c-info); }
.alert-box.is-success { border-color: var(--c-success); background: var(--c-success-bg); color: var(--c-success); }


/* ==========================================================================
   9. UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.is-style-lead { font-size: 1.25rem; font-weight: 300; opacity: 0.9; }

.mt-auto { margin-top: auto; } /* Für Cards Button unten */

/* Hide on Mobile helper */
@media (max-width: 768px) {
  .hide-on-mobile { display: none !important; }
}
