/* ============================================================
   Metallbau Huebener - style.css (v4.1) rev.2 27.11.2026
   Mobile First | Primary: #2991d6 (Blau, Alt-Template jl_simpli_free) | Accent: #0036d9
   rev.2: Topbar rechtsbuendig, Legal-Rahmen wie Hauptseiten,
          Side-Contact Oeffnen je Button einzeln
   ============================================================ */

:root {
  --primary: #2991d6;
  --dark: #2174ab;
  --accent: #0036d9;
  --bg-color: #f5f7fa;
  --text-color: #1a1a1a;
  --white: #ffffff;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  line-height: 1.6;
  padding-top: 118px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.icon { width: 20px; height: 20px; display: inline-block; vertical-align: -4px; margin-right: 6px; }

/* ---------- Topbar (rechtsbuendig) ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--white);
  display: flex; flex-wrap: wrap; justify-content: flex-end;
  align-items: center; gap: 6px 26px;
  padding: 8px 22px;
  border-bottom: 1px solid rgba(26, 94, 74, 0.15);
  font-size: 0.92rem;
}
.topbar-item { color: var(--text-color); font-weight: 500; white-space: nowrap; }
.topbar-item:hover { color: var(--primary); text-decoration: none; }

/* ---------- Header + Logo-Box (Logo LINKS, gross) ---------- */
.site-header {
  position: fixed; top: 40px; left: 0; right: 0; z-index: 999;
  background: linear-gradient(135deg, var(--primary), var(--dark));
  padding: 0;
  box-shadow: var(--shadow);
}
.header-inner {
  position: relative;
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: center;
  min-height: 78px; gap: 16px;
}
.logo-box {
  position: absolute; left: 20px; top: 6px; z-index: 1001;
  background: var(--white);
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  cursor: pointer;
}
.logo-box img { max-height: 158px; width: auto; display: block; }
/* Legal-Seiten: kein Hero -> Logo passt sich der Menueleiste an */
body.legal-body .logo-box img { max-height: 62px; }

.mainnav { padding: 0; margin: 0; }
.nav-list {
  list-style: none;
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 24px;
}
.nav-list a {
  color: var(--white); font-weight: 600; padding: 6px 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.55);
  border-bottom: 2px solid transparent; display: inline-block;
}
.nav-list a:hover { text-decoration: none; border-bottom-color: var(--accent); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 8px;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 26px; height: 3px; background: var(--white);
  border-radius: 2px; position: relative; transition: transform 0.2s;
}
.nav-toggle span::before { content: ""; position: absolute; top: -9px; }
.nav-toggle span::after  { content: ""; position: absolute; top: 9px; }

/* ---------- Hero ---------- */
.hero {
  /* Bild breitentreu (100% auto): Schriftzug bleibt KOMPLETT sichtbar
     (inkl. Randluft nach dem 'r') auf jeder Bildschirmbreite. */
  background-color: #17547e;
  background-image:
    linear-gradient(rgba(0, 30, 60, 0.55), rgba(0, 60, 110, 0.45)),
    url('/images/logo/hintergrund_mit_schriftzug.png');
  background-size: 100% 100%, 100% auto;
  background-position: center, center center;
  background-repeat: no-repeat;
  color: var(--white);
  text-align: center;
  padding: 104px 20px 90px;
}
.hero h1, .hero-sub { text-shadow: 0 2px 6px rgba(0,0,0,0.65); }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; opacity: 0.92; margin-bottom: 26px; }
.hero-cta {
  display: inline-block; background: rgba(255,255,255,0.14); color: #ffffff;
  font-weight: 700; padding: 12px 28px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.85);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  min-height: 44px; line-height: 20px;
  box-shadow: var(--shadow);
}
.hero-cta:hover { text-decoration: none; background: rgba(255,255,255,0.28); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; background: var(--bg-color); }
.section:nth-of-type(even) { background: var(--white); }
.section h2 {
  color: var(--primary);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 20px;
  border-bottom: 3px solid var(--accent);
  display: inline-block; padding-bottom: 4px;
}
.section h3 { color: var(--dark); margin: 16px 0 8px; }
.section p { margin-bottom: 14px; }
.section ul { margin: 0 0 14px 22px; }
.section ul ul { margin: 6px 0 6px 22px; }
.checklist { list-style: none; margin-left: 0 !important; }
.checklist li { padding-left: 30px; position: relative; margin-bottom: 8px; }
.checklist li::before {
  content: "\2713"; position: absolute; left: 0;
  color: var(--accent); font-weight: 700;
}

/* ---------- Leistungs-Karten ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(26, 94, 74, 0.1);
  padding: 20px; color: var(--text-color);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { text-decoration: none; transform: translateY(-3px); }
.card h3 { color: var(--primary); margin-bottom: 6px; }

/* ---------- Galerie ---------- */
figure.gallery { margin: 0; padding: 26px 0 30px; background: var(--bg-color); }
.section + figure.gallery { padding-top: 10px; }
.gallery-caption {
  max-width: 1100px; margin: 0 auto 12px; padding: 0 20px;
  font-weight: 700; color: var(--primary); font-size: 1.15rem;
}
.gallery-track-wrap { position: relative; overflow: hidden; padding: 10px 0 6px; }
.gallery-track { display: flex; gap: 16px; width: max-content; will-change: transform; }
.gallery-item { flex: 0 0 auto; width: 240px; cursor: zoom-in; }
.gallery-item img {
  width: 240px; height: 170px; object-fit: cover;
  border-radius: 10px; box-shadow: var(--shadow);
}
.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 5; width: 44px; height: 44px; border: 0; cursor: pointer;
  border-radius: 50%; background: rgba(255,255,255,0.9);
  color: var(--primary); font-size: 1.3rem; font-weight: 700;
  box-shadow: var(--shadow);
}
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
.gallery-hint {
  max-width: 1100px; margin: 10px auto 0; padding: 0 20px;
  font-size: 0.85rem; color: #667; text-align: center;
}

.lightbox {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(10, 20, 15, 0.93);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; padding: 24px;
}
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border: 0; cursor: pointer;
  border-radius: 50%; background: rgba(255,255,255,0.92);
  color: var(--primary); font-size: 1.5rem; font-weight: 700;
  box-shadow: var(--shadow);
}
.lb-btn:hover { filter: brightness(1.05); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-close {
  position: absolute; top: 14px; right: 18px;
  width: 44px; height: 44px; border: 0; cursor: pointer;
  border-radius: 50%; background: rgba(255,255,255,0.92);
  color: var(--primary); font-size: 1.7rem; line-height: 1;
  box-shadow: var(--shadow);
}

/* ---------- Kontakt ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 24px; }
.contact-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(26, 94, 74, 0.1);
  padding: 18px 22px; margin-bottom: 16px;
}
.contact-card h3 { margin: 0 0 8px; color: var(--primary); }
.contact-route {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(26, 94, 74, 0.1);
  padding: 22px;
}
.route-btn {
  display: inline-block; background: var(--primary); color: var(--white);
  font-weight: 700; padding: 12px 26px; border-radius: 999px;
  min-height: 44px; line-height: 20px; margin: 10px 0 14px;
}
.route-btn:hover { text-decoration: none; filter: brightness(1.08); }
.route-alt { font-size: 0.9rem; }

/* ---------- Footer (IMMER 3 Spalten) ---------- */
.site-footer { background: #0d2f4d; color: #dbe7f1; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 46px 0 20px; }
.footer-col h3 { color: var(--white); margin-bottom: 10px; font-size: 1.05rem; }
.footer-col a { color: #9cc8ec; font-weight: 500; }
.footer-col a:hover, .footer-bottom a:hover { color: #ffffff; text-decoration: underline; }
.footer-bottom {
  text-align: center; padding: 16px 0 22px; border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.9rem; color: #9fb8cc;
}
.footer-bottom a { color: #9cc8ec; font-weight: 500; }

/* ---------- Side-Contact (SCHUBLADE: ganzes Fach zieht aus dem Rand,
   Hörer bleibt vorne dran, Nummer kommt dahinter zum Vorschein) ---------- */
.side-contact {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 1002; display: flex; flex-direction: column; gap: 12px;
  align-items: flex-end; /* Faecher rechtsbuendig, wachsen nach LINKS */
  pointer-events: none;
}
.sc-btn {
  pointer-events: auto;
  display: flex; align-items: center;
  width: 56px; height: 56px;
  overflow: hidden;                 /* Nummer unsichtbar, solange eingezogen */
  border-radius: 10px 0 0 10px;
  background: var(--primary); color: var(--white);
  box-shadow: var(--shadow);
  transition: width 0.22s ease;
  white-space: nowrap;
}
/* gezogene Schublade: Fach faehrt nach links aus */
.sc-btn.sc-open { width: 230px; }
.sc-icon {
  flex: 0 0 56px; display: flex; align-items: center; justify-content: center;
  height: 100%;
}
.sc-icon .icon { margin: 0; }
.sc-icon img { width: 22px; height: 22px; filter: invert(1); }
.sc-label {
  display: flex; align-items: center; height: 100%;
  font-size: 0.9rem; font-weight: 600; padding-right: 14px;
  white-space: nowrap;
}

/* ---------- Back-to-Top ---------- */
.back-to-top {
  position: fixed; bottom: 22px; right: 22px; z-index: 1500;
  width: 48px; height: 48px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--primary); color: var(--white); font-size: 1.3rem;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }

/* ---------- Cookie-Banner ---------- */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000;
  background: var(--white); border-top: 3px solid var(--accent);
  box-shadow: 0 -6px 20px rgba(0,0,0,0.18);
  padding: 16px 20px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner p { max-width: 720px; margin: 0; font-size: 0.88rem; }
.cookie-actions { display: flex; gap: 10px; }
.btn-cookie {
  min-height: 44px; min-width: 120px; padding: 10px 20px;
  border-radius: 999px; border: 0; cursor: pointer; font-weight: 700;
}
.btn-accept { background: var(--accent); color: var(--white); }
.btn-reject { background: #e3e8ec; color: var(--text-color); }

/* ---------- Legal-Seiten: Rahmen wie Hauptseiten-Look ---------- */
main.legal-main {
  max-width: 1100px; margin: 34px auto 60px; padding: 0 20px;
  /* wirkt wie grosse weisse Card ueber Seitenbreite */
}
main.legal-main > *:first-child { margin-top: 0; }
.legal-sheet {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(26, 94, 74, 0.1);
  padding: 40px 48px 50px;
}
.legal-sheet h2 {
  color: var(--primary);
  border-bottom: 3px solid var(--accent);
  display: inline-block; padding-bottom: 4px;
  margin-bottom: 20px;
}
.legal-sheet h4 { margin: 22px 0 8px; color: var(--dark); }
.legal-sheet p { margin-bottom: 12px; }
.legal-sheet ul { margin: 0 0 14px 22px; }
.legal-sheet a { word-break: break-word; }

/* Tablet */
@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1.4fr 1fr; }
}

/* Laptop/Desktop */
@media (min-width: 860px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-toggle { display: none; }
}

/* Mobil: Hamburger + scrollbares Menue */
@media (max-width: 859px) {
  .nav-toggle { display: block; }
  .nav-list { display: none; flex-direction: column; align-items: stretch; overflow-x: auto; max-height: 300px; }
  .nav-list.open {
    display: flex; flex-wrap: wrap; justify-content: flex-start;
    flex-direction: row; overflow-x: auto; gap: 6px 18px;
  }
  .nav-list a { white-space: nowrap; }
  .topbar { font-size: 0.8rem; gap: 4px 14px; padding: 8px 12px; }
  .legal-sheet { padding: 26px 18px 36px; }
  .logo-box img { max-height: 94px; }
  .logo-box { left: 12px; top: 4px; padding: 0 1px; }
  .header-inner { min-height: 64px; }
  body { padding-top: 104px; }
}

/* ---------- Screenreader-Fallback ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}
