/* =========================
   Moonshadow ARC - Nature_Organic Theme
   Mobile-first, Flexbox-only CSS
   ========================= */

/* ===== CSS RESET & BASE ===== */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { margin: 0 0 16px 0; padding-left: 20px; }
h1, h2, h3, h4, h5, h6, p { margin: 0 0 16px 0; }
button { cursor: pointer; border: none; background: transparent; font: inherit; }

/* ===== THEME TOKENS (SOLID COLORS, NATURE-ORGANIC) ===== */
:root {
  /* brand */
  --brand-primary: #0E2A35; /* deep teal (brand) */
  --brand-secondary: #C62828; /* accent red (brand) */
  --brand-accent: #F5F7FA; /* light */

  /* nature organic palette */
  --green-700: #1F5B43; /* forest */
  --green-600: #2F6F4F; /* moss */
  --green-500: #3F8A5A; /* leaf */
  --green-200: #DDEBE2; /* pale leaf */
  --sage-100: #EEF3EE; /* very light sage */
  --sage-50: #F6FAF6; /* near white with green tint */
  --sand-100: #F2EDE6; /* sand */
  --clay-200: #E6D8C7; /* light clay */
  --bark-800: #2E2A24; /* bark dark */
  --ink-900: #132126; /* very dark ink */
  --ink-800: #1B2B1F;
  --text-strong: #122018;
  --text: #223529; /* dark greenish for copy */
  --muted: #5B6F64;
  --white: #FFFFFF;

  /* surfaces & borders */
  --surface: #FFFFFF;
  --surface-alt: var(--sage-50);
  --surface-card: #FCFDFB;
  --border: #C7D7CE;
  --shadow: rgba(17, 34, 24, 0.08);
  --shadow-strong: rgba(17, 34, 24, 0.14);

  /* spacing scale */
  --s-4: 4px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-20: 20px; --s-24: 24px; --s-30: 30px; --s-32: 32px; --s-40: 40px; --s-48: 48px; --s-60: 60px;

  /* radii with organic shapes */
  --r-6: 6px; --r-10: 10px; --r-14: 14px; --r-18: 18px; --r-24: 24px; --r-32: 32px;

  /* typography */
  --ff-display: "Arial Black", Arial, sans-serif;
  --ff-body: Verdana, Geneva, Tahoma, sans-serif;
}

body {
  background: var(--brand-accent);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
}

/* Typography scale */
h1 { font-family: var(--ff-display); font-size: 32px; line-height: 1.2; color: var(--ink-900); letter-spacing: 0.2px; }
h2 { font-family: var(--ff-display); font-size: 24px; line-height: 1.25; color: var(--ink-900); }
h3 { font-family: var(--ff-display); font-size: 18px; line-height: 1.3; color: var(--ink-900); }
p, li { font-size: 16px; }
small { font-size: 14px; color: var(--muted); }
strong { color: var(--ink-900); }

/* Enhanced list style with organic bullets */
ul { list-style: none; padding-left: 0; }
ul li { position: relative; padding-left: 28px; margin-bottom: 10px; }
ul li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 12px; height: 12px; background: var(--green-600); border-radius: 2px 10px 8px 10px; box-shadow: 0 1px 0 var(--shadow); }
ol { padding-left: 20px; }

/* Links */
a { color: var(--green-700); transition: color 0.2s ease, opacity 0.2s ease; }
a:hover { color: var(--brand-primary); }
a:focus-visible { outline: 3px solid var(--green-500); outline-offset: 2px; border-radius: var(--r-6); }

/* ===== LAYOUT WRAPPERS (FLEXBOX-ONLY) ===== */
.container { display: flex; width: 100%; padding: 0 var(--s-20); justify-content: center; }
.content-wrapper { display: flex; flex-direction: column; gap: var(--s-24); width: 100%; max-width: 1120px; }

/* Global section spacing (and mandatory .section class) */
section { margin-bottom: var(--s-60); padding: var(--s-40) var(--s-20); background: var(--surface); border-radius: 16px; box-shadow: 0 6px 20px var(--shadow); border: 1px solid var(--border); position: relative; overflow: hidden; }
.section { margin-bottom: 60px; padding: 40px 20px; }

/* Organic decorative edge for sections (decorative only) */
section::before { content: ""; position: absolute; z-index: 0; inset: -40px auto auto -40px; width: 140px; height: 140px; background: var(--sage-100); border-radius: 60% 40% 50% 30%; opacity: 0.6; }
section > .container, section > .container > .content-wrapper { position: relative; z-index: 1; }

/* Hero sections with nature surface */
section[aria-label*="Hero"] { background: var(--surface-alt); border: 1px solid var(--border); }
section[aria-label*="Hero"] h1 { color: var(--brand-primary); }

/* Breadcrumbs */
nav[aria-label="Brotkrumen"] p { display: flex; gap: var(--s-8); align-items: center; color: var(--muted); font-size: 14px; margin-bottom: var(--s-8); }
nav[aria-label="Brotkrumen"] a { color: var(--green-700); }

/* ===== HEADER & NAV ===== */
header { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 900; box-shadow: 0 2px 12px var(--shadow); }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; padding: var(--s-12) 0; }
.logo img { height: 36px; width: auto; }

/* Desktop main nav hidden by default (mobile-first) */
.main-nav { display: none; align-items: center; gap: var(--s-16); }
.main-nav a { padding: 10px 12px; border-radius: 14px; color: var(--text); }
.main-nav a:hover { background: var(--sage-100); color: var(--brand-primary); }
.main-nav a:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* Mobile burger */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: var(--green-600); color: var(--white); box-shadow: 0 6px 16px var(--shadow); transition: transform 0.2s ease, background 0.2s ease; }
.mobile-menu-toggle:hover { background: var(--green-700); transform: scale(1.04); }
.mobile-menu-toggle:focus-visible { outline: 3px solid var(--green-200); }

/* Mobile menu overlay */
.mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; background: var(--surface); padding: var(--s-20); transform: translateX(100%); transition: transform 0.3s ease; z-index: 1000; box-shadow: -6px 0 24px var(--shadow-strong); }
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--sand-100); color: var(--ink-900); margin-bottom: var(--s-16); }
.mobile-menu-close:hover { background: var(--clay-200); }
.mobile-nav { display: flex; flex-direction: column; gap: var(--s-12); width: 100%; }
.mobile-nav a { display: flex; align-items: center; min-height: 44px; padding: 12px 14px; background: var(--sage-100); border-radius: var(--r-14); color: var(--ink-900); box-shadow: 0 2px 8px var(--shadow); }
.mobile-nav a:hover { background: var(--green-200); }

/* ===== BUTTONS (links styled as buttons) ===== */
.btn, .text-section a[href], a.button, .cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 18px; border-radius: 999px;
  background: var(--green-600); color: var(--white);
  box-shadow: 0 8px 18px var(--shadow);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.text-section a + a { margin-left: var(--s-12); }
.btn:hover, .text-section a:hover { background: var(--green-700); transform: translateY(-1px); box-shadow: 0 10px 20px var(--shadow-strong); }
.btn:focus-visible, .text-section a:focus-visible { outline: 3px solid var(--green-200); outline-offset: 2px; }
.btn--ghost { background: var(--surface); color: var(--green-700); border: 1px solid var(--green-600); }
.btn--ghost:hover { background: var(--sage-100); }
.btn--danger { background: var(--brand-secondary); }

/* ===== CARDS & FLEX UTILITIES (MANDATORY PATTERNS) ===== */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--surface-card); border: 1px solid var(--border); border-radius: 18px; padding: var(--s-20); box-shadow: 0 6px 18px var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px var(--shadow-strong); }
.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; background: var(--sage-100); border: 1px solid var(--border); border-left: 6px solid var(--green-600); border-radius: 18px; color: var(--text-strong); box-shadow: 0 6px 18px var(--shadow); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Additional flex helpers */
.stack-vertical { display: flex; flex-direction: column; gap: var(--s-16); }
.row { display: flex; flex-direction: row; gap: var(--s-16); flex-wrap: wrap; }

/* ===== TEXT BLOCKS ===== */
.text-section { display: flex; flex-direction: column; gap: var(--s-12); }
.text-section img { display: inline-block; vertical-align: middle; margin-right: 8px; }

/* ===== SPECIFIC AREAS ===== */
/* Testimonials readable contrast rule */
section[aria-label*="Kundenstimmen"], section[aria-label*="Werkstattbewertungen"], section[aria-label*="Erfahrungen"] {
  background: var(--surface);
}
section[aria-label*="Kundenstimmen"] .testimonial-card p,
section[aria-label*="Werkstattbewertungen"] .testimonial-card p,
section[aria-label*="Erfahrungen"] .testimonial-card p { color: var(--ink-900); }

/* Contact blocks */
section[aria-label*="Kontakt"] .text-section a[href] { align-self: flex-start; }

/* Footer */
footer { background: var(--surface-alt); border-top: 1px solid var(--border); padding: var(--s-20) 0; }
footer .content-wrapper { flex-direction: column; gap: var(--s-16); }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--s-12); }
.footer-nav a { padding: 8px 12px; border-radius: var(--r-14); color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.footer-nav a:hover { background: var(--sage-100); }

/* ===== ACCESSIBILITY & FOCUS ===== */
:focus-visible { scroll-margin-top: 90px; }

/* ===== COOKIE CONSENT (BANNER & MODAL) ===== */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: var(--s-12); padding: var(--s-16) var(--s-20); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px var(--shadow-strong); transform: translateY(110%); transition: transform 0.3s ease; z-index: 1200; }
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: var(--s-12); }
.cookie-banner .btn-accept { background: var(--green-600); color: var(--white); }
.cookie-banner .btn-reject { background: var(--surface); color: var(--green-700); border: 1px solid var(--green-600); }
.cookie-banner .btn-settings { background: var(--sand-100); color: var(--ink-900); }

/* Cookie modal */
.cookie-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 1300; }
.cookie-backdrop.show { opacity: 1; pointer-events: auto; }
.cookie-modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -40%) scale(0.98); background: var(--surface); width: 92%; max-width: 720px; border-radius: 20px; border: 1px solid var(--border); box-shadow: 0 20px 60px var(--shadow-strong); padding: var(--s-20); display: flex; flex-direction: column; gap: var(--s-16); z-index: 1400; opacity: 0; pointer-events: none; transition: transform 0.3s ease, opacity 0.3s ease; }
.cookie-modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-content { display: flex; flex-direction: column; gap: var(--s-12); }
.cookie-modal .option-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-12); padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-alt); }
.cookie-modal .option-row .toggle { width: 46px; height: 28px; border-radius: 20px; background: var(--border); position: relative; transition: background 0.2s ease; display: inline-flex; align-items: center; padding: 2px; }
.cookie-modal .option-row .toggle::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 6px var(--shadow); transform: translateX(0); transition: transform 0.2s ease; }
.cookie-modal .option-row .toggle.active { background: var(--green-600); }
.cookie-modal .option-row .toggle.active::after { transform: translateX(18px); }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: var(--s-12); justify-content: flex-end; }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  /* Typography bump */
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }

  .text-image-section { flex-direction: row; }

  /* Layout breathing room */
  .content-wrapper { gap: var(--s-32); }
}

@media (min-width: 992px) {
  /* Show desktop nav */
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }

  /* Increase hero sizes */
  h1 { font-size: 48px; }

  /* Footer columns (still flex) */
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }

  /* Section padding */
  section { padding: 48px 32px; }
}

/* ===== MANDATORY SPACING & ALIGNMENT (explicit declarations) ===== */
/* Already declared above, repeated here to guarantee match */
.section { margin-bottom: 60px; padding: 40px 20px; }
.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; }

/* ===== UTILITIES ===== */
.hide { display: none !important; }
.muted { color: var(--muted); }
.separator { height: 1px; width: 100%; background: var(--border); }

/* ===== PAGE-SPECIFIC MICRO-ENHANCEMENTS ===== */
/* Index trust badges */
[aria-label="Vertrauenssiegel"] ul li::before { background: var(--green-500); }

/* Contact icon lines */
[aria-label*="Kontakt"] img { width: 18px; height: 18px; }

/* Ratings text emphasis */
[aria-label*="Kundenstimmen"] .text-section p,
[aria-label*="Werkstattbewertungen"] p { color: var(--ink-900); font-weight: bold; }

/* ===== INTERACTIONS ===== */
.card:active, .btn:active, .text-section a:active { transform: translateY(0); box-shadow: 0 6px 18px var(--shadow); }

/* ===== PRINT BASIC ===== */
@media print {
  header, footer, .mobile-menu, .cookie-banner, .cookie-backdrop, .cookie-modal { display: none !important; }
  section { box-shadow: none; border: none; background: #fff; }
}
