/* =====================================
   MetropolBlick Immobilien – Vintage Retro CSS (Mobile-first)
   - Design: Vintage/Retro with brand colors and fonts
   - ONLY Flexbox for layouts
   - Includes mobile menu + cookie consent
   ===================================== */

/* ========= Reset & Normalize ========= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure { margin: 0; padding: 0; }
ul, ol { padding-left: 1.2rem; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { font: inherit; border: none; background: none; cursor: pointer; }
:focus-visible { outline: 2px dashed #7A5C50; outline-offset: 2px; }

/* ========= Theme Variables ========= */
:root {
  /* Brand */
  --primary: #1F3A5B; /* Navy */
  --secondary: #2E7D6C; /* Teal */
  --accent: #F2F5F7; /* Light */

  /* Vintage Retro Palette */
  --ink: #2B2A28;         /* Dark ink */
  --paper: #F5EFE4;       /* Warm paper */
  --cream: #FFF8E7;       /* Soft cream */
  --mustard: #D4A373;     /* Mustard */
  --rust: #C05A36;        /* Rust */
  --brown: #7A5C50;       /* Cocoa */
  --sage: #6B8C6E;        /* Sage */
  --line: #D8CBB4;        /* Line for borders */

  /* Effects */
  --shadow-sm: 0 1px 0 rgba(43,42,40,0.12);
  --shadow-md: 0 6px 14px rgba(43,42,40,0.08);
  --shadow-lg: 0 14px 28px rgba(43,42,40,0.12);

  /* Typography scale */
  --fs-xs: 14px;
  --fs-sm: 16px;
  --fs-md: 18px;
  --fs-lg: 24px;
  --fs-xl: 32px;
  --fs-xxl: 40px;
}

/* ========= Base ========= */
body {
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
}

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

h1 { font-size: var(--fs-xxl); line-height: 1.2; margin-bottom: 12px; }
h2 { font-size: var(--fs-xl); line-height: 1.25; margin-bottom: 16px; position: relative; }
h3 { font-size: var(--fs-lg); line-height: 1.3; margin-bottom: 12px; }
h4 { font-size: 20px; line-height: 1.35; margin-bottom: 10px; }

/* Vintage underline accent */
h2::after {
  content: ''; display: block; width: 72px; height: 4px; margin-top: 8px;
  background: var(--mustard);
}

p { margin-bottom: 14px; }
ul, ol { margin-bottom: 16px; }
li { margin-bottom: 8px; }
li::marker { color: var(--brown); }
strong { color: var(--ink); }

/* ========= Layout Containers (Flex only) ========= */
.container {
  display: flex; flex-wrap: wrap; gap: 16px; width: 100%;
  justify-content: center; padding: 0 16px;
}
.content-wrapper {
  display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 1160px;
}

/* ========= Mandatory Spacing & Alignment Patterns ========= */
.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; }

/* ========= Header & Navigation ========= */
header { background: var(--cream); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 900; }
header .container { align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.logo img { height: 34px; filter: saturate(0.9) contrast(1); }

.main-nav { display: none; align-items: center; gap: 16px; }
.main-nav a {
  padding: 8px 10px; color: var(--primary);
  border-bottom: 2px solid transparent; transition: color .2s ease, border-color .2s ease;
}
.main-nav a:hover { color: var(--rust); border-color: var(--rust); }

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

/* Mobile toggle */
.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 6px; color: var(--ink);
  background: var(--accent); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.mobile-menu-toggle:hover { background: #e9eef1; }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; background: rgba(43,42,40,0.65);
  display: flex; align-items: flex-start; justify-content: flex-end;
  transform: translateX(100%); opacity: 0; pointer-events: none; transition: transform .35s ease, opacity .35s ease;
  z-index: 1200;
}
.mobile-menu.open { transform: translateX(0); opacity: 1; pointer-events: auto; }

.mobile-nav {
  background: var(--cream); border-left: 4px solid var(--mustard);
  width: 86%; max-width: 360px; min-height: 100vh; padding: 20px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-lg);
}
.mobile-menu-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--cream); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.mobile-nav a {
  display: flex; align-items: center; padding: 12px; border-radius: 6px;
  color: var(--primary); border: 1px dashed transparent; transition: background-color .2s ease, transform .1s ease;
}
.mobile-nav a:hover { background: #fff; border-color: var(--line); transform: translateX(2px); }

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

/* ========= Hero ========= */
.hero { background: var(--accent); border-bottom: 1px solid var(--line); }
.hero .content-wrapper { padding: 30px 0; }
.hero h1 { color: var(--primary); }
.hero .cta-group { margin-top: 8px; }
.hero .trust { font-size: var(--fs-xs); color: #4a4a48; opacity: 0.9; }

/* ========= Buttons ========= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: 8px; border: 2px solid var(--ink);
  background: var(--cream); color: var(--ink); box-shadow: 0 2px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 0 var(--ink); }

.btn.primary { background: var(--secondary); color: #fff; border-color: var(--brown); box-shadow: 0 2px 0 var(--brown); }
.btn.primary:hover { background: #256a5d; }

.btn.secondary { background: var(--cream); color: var(--primary); border-color: var(--primary); }
.btn.secondary:hover { background: #fff; }

.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }

/* ========= Text-Image Sections ========= */
.text-image-section { align-items: center; }
.text-image-section > div {
  flex: 1 1 280px; padding: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-sm);
}
.text-image-section h3 { color: var(--rust); }

/* ========= Property Cards ========= */
.property-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.property-card {
  flex: 1 1 280px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.property-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.property-card h4, .property-card h3 { color: var(--primary); }

/* ========= Testimonials (high contrast) ========= */
.testimonial-card {
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 6px solid var(--mustard);
  border-radius: 10px; box-shadow: var(--shadow-sm);
}
.testimonial-card p { margin: 0; }
.testimonial-card p + p { margin-left: auto; font-size: var(--fs-sm); }

/* ========= Lists & Steps ========= */
ol { padding-left: 1.2rem; }
ol > li { margin-bottom: 10px; }

/* ========= Content Sections ========= */
main section { padding: 28px 0; }
main section .content-wrapper { gap: 20px; }

/* ========= Footer ========= */
footer { background: var(--cream); border-top: 1px solid var(--line); margin-top: 24px; }
footer .content-wrapper {
  padding: 22px 0; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start;
}
.footer-nav, .legal-nav, .footer-cta, .newsletter, .social { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a, .legal-nav a { color: var(--primary); border-bottom: 1px dotted transparent; padding-bottom: 2px; }
.footer-nav a:hover, .legal-nav a:hover { border-color: var(--primary); }
.footer-cta { flex-direction: row; flex-wrap: wrap; gap: 10px; }
footer img { height: 32px; }

/* ========= Global Utilities ========= */
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: #65625e; }

/* ========= Cookie Consent ========= */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1400; display: none;
  background: var(--cream); border-top: 2px solid var(--mustard); box-shadow: 0 -6px 14px rgba(43,42,40,0.08);
}
.cookie-banner.show { display: flex; }
.cookie-banner .container { align-items: center; justify-content: center; }
.cookie-banner .content-wrapper { flex-direction: row; align-items: center; gap: 16px; }
.cookie-text { flex: 1 1 auto; font-size: var(--fs-sm); }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-btn { padding: 10px 14px; border-radius: 8px; border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.cookie-btn.accept { background: var(--secondary); color: #fff; border-color: var(--brown); box-shadow: 0 2px 0 var(--brown); }
.cookie-btn.reject { background: #fff; color: var(--rust); border-color: var(--rust); }
.cookie-btn.settings { background: var(--cream); color: var(--ink); }
.cookie-btn:hover { transform: translateY(-1px); }

/* Cookie modal */
.cookie-modal {
  position: fixed; inset: 0; z-index: 1500; background: rgba(43,42,40,0.65);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.cookie-modal.open { display: flex; }
.cookie-modal-content {
  background: #fff; width: 100%; max-width: 720px; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px dotted var(--line); }
.cookie-switch { display: inline-flex; align-items: center; gap: 10px; }
.cookie-switch input[type=checkbox] { appearance: none; width: 44px; height: 24px; border-radius: 24px; border: 1px solid var(--line); background: var(--accent); position: relative; }
.cookie-switch input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid var(--line); transition: transform .2s ease; }
.cookie-switch input[type=checkbox]:checked { background: var(--secondary); }
.cookie-switch input[type=checkbox]:checked::after { transform: translateX(20px); }
.cookie-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ========= Accessibility states ========= */
a:focus-visible, .btn:focus-visible, button:focus-visible { outline: 2px dashed var(--mustard); outline-offset: 2px; }

/* ========= Responsive Rules ========= */
@media (min-width: 768px) {
  h1 { font-size: 48px; }
  .text-image-section { flex-direction: row; align-items: center; }
  .hero .content-wrapper { padding: 40px 0; }
}

@media (min-width: 992px) {
  header .container { gap: 20px; }
  .content-wrapper { gap: 24px; }
}

/* ========= Links & Interactive ========= */
main a { color: var(--rust); border-bottom: 1px dotted var(--rust); }
main a:hover { color: #a8472b; border-bottom-style: solid; }

/* ========= Cards & Vintage Accents ========= */
.card, .text-image-section > div, .property-card, .testimonial-card {
  background-clip: padding-box;
}
/* Subtle vintage corner detail */
.card::before, .text-image-section > div::before, .property-card::before, .testimonial-card::before {
  content: ''; position: absolute; top: -1px; left: -1px; width: 12px; height: 12px; border-top: 2px solid var(--mustard); border-left: 2px solid var(--mustard);
}
.card::after, .text-image-section > div::after, .property-card::after, .testimonial-card::after {
  content: ''; position: absolute; bottom: -1px; right: -1px; width: 12px; height: 12px; border-bottom: 2px solid var(--mustard); border-right: 2px solid var(--mustard);
}

/* ========= Breadcrumbs (hero nav p) ========= */
.hero nav p { font-size: var(--fs-xs); color: #5a5855; }

/* ========= Forms (basic mailto/tel visual) ========= */
a[href^='tel'], a[href^='mailto'] { font-weight: 600; color: var(--primary); border-bottom-color: transparent; }
a[href^='tel']:hover, a[href^='mailto']:hover { color: var(--rust); }

/* ========= Ensure spacing between elements ========= */
main .content-wrapper > * + * { margin-top: 4px; }
section + section { border-top: 1px solid var(--line); }

/* ========= Z-index Management ========= */
header { z-index: 900; }
.mobile-menu { z-index: 1200; }
.cookie-banner { z-index: 1400; }
.cookie-modal { z-index: 1500; }

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