/* =====================================================
   Stadthorizont Autoberatung – style.css
   Aesthetic: creative_artistic (vibrant, artistic, unique),
   Brand-driven (cool blues + petrol, clean type, lots of whitespace)
   Mobile-first, flexbox-only layouts
   ===================================================== */

/* ------------------------------
   Reset / Normalize
   ------------------------------ */
html { box-sizing: border-box; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: inherit; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding-left: 1.25rem; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
input, button, textarea, select { font: inherit; }

/* ------------------------------
   Theme Variables (with safe fallbacks)
   ------------------------------ */
:root {
  --color-primary: #0F2A43; /* deep urban blue */
  --color-secondary: #256B5E; /* petrol */
  --color-accent: #F3F6F9; /* soft light accent */
  --color-ink: #0B1C2B; /* near-black for text */
  --color-muted: #8AA0B5; /* muted for subtext */
  --color-highlight: #FF6B6B; /* creative artistic pop (sparingly) */
  --bg-white: #FFFFFF;

  --radius-sm: 10px; 
  --radius-md: 16px; 
  --radius-lg: 24px;

  --shadow-sm: 0 4px 14px rgba(15, 42, 67, 0.08);
  --shadow-md: 0 10px 24px rgba(15, 42, 67, 0.12);
  --shadow-lg: 0 18px 40px rgba(15, 42, 67, 0.16);

  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-60: 60px;

  --font-display: "Trebuchet MS", Tahoma, Geneva, Verdana, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;
}

/* ------------------------------
   Base
   ------------------------------ */
html, body { height: 100%; }
body {
  font-family: var(--font-body), Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-ink, #0B1C2B);
  background-color: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3 { font-family: var(--font-display), "Trebuchet MS", Tahoma, sans-serif; color: var(--color-primary, #0F2A43); }
h1 { font-size: 32px; line-height: 1.2; letter-spacing: 0.2px; }
h2 { font-size: 24px; line-height: 1.25; margin-top: 8px; }
h3 { font-size: 18px; line-height: 1.3; }
p, li { color: var(--color-ink, #0B1C2B); }
small { font-size: 14px; color: var(--color-muted); }
.tagline { color: var(--color-secondary); font-weight: 600; letter-spacing: 0.3px; }

/* Artistic headings underline */
h1::after, h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 6px;
  background: var(--color-secondary);
  border-radius: 4px;
  margin-top: 10px;
  box-shadow: 6px 6px 0 0 var(--color-accent);
}

/* Links */
a { color: var(--color-secondary); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--color-primary); }
a:focus-visible { outline: 3px solid var(--color-highlight); outline-offset: 2px; border-radius: 6px; }

/* Lists */
ul, ol { display: flex; flex-direction: column; gap: 8px; }
li { padding-left: 2px; }
ul li::marker { color: var(--color-secondary); }

/* Containers (Flex only) */
.container {
  display: flex;
  justify-content: center;
  padding: 0 var(--space-16);
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-24);
  width: 100%;
  max-width: 1100px;
  padding: var(--space-24) 0;
}

/* Sections */
section { padding: var(--space-32) 0; }
main > section { position: relative; }
main > section:nth-of-type(even) { background: var(--color-accent); }
main > section:nth-of-type(odd) { background: #FFFFFF; }

/* Artistic corner blocks (decorative, not content) */
main > section .content-wrapper::before {
  content: "";
  position: absolute;
  top: 12px; left: 8px;
  width: 18px; height: 18px;
  background: var(--color-secondary);
  opacity: 0.15;
  border-radius: 4px;
  z-index: 0;
}
main > section .content-wrapper > * { position: relative; z-index: 1; }

/* ------------------------------
   Header & Navigation
   ------------------------------ */
header { background: #FFFFFF; border-bottom: 1px solid rgba(15,42,67,0.08); position: relative; z-index: 50; }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-16); flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 36px; width: auto; }

.main-nav { display: none; align-items: center; gap: var(--space-16); flex-wrap: wrap; }
.main-nav a { color: var(--color-primary); padding: 10px 8px; border-radius: 8px; transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease; }
.main-nav a:hover { background: var(--color-accent); color: var(--color-secondary); transform: translateY(-1px); }
.main-nav a[aria-current="page"] { color: var(--color-secondary); font-weight: 700; box-shadow: inset 0 -3px 0 0 var(--color-secondary); }

.header-cta { display: none; align-items: center; gap: var(--space-12); flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 999px; font-weight: 700; letter-spacing: 0.2px; transition: transform 0.18s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease; box-shadow: var(--shadow-sm); }
.btn.primary { background: var(--color-secondary); color: #fff; }
.btn.primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #1F5A50; }
.btn.secondary { background: #FFFFFF; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn.secondary:hover { background: var(--color-primary); color: #FFFFFF; transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-highlight); outline-offset: 2px; }

/* Mobile menu */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; font-size: 22px; border-radius: 10px; background: var(--color-accent); color: var(--color-primary); box-shadow: var(--shadow-sm); transition: background-color 0.25s ease, transform 0.2s ease; }
.mobile-menu-toggle:hover { background: #E7EEF5; transform: translateY(-1px); }

.mobile-menu {
  position: fixed; inset: 0; background: var(--color-primary);
  display: flex; flex-direction: column; justify-content: space-between; align-items: stretch;
  padding: var(--space-24) var(--space-16);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 1000;
}
.mobile-menu.open { transform: translateX(0); }
body.menu-open { overflow: hidden; }

.mobile-menu-close { align-self: flex-end; width: 44px; height: 44px; font-size: 22px; color: #FFFFFF; border-radius: 10px; background: rgba(255,255,255,0.1); }
.mobile-menu-close:hover { background: rgba(255,255,255,0.18); }

.mobile-nav { display: flex; flex-direction: column; gap: 12px; margin-top: var(--space-16); }
.mobile-nav a { color: #FFFFFF; font-size: 18px; padding: 14px 12px; border-radius: 12px; background: rgba(255,255,255,0.06); }
.mobile-nav a:hover { background: rgba(255,255,255,0.12); }
.mobile-nav a[aria-current="page"] { background: var(--color-secondary); }

/* ------------------------------
   Text Sections & Utilities
   ------------------------------ */
.text-section { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-16); }
.text-section p a { text-decoration: underline; text-decoration-thickness: 2px; }
.text-section p img { width: 20px; height: 20px; margin-right: 8px; display: inline-block; vertical-align: text-bottom; }

/* Decorative artistic chips for emphasis in paragraphs (optional) */
.text-section strong { background: linear-gradient(transparent 60%, var(--color-accent) 0); background: none; box-shadow: inset 0 -8px 0 0 var(--color-accent); }

/* Cards & Flex helpers (MANDATORY 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; }

/* Actual visual for .card and testimonials */
.card, .testimonial-card {
  background: #FFFFFF;
  border: 1px solid rgba(15,42,67,0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card:hover, .testimonial-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); transition: transform 0.18s ease, box-shadow 0.25s ease; }

/* Testimonial specifics: light background, dark text for accessibility */
.testimonial-card { background: #FFFFFF; color: var(--color-primary); border-left: 6px solid var(--color-secondary); }
.testimonial-card p { margin: 0; }
.testimonial-card strong { color: var(--color-primary); }

/* Footer */
footer { background: var(--color-primary); color: #FFFFFF; }
footer a { color: #EAF4FF; }
footer a:hover { color: #FFFFFF; text-decoration: underline; }
footer .content-wrapper { gap: var(--space-32); }
.footer-nav { display: flex; gap: var(--space-32); flex-wrap: wrap; align-items: flex-start; }
.footer-nav .text-section { background: rgba(255,255,255,0.04); padding: 16px; border-radius: 12px; }
.footer-nav h3 { color: #FFFFFF; }
footer .text-section p {
    color: #FFFFFF;
}
/* Buttons inside dark footer (edge case) */
footer .btn.secondary {
    border-color: #FFFFFF;
    color: #FFFFFF;
    background: transparent;
}
footer .btn.secondary:hover { background: #FFFFFF; color: var(--color-primary); }

/* Artistic separators between major blocks */
main > section + section { border-top: 8px solid rgba(37,107,94,0.06); }

/* ------------------------------
   Cookie Consent (banner + modal)
   ------------------------------ */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--color-primary);
  color: #FFFFFF;
  display: flex; justify-content: center; align-items: center;
  padding: 14px var(--space-16);
  transform: translateY(100%);
  transition: transform 0.35s ease;
  z-index: 1200;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-inner { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1100px; }
.cookie-banner p { margin: 0; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .btn { box-shadow: none; }
.cookie-actions .btn.accept { background: var(--color-secondary); color: #fff; }
.cookie-actions .btn.accept:hover { background: #1F5A50; }
.cookie-actions .btn.reject { background: #FFFFFF; color: var(--color-primary); border: 2px solid #FFFFFF; }
.cookie-actions .btn.reject:hover { background: rgba(255,255,255,0.9); color: var(--color-primary); }
.cookie-actions .btn.settings { background: rgba(255,255,255,0.12); color: #FFFFFF; border: 2px solid rgba(255,255,255,0.2); }
.cookie-actions .btn.settings:hover { background: rgba(255,255,255,0.2); }

/* Cookie modal */
.cookie-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 1300; }
.cookie-overlay.open { opacity: 1; pointer-events: auto; }
.cookie-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.98);
  width: calc(100% - 32px); max-width: 720px;
  background: #FFFFFF; color: var(--color-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: var(--space-20);
  padding: var(--space-24);
  opacity: 0; pointer-events: none; transition: transform 0.25s ease, opacity 0.25s ease; z-index: 1400;
}
.cookie-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-modal .categories { display: flex; flex-direction: column; gap: 10px; }
.cookie-modal .category { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid rgba(15,42,67,0.1); border-radius: 10px; }
.cookie-modal .category .note { color: var(--color-muted); font-size: 14px; }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Simple toggle */
.toggle { position: relative; width: 50px; height: 28px; border-radius: 999px; background: #DCE5EE; transition: background 0.2s ease; display: inline-flex; align-items: center; }
.toggle::after { content: ""; width: 22px; height: 22px; background: #FFFFFF; border-radius: 50%; box-shadow: var(--shadow-sm); transform: translateX(3px); transition: transform 0.2s ease; }
.toggle.on { background: var(--color-secondary); }
.toggle.on::after { transform: translateX(25px); }

/* ------------------------------
   Responsive rules (Mobile-first)
   ------------------------------ */
@media (min-width: 480px) {
  h1 { font-size: 36px; }
}

@media (min-width: 768px) {
  h1 { font-size: 42px; }
  h2 { font-size: 28px; }
  .logo img { height: 44px; }

  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }

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

@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

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

/* ------------------------------
   Focus, Accessibility & Micro-interactions
   ------------------------------ */
:focus-visible { outline: 3px solid var(--color-highlight); outline-offset: 2px; }
button:active, .btn:active { transform: translateY(0); }

/* ------------------------------
   Page-specific small touches
   ------------------------------ */
/* Hero sections a bit roomier */
main > section:first-of-type .content-wrapper { padding-top: var(--space-32); padding-bottom: var(--space-24); }

/* Links inside paragraph visually balanced */
.text-section a { position: relative; }
.text-section a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%; background: currentColor; opacity: 0.3; transition: opacity 0.2s ease; }
.text-section a:hover::after { opacity: 0.6; }

/* Artistic chips near headings in index and others */
main h1::before, main h2::before {
  content: "";
  display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  background: var(--color-highlight);
  border-radius: 2px; transform: rotate(15deg);
}

/* Ensure adequate spacing between all elements */
.content-wrapper > * + * { margin-top: 0; }

/* Prevent overlaps and ensure z-index sanity for decorations */
header, .mobile-menu, .cookie-banner, .cookie-overlay, .cookie-modal { z-index: auto; }

/* ------------------------------
   Flex-only verification helpers (no grid used)
   ------------------------------ */
/* Additional generic flex utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { display: flex; flex-wrap: wrap; }

/* ------------------------------
   Accessibility for testimonials/reviews (explicit)
   ------------------------------ */
/* Dark text on light background ensured above; reiterate for safety */
main .testimonial-card, .testimonial-card * { color: var(--color-primary); }

/* ------------------------------
   Spacing safeguard between blocks/cards
   ------------------------------ */
.content-grid > *, .card-container > *, .footer-nav > *, .text-image-section > *, .text-section > * { margin: 0; }

/* ------------------------------
   Print (optional minimal)
   ------------------------------ */
@media print {
  .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-overlay, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
}
