/* ============================================================
   Schichtwerk Ausbau – Elegant Classic Theme (Mobile-first)
   Author: Senior CSS Developer & UI Designer
   Notes:
   - Uses ONLY Flexbox for layouts (no CSS Grid/Columns)
   - Elegant Classic: serif-leaning hierarchy via spacing, muted palette
   - Brand-compliant colors and fonts
   - Mobile menu + Cookie banner components included
   ============================================================ */

/* ---------------------------
   0) RESET & BASELINE
---------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body { line-height: 1.6; color: #24303A; background-color: #FAFAF8; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 16px; }
img, svg { display: block; max-width: 100%; height: auto; }
img[alt=""], svg[aria-hidden="true"] { filter: none; }
figure { margin: 0; }
ul, ol { margin: 0 0 16px 20px; padding: 0; }
p { margin: 0 0 16px; }
small { font-size: 12px; color: #5F6B75; }
hr { height: 1px; border: 0; background: #E9ECEF; margin: 24px 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid #C06A2B; outline-offset: 2px; }

/* ---------------------------
   1) THEME VARIABLES & FALLBACKS
---------------------------- */
:root {
  --color-primary: #22313F; /* brand primary */
  --color-secondary: #C06A2B; /* brand secondary */
  --color-accent: #F5F7FA; /* brand accent */
  --color-ink: #1E2A35; /* dark text */
  --color-text: #2A3640; /* body text */
  --color-muted: #6C7781; /* muted text */
  --color-line: #E6E3DC; /* classic warm line */
  --color-paper: #FFFFFF; /* card/panel */
  --color-ivory: #FAFAF8; /* page bg */
  --shadow-soft: 0 2px 8px rgba(18, 24, 32, 0.06);
  --shadow-elev: 0 8px 24px rgba(18, 24, 32, 0.10);
  --radius-s: 6px; --radius-m: 10px; --radius-l: 14px;
  --space-8: 8px; --space-12: 12px; --space-16: 16px; --space-20: 20px; --space-24: 24px; --space-32: 32px; --space-40: 40px; --space-60: 60px;
}

/* Fallbacks for older browsers (use if CSS variables not supported) */
body { color: var(--color-text, #2A3640); background: var(--color-ivory, #FAFAF8); }

/* ---------------------------
   2) TYPOGRAPHY – Elegant Classic hierarchy
---------------------------- */
h1, h2, h3, h4, h5, h6 { font-family: "Trebuchet MS", Georgia, serif; color: var(--color-primary); line-height: 1.25; margin: 0 0 12px; letter-spacing: 0.2px; }
h1 { font-size: 32px; }
h2 { font-size: 24px; margin-top: 16px; }
h3 { font-size: 18px; color: #2E3B46; }
body, p, li { color: var(--color-text); }
.tagline { color: #505A64; font-size: 14px; letter-spacing: 0.3px; }
strong { color: #1F2A33; font-weight: 700; }

/* Links */
a { color: var(--color-secondary); text-decoration: underline; text-underline-offset: 2px; transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
a:hover { color: #a55822; }
a[aria-current="page"] { color: #8D4E1F; font-weight: 700; }

/* Button-like links (direct anchors inside .text-section or header CTAs) */
.text-section > a, .header-ctas > a { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: var(--radius-s); border: 1px solid #DAD6CE; text-decoration: none; background: #FFFFFF; color: var(--color-primary); box-shadow: 0 1px 0 rgba(0,0,0,0.02); margin-right: 10px; margin-bottom: 8px; }
.text-section > a:first-child, .header-ctas > a:first-child { background: var(--color-secondary); border-color: var(--color-secondary); color: #fff; }
.text-section > a:hover { border-color: #C8C3B7; background: #FBFBF9; }
.text-section > a:first-child:hover, .header-ctas > a:first-child:hover { background: #A95B24; border-color: #A95B24; }

/* Lists – refined spacing */
ul li, ol li { margin-bottom: 8px; }
ul { list-style-type: disc; }
ol { padding-left: 20px; }

/* ---------------------------
   3) GLOBAL LAYOUT – FLEX ONLY
---------------------------- */
.container { display: flex; width: 100%; justify-content: center; padding-left: 20px; padding-right: 20px; }
.content-wrapper { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; max-width: 1120px; padding: 24px 0; }

main > section { background: transparent; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
main > section .content-wrapper { padding-top: 28px; padding-bottom: 28px; }

/* Mandatory spacing classes */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--color-paper); border: 1px solid #E6E3DC; border-radius: var(--radius-m); box-shadow: var(--shadow-soft); padding: 20px; }
.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; border: 1px solid #E6E3DC; border-radius: var(--radius-m); background: #FFFFFF; color: #1E2A35; box-shadow: var(--shadow-soft); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Ensure gaps between stacked blocks */
.text-section { display: flex; flex-direction: column; gap: 8px; }

/* ---------------------------
   4) HEADER & NAVIGATION
---------------------------- */
header { background: #FFFFFF; border-bottom: 1px solid var(--color-line); box-shadow: 0 2px 10px rgba(34,49,63,0.04); position: relative; z-index: 50; }
.logo img { height: 40px; width: auto; }

/* Top bar layout */
header .content-wrapper { gap: 12px; }

/* Desktop nav hidden by default (mobile-first) */
.main-nav { display: none; flex-wrap: wrap; gap: 12px; align-items: center; }
.main-nav a { text-decoration: none; color: var(--color-primary); padding: 8px 10px; border-radius: var(--radius-s); border: 1px solid transparent; }
.main-nav a:hover { background: var(--color-accent); border-color: #E1E6EC; }

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

/* Mobile menu toggle */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid #DAD6CE; background: #FFFFFF; border-radius: var(--radius-s); color: var(--color-primary); cursor: pointer; }
.mobile-menu-toggle:hover { background: #FBFBF9; }

/* ---------------------------
   5) MOBILE MENU (overlay with slide-in panel)
---------------------------- */
.mobile-menu { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px; padding: 16px; background: rgba(34,49,63,0.45); transform: translateX(100%); transition: transform 240ms ease; z-index: 9999; }
.mobile-menu[aria-hidden="false"] { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-s); border: 1px solid #DAD6CE; background: #FFFFFF; color: var(--color-primary); cursor: pointer; }
.mobile-menu-close:hover { background: #FBFBF9; }
/* Slide-in panel built with flex; no absolute positioning for card content */
.mobile-nav { display: flex; flex-direction: column; gap: 4px; background: #FFFFFF; border: 1px solid #E6E3DC; border-radius: var(--radius-m); box-shadow: var(--shadow-elev); margin-left: auto; width: 92%; max-width: 360px; padding: 16px; }
.mobile-nav a { display: flex; align-items: center; padding: 12px 10px; color: var(--color-primary); text-decoration: none; border-radius: var(--radius-s); border: 1px solid transparent; }
.mobile-nav a:hover { background: var(--color-accent); border-color: #E1E6EC; }

/* Prevent scroll bleed when menu is open (requires JS to toggle .menu-open on body) */
body.menu-open { overflow: hidden; }

/* ---------------------------
   6) SECTIONS & COMPONENTS
---------------------------- */
/* Hero sections: add subtle classic balance */
main > section:first-of-type { background: #FFFFFF; }
main > section:first-of-type .content-wrapper { padding-top: 32px; padding-bottom: 32px; }

/* Testimonials – ensure strong contrast on light background */
.testimonial-card p { margin: 0; }
.testimonial-card strong { color: #1B2732; }

/* Footer */
footer { background: #FFFFFF; border-top: 1px solid var(--color-line); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer-nav a { color: var(--color-primary); text-decoration: none; padding: 6px 8px; border-radius: var(--radius-s); }
.footer-nav a:hover { background: var(--color-accent); }

/* Contact rows with icons */
.text-section img[alt] { display: inline-block; vertical-align: middle; margin-right: 6px; }

/* Cards (generic) */
.card:hover { box-shadow: var(--shadow-elev); transform: translateY(-1px); transition: box-shadow 200ms ease, transform 200ms ease; }

/* Content utility spacing to avoid overlaps */
.content-wrapper > * + * { margin-top: 0; }

/* ---------------------------
   7) COOKIE CONSENT (banner + modal)
---------------------------- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: #FFFFFF; border-top: 1px solid var(--color-line); box-shadow: 0 -6px 18px rgba(18,24,32,0.08); padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; transform: translateY(100%); transition: transform 240ms ease; z-index: 9998; }
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: 8px; }
.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: var(--radius-s); border: 1px solid #DAD6CE; background: #FFFFFF; color: var(--color-primary); cursor: pointer; text-decoration: none; }
.cookie-btn:hover { background: #FBFBF9; }
.cookie-btn.primary { background: var(--color-secondary); border-color: var(--color-secondary); color: #FFFFFF; }
.cookie-btn.primary:hover { background: #A95B24; border-color: #A95B24; }
.cookie-btn.ghost { background: #FFFFFF; border-color: #DAD6CE; color: var(--color-primary); }

/* Cookie Preferences Modal */
.cookie-modal { position: fixed; inset: 0; background: rgba(34,49,63,0.55); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 220ms ease; z-index: 9999; }
.cookie-modal.open { opacity: 1; pointer-events: auto; }
.cookie-modal-dialog { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 640px; background: #FFFFFF; border: 1px solid #E6E3DC; border-radius: var(--radius-l); box-shadow: var(--shadow-elev); padding: 18px; }
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cookie-modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EFEDE7; }
.cookie-category .desc { color: #5F6B75; font-size: 14px; }
.cookie-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; width: 46px; height: 26px; border-radius: 26px; background: #D9DCE1; border: 1px solid #C8CCD2; transition: background 180ms ease, border-color 180ms ease; }
.switch::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; border: 1px solid #C8CCD2; transform: translateX(1px); transition: transform 180ms ease; }
.switch.on { background: #C06A2B; border-color: #A95B24; }
.switch.on::after { transform: translateX(21px); }
.switch.disabled, .switch[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }

/* ---------------------------
   8) ACCESSIBILITY & STATES
---------------------------- */
[hidden] { display: none !important; }
::selection { background: rgba(192,106,43,0.2); }

/* ---------------------------
   9) RESPONSIVE – Flex alignment rules
---------------------------- */
/* Mobile: column-first, already set. */
.text-image-section { flex-direction: column; }

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

@media (min-width: 768px) {
  .logo img { height: 48px; }
  h1 { font-size: 40px; }
  .content-wrapper { gap: 18px; padding-top: 32px; padding-bottom: 32px; }
  .text-image-section { flex-direction: row; }
}

@media (min-width: 992px) {
  /* Show desktop navigation & CTAs */
  .main-nav { display: flex; }
  .header-ctas { display: flex; }
  .mobile-menu-toggle { display: none; }

  /* Elegant spacing scale on desktop */
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 20px; }

  /* Footer layout enhancements */
  footer .content-wrapper { flex-direction: row; align-items: flex-start; gap: 32px; }
  footer .text-section { flex: 1 1 50%; }
  .footer-nav { flex: 1 1 auto; }
}

/* ---------------------------
   10) PAGE-SPECIFIC FINESSE (applies broadly)
---------------------------- */
/* Hero CTA groups */
section[aria-labelledby^="hero-"] .text-section { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
section[aria-labelledby^="hero-"] p { max-width: 70ch; }

/* Bullet lists in content wrappers: generous spacing */
.content-wrapper > ul, .content-wrapper > ol { background: #FFFFFF; border: 1px solid #ECE8E0; border-radius: var(--radius-m); padding: 16px 18px; box-shadow: var(--shadow-soft); }

/* Emphasis for numbers/metrics */
.content-wrapper p strong, .content-wrapper li strong { color: var(--color-primary); }

/* Header tagline placed elegantly */
header .tagline { font-size: 13px; color: #606B75; }

/* Inline contact line in hero/sections */
.text-section p a { text-decoration: underline; }

/* ---------------------------
   11) NAV CURRENT STATE
---------------------------- */
.main-nav a[aria-current="page"], .footer-nav a[aria-current="page"] {
  background: var(--color-accent);
  border-color: #E1E6EC;
  font-weight: 700;
}

/* ---------------------------
   12) MISC UTILITIES
---------------------------- */
.muted { color: var(--color-muted); }
.accent-bg { background: var(--color-accent); }
.paper { background: var(--color-paper); border: 1px solid #ECE8E0; border-radius: var(--radius-m); }

/* Ensure minimum spacing between any successive elements to prevent overlap */
.content-wrapper > * { margin-bottom: 0; }
.content-wrapper > * + * { margin-top: 8px; }

/* ---------------------------
   13) PRINT TWEAKS
---------------------------- */
@media print {
  .mobile-menu-toggle, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: none; color: #000; }
  header, footer { box-shadow: none; }
}
