/* =====================================================
   Crisp Sky Immobilien — Playful Dynamic Style (Flex-only)
   Author: Senior CSS Developer & UI Designer
   Notes:
   - Mobile-first
   - Only Flexbox for layout (no grid/columns)
   - Bright, energetic accents with brand core colors
   - Smooth micro-interactions and accessibility-focused
   ===================================================== */

/* -----------------------
   CSS RESET / NORMALIZE
------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #0A2333; /* dark ink */
  background: #FFFFFF;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #0B3B5A; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
button { font-family: inherit; cursor: pointer; }
:focus { outline: 3px dashed #00C2FF; outline-offset: 3px; }

/* -----------------------
   THEME VARIABLES
------------------------- */
:root {
  --brand-primary: #0B3B5A; /* deep sky blue (brand) */
  --brand-secondary: #2D6A4F; /* natural green (brand) */
  --brand-accent: #F4F7FB; /* light accent (brand) */
  --text: #0A2333;
  --muted: #5B7285;
  --line: #E6EDF5;
  --white: #FFFFFF;
  /* Playful pops (tasteful, limited) */
  --pop-yellow: #FFD447;
  --pop-pink: #FF6B8A;
  --pop-sky: #00C2FF;
  --pop-lime: #9AE6B4;
  --shadow: 0 6px 20px rgba(11,59,90,0.12);
  --shadow-lg: 0 16px 40px rgba(11,59,90,0.18);
  --radius-s: 10px;
  --radius: 16px;
  --radius-lg: 22px;
}

/* -----------------------
   TYPOGRAPHY
------------------------- */
h1, h2, h3, h4 { font-family: Georgia, Times, "Times New Roman", serif; color: var(--brand-primary); line-height: 1.25; }
h1 { font-size: 32px; letter-spacing: 0.2px; }
h2 { font-size: 24px; margin: 0; }
h3 { font-size: 18px; margin: 0; }
p { margin: 0; }
.small { font-size: 14px; color: var(--muted); }

@media (min-width: 768px) {
  h1 { font-size: 44px; }
  h2 { font-size: 32px; }
  h3 { font-size: 20px; }
}
@media (min-width: 992px) {
  h1 { font-size: 48px; }
}

/* -----------------------
   GLOBAL LAYOUT UTILITIES
------------------------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;           /* FLEX-ONLY */
  flex-direction: column;  /* mobile-first */
  gap: 20px;
}
.content-wrapper {
  display: flex;           /* FLEX-ONLY */
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}

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

/* Apply generous spacing to native sections too */
section { margin-bottom: 60px; padding: 40px 20px; background: transparent; }

/* Default card look for text blocks to boost playful dynamic feel */
.text-section {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  flex: 1 1 280px; /* allows wrapping into multiple columns at larger screens */
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.text-section:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.text-section h3 { color: var(--brand-secondary); }
.text-section ul, .text-section ol { margin: 8px 0 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.text-section li { display: flex; align-items: center; gap: 10px; }
.text-section li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pop-pink); display: inline-flex; flex: 0 0 8px; }
.text-section li img { width: 18px; height: 18px; object-fit: contain; }
.text-section li img + * { margin-left: 2px; }
.text-section p img { width: 18px; height: 18px; display: inline-block; vertical-align: middle; margin-right: 6px; }

/* -----------------------
   HEADER & NAVIGATION
------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--white);
  box-shadow: 0 2px 0 var(--pop-yellow), 0 8px 24px rgba(0,0,0,0.05); /* playful bar */
}
header .container { gap: 12px; }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 40px; transition: transform 200ms ease; }
.logo:hover img { transform: rotate(-3deg) scale(1.03); }

.main-nav { display: none; align-items: center; gap: 12px; }
.main-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--brand-primary);
  background: transparent;
  transition: background 200ms ease, transform 200ms ease;
}
.main-nav a:hover { background: var(--brand-accent); transform: translateY(-2px); }

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

.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 2px solid var(--brand-primary);
  background: var(--pop-yellow);
  color: #102A43;
  font-size: 22px;
  box-shadow: var(--shadow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.mobile-menu-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Mobile menu drawer */
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 86vw; max-width: 420px;
  background: var(--white);
  box-shadow: -8px 0 24px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 300ms ease;
  z-index: 1100;
  display: flex;          /* FLEX-ONLY */
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}
.mobile-menu.open,
body.menu-open .mobile-menu,
.mobile-menu.active { transform: translateX(0); }

.mobile-menu-close {
  align-self: flex-end;
  background: var(--brand-accent);
  border: 2px solid var(--line);
  color: var(--brand-primary);
  border-radius: 10px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
}
.mobile-nav { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mobile-nav a {
  display: flex; align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--brand-accent);
  color: var(--brand-primary);
  border: 2px solid transparent;
  transition: background 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.mobile-nav a:hover { background: var(--white); border-color: var(--line); transform: translateX(-4px); }

@media (min-width: 992px) {
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* -----------------------
   HERO SECTIONS
------------------------- */
.hero {
  background: var(--brand-accent);
  border-bottom: 6px solid var(--pop-pink);
  position: relative;
}
.hero .content-wrapper { align-items: flex-start; gap: 16px; }
.hero p { color: var(--muted); }
.hero .text-section { background: #FFFFFF; border-color: #EAF1F8; }

/* playful decorative confetti - decorative only */
.hero::after, .hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 120px; height: 120px;
  border-radius: 24px;
  opacity: 0.15;
}
.hero::before { background: var(--pop-yellow); top: 12px; right: 14px; transform: rotate(8deg); }
.hero::after { background: var(--pop-sky); bottom: 12px; left: 14px; transform: rotate(-6deg); }
.hero > .container, .hero .content-wrapper, .hero * { position: relative; z-index: 1; }

/* -----------------------
   BUTTONS
------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  transition: transform 150ms ease, box-shadow 150ms ease, background 200ms ease, color 200ms ease, border-color 200ms ease;
  box-shadow: var(--shadow);
}
.button:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.button.primary { background: var(--brand-primary); color: #FFFFFF; }
.button.primary:hover { background: #0a3450; }

.button.secondary { background: var(--brand-secondary); color: #FFFFFF; }
.button.secondary:hover { background: #265a44; }

.button.tertiary { background: var(--pop-yellow); color: #102A43; border-color: #E9B600; }
.button.tertiary:hover { background: #ffe070; }

/* -----------------------
   LISTS & INLINE ICONS
------------------------- */
ul, ol { margin: 0; padding-left: 18px; }
.text-section ul, .text-section ol { padding-left: 0; }
.text-section p a { font-weight: 600; }

/* -----------------------
   TESTIMONIALS (Readable, high contrast)
------------------------- */
/* Ensure dark text on light background for readability */
.testimonial-card {
  background: #FFFFFF;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}
.testimonial-card p { margin: 0; }
.testimonial-card strong { color: var(--brand-primary); }
.testimonial-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* -----------------------
   GENERIC CARDS (optional utility)
------------------------- */
.card {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .card-content { display: flex; flex-direction: column; justify-content: center; gap: 10px; }

/* -----------------------
   CONTENT GRIDS & TEXT-IMAGE SECTIONS
------------------------- */
.content-grid > * { flex: 1 1 280px; }
.text-image-section { align-items: center; }
.text-image-section > * { flex: 1 1 300px; }
@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

/* -----------------------
   FOOTER
------------------------- */
footer section { background: var(--brand-primary); color: #FFFFFF; border-top: 6px solid var(--pop-lime); }
footer .content-wrapper { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
footer .text-section { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.22); color: #E8F1F8; }
footer a { color: #FFFFFF; }
footer .container > p, footer .container p { color: #FFFFFF; }
footer .text-section h3 { color: #FFFFFF; }

/* -----------------------
   FORMS / INPUTS (basic)
------------------------- */
input, select, textarea {
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--pop-sky); box-shadow: 0 0 0 4px rgba(0,194,255,0.15); }

/* -----------------------
   RESPONSIVE TWEAKS
------------------------- */
@media (min-width: 768px) {
  .content-wrapper { flex-direction: row; align-items: flex-start; }
  .hero .content-wrapper { flex-direction: column; } /* keep hero text stacked */
}

/* -----------------------
   COOKIE CONSENT BANNER & MODAL
------------------------- */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  background: #FFFFFF;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: 18px;
  z-index: 2000;
  padding: 16px;
  display: none;             /* hidden by default */
  flex-direction: column;    /* FLEX-ONLY */
  gap: 12px;
}
.cookie-banner.show, .cookie-banner.visible { display: flex; }
.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: 8px; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cookie-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 999px; border: 2px solid transparent; font-weight: 700; box-shadow: var(--shadow); }
.cookie-accept { background: var(--brand-secondary); color: #fff; }
.cookie-accept:hover { background: #265a44; }
.cookie-reject { background: var(--pop-pink); color: #102A43; border-color: #d44a6d; }
.cookie-reject:hover { background: #ff82a0; }
.cookie-settings { background: var(--brand-accent); color: var(--brand-primary); border: 2px solid var(--line); }
.cookie-settings:hover { background: #fff; }

/* Cookie preferences modal */
.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 35, 51, 0.55);
  display: none;              /* hidden by default */
  align-items: center;        /* FLEX-ONLY */
  justify-content: center;    /* FLEX-ONLY */
  z-index: 2100;
}
.cookie-modal.show, .cookie-modal.visible { display: flex; }
.cookie-modal .modal-content {
  background: #FFFFFF;
  width: 92vw; max-width: 720px;
  border-radius: 18px;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.cookie-modal h3 { margin: 0; color: var(--brand-primary); }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cookie-category:last-child { border-bottom: none; }
.cookie-toggle { display: inline-flex; align-items: center; gap: 8px; }
.cookie-toggle input[type="checkbox"] { width: 20px; height: 20px; }
.cookie-modal .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* -----------------------
   MICRO-ANIMATIONS
------------------------- */
@keyframes popIn { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes floaty { 0% { transform: translateY(0); } 50% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
.hero .button { animation: popIn 300ms ease both; }
.logo img { animation: floaty 4s ease-in-out infinite; }

/* -----------------------
   UTILITIES & MISC
------------------------- */
.muted { color: var(--muted); }
.hr { width: 100%; height: 2px; background: var(--line); border-radius: 1px; }
.badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--brand-accent); color: var(--brand-primary); font-weight: 700; }

/* Ensure adequate gaps between content elements */
.content-wrapper > * { margin: 0; }
.content-wrapper { gap: 24px; }

/* -----------------------
   PAGE-SPECIFIC POLISH
------------------------- */
/* Ratings row with star icon */
img[alt^="4,9/5"], img[alt^="4,8/5"], img[alt^="4,9/5 aus"], img[alt^="4,8/5 Zufriedenheit"], img[alt^="4,9/5 aus 180 Bewertungen"], img[alt^="icon-star"] { width: 18px; height: 18px; display: inline-block; vertical-align: middle; margin-right: 6px; }

/* Contact inline data spacing */
.hero p img, section p img { width: 18px; height: 18px; display: inline-block; vertical-align: middle; margin-right: 6px; }

/* -----------------------
   RESPONSIVE NAV/HEADER LAYOUT
------------------------- */
@media (min-width: 992px) {
  header .content-wrapper { gap: 18px; }
  .logo img { height: 46px; }
}

/* -----------------------
   ACCESSIBILITY & STATES
------------------------- */
.button:focus, .mobile-menu-toggle:focus, .mobile-menu-close:focus, .mobile-nav a:focus, .main-nav a:focus { outline: 3px dashed var(--pop-sky); outline-offset: 2px; }

/* -----------------------
   ENSURE NO OVERLAPS & CLEAN SPACING
------------------------- */
section + section { margin-top: 0; }
.text-section + .text-section, .testimonial-card + .testimonial-card { margin-top: 0; } /* gaps handled by flex gap */

/* -----------------------
   PRINT BASICS (optional)
------------------------- */
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  section { page-break-inside: avoid; }
}
