/* ===================================================================
   GlimmerDach – style.css
   Minimalist, mobile-first, flexbox-only UI system
   Brand: primary #1F3A5F, secondary #A64B2A, accent #F2F5F7
   Fonts: Trebuchet MS (display), Arial (body)
   =================================================================== */

/* ------------------------------
   1) Reset & Base Normalize
   ------------------------------ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { padding-left: 1.25rem; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
:focus-visible { outline: 3px solid rgba(31,58,95,0.35); outline-offset: 2px; }

/* ------------------------------
   2) CSS Variables (with sensible fallbacks)
   ------------------------------ */
:root {
  --color-primary: #1F3A5F;
  --color-secondary: #A64B2A;
  --color-accent: #F2F5F7;
  --color-bg: #FFFFFF;
  --color-text: #1C2430; /* dark neutral for high readability */
  --color-muted: #6B7785;
  --color-border: #E6ECF1;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --container: 1200px;
}

/* ------------------------------
   3) Global Base Styles
   ------------------------------ */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Arial, Helvetica, sans-serif; /* body font per brand */
  font-size: 16px;
  scroll-behavior: smooth;
}

h1, h2, h3, h4 { font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; color: var(--color-primary); line-height: 1.25; letter-spacing: -0.2px; }
h1 { font-size: 32px; margin-bottom: 16px; }
h2 { font-size: 24px; margin-bottom: 14px; }
h3 { font-size: 18px; margin-bottom: 10px; }
h4 { font-size: 16px; margin-bottom: 8px; }

p { margin-bottom: 12px; color: var(--color-text); }
small, .muted { color: var(--color-muted); }
strong { font-weight: 700; }

/* Links */
a { color: var(--color-primary); transition: color 160ms ease, opacity 160ms ease; }
a:hover { color: var(--color-secondary); }
a:active { opacity: 0.9; }

/* Lists */
ul li, ol li { margin: 6px 0; }

/* Containers & structural wrappers – flexbox only */
header, main, footer, section { width: 100%; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  display: flex; /* flexbox container */
  flex-direction: column; /* default mobile vertical stacking */
}

/* Content wrapper: used across header/sections/footer */
.content-wrapper {
  width: 100%;
  display: flex; /* flexbox container */
  flex-direction: column;
  gap: 16px;
}

/* Default section spacing (minimalist generous whitespace) */
section { padding: 40px 0; border-bottom: 1px solid var(--color-border); }
section:last-of-type { border-bottom: none; }

/* Alternate subtle background for visual rhythm */
section:nth-of-type(even) { background: var(--color-accent); }

/* MANDATORY SPACING PATTERNS (as provided) */
.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; }

/* ------------------------------
   4) Header & Navigation
   ------------------------------ */
header {
  position: relative;
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  z-index: 50;
}

/* Header layout row on mobile too, with wrap */
header .content-wrapper {
  flex-direction: row;
  align-items: center; /* vertical centering */
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px 0;
}

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

.main-nav {
  display: none; /* hidden on mobile */
  gap: 16px;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  color: var(--color-text);
  opacity: 0.9;
}
.main-nav a:hover { color: var(--color-primary); opacity: 1; }

.header-ctas {
  display: none; /* hide on mobile, show on larger */
  align-items: center;
  gap: 10px;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transition: background 160ms ease, transform 160ms ease;
}
.mobile-menu-toggle:hover { background: var(--color-accent); transform: translateY(-1px); }

/* Mobile slide-in menu */
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 80%; max-width: 360px;
  background: #fff;
  border-left: 1px solid var(--color-border);
  box-shadow: -12px 0 24px rgba(0,0,0,0.08);
  transform: translateX(100%);
  transition: transform 260ms ease;
  display: flex; /* flexbox container */
  flex-direction: column;
  padding: 16px;
  z-index: 999;
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-close {
  align-self: flex-end;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.mobile-menu-close:hover { background: var(--color-accent); }

.mobile-nav {
  display: flex; /* flexbox container */
  flex-direction: column;
  margin-top: 12px;
}
.mobile-nav a {
  padding: 14px 10px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.mobile-nav a:hover { background: var(--color-accent); color: var(--color-primary); }

/* ------------------------------
   5) Buttons & Interactive Elements
   ------------------------------ */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: #233f69;
  border-color: #233f69;
}

.btn-secondary {
  background: transparent;
  color: var(--color-secondary);
  border: 1px solid var(--color-secondary);
}
.btn-secondary:hover {
  background: var(--color-secondary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Utility ghost button for subtle actions */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
}
.btn-ghost:hover { background: var(--color-accent); }

/* ------------------------------
   6) Content Blocks & Cards
   ------------------------------ */
.text-section {
  display: flex; /* flexbox container */
  flex-direction: column;
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Responsive content grid using flex only */
.content-grid > * {
  flex: 1 1 260px;
  min-width: 240px;
}

/* Text + Image split section */
.text-image-section > .text, .text-image-section > .media { flex: 1 1 320px; min-width: 260px; }

/* Testimonial cards – ensure dark text on light bg for contrast */
.testimonial-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}
.testimonial-card p { margin: 0; }

/* Lists inside text-section get extra breathing room */
.text-section ul, .text-section ol { margin-top: 4px; }

/* ------------------------------
   7) Footer
   ------------------------------ */
footer {
  background: var(--color-accent);
  border-top: 1px solid var(--color-border);
}
footer .content-wrapper {
  padding: 20px 0;
  gap: 20px;
}
footer a { color: var(--color-primary); }
footer a:hover { color: var(--color-secondary); }

/* ------------------------------
   8) Cookie Consent Banner & Modal
   ------------------------------ */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px;
  display: flex; /* flexbox container */
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  transform: translateY(140%);
  opacity: 0; pointer-events: none;
  transition: transform 260ms ease, opacity 260ms ease;
}
.cookie-banner.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cookie-banner .cookie-text { display: flex; flex-direction: column; gap: 6px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .accept-all { composes: btn-primary; }
.cookie-actions .reject-all { composes: btn-ghost; }
.cookie-actions .open-settings { composes: btn-secondary; }
/* If "composes" isn't supported, also style button classes directly: */
.cookie-actions .accept-all { background: var(--color-primary); color: #fff; border: 1px solid var(--color-primary); border-radius: var(--radius-sm); padding: 10px 16px; }
.cookie-actions .accept-all:hover { background: #233f69; border-color: #233f69; }
.cookie-actions .reject-all { background: #fff; color: var(--color-primary); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 10px 16px; }
.cookie-actions .reject-all:hover { background: var(--color-accent); }
.cookie-actions .open-settings { background: transparent; color: var(--color-secondary); border: 1px solid var(--color-secondary); border-radius: var(--radius-sm); padding: 10px 16px; }
.cookie-actions .open-settings:hover { background: var(--color-secondary); color: #fff; }

/* Cookie preferences modal */
.cookie-overlay {
  position: fixed; inset: 0; /* top:0; right:0; bottom:0; left:0 */
  background: rgba(0,0,0,0.45);
  z-index: 1001;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease;
  display: flex; /* flexbox container */
  align-items: center; justify-content: center;
}
.cookie-overlay.show { opacity: 1; pointer-events: auto; }

.cookie-modal {
  width: min(680px, 92%);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
  display: flex; /* flexbox container */
  flex-direction: column;
  gap: 16px;
}
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Simple toggle style for cookie categories */
.cookie-toggle { display: inline-flex; align-items: center; gap: 10px; }
.cookie-toggle input[type="checkbox"] { width: 42px; height: 22px; appearance: none; background: #e3e8ee; border-radius: 999px; position: relative; transition: background 160ms ease; }
.cookie-toggle input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform 160ms ease; }
.cookie-toggle input[type="checkbox"]:checked { background: var(--color-primary); }
.cookie-toggle input[type="checkbox"]:checked::after { transform: translateX(20px); }

/* ------------------------------
   9) Utilities
   ------------------------------ */
.centered { display: flex; align-items: center; justify-content: center; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.stack-24 { display: flex; flex-direction: column; gap: 24px; }
.muted { color: var(--color-muted); }
.accent-bg { background: var(--color-accent); }
.separator { height: 1px; background: var(--color-border); width: 100%; }

/* ------------------------------
   10) Responsive Enhancements
   ------------------------------ */
@media (max-width: 768px) {
  /* text-image sections must stack vertically on mobile */
  .text-image-section { flex-direction: column; align-items: center; }
}

@media (min-width: 640px) {
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
}

@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }

  /* show header CTAs and main nav on tablet+ */
  .main-nav { display: flex; }
  .header-ctas { display: flex; }
  .mobile-menu-toggle { display: none; }
}

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

  /* Section content wrapper can be narrower for optimal line length */
  main .content-wrapper { max-width: 100%; }
}

/* ------------------------------
   11) Page-specific tiny refinements (using existing classes only)
   ------------------------------ */
/* Make intro sections breathe */
main > section:first-of-type .content-wrapper { padding-top: 10px; }

/* Inline icon alignment within text */
.text-section img[alt="Telefon"], .text-section img[alt="E-Mail"], .text-section img[alt="24/7"] {
  display: inline-block; vertical-align: middle; margin-right: 6px; height: 18px; width: auto;
}

/* Make hotline links stand out slightly */
.text-section a[href^="tel:"] { font-weight: 600; }

/* Improve readability for long legal pages */
[data-page="legal"], .legal {
  display: flex; flex-direction: column; gap: 16px;
}

/* Ensure no element overlaps – provide consistent spacing */
.content-wrapper > * + * { margin-top: 4px; }

/* ------------------------------
   12) Accessibility & Micro-interactions
   ------------------------------ */
.btn-primary:active, .btn-secondary:active { transform: translateY(0); }

/* Hover lift for cards */
.card:hover, .testimonial-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); transition: transform 160ms ease, box-shadow 160ms ease; }

/* ------------------------------
   13) Flex-only assurance: ensure all common layout groups are flex containers
   ------------------------------ */
header .container, main .container, footer .container { display: flex; flex-direction: column; }
footer .content-wrapper, main .content-wrapper { display: flex; flex-direction: column; }

/* Keep adequate gaps between independent content blocks */
main section .text-section > * + * { margin-top: 2px; }

/* ------------------------------
   14) Print-friendly adjustments (minimal)
   ------------------------------ */
@media print {
  .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-overlay { display: none !important; }
  a { text-decoration: underline; }
  header, footer { box-shadow: none; }
}
