/* ==========================================================================
   Duskfall Crest Metropol-Immobilien – style.css
   Scandinavian clean: light colors, simple fonts, functional beauty
   Brand: primary #1E2A44, secondary #8C5A1E, accent #F5F7FA
   Layout: FLEXBOX ONLY (no CSS Grid/Columns)
   Mobile-first, responsive, accessible
   ========================================================================= */

/* 1) CSS RESET & NORMALIZE */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: transparent; border: none; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid #8C5A1E; outline-offset: 2px; }

/* 2) THEME TOKENS */
:root {
  --brand-primary: #1E2A44;
  --brand-secondary: #8C5A1E;
  --brand-accent: #F5F7FA;
  --ink: #1E2A44;
  --ink-muted: #4A5B77;
  --surface: #FFFFFF;
  --surface-soft: #FAFBFD;
  --border: #E3E8EF;
  --shadow-1: 0 2px 8px rgba(30,42,68,0.06);
  --shadow-2: 0 6px 18px rgba(30,42,68,0.10);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --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-60: 60px;
  --transition-fast: 180ms ease;
  --transition-base: 260ms ease;
}

/* 3) TYPOGRAPHY */
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif; /* brand body */
  color: var(--ink);
  background: var(--surface-soft);
  line-height: 1.65;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: "Trebuchet MS", Verdana, sans-serif; /* brand display */
  color: var(--ink);
  margin: 0 0 12px 0;
  line-height: 1.25;
}

h1 { font-size: 32px; letter-spacing: 0.2px; }
h2 { font-size: 24px; letter-spacing: 0.2px; }
h3 { font-size: 18px; letter-spacing: 0.1px; }

p { margin: 0 0 12px 0; color: var(--ink); }

ul, ol { margin: 0 0 16px 22px; }
li { margin-bottom: 8px; }

small { color: var(--ink-muted); }

/* 4) LINKS & BUTTONS */
a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: #2B3B60; }
a:focus-visible { outline: 2px solid var(--brand-secondary); outline-offset: 2px; }

/* Button-like anchors in CTAs */
.header-cta a,
.text-section > a,
.hero a,
.content-wrapper > p > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  margin-right: 10px;
  margin-bottom: 10px;
  border-radius: var(--radius-s);
  border: 1px solid var(--brand-primary);
  background: var(--brand-primary);
  color: #fff;
  box-shadow: var(--shadow-1);
  transition: background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.header-cta a:hover,
.text-section > a:hover,
.hero a:hover,
.content-wrapper > p > a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
  background: #233252;
}
/* Outline style (secondary action) */
.text-section > a + a,
.hero a + a,
.header-cta a + a {
  background: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.text-section > a + a:hover,
.hero a + a:hover,
.header-cta a + a:hover {
  background: var(--brand-accent);
  color: var(--ink);
}

/* Subtle secondary accent utility */
.btn-accent { background: var(--brand-secondary); border-color: var(--brand-secondary); }
.btn-accent:hover { background: #754A18; border-color: #754A18; }

/* 5) LAYOUT PRIMITIVES (FLEXBOX ONLY) */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex; /* flex-only */
  flex-direction: column;
  gap: var(--space-20);
}

/* Generic section spacing to breathe like Scandinavian minimalism */
section { margin-bottom: var(--space-60); padding: var(--space-40) 0; background: transparent; }
/* MANDATORY PATTERN: .section spacing */
.section { margin-bottom: 60px; padding: 40px 20px; }

.content-wrapper {
  display: flex; /* flex-only */
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-20);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--space-24);
  box-shadow: var(--shadow-1);
}

.text-section { display: flex; flex-direction: column; gap: 10px; }

/* Cards and flexible collections */
/* MANDATORY PATTERN: .card-container */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
/* MANDATORY PATTERN: .card */
.card {
  margin-bottom: 20px;
  position: relative; /* allowed, not absolute */
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--transition-base), transform var(--transition-fast);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* MANDATORY PATTERN: .content-grid */
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }

/* MANDATORY PATTERN: .text-image-section */
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.text-image-section img { border-radius: var(--radius-s); box-shadow: var(--shadow-1); }

/* MANDATORY PATTERN: .testimonial-card */
.testimonial-card {
  display: flex; align-items: center; gap: 20px; padding: 20px;
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  background: var(--brand-accent); /* light for readability */
  color: var(--ink); /* dark text on light bg (accessibility) */
  box-shadow: var(--shadow-1);
}
.testimonial-card p { margin: 0; }

/* MANDATORY PATTERN: .feature-item */
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* 6) HEADER & NAVIGATION */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 20;
}

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

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

.main-nav { display: none; align-items: center; gap: 16px; }
.main-nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.main-nav a:hover { background: var(--brand-accent); color: #233252; }

.header-cta { display: none; align-items: center; gap: 10px; }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.mobile-menu-toggle:hover { background: var(--brand-accent); box-shadow: var(--shadow-2); transform: translateY(-1px); }

/* 7) HERO */
.hero { background: var(--brand-accent); padding: 40px 0; }
.hero .content-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
.hero h1 { color: var(--brand-primary); }
.hero p { color: var(--ink); }

/* 8) CONTENT ENHANCEMENTS */
blockquote {
  margin: 0; padding: 14px 16px; border-left: 4px solid var(--brand-secondary);
  background: #FFF9F2; border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

/* Inline icons in paragraphs */
p img[alt^="Telefon"],
p img[alt^="E-Mail"],
p img[alt^="Adresse"],
p img[alt^="Mail"],
p img[alt^="Telefon"] {
  display: inline-flex; vertical-align: middle; margin: 0 8px 0 0; height: 18px; width: auto;
}

/* 9) FOOTER */
footer { background: var(--surface); border-top: 1px solid var(--border); }
footer .container { padding-top: 24px; padding-bottom: 24px; }
footer .content-wrapper {
  background: transparent; border: none; box-shadow: none; padding: 0; gap: 20px;
}



/* 10) MOBILE NAV MENU (slide-in) */
.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 360px;
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  z-index: 1000;
  padding: 16px;
}
/* Backdrop using body class */
body.nav-open::after {
  content: ""; position: fixed; inset: 0; background: rgba(30,42,68,0.38);
  z-index: 999; /* under menu */
}
/* Open state expected from JS by toggling .nav-open on body */
body.nav-open .mobile-menu { transform: translateX(0); }

.mobile-menu-close {
  align-self: flex-end;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--ink);
}
.mobile-menu-close:hover { background: var(--brand-accent); }

.mobile-nav { display: flex; flex-direction: column; gap: 8px; width: 100%; padding-top: 10px; }
.mobile-nav a {
  display: flex; align-items: center; padding: 12px 10px;
  border-radius: 8px; color: var(--ink);
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.mobile-nav a:hover { background: var(--brand-accent); border-color: var(--border); }

/* 11) COOKIE CONSENT BANNER & MODAL */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-2);
  padding: 14px;
  transform: translateY(120%);
  transition: transform var(--transition-base);
  z-index: 1100;
}
.cookie-banner.show,
body.cookie-banner-visible .cookie-banner { transform: translateY(0); }

.cookie-banner .cookie-text { color: var(--ink); }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-buttons .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 8px; border: 1px solid var(--brand-primary);
  transition: background var(--transition-base), color var(--transition-base), border var(--transition-base);
}
.cookie-buttons .btn.accept { background: var(--brand-primary); color: #fff; }
.cookie-buttons .btn.accept:hover { background: #233252; }
.cookie-buttons .btn.reject { background: transparent; color: var(--brand-primary); }
.cookie-buttons .btn.reject:hover { background: var(--brand-accent); }
.cookie-buttons .btn.settings { border-color: var(--brand-secondary); color: var(--brand-secondary); }
.cookie-buttons .btn.settings:hover { background: #FFF5EA; }

/* Cookie preferences modal */
.cookie-backdrop {
  position: fixed; inset: 0; background: rgba(30,42,68,0.38);
  opacity: 0; pointer-events: none; transition: opacity var(--transition-base); z-index: 1200;
}
.cookie-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, 60%);
  width: min(680px, calc(100% - 32px));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); box-shadow: var(--shadow-2);
  padding: 20px; z-index: 1201; opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cookie-row:last-child { border-bottom: none; }

/* Toggle switch */
.switch { position: relative; width: 46px; height: 26px; display: inline-flex; align-items: center; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 30px; background: #D5DBE5; outline: none; transition: background var(--transition-fast); }
.switch input:checked { background: var(--brand-primary); }
.switch input::after { content: ""; position: relative; left: 2px; display: block; width: 22px; height: 22px; background: #fff; border-radius: 50%; transform: translateX(0); transition: transform var(--transition-fast); box-shadow: var(--shadow-1); }
.switch input:checked::after { transform: translateX(20px); }

/* Open modal states */
.cookie-open .cookie-backdrop { opacity: 1; pointer-events: auto; }
.cookie-open .cookie-modal { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }

/* 12) UTILITIES */
.hr { height: 1px; background: var(--border); width: 100%; }
.muted { color: var(--ink-muted); }
.rounded { border-radius: var(--radius-m); }
.hidden { display: none !important; }

/* 13) RESPONSIVE BREAKPOINTS */
@media (min-width: 600px) {
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
}

@media (min-width: 768px) {
  h1 { font-size: 42px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }

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

  /* Wider content wrappers spacing */
  .content-wrapper { padding: 28px; gap: 24px; }

  /* Text-image sections horizontal */
  .text-image-section { flex-wrap: nowrap; }
}

@media (min-width: 1024px) {
  .logo img { height: 40px; }
  .container { gap: var(--space-24); }
}

/* 14) ACCESSIBILITY & MOTION PREFERENCES */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 15) LIST PADDING IN CONTENT WRAPPER for consistent breathing */
.content-wrapper ul,
.content-wrapper ol { padding-left: 20px; }

/* 16) ENSURE NO OVERLAPPING & CONSISTENT GAPS */
.content-wrapper > * + * { margin-top: 0; }
.card + .card { margin-top: 0; }

/* 17) ADDITIONAL FLEX WRAPPERS FOR PAGE GROUPINGS */
/* These help when future grids are needed, still flex-only */
.flex-row { display: flex; flex-wrap: wrap; gap: 20px; }
.flex-col { display: flex; flex-direction: column; gap: 16px; }

/* 18) PAGE-SPECIFIC POLISH (generic since content is semantic) */
/* KPIs or inline strong elements styling */
strong { color: var(--ink); }

/* Hero links spacing refinement */
.hero .content-wrapper a { margin-top: 4px; }

/* Testimonials spacing within sections */
.content-wrapper .testimonial-card + .testimonial-card { margin-top: 10px; }

/* 19) COMPLIANCE WITH MANDATORY FLEX PATTERNS (already applied above) */
/* .section { margin-bottom: 60px; padding: 40px 20px; } [included] */
/* .card-container { display: flex; flex-wrap: wrap; gap: 24px; } [included] */
/* .card { margin-bottom: 20px; position: relative; } [included] */
/* .content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; } [included] */
/* .text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; } [included] */
/* .testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; } [included] */
/* .feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; } [included] */

/* 20) HEADER CTA COLOR SCHEME TO MATCH SCANDINAVIAN CLEAN */
.header-cta a { border-radius: 999px; padding: 10px 18px; }
.header-cta a + a { border-color: var(--brand-secondary); color: var(--brand-secondary); }
.header-cta a + a:hover { background: #FFF5EA; }

/* 21) ENSURE MAIN AREAS DO NOT COLLIDE */
main .container { gap: var(--space-20); }

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