/* =========================================================
   GrundKompass Deutschland - Warm & Friendly UI
   style.css (mobile-first, flexbox-only)
   ========================================================= */

/* -------------------------
   CSS Reset / Normalize
-------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; margin: 0; }
img, picture { max-width: 100%; display: block; height: auto; }
input, button, textarea, select { font: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* -------------------------
   Root variables (with fallbacks)
-------------------------- */
:root {
  --color-primary: #0F3557;
  --color-secondary: #2E7D6E;
  --color-accent: #F7F5EF;
  --color-warm-1: #FFF7ED; /* warm friendly backdrop */
  --color-warm-2: #F3E7D8; /* subtle warm tint */
  --color-text: #25313B; /* dark neutral for readability */
  --color-muted: #6B7A89;
  --color-border: #E6DED2;
  --white: #FFFFFF;
  --black: #000000;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 8px rgba(15, 53, 87, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 53, 87, 0.10);
  --shadow-lg: 0 12px 28px rgba(15, 53, 87, 0.14);

  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-60: 60px;
}

/* -------------------------
   Base typography & body
-------------------------- */
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: var(--color-text);
  background: var(--white);
  line-height: 1.6;
  letter-spacing: 0.1px;
}

h1, h2, h3 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  color: var(--color-primary);
}

h1 { font-size: 32px; line-height: 1.2; margin-bottom: var(--space-16); }
h2 { font-size: 24px; line-height: 1.3; margin-bottom: var(--space-12); }
h3 { font-size: 18px; line-height: 1.4; margin-bottom: var(--space-8); }

p { font-size: 16px; margin-bottom: var(--space-16); }
ul, ol { margin-left: 1.2em; margin-bottom: var(--space-16); }
li { margin-bottom: 8px; }
strong { color: var(--color-primary); }

/* Links */
a { color: var(--color-secondary); text-decoration: underline; text-underline-offset: 2px; transition: color .2s ease, background-color .2s ease; }
a:hover { color: #256b5f; }
a.button { text-decoration: none; }

/* Focus states */
:focus-visible { outline: 2px solid rgba(46,125,110,0.6); outline-offset: 2px; border-radius: var(--radius-sm); }

/* -------------------------
   Layout helpers (Flexbox-only)
-------------------------- */
.container {
  width: 100%;
  padding: 0 var(--space-20);
  margin: 0 auto;
  display: flex; /* flexbox for layout wrapper */
  justify-content: center;
}
.content-wrapper {
  width: 100%;
  max-width: 1120px;
  display: flex; /* base flex layout */
  flex-direction: column;
  gap: var(--space-20);
}

section { margin-bottom: var(--space-60); padding: var(--space-40) var(--space-20); }

/* Mandatory spacing patterns (exact) */
.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; }

/* Card defaults */
.card, .testimonial-card {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover, .testimonial-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* -------------------------
   Header & Navigation
-------------------------- */
header {
  position: relative;
  background: var(--white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
header .content-wrapper {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-16) 0;
}
.logo { display: flex; align-items: center; }
.logo img { height: 36px; width: auto; }

.main-nav {
  display: none; /* hidden on mobile */
  align-items: center;
  gap: var(--space-16);
}
.main-nav a {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.main-nav a:hover { background: var(--color-accent); color: var(--color-secondary); }

/* Header primary CTA visible on desktop only (space-saving) */
header .button.primary { display: none; }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transition: background-color .2s ease, transform .2s ease;
}
.mobile-menu-toggle:hover { background: var(--color-warm-2); transform: translateY(-1px); }

/* Mobile menu overlay (slide-in) */
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 86vw; max-width: 360px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
  transition: transform .35s ease;
  z-index: 9999;
  display: flex; flex-direction: column;
  padding: var(--space-20);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-primary);
}
.mobile-nav { display: flex; flex-direction: column; gap: var(--space-12); margin-top: var(--space-12); }
.mobile-nav a {
  display: flex;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-warm-1);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.mobile-nav a:hover { background: var(--color-accent); }

/* Backdrop for body when menu open (optional class on body) */
body.menu-open { overflow: hidden; }

/* -------------------------
   Buttons & CTAs
-------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease, transform .1s ease;
  border: 1px solid transparent;
}
.button.primary {
  background: var(--color-secondary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.button.primary:hover { background: #256b5f; box-shadow: var(--shadow-md); }
.button.secondary {
  background: var(--white);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.button.secondary:hover {
  background: var(--color-accent);
}
.button:active { transform: translateY(1px); }

.cta-group { display: flex; flex-wrap: wrap; gap: var(--space-12); }

/* -------------------------
   Hero section
-------------------------- */
.hero {
  background: var(--color-warm-1);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.hero .content-wrapper {
  align-items: flex-start;
}
.hero h1 { font-size: 28px; }
.hero p { font-size: 16px; color: var(--color-muted); }

/* -------------------------
   Text sections and lists
-------------------------- */
.text-section { display: flex; flex-direction: column; gap: var(--space-12); }
.text-section ul, .text-section ol { margin-left: 1.2em; }
.text-section li { display: flex; align-items: center; gap: 10px; }
.text-section img { width: 20px; height: 20px; object-fit: contain; filter: saturate(0.8); }
.text-section a { font-weight: 600; }

/* -------------------------
   Testimonials (light background for readability)
-------------------------- */
.testimonial-card {
  background: var(--white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.testimonial-card p { margin: 0; }
.testimonial-card p + p { color: var(--color-primary); margin-top: 8px; }

/* -------------------------
   Footer
-------------------------- */
footer {
  background: var(--color-accent);
  border-top: 1px solid var(--color-border);
}
footer .content-wrapper {
  display: flex; flex-wrap: wrap; gap: var(--space-24);
}
.footer-nav, .footer-legal {
  display: flex; flex-direction: column; gap: var(--space-12);
  min-width: 240px;
}
.footer-nav strong, .footer-legal strong { font-family: Georgia, serif; color: var(--color-primary); }
.footer-nav div, .footer-legal div { display: flex; flex-direction: column; gap: 8px; }
footer a { color: var(--color-primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .text-section p { margin: 0; color: var(--color-muted); }

/* -------------------------
   Generic cards & feature items (for future use)
-------------------------- */
.card {
  padding: var(--space-20);
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.feature-item .icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--color-warm-2); }

/* -------------------------
   Content layout enhancements using flex-wrap
   Ensure h-elements take full width so cards can align beside each other
-------------------------- */
.content-wrapper { flex-wrap: wrap; }
.content-wrapper > h1,
.content-wrapper > h2,
.content-wrapper > h3,
.content-wrapper > p,
.content-wrapper > ol,
.content-wrapper > ul,
.content-wrapper > .text-section,
.content-wrapper > .cta-group { flex: 1 1 100%; }

/* Make testimonial cards responsive in multi-column without grid */
.content-wrapper > .testimonial-card { flex: 1 1 100%; }
@media (min-width: 992px) {
  .content-wrapper > .testimonial-card { flex: 1 1 calc(50% - 12px); }
}

/* -------------------------
   Accessibility helpers for contrast
-------------------------- */
.hero h1, .hero p, .hero a { color: var(--color-primary); }

/* -------------------------
   Cookie Consent Banner & Modal (flex + animations)
-------------------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: var(--space-12);
  padding: var(--space-16) var(--space-20);
  background: var(--color-warm-1);
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -6px 16px rgba(15,53,87,0.08);
  transform: translateY(100%);
  transition: transform .35s ease;
  z-index: 9998;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-text { font-size: 14px; }
.cookie-banner .cookie-buttons { display: flex; flex-wrap: wrap; gap: var(--space-12); }
.cookie-banner .button { padding: 10px 14px; font-size: 14px; }
.cookie-banner .button.reject { background: var(--white); color: var(--color-primary); border: 1px solid var(--color-primary); }
.cookie-banner .button.settings { background: var(--color-accent); color: var(--color-primary); border: 1px solid var(--color-border); }

/* Cookie modal overlay */
.cookie-modal {
  position: fixed; inset: 0;
  display: none; /* hidden by default */
  z-index: 10000;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45);
}
.cookie-modal.open { display: flex; }
.cookie-modal .cookie-dialog {
  width: 92%; max-width: 720px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: var(--space-16);
  padding: var(--space-20);
}
.cookie-dialog header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); }
.cookie-dialog h3 { margin: 0; font-size: 20px; }
.cookie-dialog .cookie-groups { display: flex; flex-direction: column; gap: var(--space-16); }
.cookie-group { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); padding: 12px 0; border-bottom: 1px dashed var(--color-border); }
.cookie-group .label { display: flex; flex-direction: column; gap: 4px; }
.cookie-group .hint { font-size: 14px; color: var(--color-muted); }

/* Toggle switch */
.toggle { position: relative; display: inline-flex; align-items: center; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .slider {
  width: 46px; height: 26px;
  background: #d7e3de;
  border-radius: 999px;
  position: relative;
  transition: background-color .2s ease;
}
.toggle .slider::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease;
}
.toggle input:checked + .slider { background: var(--color-secondary); }
.toggle input:checked + .slider::after { transform: translateX(20px); }

.cookie-dialog .actions { display: flex; flex-wrap: wrap; gap: var(--space-12); justify-content: flex-end; }
.cookie-dialog .button { font-size: 14px; padding: 10px 14px; }

/* -------------------------
   Mobile-first responsive adjustments
-------------------------- */
@media (min-width: 480px) {
  h1 { font-size: 34px; }
  .hero h1 { font-size: 32px; }
}

@media (min-width: 768px) {
  /* Show main nav and header CTA on tablet+ */
  .main-nav { display: flex; }
  header .button.primary { display: inline-flex; }
  .mobile-menu-toggle { display: none; }

  .hero h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }

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

@media (min-width: 1024px) {
  .hero h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  p { font-size: 18px; }
}

/* -------------------------
   Utility classes
-------------------------- */
.hidden { display: none !important; }
.muted { color: var(--color-muted); }
.center { text-align: center; }

/* -------------------------
   Extra polish & micro-interactions
-------------------------- */
section { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.hero { background: var(--color-warm-1); box-shadow: var(--shadow-md); }

/* Ensure adequate spacing between all elements */
section + section { margin-top: 0; }

/* Icon links inside lists */
.text-section li a { text-decoration: underline; text-underline-offset: 2px; }

/* Prevent overlapping via consistent margins/padding */
.content-wrapper > * { margin: 0; }

/* -------------------------
   Accessibility contrast in testimonials/reviews
-------------------------- */
/* Dark text on light background ensured above; additionally enforce */
.testimonial-card, .testimonial-card * { color: #1f2a35; }

/* -------------------------
   Print adjustments (basic)
-------------------------- */
@media print {
  .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
}
