/* ===============================
   Stein & Spachtel – Professional Corporate Theme
   Mobile-first, flexbox-only CSS
   Palette: blue/gray base, terracotta highlights, light accents
   Fonts: Trebuchet MS (display), Verdana (body)
   =============================== */

/* --- CSS Reset & Normalize --- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote { margin: 0; padding: 0; }
ul, ol { padding-left: 1.2rem; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { font: inherit; background: none; border: none; padding: 0; cursor: pointer; }
:focus { outline: 2px solid #C05621; outline-offset: 2px; }

/* --- Variables (with fallbacks where used) --- */
:root {
  --color-primary: #1F2937; /* blue-gray */
  --color-secondary: #C05621; /* terracotta */
  --color-accent: #F5F7FA; /* light */
  --color-text: #111827; /* near-black for readability */
  --color-muted: #6B7280; /* gray */
  --color-border: #E5E7EB; /* light border */
  --color-white: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.10);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* --- Base Typography --- */
body {
  font-family: Verdana, Geneva, sans-serif;
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.6;
  font-size: 16px;
}
h1, h2, h3, h4 {
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  color: var(--color-primary);
  line-height: 1.25;
}
h1 { font-size: 32px; margin-bottom: 16px; }
h2 { font-size: 24px; margin-bottom: 14px; }
h3 { font-size: 18px; margin-bottom: 10px; color: var(--color-primary); }
p { margin-bottom: 12px; }
strong { color: var(--color-primary); }

/* Lists */
ul li, ol li { margin-bottom: 8px; }
ul li::marker { color: var(--color-secondary); }
ol { list-style: decimal; }

/* Links */
main a:not(nav a) {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
main a:not(nav a):hover { color: var(--color-secondary); }

/* --- Layout Utilities (Flexbox-only) --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.text-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 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; display: flex; flex-direction: column; gap: 12px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); }
.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; background: var(--color-accent); border: 1px solid var(--color-border); border-left: 4px solid var(--color-secondary); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Generic sections */
section { padding: 40px 20px; margin-bottom: 60px; }
section:nth-of-type(odd) { background: var(--color-white); }
section:nth-of-type(even) { background: var(--color-accent); }

/* Images inside flexible sections */
.text-image-section img { border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }

/* --- Header & Navigation --- */
header { position: sticky; top: 0; background: var(--color-white); border-bottom: 1px solid var(--color-border); z-index: 1000; }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo img { height: 40px; width: auto; }

/* Main navigation (desktop) */
.main-nav { display: none; align-items: center; gap: 16px; }
.main-nav a { color: var(--color-primary); padding: 8px 10px; border-radius: var(--radius-sm); transition: color .2s ease, background-color .2s ease; }
.main-nav a[aria-current="page"], .main-nav a:hover { color: var(--color-secondary); background-color: rgba(192,86,33,0.08); }

/* Header CTAs */
.header-cta { display: none; align-items: center; gap: 10px; }
.header-cta a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--color-primary); color: var(--color-white); background: var(--color-primary); transition: transform .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease; }
.header-cta a:hover { transform: translateY(-1px); background: #111827; border-color: #111827; }
.header-cta .phone-link { background: var(--color-white); color: var(--color-primary); border-color: var(--color-border); }
.header-cta .phone-link:hover { background: var(--color-accent); border-color: var(--color-primary); }
.header-cta .phone-link img { width: 16px; height: 16px; }

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

/* Mobile menu panel */
.mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; width: 85%; max-width: 360px; background: var(--color-white); box-shadow: -8px 0 24px rgba(0,0,0,0.15); transform: translateX(100%); transition: transform .3s ease; z-index: 1200; display: flex; flex-direction: column; }
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; margin: 12px; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--color-border); color: var(--color-primary); background: var(--color-white); }
.mobile-nav { display: flex; flex-direction: column; gap: 8px; padding: 8px 20px 24px; }
.mobile-nav a { padding: 12px 10px; border-radius: 8px; color: var(--color-primary); border: 1px solid transparent; }
.mobile-nav a[aria-current="page"], .mobile-nav a:hover { border-color: var(--color-border); background: var(--color-accent); color: var(--color-secondary); }

/* Optional page overlay when menu open (body.menu-open is expected to be toggled by JS) */
body.menu-open { overflow: hidden; }
body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(17,24,39,0.45); z-index: 1100; }

/* --- Buttons (utility classes) --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--color-primary); color: var(--color-white); background: var(--color-primary); transition: transform .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-1px); background: #111827; border-color: #111827; }
.btn-secondary { background: var(--color-white); color: var(--color-primary); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-accent); border-color: var(--color-primary); }
.btn-accent { background: var(--color-secondary); border-color: var(--color-secondary); color: var(--color-white); }
.btn-accent:hover { background: #9a451a; border-color: #9a451a; }

/* Style links in content blocks to look like buttons when placed alone after paragraphs */
.content-wrapper > a[href]:not(.phone-link):not(nav a) {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--color-primary); color: var(--color-white); background: var(--color-primary); transition: transform .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease; width: fit-content;
}
.content-wrapper > a[href]:not(.phone-link):not(nav a):hover { transform: translateY(-1px); background: #111827; border-color: #111827; }

/* In-line telephone/email links keep text style */
.content-wrapper p a[href^="tel"], .content-wrapper p a[href^="mailto"] {
  display: inline; padding: 0; border: none; background: transparent; color: var(--color-secondary); text-decoration: underline; text-underline-offset: 3px;
}

/* --- Cards & Testimonials --- */
.testimonial-card p { margin: 0; }
.testimonial-card p + p { color: var(--color-primary); margin-top: 6px; }

/* --- Footer --- */
footer { background: var(--color-primary); color: var(--color-accent); padding: 24px 0; }
footer .content-wrapper { flex-direction: column; gap: 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 12px 16px; }
footer nav a { color: var(--color-accent); opacity: 0.9; padding: 6px 8px; border-radius: 6px; transition: background-color .2s ease, color .2s ease; }
footer nav a[aria-current="page"], footer nav a:hover { background: rgba(255,255,255,0.08); color: #FFFFFF; }
footer .text-section p, footer .text-section a { color: var(--color-accent); opacity: 0.95; }

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

/* --- Forms (future-proofing) --- */
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); font: inherit; color: var(--color-text); background: var(--color-white); }
input:focus, select:focus, textarea:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 3px rgba(31,41,55,0.15); }
label { font-weight: bold; color: var(--color-primary); display: block; margin-bottom: 6px; }

/* --- Spacing & rhythm helpers --- */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-16 { margin-top: 16px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mt-24 { margin-top: 24px !important; }
.mb-24 { margin-bottom: 24px !important; }

/* --- Content readability --- */
.content-wrapper > p { max-width: 75ch; }
.text-section > p { max-width: 75ch; }

/* --- Decorative separators (optional) --- */
hr { border: 0; height: 1px; background: var(--color-border); margin: 24px 0; }

/* --- Cookie Consent Banner & Modal --- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: var(--color-white); border-top: 1px solid var(--color-border); box-shadow: 0 -10px 30px rgba(0,0,0,0.12); z-index: 1300; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; transform: translateY(100%); transition: transform .3s ease; }
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: 10px; }
.cookie-banner .cookie-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-banner .btn { padding: 10px 14px; }
.cookie-banner .btn.reject { background: var(--color-white); color: var(--color-primary); border-color: var(--color-border); }
.cookie-banner .btn.settings { background: var(--color-secondary); border-color: var(--color-secondary); }

/* Cookie preferences modal */
.cookie-modal-overlay { position: fixed; inset: 0; background: rgba(17,24,39,0.45); z-index: 1400; display: none; }
.cookie-modal-overlay.open { display: block; }
.cookie-modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.98); transition: transform .25s ease; width: 92%; max-width: 640px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); z-index: 1500; padding: 20px; display: none; flex-direction: column; gap: 14px; }
.cookie-modal.open { display: flex; transform: translate(-50%, -50%) scale(1); }
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: 10px; }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* --- Animations --- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
section { animation: fadeInUp .35s ease both; }

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

@media (min-width: 768px) {
  /* Header: show desktop nav & CTAs */
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }

  /* Content layout helpers */
  .content-wrapper { gap: 20px; }
  .text-image-section { flex-direction: row; }

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

  /* Typography scale */
  h1 { font-size: 42px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 20px; }
  h1 { font-size: 48px; }
}

/* --- Accessibility & Contrast checks --- */
.testimonial-card, .testimonial-card p, .testimonial-card strong { color: var(--color-text); } /* dark text on light background for optimal readability */

/* --- Additional safety spacing to prevent overlaps --- */
section .container .content-wrapper > * + * { margin-top: 4px; }
.testimonial-card { margin-bottom: 20px; }
.card { margin-bottom: 20px; }

/* --- Misc elements from pages --- */
ol { padding-left: 1.2rem; }
header .phone-link img { display: inline-block; }

/* --- Ensure all flex containers use gap for spacing --- */
nav[aria-label="Hauptnavigation"], nav[aria-label="Footer Navigation"], .header-cta, .mobile-nav, .cookie-buttons, .modal-actions, .card-container, .content-grid, .text-image-section, .testimonial-card, .feature-item {
  gap: 20px;
}

/* --- Corporate visual touches --- */
blockquote { border-left: 4px solid var(--color-secondary); padding-left: 12px; color: var(--color-primary); }

/* --- Prevent content overlap with sticky header --- */
header + main { padding-top: 8px; }

/* --- Ensure minimum 20px spacing between content blocks/cards --- */
.content-wrapper > * { margin-bottom: 8px; }
.content-wrapper > *:last-child { margin-bottom: 0; }
.card-container > * { margin-bottom: 0; } /* gap handles spacing */

/* --- End of stylesheet --- */
