/* =====================================
   Tellerpfad – Scandinavian Clean Theme
   Mobile-first, Flexbox-only CSS
   ===================================== */

/* Reset & Normalize */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
ul, ol { margin: 0; padding-left: 22px; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: transparent; border: none; padding: 0; cursor: pointer; }

/* Theme Tokens */
:root {
  --primary: #2E3F2A; /* Tiefes Grün */
  --secondary: #C2572B; /* Terrakotta */
  --accent: #FFF3E6; /* Cremiges Akzent */
  --base: #FAFAF7; /* Helles, warmes Grundweiß */
  --card: #FFFFFF; /* Kartenweiß */
  --ink: #233024; /* Textfarbe */
  --muted: #6B6F6A; /* Sekundärtext */
  --line: #E6E4DE; /* Linien/Borders */
  --radius: 12px; /* weiche Kanten */
  --shadow: 0 2px 8px rgba(35, 48, 36, 0.08);
}

/* Base Typography */
body {
  background: var(--base);
  color: var(--ink);
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--primary);
}
h1 { font-size: 32px; line-height: 1.2; letter-spacing: -0.2px; }
h2 { font-size: 24px; line-height: 1.25; margin-top: 4px; }
h3 { font-size: 18px; line-height: 1.3; color: var(--ink); }
p { color: var(--ink); font-size: 16px; }
small { font-size: 14px; color: var(--muted); }

/* Links */
a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(46,63,42,0.35); text-underline-offset: 3px; transition: color .2s ease, background-color .2s ease, box-shadow .2s ease; }
a:hover { color: var(--secondary); text-decoration-color: var(--secondary); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; border-radius: 6px; }

/* Layout Helpers (Flexbox only) */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex; /* flex container as required */
  flex-direction: column;
  align-items: stretch;
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

/* Global Sections */
section {
  display: flex; /* layout container */
  flex-direction: column;
  gap: 0;
  margin-bottom: 60px; /* consistent rhythm */
  padding: 40px 0; /* vertical breathing room */
}

/* Mandatory spacing classes (as provided) */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.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; }

/* Header */
header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
header .container {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo { display: flex; align-items: center; }
.logo img { height: 34px; width: auto; }

/* Desktop nav hidden by default (mobile-first) */
.main-nav { display: none; align-items: center; gap: 12px; }
.main-nav a {
  text-decoration: none;
  color: var(--primary);
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color .2s ease, color .2s ease;
}
.main-nav a:hover { background: var(--accent); color: var(--secondary); }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.mobile-menu-toggle:hover { background: var(--accent); color: var(--secondary); }

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--card);
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 999;
  box-shadow: -8px 0 20px rgba(0,0,0,0.08);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--base);
}
.mobile-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.mobile-nav a {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--primary);
  border: 1px solid transparent;
}
.mobile-nav a:hover { background: var(--accent); color: var(--secondary); border-color: var(--line); }

/* Hero and CTA links in content blocks */
.content-wrapper > div { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.content-wrapper > div a,
.text-section > a,
.content-wrapper p + a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.content-wrapper > div a:hover,
.text-section > a:hover,
.content-wrapper p + a:hover {
  background: var(--accent);
  color: var(--secondary);
  border-color: var(--secondary);
}

/* Utility button classes for future-proofing */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--primary); text-decoration: none; box-shadow: var(--shadow); }
.btn:hover { background: var(--accent); color: var(--secondary); border-color: var(--secondary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #24321F; border-color: #24321F; color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-secondary:hover { background: #A64B26; border-color: #A64B26; }

/* Text Sections and Cards */
.text-section {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

/* Testimonials – ensure contrast on light background */
.testimonial-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink); /* dark text for readability */
}
.testimonial-card p { margin: 0; }
.testimonial-card p + p { color: var(--primary); }

/* Lists spacing */
ul li, ol li { margin-bottom: 8px; }
ul li img, ol li img { display: inline-block; vertical-align: middle; margin-right: 8px; height: 18px; width: auto; }

/* Footer */
footer { background: var(--card); border-top: 1px solid var(--line); }
footer .content-wrapper { gap: 20px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-nav a { text-decoration: none; color: var(--primary); padding: 6px 8px; border-radius: 8px; }
.footer-nav a:hover { background: var(--accent); color: var(--secondary); }
footer .text-section { background: transparent; border: 0; padding: 0; }

/* Images inside content */
.content-wrapper img { border-radius: 10px; }

/* Decorative section variants (optional) */
.alt-bg { background: var(--accent); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  z-index: 1000;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
}
.cookie-banner.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cookie-banner .cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner .cookie-buttons .btn { padding: 10px 14px; }

/* Cookie Modal */
.cookie-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 1001;
}
.cookie-overlay.show { opacity: 1; pointer-events: auto; }
.cookie-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.98);
  width: 92%; max-width: 720px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  display: none; flex-direction: column; gap: 16px; padding: 20px; z-index: 1002; transition: transform .25s ease;
}
.cookie-modal.show { display: flex; transform: translate(-50%, -50%) scale(1); }
.cookie-modal .cookie-modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .cookie-categories { display: flex; flex-direction: column; gap: 12px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--base); }

/* Toggle switch (for Analytics/Marketing) */
.toggle-switch { display: flex; align-items: center; gap: 12px; }
.toggle {
  appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px;
  background: #D5D5D0; position: relative; transition: background .2s ease; outline: none; border: 1px solid var(--line);
}
.toggle::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .2s ease; }
.toggle:checked { background: var(--primary); }
.toggle:checked::after { transform: translateX(18px); }

/* Accessibility: focus ring for toggles too */
.toggle:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

/* Micro-interactions */
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(35,48,36,0.12); }

/* Content Grids (Flexbox only) */
.content-grid > * { flex: 1 1 260px; min-width: 260px; }
.card-container > .card { flex: 1 1 280px; }
.text-image-section > * { flex: 1 1 320px; }

/* Tables (if appear) */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }

/* Forms (if appear later) */
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
}
label { font-weight: bold; color: var(--primary); margin-bottom: 6px; display: inline-flex; }

/* Icons in text */
img[alt^="Sicher"], img[alt^="Bewertung"], img[alt^="Zahlung"], img[alt^="Guide"], img[alt^="Nachhaltig"], img[alt^="Sicherheit"] {
  filter: saturate(0.8);
}

/* Readability helpers */
.lead { font-size: 18px; color: var(--ink); }
.muted { color: var(--muted); }

/* Responsive – Tablet */
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }

  .logo img { height: 38px; }

  .content-wrapper { gap: 20px; }

  /* Text-image sections row on tablet/desktop */
  .text-image-section { flex-direction: row; }
}

/* Responsive – Desktop */
@media (min-width: 992px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  p { font-size: 17px; }

  /* Show desktop nav, hide burger */
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }

  header .container { padding-top: 18px; padding-bottom: 18px; }
  .logo img { height: 42px; }

  /* Spacey sections on desktop */
  section { padding: 56px 0; }
}

/* Ensure no overlaps & tidy spacing between elements */
.content-wrapper > * + * { margin-top: 0; }
section + section { margin-top: 0; }

/* High-contrast testimonials and review sections */
section .testimonial-card p, section .testimonial-card strong { color: var(--ink); }

/* Z-index safety for header vs menus vs cookie modal */
header { position: relative; z-index: 10; }

/* Print adjustments (optional for legal pages) */
@media print {
  .mobile-menu-toggle, .mobile-menu, .cookie-banner, .cookie-overlay, .cookie-modal { display: none !important; }
  a { text-decoration: none; color: #000; }
}
