/* =========================================================
   MeisterFuge Ausbau – style.css
   Theme: monochrome_sophisticated (black/white/gray, high contrast, elegant type)
   Notes: Mobile-first, ONLY Flexbox (no CSS Grid/Columns), strong accessibility
   ========================================================= */

/* -----------------------------
   1) RESET & NORMALIZE
   ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 8px; }
h1, h2, h3, h4, p, figure { margin: 0 0 16px; }
button, input, select, textarea { font: inherit; color: inherit; background: transparent; border: none; padding: 0; }
:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* -----------------------------
   2) THEME TOKENS (MONOCHROME + BRAND)
   ----------------------------- */
:root {
  /* Core monochrome palette */
  --bg: #FFFFFF;
  --surface: #F7F7F7;
  --elevated: #FAFAFA;
  --text: #0B0B0B;
  --text-muted: #555555;
  --text-subtle: #8C8C8C;
  --line: #E6E6E6;
  --line-strong: #D0D0D0;
  --hero-bg: #0E0E0E;
  --hero-text: #FFFFFF;

  /* Brand (subtle, respecting monochrome aesthetic) */
  --brand-primary: #1F2A33; /* deep blue-gray */
  --brand-secondary: #8B3E00; /* warm earth brown (used sparingly) */
  --brand-accent: #F6F2EA;   /* off-white, gentle accent surface */

  /* Radii & Shadows */
  --radius-1: 8px;
  --radius-2: 12px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-2: 0 8px 24px rgba(0,0,0,0.12);

  /* Layout */
  --container-max: 1180px;
  --g-8: 8px;
  --g-12: 12px;
  --g-16: 16px;
  --g-20: 20px;
  --g-24: 24px;
  --g-30: 30px;
  --g-40: 40px;
  --g-60: 60px;
}

/* -----------------------------
   3) TYPOGRAPHY
   ----------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: Verdana, Geneva, sans-serif; /* brand body */
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; /* brand display */
  color: #121212;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

h1 { font-size: 32px; margin-bottom: 12px; }
h2 { font-size: 24px; margin-top: 8px; margin-bottom: 12px; }
h3 { font-size: 20px; margin-bottom: 8px; }
h4 { font-size: 18px; }

p { color: var(--text); }
.small, small { font-size: 14px; color: var(--text-subtle); }

@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
}
@media (min-width: 1024px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 24px; }
}

/* -----------------------------
   4) GLOBAL LAYOUT HELPERS (FLEX ONLY)
   ----------------------------- */
.container {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--g-16);
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}

/* Default section spacing (also see .section rule as required) */
section { margin-bottom: var(--g-60); padding: 40px 20px; }
.section { margin-bottom: 60px; padding: 40px 20px; }

/* Required utility patterns */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Force column on mobile for text-image blocks */
.text-image-section { flex-direction: column; }
@media (min-width: 768px) {
  .text-image-section { flex-direction: row; }
}

/* -----------------------------
   5) HEADER & NAVIGATION
   ----------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
}
.site-header .content-wrapper {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--g-16);
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo img { height: 36px; }

.main-nav { display: none; align-items: center; gap: 16px; }
.main-nav a {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  color: #111;
  border-radius: 6px;
  transition: color .2s ease, background-color .2s ease;
}
.main-nav a:hover { background: var(--surface); }

.header-cta { display: none; }
.header-cta .button.primary { white-space: nowrap; }

.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 8px;
  background: #111;
  color: #FFF;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.mobile-menu-toggle:hover { background: #000; transform: translateY(-1px); }

@media (min-width: 992px) {
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }
  .logo img { height: 42px; }
}

/* -----------------------------
   6) MOBILE MENU OVERLAY
   ----------------------------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #0F0F0F;
  color: #FFF;
  transform: translateX(100%);
  transition: transform .35s ease;
  z-index: 1000;
  padding: 20px;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: #1A1A1A; color: #FFF; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.mobile-menu-close:hover { background: #222; transform: translateY(-1px); }
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  border-radius: 8px;
  background: #151515;
  color: #FFF;
  border: 1px solid #222;
  transition: background .2s ease, border-color .2s ease;
}
.mobile-nav a:hover { background: #1C1C1C; border-color: #2A2A2A; }

/* -----------------------------
   7) HERO SECTION (dramatic contrast)
   ----------------------------- */
.hero { background: var(--hero-bg); color: var(--hero-text); }
.hero h1, .hero p, .hero li, .hero a { color: #0B0B0B;}
.hero .content-wrapper { gap: var(--g-16); }
.hero ul { padding-left: 20px; }
.hero .button { border-color: #FFFFFF; color: #111; }
.hero .button.primary { background: #FFFFFF; color: #111; }

/* -----------------------------
   8) BUTTONS
   ----------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-1);
  border: 1px solid #111;
  background: transparent;
  color: #111;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.button:hover { background: #111; color: #FFF; transform: translateY(-1px); }
.button:active { transform: translateY(0); }

.button.primary {
  background: #111;
  color: #FFF;
  border-color: #111;
}
.button.primary:hover { background: #000; border-color: #000; color: white;}

/* Minimal brand accent for focus rings on buttons */
.button:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

/* -----------------------------
   9) TEXT & LISTS
   ----------------------------- */
.content-wrapper > ul, .content-wrapper > ol { margin-top: 4px; }
ul li::marker, ol li::marker { color: #111; }
.hero ul li::marker { color: #FFF; }

/* -----------------------------
   10) CARDS & TESTIMONIALS
   ----------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-1);
  box-shadow: var(--shadow-1);
}

/* Testimonials: light background, dark text (accessibility requirement) */
.testimonial-card {
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  border-left: 4px solid #111;
  border-radius: var(--radius-1);
  box-shadow: var(--shadow-1);
  color: var(--text);
  margin-bottom: 20px; /* ensure spacing between cards */
}
.testimonial-card p { margin: 0; }
.testimonial-card p + p { color: var(--text-muted); }

/* -----------------------------
   11) GENERIC FLEX LAYOUT COLLECTIONS
   ----------------------------- */
.card-container { align-items: stretch; }
.card-container .card { flex: 1 1 280px; }

.content-grid { align-items: stretch; }
.content-grid > * { flex: 1 1 320px; min-width: 280px; }

/* -----------------------------
   12) MISC SECTIONS & SURFACES
   ----------------------------- */
/* Alternate surface blocks to create hierarchy */
section:nth-of-type(odd) { background: var(--bg); }
section:nth-of-type(even) { background: var(--surface); }

/* Rich text blocks within legal pages */
main h2 + p { color: var(--text-muted); }

/* Links styling */
a:hover { color: #000; }
a.underline, .main-nav a:hover, .footer-nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* -----------------------------
   13) FOOTER
   ----------------------------- */
.site-footer { background: #0F0F0F; color: #EDEDED; padding-top: 30px; }
.site-footer .content-wrapper { gap: var(--g-24); }
.site-footer .brand { display: flex; flex-direction: column; gap: 12px; }
.site-footer .brand p { color: white;;}
.site-footer .brand img { height: 32px; filter: brightness(10); }
.footer-nav nav { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-nav a { color: #EDEDED; padding: 6px 8px; border-radius: 6px; transition: background .2s ease; }
.footer-nav a:hover { background: #1A1A1A; }
.site-footer .contact, .site-footer .social { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: #FFFFFF; }
.site-footer address { font-style: normal; color: #D8D8D8; }
.site-footer .container:last-of-type { border-top: 1px solid #1E1E1E; margin-top: 10px; }
.site-footer .container:last-of-type .content-wrapper { justify-content: center; align-items: center; padding: 16px 0; }

@media (min-width: 900px) {
  .site-footer .content-wrapper { flex-direction: row; align-items: flex-start; justify-content: space-between; }
}

/* -----------------------------
   14) RESPONSIVE RULES
   ----------------------------- */
/* Ensure top alignment or centering where needed */
.align-center { display: flex; align-items: center; }
.align-start { display: flex; align-items: flex-start; }
.justify-between { display: flex; justify-content: space-between; }

/* Make long lists comfortable on wider screens */
@media (min-width: 768px) {
  .content-wrapper { gap: var(--g-20); }
}

/* -----------------------------
   15) COOKIE CONSENT BANNER & MODAL
   ----------------------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1100;
  background: #0F0F0F;
  color: #FFFFFF;
  border-top: 1px solid #1E1E1E;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.25);
  transform: translateY(100%);
  transition: transform .35s ease;
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner .cookie-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
}
.cookie-banner .cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cookie-banner .cookie-actions .button { border-color: #FFF; color: #FFF; }
.cookie-banner .cookie-actions .button:hover { background: #FFF; color: #111; }
.cookie-banner .cookie-actions .button.primary { background: #FFF; color: #111; border-color: #FFF; }
.cookie-banner .cookie-actions .button.primary:hover { background: #EDEDED; }

/* Cookie Modal Overlay */
.cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.cookie-overlay.open { display: flex; }

.cookie-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 92%;
  max-width: 680px;
  background: #FFFFFF;
  color: #111;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-2);
  padding: 20px;
}
.cookie-modal header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.cookie-modal .cookie-groups { display: flex; flex-direction: column; gap: 12px; }
.cookie-modal .group {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--elevated);
}
.cookie-modal .group .label { font-weight: 700; }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Toggle switch (checkbox based) */
.toggle { display: inline-flex; align-items: center; gap: 10px; }
.toggle input[type="checkbox"] { appearance: none; width: 44px; height: 24px; border-radius: 20px; background: #CFCFCF; position: relative; transition: background .2s ease; }
.toggle input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform .2s ease; }
.toggle input[type="checkbox"]:checked { background: #111; }
.toggle input[type="checkbox"]:checked::after { transform: translateX(20px); }
.toggle .hint { color: var(--text-subtle); font-size: 14px; }

/* -----------------------------
   16) ACCESSIBILITY & STATES
   ----------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; border: 0; padding: 0; clip: rect(0 0 0 0); overflow: hidden; }

/* Strong focus states for links */
a:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

/* -----------------------------
   17) FORMS (generic – if added later)
   ----------------------------- */
.input, input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  display: flex;
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--text-subtle); }

/* -----------------------------
   18) PAGE-SPECIFIC NUANCE
   ----------------------------- */
/* Legal pages: keep clean reading width */
body:has(.hero h1:contains("Datenschutzerklärung")),
body:has(.hero h1:contains("DSGVO")),
body:has(.hero h1:contains("Nutzungsbedingungen")) { }
/* Note: :has() may have partial support; the layout remains fine without it. */

/* -----------------------------
   19) DESKTOP ENHANCEMENTS
   ----------------------------- */
@media (min-width: 1024px) {
  .content-wrapper.tight { max-width: 900px; }
}

/* -----------------------------
   20) ENSURE NO OVERLAP & ADEQUATE SPACING
   ----------------------------- */
.content-wrapper > * + * { margin-top: 0; }

/* -----------------------------
   21) BRAND PERSONALITY (subtle usage within mono theme)
   ----------------------------- */
/* Use off-white brand accent occasionally for soft sections */
.section--accent, .surface-accent { background: var(--brand-accent); }

/* Optional subtle underline using brand secondary on hover */
.main-nav a:hover { box-shadow: inset 0 -2px 0 0 var(--brand-secondary); }

/* -----------------------------
   22) PRINT BASICS
   ----------------------------- */
@media print {
  .site-header, .site-footer, .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-overlay { display: none !important; }
  a { text-decoration: underline; }
}
