/* =============================
   ImmoKompass Deutschland – Soft Pastel UI
   Global style.css for all pages
   Mobile-first, flexbox-only, accessible
   ============================= */

/* 1) CSS Reset & Normalize */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, figcaption, blockquote, dl, dd { margin: 0; padding: 0; }
ul[role='list'], ol[role='list'] { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { background: none; border: 0; font: inherit; cursor: pointer; }
input, button, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid #8BC6F6; outline-offset: 2px; }

/* 2) Theme Tokens (with fallbacks) */
:root {
  /* Brand core */
  --primary: #0B3B5C;
  --secondary: #227D53;
  --accent: #F3F6F9;
  /* Soft pastel palette */
  --pastel-peach: #FFEFE3;
  --pastel-lavender: #F2EAFE;
  --pastel-mint: #EAF7F1;
  --pastel-blue: #EAF4FB;
  --pastel-rose: #FDECEF;
  /* Surfaces & text */
  --page-bg: #FAFBFD;
  --surface: #FFFFFF;
  --ink: #1F2A37;
  --ink-soft: #475569;
  --muted: #6B7280;
  --border: #E6EAF0;
  /* Effects */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.08);
  /* Spacing scale */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-30: 30px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-60: 60px;
  --space-80: 80px;
}

/* 3) Base Typography – soft pastel, brand fonts */
body {
  font-family: Verdana, Geneva, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  line-height: 1.65;
  font-size: 16px;
}

h1, h2, h3, h4 { font-family: Georgia, 'Times New Roman', serif; color: var(--primary); letter-spacing: 0.2px; }
h1 { font-size: 28px; line-height: 1.25; margin-bottom: var(--space-16); }
h2 { font-size: 22px; line-height: 1.3; margin-bottom: var(--space-12); }
h3 { font-size: 18px; line-height: 1.35; margin-top: var(--space-16); margin-bottom: var(--space-8); }

p { margin-bottom: var(--space-12); color: var(--ink); }
strong { color: var(--ink); font-weight: 700; }

.text-section { margin-top: var(--space-12); display: flex; flex-direction: column; gap: var(--space-8); }

/* Links */
a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #0a2f48; }

/* Lists */
ul, ol { padding-left: var(--space-20); }
ul li, ol li { margin-bottom: 8px; }

/* 4) Layout Wrappers – FLEX ONLY */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-16);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-20);
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  box-shadow: var(--shadow-sm);
}

/* Breadcrumbs */
nav[aria-label="Brotkrumen"] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
nav[aria-label="Brotkrumen"] a { color: var(--muted); }
nav[aria-label="Brotkrumen"] a:hover { color: var(--primary); }

/* 5) Sections – soft pastel atmosphere */
section {
  padding: var(--space-40) 0;
}
/* Gentle alternating pastel section backgrounds with good contrast */
main > section:nth-of-type(1) { background: var(--pastel-blue); }
main > section:nth-of-type(2) { background: var(--pastel-rose); }
main > section:nth-of-type(3) { background: var(--pastel-mint); }
main > section:nth-of-type(4) { background: var(--pastel-lavender); }
main > section:nth-of-type(5) { background: var(--pastel-peach); }
main > section:nth-of-type(6) { background: var(--pastel-blue); }

/* MANDATORY spacing classes (available globally) */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: var(--space-20); }
.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: #FFFFFF; color: #1F2937; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* 6) Header & Navigation */
header {
  background: linear-gradient(0deg, var(--accent), var(--accent));
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 30;
}

header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-16); padding-top: var(--space-12); padding-bottom: var(--space-12); }

.logo { display: flex; align-items: center; }
.logo img { height: 40px; width: auto; }

.main-nav { display: none; align-items: center; gap: var(--space-16); }
.main-nav a {
  color: var(--primary);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}
.main-nav a:hover { background: #E7F0F8; color: #08293F; }

.header-ctas { display: none; align-items: center; gap: var(--space-12); }

/* Mobile burger */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.mobile-menu-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0 0 0 0;
  background: rgba(11, 59, 92, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  transform: translateX(100%);
  transition: transform 300ms ease;
  z-index: 100;
}
.mobile-menu.open { transform: translateX(0); }

/* Slide-in panel */
.mobile-menu .mobile-nav {
  background: #FFFFFF;
  width: 86%;
  max-width: 420px;
  height: 100%;
  padding: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  box-shadow: var(--shadow-lg);
}
.mobile-menu-close {
  position: relative;
  margin: var(--space-12) var(--space-12) 0 0;
  align-self: flex-end;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
}
.mobile-nav a {
  color: var(--ink);
  background: var(--accent);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 200ms ease, transform 200ms ease;
}
.mobile-nav a:hover { background: #E7F0F8; transform: translateX(2px); }

/* 7) Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 150ms ease;
}
.btn:hover { background: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-primary {
  background: #EAF4FB; /* pastel blue */
  color: var(--primary);
  border-color: #D7E6F4;
}
.btn-primary:hover { background: #DDEDF9; }

.btn-secondary {
  background: #EAF7F1; /* pastel mint */
  color: var(--secondary);
  border-color: #D6EFE5;
}
.btn-secondary:hover { background: #DDF3EA; }

/* 8) Testimonials – ensure contrast */
.testimonial-card p { margin: 0; }
.testimonial-card p + p { margin-left: auto; font-weight: 700; color: #0F172A; }

/* 9) Footer */
footer {
  background: var(--accent);
  border-top: 1px solid var(--border);
}
footer .content-wrapper {
  background: #FFFFFF;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
}
.footer-nav a {
  color: var(--primary);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
}
.footer-nav a:hover { background: #E7F0F8; }

/* 10) Tables (if any appear later) */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--primary); font-family: Georgia, 'Times New Roman', serif; }

/* 11) Utility spacing to prevent overlap */
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.gap-20 { display: flex; gap: 20px; }

/* 12) Images in text-image sections */
.text-image-section img { border-radius: 12px; box-shadow: var(--shadow-sm); }

/* 13) Readability helpers */
.content-wrapper > ul, .content-wrapper > ol { margin-top: var(--space-8); }
.content-wrapper > p + ul, .content-wrapper > p + ol { margin-top: 0; }

/* 14) Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.06);
  padding: var(--space-16);
  transform: translateY(100%);
  transition: transform 300ms ease;
  z-index: 120;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-row { display: flex; flex-direction: column; gap: var(--space-12); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--space-12); }
.cookie-actions .btn { min-width: 140px; }
.cookie-actions .btn-accept { background: #EAF7F1; color: var(--secondary); border-color: #D6EFE5; }
.cookie-actions .btn-reject { background: #FDECEF; color: #9C3959; border-color: #F7D2DC; }
.cookie-actions .btn-settings { background: #EAF4FB; color: var(--primary); border-color: #D7E6F4; }

/* Cookie Preferences Modal */
.cookie-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: none;
  align-items: center; justify-content: center;
  z-index: 130;
}
.cookie-modal-overlay.open { display: flex; }
.cookie-modal {
  background: #FFFFFF;
  width: 92%; max-width: 640px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: var(--space-16);
  padding: var(--space-24);
}
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: 14px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); padding: 12px 14px; background: var(--accent); border: 1px solid var(--border); border-radius: var(--radius-md); }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: var(--space-12); justify-content: flex-end; }
/* Simple toggle */
.cookie-toggle { display: inline-flex; align-items: center; gap: 10px; }
.cookie-switch {
  width: 46px; height: 26px; border-radius: 26px; position: relative; background: #E5E7EB; transition: background-color 200ms ease;
}
.cookie-switch::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; left: 3px; top: 3px; background: #FFFFFF; box-shadow: var(--shadow-sm); transition: transform 200ms ease;
}
.cookie-switch.on { background: #C7EBD7; }
.cookie-switch.on::after { transform: translateX(20px); }

/* 15) Animations & Transitions */
.fade-in { animation: fadeIn 300ms ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* 16) Responsive – Mobile-first */
@media (min-width: 640px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
}

@media (min-width: 768px) {
  .text-image-section { flex-direction: row; }
  .container { gap: var(--space-24); }
  .content-wrapper { padding: var(--space-32); }
}

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

  header .container { gap: var(--space-24); }
  .logo img { height: 48px; }

  h1 { font-size: 44px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }

  /* Align header groups */
  header .container { align-items: center; }
}

/* 17) Accessibility & States */
.btn:focus-visible, .mobile-menu-toggle:focus-visible, .mobile-nav a:focus-visible, .main-nav a:focus-visible, .footer-nav a:focus-visible {
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.6);
}

/* 18) Additional soft pastel accents for key blocks */
.content-wrapper {
  background: #FFFFFF;
  border-image: initial;
}
/* Add subtle top border tint per section for visual hierarchy */
main > section .content-wrapper { border-top: 4px solid rgba(11,59,92,0.06); }
main > section:nth-of-type(2) .content-wrapper { border-top-color: rgba(156,57,89,0.18); }
main > section:nth-of-type(3) .content-wrapper { border-top-color: rgba(34,125,83,0.18); }
main > section:nth-of-type(4) .content-wrapper { border-top-color: rgba(86, 70, 151, 0.18); }
main > section:nth-of-type(5) .content-wrapper { border-top-color: rgba(255, 159, 67, 0.25); }

/* 19) Header CTA group on desktop spacing */
.header-ctas .btn { white-space: nowrap; }

/* 20) Ensure all global flex containers use gap to avoid overlap */
.content-wrapper, .card-container, .content-grid, .text-image-section, .testimonial-card, .feature-item, .footer-nav, .header-ctas, .main-nav, nav[aria-label="Brotkrumen"], .cookie-actions, .mobile-nav { gap: 20px; }

/* END */
