/* =====================================
   HERA Immo Gera - Vintage Retro Style
   Global style.css (mobile-first, flex-only)
   ===================================== */

/* ----------------------
   CSS Reset & Normalize
------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; }
ul, ol { margin: 0; padding: 0 0 0 1.2rem; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
a { color: inherit; text-decoration-color: currentColor; text-underline-offset: 3px; }
button { border: none; background: none; cursor: pointer; }

/* ----------------------
   Theme Variables
------------------------- */
:root {
  /* Brand */
  --primary: #123B5A; /* Navy */
  --secondary: #2F8F74; /* Teal/Green */
  --accent: #F4F6F8; /* Light UI */
  /* Vintage/Retro Palette */
  --paper: #F7F2E7; /* Warm paper */
  --cream: #EFE7DA; /* Aged cream */
  --ink: #2B2B2B; /* Dark ink */
  --rust: #B3542E; /* Burnt orange */
  --mustard: #CCA43B; /* Mustard */
  --sage: #8AA37B; /* Sage green */
  --maroon: #6E3B3B; /* Deep retro accent */
  /* Effects */
  --shadow-1: 0 2px 6px rgba(0,0,0,.08);
  --shadow-2: 0 6px 18px rgba(0,0,0,.12);
  --radius-1: 8px;
  --radius-2: 12px;
  /* Typography */
  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: Arial, Helvetica, sans-serif;
  --fs-14: 14px; --fs-16: 16px; --fs-18: 18px; --fs-20: 20px;
  --fs-24: 24px; --fs-28: 28px; --fs-32: 32px; --fs-40: 40px; --fs-48: 48px;
  /* Spacing */
  --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 {
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--primary); line-height: 1.25; }
h1 { font-size: var(--fs-40); letter-spacing: 0.5px; }
h2 { font-size: var(--fs-28); margin-bottom: var(--space-16); border-bottom: 4px double var(--mustard); padding-bottom: 8px; }
h3 { font-size: var(--fs-20); color: var(--maroon); }
.subheadline { font-size: var(--fs-18); color: #4a4a4a; max-width: 75ch; }

p { margin-bottom: var(--space-12); }
strong { color: var(--maroon); }

/* Retro link styling */
a { color: var(--secondary); text-decoration-thickness: 1.5px; }
a:hover { color: var(--rust); background: rgba(179,84,46,0.08); transition: color .2s ease, background .2s ease; }

/* Focus styles */
:focus-visible { outline: 3px dashed var(--mustard); outline-offset: 2px; }

/* ----------------------
   Layout Helpers (Flex Only)
------------------------- */
.container {
  display: flex; flex-direction: column; gap: var(--space-20);
  width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px;
}
.content-wrapper { display: flex; flex-direction: column; gap: var(--space-20); }

/* 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; }

/* Generic section spacing for semantic <section> */
main section { margin-bottom: var(--space-60); padding: var(--space-40) 0; }

/* ----------------------
   Header & Navigation
------------------------- */
header {
  background: var(--cream);
  border-bottom: 6px solid var(--mustard);
  box-shadow: var(--shadow-1);
}
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; }

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

.main-nav { display: none; align-items: center; gap: var(--space-20); }
.main-nav a { font-weight: 600; color: var(--primary); padding: 8px 10px; border-radius: 6px; }
.main-nav a[aria-current="page"] { background: var(--accent); box-shadow: inset 0 0 0 2px var(--mustard); }
.main-nav a:hover { background: #fff; color: var(--rust); }

.header-cta { display: none; align-items: center; gap: var(--space-12); }
.header-cta a { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: var(--radius-1); box-shadow: var(--shadow-1); border: 2px solid var(--primary); background: #fff; color: var(--primary); font-weight: 700; }
.header-cta a:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.header-cta a:first-child { background: var(--mustard); border-color: var(--maroon); color: #1b1b1b; }
.header-cta a:first-child:hover { background: #deb859; }

.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 22px;
  box-shadow: var(--shadow-1);
}
.mobile-menu-toggle:hover { background: #0f2f47; }

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(18,59,90,0.96);
  color: #fff;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: var(--space-20);
  padding: 20px;
  transform: translateX(100%);
  transition: transform .35s ease;
}
.mobile-menu.open, .mobile-menu.is-open, body.menu-open .mobile-menu { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end; width: 42px; height: 42px; border-radius: 8px; background: var(--rust); color: #fff; font-size: 20px;
}
.mobile-nav { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.mobile-nav a {
  display: flex; align-items: center; padding: 14px 12px; border-radius: 10px; width: 100%;
  background: rgba(255,255,255,0.08); color: #fff; font-size: var(--fs-18); font-weight: 600;
}
.mobile-nav a:hover { background: rgba(255,255,255,0.18); }

/* ----------------------
   Hero Sections
------------------------- */
.hero { background: #fff; border-top: 8px double var(--rust); border-bottom: 8px double var(--mustard); }
.hero .container { padding-top: var(--space-32); padding-bottom: var(--space-32); }
.hero h1 { font-size: var(--fs-40); }
.hero .subheadline { margin-top: var(--space-12); }

/* CTA group buttons */
.cta-group { display: flex; flex-wrap: wrap; gap: var(--space-12); margin-top: var(--space-16); }
.cta-group a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 16px; border-radius: var(--radius-2);
  border: 2px solid var(--primary); background: var(--mustard); color: #1c1c1c; font-weight: 700; box-shadow: var(--shadow-1);
}
.cta-group a:nth-child(2) { background: #fff; color: var(--primary); border-color: var(--primary); }
.cta-group a:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* ----------------------
   Text Blocks, Lists, Articles
------------------------- */
.text-section { display: flex; flex-direction: column; gap: var(--space-12); }
.text-section ul { list-style: none; padding: 0; }
.text-section ul li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.text-section ul li::before { content: '\25CF'; position: absolute; left: 0; color: var(--mustard); font-size: 14px; top: 4px; }
.text-section ol { padding-left: 20px; }

/* Article cards inside content lists */
.text-section article {
  display: flex; flex-direction: column; gap: 8px; padding: 16px;
  background: #fff; border-radius: var(--radius-1);
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-1);
}
.text-section article h3 { color: var(--primary); }

/* Disclaimer & pagination */
.disclaimer { font-size: var(--fs-14); color: #5a5a5a; background: var(--accent); padding: 10px 12px; border-left: 4px solid var(--mustard); border-radius: 6px; }
[aria-label="Seitennummerierung"] { display: flex; gap: 10px; margin-top: var(--space-12); }
[aria-label="Seitennummerierung"] a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: #fff; border: 2px solid var(--primary); color: var(--primary); font-weight: 700; }
[aria-label="Seitennummerierung"] a:hover { background: var(--mustard); color: #1b1b1b; }

/* ----------------------
   Testimonials (High Contrast)
------------------------- */
.testimonial-card {
  background: #fff; border: 3px double var(--mustard); border-radius: var(--radius-2);
  color: var(--ink); box-shadow: var(--shadow-1);
}
.testimonial-card p { margin: 0; }
.testimonial-card p + p { margin-left: auto; color: var(--primary); }

/* ----------------------
   Numbers/Facts lists
------------------------- */
section ul { display: flex; flex-direction: column; gap: 8px; }

/* ----------------------
   Footer
------------------------- */
footer { background: var(--primary); color: #f6f6f6; padding: var(--space-32) 0; border-top: 8px double var(--rust); }
footer .content-wrapper { gap: var(--space-24); }
footer nav { display: flex; flex-wrap: wrap; gap: 12px 16px; }
footer nav a { color: #f6f6f6; padding: 6px 8px; border-radius: 6px; }
footer nav a:hover { background: rgba(255,255,255,.12); }
footer .text-section strong { color: #fff; }
footer img { filter: brightness(100%); }

/* ----------------------
   Generic Cards (optional class hooks)
------------------------- */
.card {
  background: #fff; border-radius: var(--radius-1);
  border: 2px solid var(--primary); box-shadow: var(--shadow-1);
  padding: var(--space-16);
}

/* ----------------------
   Utility & Micro-interactions
------------------------- */
@keyframes slide-up { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.hero h1, .hero .subheadline, .cta-group { animation: slide-up .5s ease both; }

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ----------------------
   Mobile-first Visibility
------------------------- */
/* By default (mobile): main nav hidden, burger visible, stacks everywhere */

/* ----------------------
   Responsive Breakpoints
------------------------- */
@media (min-width: 600px) {
  h1 { font-size: var(--fs-48); }
}

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

  /* Section wrappers side-by-side when reasonable */
  .content-wrapper { flex-direction: column; }
  .text-image-section { flex-direction: row; }

  /* Make some lists appear in two/three columns using flex-wrap only */
  .content-grid { justify-content: flex-start; }

  /* Footer layout improvements */
  footer .content-wrapper { flex-direction: row; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
}

@media (min-width: 992px) {
  .content-wrapper { flex-direction: column; }
  header .content-wrapper { flex-direction: row; }
}

/* ----------------------
   Buttons (anchors as buttons in contexts)
------------------------- */
button, .btn, .cta-group a, .header-cta a, [aria-label="Seitennummerierung"] a { transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease; }

/* ----------------------
   Forms (future-proof)
------------------------- */
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 8px; border: 2px solid var(--primary); background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 3px dashed var(--mustard); outline-offset: 2px; }

/* ----------------------
   Mobile Menu Backdrop Support (optional)
------------------------- */
.mobile-menu::backdrop { background: rgba(0,0,0,.4); }

/* ----------------------
   Cookie Consent Banner & Modal
------------------------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998;
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  background: #fff; color: var(--ink);
  border-top: 6px solid var(--mustard); box-shadow: 0 -6px 18px rgba(0,0,0,.12);
  padding: 16px; margin: 0;
  transform: translateY(100%);
  transition: transform .35s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-text { font-size: var(--fs-14); }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-buttons .btn-accept, .cookie-buttons .btn-reject, .cookie-buttons .btn-settings {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 8px; font-weight: 700; box-shadow: var(--shadow-1);
}
.cookie-buttons .btn-accept { background: var(--mustard); border: 2px solid var(--maroon); color: #1b1b1b; }
.cookie-buttons .btn-reject { background: #fff; border: 2px solid var(--primary); color: var(--primary); }
.cookie-buttons .btn-settings { background: var(--accent); border: 2px solid var(--primary); color: var(--primary); }
.cookie-buttons button:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* Cookie Modal */
.cookie-overlay {
  position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.cookie-overlay.show { display: flex; }
.cookie-modal {
  background: #fff; border: 3px double var(--mustard); border-radius: 12px; box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: 16px; max-width: 640px; width: 100%; padding: 20px;
}
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-toggle { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.cookie-modal-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }

/* Simple toggle style */
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--accent); border: 2px solid var(--primary); display: inline-flex; align-items: center; padding: 2px; }
.switch .knob { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); transform: translateX(0); transition: transform .2s ease; }
.switch.on { background: var(--mustard); border-color: var(--maroon); }
.switch.on .knob { transform: translateX(20px); background: var(--maroon); }

/* ----------------------
   Accessibility & Readability tweaks
------------------------- */
.hero, section, footer { scroll-margin-top: 80px; }

/* ----------------------
   Page-specific fine-tunes
------------------------- */
/* Quick filters list in hero/text sections */
.text-section ul li a { font-weight: 600; }

/* Contact info rows with icons */
.text-section p img { display: inline-block; vertical-align: middle; margin-right: 8px; }
.text-section p a { font-weight: 700; }

/* Lists of facts displayed more compact on desktop using flex only */
@media (min-width: 768px) {
  section ul { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; }
  section ul li { width: auto; }
}

/* ----------------------
   Ensure no overlap & generous spacing
------------------------- */
section .container .content-wrapper > * + * { margin-top: 0; }

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