/* =============================
   CalcaComod Renovationen Bern
   Design: geometric_structured
   Style: Flexbox-only, mobile-first
   ============================= */

/* -----------------------------
   CSS RESET & BASELINE
------------------------------ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding-left: 20px; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
button { background: none; border: none; cursor: pointer; font: inherit; }
:focus { outline: 2px dashed #2F6D3A; outline-offset: 2px; }

/* -----------------------------
   THEME VARIABLES (with fallbacks)
------------------------------ */
:root {
  --primary: #1F3B4D;
  --secondary: #2F6D3A;
  --accent: #F5F7FA;
  --ink: #0E1A22;
  --muted: #8293A1;
  --line: #D8E2EA;
  --white: #FFFFFF;
  --shadow: rgba(15, 30, 40, 0.12);
}

/* Fallbacks if custom properties unsupported */
body { background: #FFFFFF; color: #0E1A22; }

/* -----------------------------
   TYPOGRAPHY
------------------------------ */
body {
  font-family: Verdana, Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

h1, h2, h3, h4 { font-family: "Trebuchet MS", Verdana, Tahoma, Arial, sans-serif; letter-spacing: 0.4px; }
h1 { font-size: 32px; line-height: 1.2; color: var(--primary); font-weight: 700; }
h2 { font-size: 24px; line-height: 1.3; color: var(--primary); font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 18px; line-height: 1.35; color: var(--primary); font-weight: 700; }
h4 { font-size: 16px; font-weight: 700; }
p { font-size: 16px; color: var(--ink); }
small { font-size: 14px; color: var(--muted); }
strong { color: var(--primary); }

/* -----------------------------
   LAYOUT PRIMITIVES - FLEX ONLY
------------------------------ */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;            /* flex-only */
  flex-direction: column;   /* mobile-first */
  gap: 24px;
}
.content-wrapper {
  display: flex;            /* flex-only */
  flex-direction: column;
  gap: 20px;
}

/* Mandatory spacing and alignment 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; }

/* Generic card styling (geometric, structured) */
.card, .text-section, .testimonial-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px; /* subtle, crisp */
  box-shadow: 0 2px 10px var(--shadow);
}

/* -----------------------------
   HEADER & NAVIGATION
------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 3px solid var(--primary);
}
.site-header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }

.branding { display: flex; align-items: center; gap: 14px; }
.branding .logo-link img { height: 40px; width: auto; }
.tagline {
  font-size: 14px; color: var(--muted); border-left: 3px solid var(--secondary);
  padding-left: 10px; line-height: 1.3; max-width: 420px;
}

.site-nav { display: none; }
.site-nav a {
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 4px;
  color: var(--primary);
 
}
.site-nav .btn-primary{ background-color: var(--secondary);}
.site-nav a[aria-current="page"] { border-color: var(--secondary); }
.site-nav a:hover { background: var(--accent); }

/* Buttons (geometric, angular feel) */
.btn-primary, .btn-secondary, .btn-tertiary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700; letter-spacing: 0.3px;
  transition: background-color 200ms ease, color 200ms ease, transform 120ms ease, border-color 200ms ease;
  border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: #163344; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: var(--white); color: var(--secondary); border-color: var(--secondary); }
.btn-secondary:hover { background: #EAF3EC; }

.btn-tertiary { background: var(--accent); color: var(--primary); border-color: var(--line); }
.btn-tertiary:hover { border-color: var(--secondary); }
.btn-tertiary img { width: 18px; height: 18px; }

/* Mobile hamburger */
.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 2px solid var(--primary); border-radius: 6px; color: var(--primary);
}
.mobile-menu-toggle:hover { background: var(--accent); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0 0 0 auto; /* right-side drawer */
  width: 100%; max-width: 380px; height: 100vh;
  background: var(--white);
  box-shadow: -6px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 280ms ease;
  z-index: 1200;
  display: flex; flex-direction: column; gap: 16px; padding: 20px; border-left: 3px solid var(--primary);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end; width: 42px; height: 42px; border: 2px solid var(--primary); border-radius: 6px; color: var(--primary);
}
.mobile-nav { display: flex; flex-direction: column; gap: 10px; }
.mobile-nav a { padding: 14px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--accent); color: var(--primary); }
.mobile-nav a:hover { background: #EDEFF3; }

/* -----------------------------
   HERO SECTIONS
------------------------------ */
.hero { background: var(--accent); border-bottom: 2px solid var(--line); position: relative; }
.hero .container { padding-top: 24px; padding-bottom: 24px; }
.hero .content-wrapper { gap: 16px; }
.hero h1 { border-left: 6px solid var(--secondary); padding-left: 12px; }

/* Decorative geometric corner (allowed decorative absolute) */
.hero::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 140px; height: 140px; background: var(--primary);
  opacity: 0.06; transform: skew(-14deg);
  pointer-events: none; z-index: 0;
}
.hero .content-wrapper { position: relative; z-index: 1; }

/* Trust badges */
.trust-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.trust-badges span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--secondary);
  border-radius: 6px; color: var(--primary);
}
.trust-badges img { width: 18px; height: 18px; }

/* CTA rows */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* -----------------------------
   CONTENT SECTIONS
------------------------------ */
section { padding: 28px 0; }

.text-section {
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.text-section h3 { border-bottom: 2px solid var(--line); padding-bottom: 6px; }

/* Geometric list markers */
.text-section ul, .text-section ol, ul.text-section, ol.text-section { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: 8px; }
.text-section li { position: relative; padding-left: 20px; }
.text-section li::before {
  content: ""; position: absolute; left: 0; top: 10px; width: 10px; height: 10px; background: var(--secondary);
  transform: rotate(45deg); /* diamond marker */ border-radius: 1px;
}

/* Ordered lists use angular counter style */
ol.text-section { counter-reset: step; }
ol.text-section > li { counter-increment: step; padding-left: 28px; }
ol.text-section > li::before { content: counter(step) "."; transform: none; width: auto; height: auto; background: none; color: var(--secondary); font-weight: 700; top: 0; }

/* Links */
a { color: var(--secondary); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { color: #255831; }

/* Testimonial cards - ensure dark text on light bg */
.testimonial-card { background: var(--white); border: 1px solid var(--line); box-shadow: 0 2px 10px var(--shadow); border-left: 6px solid var(--primary); }
.testimonial-card p { margin: 0; }

/* Contact snippet inside sections */
.text-section a { font-weight: 700; }

/* -----------------------------
   FOOTER
------------------------------ */
.site-footer { background: var(--primary); color: var(--white); margin-top: 20px; }
.site-footer .container { padding-top: 28px; padding-bottom: 28px; }
.site-footer .content-wrapper { gap: 16px; }
.brand-signature { display: flex; align-items: center; gap: 12px; }
.brand-signature img { width: 36px; height: 36px; }
.footer-nav, .legal-nav { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-nav a, .legal-nav a { color: var(--white); border: 2px solid transparent; padding: 6px 10px; border-radius: 4px; }
.footer-nav a:hover, .legal-nav a:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.contact-snippet a { color: #CFE3EF; text-decoration: underline; }

/* -----------------------------
   RESPONSIVE BEHAVIOR
------------------------------ */
@media (min-width: 600px) {
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
}

@media (min-width: 768px) {
  .text-image-section { flex-direction: row; }
  .hero .container { padding-top: 32px; padding-bottom: 32px; }
  .cta-row { gap: 14px; }
}

@media (min-width: 992px) {
  .site-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .mobile-menu-toggle { display: none; }
  .tagline { max-width: 560px; }
  .content-grid > * { flex: 1 1 calc(50% - 20px); }
}

@media (min-width: 1200px) {
  h1 { font-size: 42px; }
  h2 { font-size: 32px; }
  .content-grid > * { flex: 1 1 calc(33.33% - 20px); }
}

/* -----------------------------
   ACCESSIBILITY & STATES
------------------------------ */
button:focus, a:focus { box-shadow: 0 0 0 3px rgba(47,109,58,0.3); }
.btn-primary:focus, .btn-secondary:focus, .btn-tertiary:focus { outline: none; }

/* -----------------------------
   UTILITIES (geometric separators)
------------------------------ */
.hr-line { height: 2px; background: var(--line); width: 100%; display: flex; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border: 2px solid var(--primary); color: var(--primary); border-radius: 4px; font-weight: 700; font-size: 12px; }

/* -----------------------------
   COOKIE CONSENT BANNER & MODAL
------------------------------ */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--white);
  border-top: 3px solid var(--primary);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.12);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px; /* flex-only */
  z-index: 1300;
  transform: translateY(110%);
  transition: transform 280ms ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.cookie-banner .cookie-text { flex: 1 1 240px; font-size: 14px; color: var(--ink); }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-accept { background: var(--secondary); color: var(--white); border: 2px solid var(--secondary); border-radius: 6px; padding: 10px 14px; font-weight: 700; }
.cookie-reject { background: var(--white); color: var(--primary); border: 2px solid var(--primary); border-radius: 6px; padding: 10px 14px; font-weight: 700; }
.cookie-settings { background: var(--accent); color: var(--primary); border: 2px solid var(--line); border-radius: 6px; padding: 10px 14px; font-weight: 700; }
.cookie-accept:hover { background: #255831; border-color: #255831; }
.cookie-reject:hover { background: var(--accent); }
.cookie-settings:hover { border-color: var(--secondary); }

/* Cookie Preferences Modal */
.cookie-modal {
  position: fixed; inset: 0;
  display: none; /* toggled by .open */
  z-index: 1400;
  align-items: center; justify-content: center; /* flex-only */
}
.cookie-modal.open { display: flex; }
.cookie-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.48); }
.cookie-modal-content {
  position: relative; z-index: 1;
  background: var(--white); border: 2px solid var(--primary); border-radius: 8px;
  width: 92%; max-width: 640px; padding: 18px;
  display: flex; flex-direction: column; gap: 14px; /* flex-only */
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.cookie-category small { color: var(--muted); }

/* Toggle switches (CSS-only) */
.toggle { position: relative; width: 48px; height: 28px; border: 2px solid var(--primary); border-radius: 18px; background: var(--accent); }
.toggle::after { content: ""; position: absolute; top: 50%; left: 4px; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--primary); transition: left 180ms ease, background 180ms ease; }
.toggle.on { background: #EAF3EC; border-color: var(--secondary); }
.toggle.on::after { left: 24px; background: var(--secondary); }

.cookie-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.cookie-save { background: var(--secondary); color: var(--white); border: 2px solid var(--secondary); border-radius: 6px; padding: 10px 14px; font-weight: 700; }
.cookie-cancel { background: var(--white); color: var(--primary); border: 2px solid var(--primary); border-radius: 6px; padding: 10px 14px; font-weight: 700; }

/* -----------------------------
   MISC COMPONENTS / HELPERS
------------------------------ */
.icon { width: 18px; height: 18px; }
.align-center { display: flex; align-items: center; justify-content: center; }
.stack-vertical { display: flex; flex-direction: column; gap: 12px; }

/* -----------------------------
   PAGE-SPECIFIC NUANCES
------------------------------ */
/* Highlight hero CTAs on key pages */
.index .hero .cta-row a, .leistungen .hero .cta-row a, .projekte .hero .cta-row a, .kontakt .hero .cta-row a, .offerte .hero .cta-row a { margin-right: 0; }

/* Legal pages: simpler cards spacing */
main > section .text-section + .text-section { margin-top: 6px; }

/* -----------------------------
   ENSURE NO OVERLAPS
------------------------------ */
section .container, .site-footer .container, .site-header .container { gap: 20px; }
section .content-wrapper > * { margin: 0; }

/* -----------------------------
   PRINT BASICS
------------------------------ */
@media print {
  .site-header, .site-footer, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
}
