/* =====================================================
   Stadtblicke Immobilien - Professional Corporate Theme
   Role: Senior CSS Developer & UI Designer
   Brand: blue/gray palette, formal tone, business fonts
   Fonts: Trebuchet MS (display), Verdana (body)
   NOTE: Flexbox-only layouts. No CSS Grid or CSS Columns.
   ===================================================== */

/* ========== CSS RESET & NORMALIZE (light) ========== */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0 0 16px 20px; padding: 0; }
p { margin: 0 0 16px; }

/* ========== THEME VARIABLES ========== */
:root {
  --color-primary: #1E3A8A; /* Navy / Corporate Blue */
  --color-primary-600: #2746A5;
  --color-primary-700: #193072;
  --color-secondary: #F59E0B; /* Amber */
  --color-accent: #FFFFFF; /* White */
  --gray-900: #0F172A; /* Text */
  --gray-800: #111827;
  --gray-700: #374151;
  --gray-600: #475569;
  --gray-500: #64748B;
  --gray-400: #94A3B8;
  --gray-300: #CBD5E1;
  --gray-200: #E2E8F0;
  --gray-100: #F1F5F9;
  --gray-50:  #F8FAFC;
  --success: #10B981;
  --danger: #DC2626;
  --focus: #2563EB;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 32px rgba(15, 23, 42, 0.12);

  --container-max: 1200px;
  --content-max: 1100px;
}

/* ========== BASE TYPOGRAPHY ========== */
html { scroll-behavior: smooth; }
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: var(--gray-900);
  background-color: var(--gray-50);
  line-height: 1.6;
  font-size: 16px;
}
h1, h2, h3, h4 { font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; color: var(--gray-900); margin: 0 0 12px; line-height: 1.25; }
h1 { font-size: 32px; letter-spacing: -0.2px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
small { color: var(--gray-600); }
strong { font-weight: 700; color: var(--gray-900); }

/* Headings color accents for corporate look */
.hero h1 { color: var(--color-primary); }
section h2 { border-left: 4px solid var(--color-primary); padding-left: 12px; }

/* Links */
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ========== LAYOUT PRIMITIVES (Flex-only) ========== */
.container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}
.content-wrapper {
  width: 100%;
  max-width: var(--content-max);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Mandatory spacing classes (as requested) */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--color-accent); border: 1px solid var(--gray-200); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.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: var(--gray-900); border: 1px solid var(--gray-200); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Default section spacing for all sections */
main section { margin-bottom: 60px; }

/* Text blocks as corporate info cards */
.text-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.text-section ul li { margin-bottom: 8px; color: var(--gray-800); }
.text-section ul li img { width: 18px; height: 18px; display: inline-block; vertical-align: middle; margin-right: 8px; }

/* Micro-interactions for cards */
.text-section:hover, .card:hover, .testimonial-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); transition: all 0.25s ease; }

/* ========== HEADER & NAVIGATION ========== */
header {
  position: sticky;
  top: 0;
  background: #FFFFFF;
  border-bottom: 1px solid var(--gray-200);
  z-index: 1000;
}
header .content-wrapper { padding: 12px 0; }
.logo { display: flex; align-items: center; }
.logo img { height: 38px; width: auto; }

.main-nav { display: none; gap: 16px; align-items: center; }
.main-nav a { color: var(--gray-800); padding: 8px 10px; border-radius: var(--radius-sm); transition: color 0.2s ease, background 0.2s ease; }
.main-nav a:hover { color: var(--color-primary); background: var(--gray-100); text-decoration: none; }

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

/* Mobile burger */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: #FFFFFF;
  color: var(--color-primary);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.mobile-menu-toggle:hover { background: var(--gray-100); }
.mobile-menu-toggle:active { transform: scale(0.98); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.45);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 1200;
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  color: var(--gray-800);
  cursor: pointer;
}
.mobile-nav {
  width: 80%; max-width: 360px; height: 100%;
  background: #FFFFFF;
  display: flex; flex-direction: column; flex-wrap: nowrap; gap: 8px;
  padding: 70px 20px 20px; /* leave space for close button */
  transform: translateX(20px);
  transition: transform 0.35s ease;
}
.mobile-menu.active .mobile-nav { transform: translateX(0); }
.mobile-nav a {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  color: var(--gray-800);
  border: 1px solid transparent;
}
.mobile-nav a:hover { background: var(--gray-100); border-color: var(--gray-200); text-decoration: none; }

/* ========== HERO ========== */
.hero { background: #ECF2FF; border-bottom: 1px solid var(--gray-200); }
.hero .content-wrapper { padding: 28px 0; }
.hero p { color: var(--gray-700); max-width: 70ch; }
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }

/* ========== BUTTONS ========== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-primary);
  background: #FFFFFF;
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.08s ease;
}
.button:hover { background: var(--gray-100); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--color-primary); color: #FFFFFF; border-color: var(--color-primary); }
.button.primary:hover { background: var(--color-primary-600); }
.button.secondary { background: #FFFFFF; color: var(--color-primary); border-color: var(--gray-300); }
.button.secondary:hover { background: var(--gray-100); border-color: var(--gray-400); }

/* Inline icon alignment */
.button img { width: 18px; height: 18px; }

/* ========== LISTS & CONTENT ========== */
ul { display: block; }
li { color: var(--gray-800); margin-bottom: 8px; }
ol { padding-left: 20px; }

/* Inline icon rows in content */
.text-section p img, footer .text-section p img { width: 18px; height: 18px; display: inline-block; vertical-align: middle; margin-right: 8px; }

/* ========== TESTIMONIALS (readability) ========== */
.testimonial-card p { margin: 0; }
.testimonial-card p + p { color: var(--gray-700); }

/* ========== FOOTER ========== */
footer { background: var(--color-primary); color: #FFFFFF; border-top: 4px solid var(--color-secondary); }
footer .content-wrapper { padding: 24px 0; }
footer .text-section { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255,255,255,0.15); color: #FFFFFF; }
footer .text-section p, footer .text-section h3 { color: #FFFFFF; }
.footer-nav, .footer-legal { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-nav a, .footer-legal a { color: #E5E7EB; padding: 6px 8px; border-radius: var(--radius-sm); }
.footer-nav a:hover, .footer-legal a:hover { background: rgba(255,255,255,0.12); color: #FFFFFF; text-decoration: none; }

/* ========== FORMS & INPUTS (basic) ========== */
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-primary); }

/* ========== MISC LAYOUT HELPERS ========== */
.align-center { display: flex; align-items: center; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }

/* ========== COOKIE CONSENT BANNER & MODAL ========== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #FFFFFF;
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  z-index: 1100;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}
.cookie-banner.active { transform: translateY(0); }
.cookie-banner .cookie-text { display: flex; flex-direction: column; gap: 8px; color: var(--gray-800); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .btn-accept { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.cookie-actions .btn-reject { background: #FFFFFF; color: var(--gray-800); border-color: var(--gray-300); }
.cookie-actions .btn-settings { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-200); }

/* Cookie Preferences Modal */
.cookie-modal {
  position: fixed;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1300;
}
.cookie-modal.active { opacity: 1; pointer-events: auto; }
.cookie-modal-content {
  width: min(92%, 720px);
  background: #FFFFFF;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px;
}
.cookie-categories { display: flex; flex-direction: column; gap: 12px; }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--gray-200); }
.cookie-row:last-child { border-bottom: none; }

/* Toggle (visual) */
.cookie-toggle { display: inline-flex; align-items: center; gap: 10px; }
.switch {
  width: 44px; height: 26px; border-radius: 20px; border: 1px solid var(--gray-300);
  background: var(--gray-200);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 50%; left: 3px; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: var(--shadow-sm);
  transition: left 0.2s ease;
}
.switch.on { background: var(--success); border-color: var(--success); }
.switch.on::after { left: 21px; }
.switch.locked { background: var(--gray-300); border-color: var(--gray-300); }

.cookie-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* ========== RESPONSIVE RULES ========== */
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }

  header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; }
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }

  .hero .content-wrapper { padding: 40px 0; }

  .text-image-section { flex-direction: row; }
}

@media (max-width: 768px) {
  .text-image-section { flex-direction: column; align-items: center; }
  .footer-nav, .footer-legal { gap: 8px; }
}

@media (min-width: 992px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  body { font-size: 17px; }

  .hero .content-wrapper { padding: 56px 0; }
}

/* ========== ACCESSIBILITY & STATES ========== */
button, .button { cursor: pointer; }
button:disabled, .button:disabled { cursor: not-allowed; opacity: 0.7; }

/* ========== UTILITIES FOR PAGES (match provided classes) ========== */
/* Make any nav groups in content behave well */
nav[aria-label] { display: flex; flex-wrap: wrap; gap: 12px; }

/* Ensure adequate spacing between adjacent blocks */
.content-wrapper > * { margin: 0; }

/* Icon rows in lists */
li img { width: 16px; height: 16px; margin-right: 6px; vertical-align: middle; }

/* Prevent overlap by ensuring minimal spacing between cards/blocks */
.text-section + .text-section,
.text-section + .testimonial-card,
.testimonial-card + .testimonial-card { margin-top: 20px; }

/* ========== HOVER/FOCUS POLISH ========== */
.button:focus-visible, .mobile-menu-toggle:focus-visible, .mobile-menu-close:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ========== PAGE-SPECIFIC LIGHT TOUCHES ========== */
/* Hero paragraphs narrower on large screens for corporate readability */
@media (min-width: 992px) { .hero p { max-width: 60ch; } }

/* Footer compact spacing on very small screens */
@media (max-width: 420px) { footer .content-wrapper { gap: 16px; } }

/* ========== ENSURE FLEX ON COMMON CONTAINERS ========== */
header .container, main .container, footer .container { display: flex; }

/* ========== SAFETY: NO ABSOLUTE FOR CONTENT CARDS (only overlay buttons used) ========== */
/* Already respected. */
