/* ============================================================
   Kelle & Kachel Renovierungen - Professional Corporate Theme
   Mobile-first, flexbox-only layout, brand-aligned styles
   ============================================================ */

/* -----------------------------
   Reset & Base Normalization
------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; background: transparent; border: none; padding: 0; cursor: pointer; }

/* -----------------------------
   Design Tokens (CSS Variables)
------------------------------ */
:root {
  /* Brand palette */
  --primary: #24313A; /* deep blue-gray */
  --secondary: #9A5A3D; /* warm copper-brown accent */
  --accent: #F3F1EA; /* warm off-white */

  /* Corporate neutrals */
  --ink: #1F2930; /* main text */
  --ink-dim: #5E6A73; /* muted text */
  --surface: #FFFFFF; /* cards & header */
  --surface-alt: #F7F9FB; /* page background */
  --border: #D6DEE5; /* subtle borders */
  --shadow: 0 1px 2px rgba(0,0,0,0.06), 0 6px 18px rgba(36,49,58,0.08);

  /* Typography */
  --font-display: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --font-body: Verdana, Geneva, Tahoma, sans-serif;

  /* Spacing scale */
  --s-4: 4px; --s-6: 6px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-20: 20px; --s-24: 24px; --s-30: 30px; --s-32: 32px; --s-40: 40px; --s-48: 48px; --s-60: 60px;

  /* Interactive */
  --link: #235B8C; /* professional blue for links */
  --focus: #0B6BD3;
}

/* -----------------------------
   Base Elements
------------------------------ */
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface-alt);
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--primary); line-height: 1.25; }
h1 { font-size: 32px; margin-bottom: var(--s-16); }
h2 { font-size: 24px; margin-bottom: var(--s-16); }
h3 { font-size: 18px; margin-bottom: var(--s-12); }

p { font-size: 16px; margin-bottom: var(--s-12); }
ul, ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

a { color: var(--link); }
a:hover { color: #1a4a74; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* -----------------------------
   Layout Containers (Flex-only)
------------------------------ */
.container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-left: var(--s-20);
  padding-right: var(--s-20);
}
.content-wrapper {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: var(--s-20);
}

section { margin-bottom: var(--s-60); padding: var(--s-40) var(--s-20); background: transparent; }

/* Distinctive cards/blocks for sections with strong hierarchy */
main > section:nth-child(1) { background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border); border-radius: 10px; }

.text-section { display: flex; flex-direction: column; gap: var(--s-12); }

/* -----------------------------
   Header & Navigation
------------------------------ */
header { background: var(--surface); box-shadow: 0 1px 0 var(--border); position: relative; z-index: 50; }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s-16); padding: var(--s-12) 0; }

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

.main-nav { display: none; align-items: center; gap: var(--s-24); }
.main-nav a { text-decoration: none; color: var(--primary); font-size: 15px; padding: 10px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--link); border-bottom-color: var(--border); }

.header-cta { display: none; align-items: center; gap: var(--s-12); }
.header-cta a { text-decoration: none; }

/* Buttons (corporate) */
.btn, .header-cta a, .text-section > a {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 16px; border-radius: 8px;
  text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .06s ease;
  border: 1px solid transparent;
}
.btn-primary, .header-cta a:first-child, .text-section > a:first-child {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover, .header-cta a:first-child:hover, .text-section > a:first-child:hover { background: #1c2730; box-shadow: var(--shadow); }

.btn-secondary, .header-cta a:last-child, .text-section > a:last-child {
  background: var(--accent); color: var(--primary); border-color: #E5E1D6;
}
.btn-secondary:hover, .header-cta a:last-child:hover, .text-section > a:last-child:hover { background: #EEEADF; box-shadow: var(--shadow); }

.btn:active, .header-cta a:active, .text-section > a:active { transform: translateY(1px); }

/* Mobile Menu */
.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px; color: var(--primary);
  border: 1px solid var(--border); background: var(--surface);
  transition: background-color .2s ease, color .2s ease;
}
.mobile-menu-toggle:hover { background: var(--accent); }

.mobile-menu {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: stretch; gap: 0;
  background: rgba(36,49,58,0.92); color: #fff;
  transform: translateX(100%); transition: transform .3s ease; z-index: 1000;
  padding: var(--s-20);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end; width: 40px; height: 40px; border-radius: 8px; color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.mobile-nav { display: flex; flex-direction: column; gap: 8px; margin-top: var(--s-20); }
.mobile-nav a {
  display: flex; align-items: center; min-height: 48px; padding: 12px 10px; border-radius: 8px;
  color: #fff; text-decoration: none; border: 1px solid transparent;
}
.mobile-nav a:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }

/* -----------------------------
   Footer
------------------------------ */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: var(--s-40) var(--s-20); }
footer .content-wrapper { gap: var(--s-24); }
.footer-nav, .legal-nav { display: flex; flex-wrap: wrap; gap: var(--s-12) var(--s-20); }
.footer-nav a, .legal-nav a { text-decoration: none; color: var(--primary); font-size: 14px; }
.footer-nav a:hover, .legal-nav a:hover { color: var(--link); text-decoration: underline; }

/* -----------------------------
   Cards & Reusable Blocks
------------------------------ */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: var(--s-20); margin-bottom: 20px; position: relative; display: flex; flex-direction: column; gap: var(--s-12); }

.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; }
.text-image-section > * { flex: 1 1 280px; }

.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; border-radius: 10px; border: 1px solid var(--border); background: #ffffff; box-shadow: var(--shadow); color: var(--primary); }
.testimonial-card p { margin: 0; }
.testimonial-card strong { color: var(--primary); }

.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Ensure readable contrast for testimonials/reviews */
section h2 + .testimonial-card,
section .testimonial-card { background: var(--surface); color: var(--primary); }

/* Lists inside text sections */
.text-section ul, .text-section ol { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: var(--s-16) var(--s-20); }
.text-section li { color: var(--ink); }

/* Links inside paragraphs remain inline; only direct children anchors become CTAs */
.text-section > p > a { text-decoration: underline; padding: 0; border: none; background: transparent; }

/* -----------------------------
   Tables (generic, if any appear)
------------------------------ */
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border); padding: 10px; text-align: left; }
th { background: var(--accent); color: var(--primary); }

/* -----------------------------
   Cookie Consent Banner & Modal
------------------------------ */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  display: flex; justify-content: center; padding: var(--s-16);
  transform: translateY(100%); transition: transform .3s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-inner {
  display: flex; flex-direction: column; gap: var(--s-12);
  width: 100%; max-width: 1100px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 12px; padding: var(--s-16);
}
.cookie-banner p { color: var(--ink); font-size: 14px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--s-12); }
.cookie-actions .btn-accept { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.cookie-actions .btn-reject { background: var(--accent); color: var(--primary); border: 1px solid #E5E1D6; }
.cookie-actions .btn-settings { background: #ffffff; color: var(--primary); border: 1px solid var(--border); }
.cookie-actions a, .cookie-actions button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.cookie-actions a:hover, .cookie-actions button:hover { box-shadow: var(--shadow); }

.cookie-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1150; opacity: 0; pointer-events: none; transition: opacity .3s ease;
  display: flex; align-items: center; justify-content: center; padding: var(--s-20);
}
.cookie-modal-overlay.show { opacity: 1; pointer-events: auto; }
.cookie-modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: var(--s-16); padding: var(--s-20);
}
.cookie-modal header { display: flex; align-items: center; justify-content: space-between; box-shadow: none; border-bottom: 1px solid var(--border); padding-bottom: var(--s-12); }
.cookie-categories { display: flex; flex-direction: column; gap: var(--s-12); }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: var(--s-12); padding: 10px 0; border-bottom: 1px solid var(--border); }
.cookie-category:last-child { border-bottom: none; }
.cookie-toggle { display: inline-flex; align-items: center; gap: 8px; }
.cookie-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: var(--s-12); justify-content: flex-end; }

/* -----------------------------
   Forms (generic future-proofing)
------------------------------ */
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
label { font-size: 14px; color: var(--primary); }

/* -----------------------------
   Utilities
------------------------------ */
.muted { color: var(--ink-dim); }
.center { text-align: center; }
.hide { display: none !important; }

/* -----------------------------
   Mandatory Spacing Patterns (as required)
------------------------------ */
.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; }

/* -----------------------------
   Page-specific Touches
------------------------------ */
/* Hero tighten spacing */
main > section:first-of-type .text-section { gap: var(--s-16); }

/* Price lists and FAQs readability */
[data-page="preise-und-beratung"] .text-section ul li,
.text-section ul li { font-size: 15px; }

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

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

  /* Header navigation visible on tablet+ */
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }

  /* Align section blocks side breathing */
  .content-wrapper { gap: var(--s-24); }

  /* Text-image sections horizontal */
  .text-image-section { flex-direction: row; }
}

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

  .main-nav a { font-size: 16px; }
}

/* -----------------------------
   Accessibility & Micro-interactions
------------------------------ */
:focus-visible { scroll-margin-block: 80px; }

/* Link subtle underline on hover */
a { transition: color .2s ease, background-color .2s ease, border-color .2s ease, text-decoration-color .2s ease; }

/* Subtle elevation on interactive cards */
.card:hover, .testimonial-card:hover { transform: translateY(-1px); transition: transform .12s ease, box-shadow .2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 10px 24px rgba(36,49,58,0.10); }

/* -----------------------------
   Header spacing for first section
------------------------------ */
main { display: flex; flex-direction: column; gap: var(--s-20); }

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

/* -----------------------------
   Print styles (basic)
------------------------------ */
@media print {
  .mobile-menu, .mobile-menu-toggle, .header-cta, .cookie-banner, .cookie-modal-overlay { display: none !important; }
  a { text-decoration: none; color: #000; }
  header, footer, section { box-shadow: none; border: none; background: #fff; }
}
