
/* === About section layout === */
.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: clamp(18px, 4vw, 36px);
  align-items: center;
  margin-top: 20px;
}
.about-portrait img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  display: block;
  object-fit: cover;
}
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { order: -1; margin-bottom: 10px; }
}
.about-copy h2 { margin: 0 0 6px 0; }
.about-copy p { font-size: clamp(16px, 1.1rem, 18px); line-height: 1.6; }

/* === Social icons === */
.social-icon {
  display: inline-flex;
  align-items: left;
  justify-content: left;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.social-icon img, .social-icon svg {
  display: block;
}
.social-icon:hover {
  transform: translateY(-1px) scale(1.05);
  filter: brightness(1.05);
}
.social-icon.instagram { background: #fff; }

/* === Social icons: colored Instagram with label === */
.social-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  background: none !important;
  box-shadow: none !important;
  padding: 4px 2px;
}
.social-icon img, .social-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}
.social-icon .label {
  font-weight: 600;
  line-height: 1;
}
.social-icon:hover {
  transform: translateY(-1px);
}
/* Ensure Instagram link inherits text color properly */
a.social-icon.instagram .label { color: inherit; }

/* === Zentrierung des Instagram-Links === */
.social-icon.instagram {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  text-align: center;
  gap: 8px;
}
#kontakt .social-icon.instagram {
  justify-content: center;
}

/* === Einheitliches Button-Design (Blau mit weißer Schrift und Schatten) === */
button,
.btn,
input[type="submit"],
a.button,
a.btn {
  background-color: #007bff;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 500;
  box-shadow: 0 3px 8px rgba(0, 123, 255, 0.25);
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
a.button:hover,
a.btn:hover {
  background-color: #0069d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.35);
}

button:active,
.btn:active,
input[type="submit"]:active,
a.button:active,
a.btn:active {
  background-color: #0056b3;
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}

/* === Sicheres Button-Styling für alle Leistungs-Buttons === */
section.leistungen a,
.services a,
.card a,
.service-btn,
a.service-btn {
  background-color: #007bff !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px;
  padding: 10px 20px;
  box-shadow: 0 3px 8px rgba(0, 123, 255, 0.25);
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-decoration: none;
  display: inline-block;
}

section.leistungen a:hover,
.services a:hover,
.card a:hover,
.service-btn:hover,
a.service-btn:hover {
  background-color: #0069d9 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.35);
}



/* Banner: ganze Grafik zeigen, nicht abschneiden */
.hero-banner {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;                 /* entfernt unnötigen Innenabstand */
  background: #000;           /* dezente Letterbox-Ränder bei sehr breiten/hohen Screens */
  overflow: hidden;
}

.hero-banner img {
  max-height: 60vh;           /* begrenzt die Höhe auf 60% der Viewport-Höhe */
  width: auto;                /* Bild behält Seitenverhältnis */
  max-width: 100%;            /* skaliert auf schmale Screens */
  height: auto;               /* wichtig: kein Strecken */
  display: block;
  object-fit: contain;        /* falls Höhe woanders erzwungen wurde */
}

/* Überschrift und Overlay sauber positionieren */
.hero-banner .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0.05) 60%, transparent);
  pointer-events: none;
}

.hero-banner h1 {
  position: absolute;
  left: 24px;
  bottom: 18px;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  font-size: clamp(1.4rem, 2.4vw + 0.6rem, 2.4rem);
}

/* Einheitliche Kartenanordnung */
.cards-equal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  align-items: stretch;
}

/* Karteninhalt gleichmäßig von unten aufbauen */
.card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: 1.5rem;
}

/* Überschrift oben */
.card h3 {
  order: 1;
  margin-bottom: 0.75rem; /* kleinerer Abstand zum Text */
}

/* Spacer minimalisieren – nur für Resthöhen, kein großer Abstand */
.card .spacer {
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0; /* kein zusätzlicher Abstand */
  padding: 0;
}

/* Text direkt über dem Button */
.card p {
  order: 3;
  margin: 0 0 0.75rem 0; /* kleiner Abstand nach unten */
}

/* Button bündig unten */
.card .btn {
  order: 4;
  margin-top: auto;
  align-self: flex-start;
}

/* Optional gleiche Mindesthöhe für alle Karten */
.grid.cards-equal > .card {
  min-height: 320px;
}


/* Optional: fixe Mindesthöhe, falls gewünscht (anpassen/entfernen) */
.grid.cards-equal > .card {
  min-height: 320px;
}



/* Falls bestehende Styles das Bild per cover erzwingen, überschreiben wir das hartnäckig */
.hero-banner img,
.hero-banner::before,
.hero-banner::after {
  object-fit: contain !important;
}

/* --- LEISTUNGEN: Überschrift oben, Text + Button unten --- */
#leistungen .cards-equal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

#leistungen .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.5rem;
  min-height: 260px; /* einheitliche Höhe */
}

/* Überschrift bleibt oben */
#leistungen .card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

/* Spacer bleibt als Platzhalter zwischen Überschrift und Textblock */
#leistungen .card .spacer {
  flex: 1 1 auto;
}

/* Text und Button bilden zusammen den unteren Block */
#leistungen .card p,
#leistungen .card .btn {
  margin: 0;
}

/* Text-Button-Gruppe unten fixieren */
#leistungen .card p {
  margin-bottom: 0.5rem;
}

#leistungen .card .btn {
  align-self: flex-start;
  margin-top: 0;
}


/* Mobile Feinschliff */
@media (max-width: 640px) {
  .hero-banner h1 {
    left: 16px;
    right: 16px;
    bottom: 14px;
  }
  .hero-banner img {
    max-height: 50vh;
  }
}





/* === Mobile Card-Komprimierung (<=768px) === */
@media (max-width: 768px) {
  .cards-equal {
    gap: 0.6rem;
  }

  .card {
    padding: 12px;
    gap: 4px;
  }

  .card h3 {
    margin: 0 0 0.25rem 0;
  }

  .card p {
    margin: 0 0 0.5rem 0;
  }

  /* Speziell für Bereich "Leistungen": Mindesthöhe entfernen & enger packen */
  #leistungen .card {
    min-height: unset;
    padding: 10px;
  }

  #leistungen .card h3 {
    margin-bottom: 0.25rem;
  }
}



/* === Hero-Bild fix: vollständig anzeigen === */
.hero-banner {
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero-banner img.hero-image {
  width: 100%;
  height: auto;
  object-fit: contain; /* zeigt das Bild vollständig */
}
.hero-text {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
}

/* === Mobile Anpassung: Text kleiner + weiter unten === */
@media (max-width: 768px) {
  .hero-text {
    top: 65%; /* Text etwas weiter nach unten */
  }

  .hero-text h1 {
    font-size: 1.6rem;
    line-height: 1.2;
  }

  .hero-text p {
    font-size: 0.9rem;
    line-height: 1.4;
  }
}
@media (max-width: 768px) {
  .card div {
    flex-direction: column !important;
  }
  .card img {
    max-width: 100% !important;
  }
}


/* === ADMINISTRATION: Bild-Fixes für mobile Ansicht === */

/* 1) Inline-Höhe vom Banner aushebeln + sicheres Skalieren */
.hero-banner[style] { height: auto !important; }
.hero-banner {
  padding: 0 !important;
  overflow: hidden;
}
.hero-banner img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
}

/* 2) Karten-Layouts: Bilder nie strecken */
#verwaltung .card div,
#sicherheit .card div,
#monitoring .card div {
  align-items: flex-start;
}

/* Desktop: Bild ~40% breit, Text daneben */
@media (min-width: 821px) {
  #verwaltung .card div > img,
  #sicherheit .card div > img,
  #monitoring .card div > img {
    flex: 0 0 40%;
    max-width: 420px;
    width: 40%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
  }
}

/* Mobile: Bild volle Breite unter-/oberhalb des Textes, ohne Beschnitt */
@media (max-width: 820px) {
  #verwaltung .card div,
  #sicherheit .card div,
  #monitoring .card div {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px;
  }
  #verwaltung .card div > img,
  #sicherheit .card div > img,
  #monitoring .card div > img {
    flex: 0 0 auto;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px;
  }

  .hero-banner img {
    object-fit: contain !important;
    max-height: 55vh;
    background-color: #0a2233;
  }
}



/* === FIX: it-beratung.html Bildverzerrung beheben === */
.beratung-section img {
  height: auto !important;
  object-fit: contain !important;
  flex: 0 0 auto !important; /* verhindert Stretching durch Flex */
}

/* Mobile: Bild vollbreit, korrekt skaliert */
@media (max-width: 820px) {
  .beratung-section {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }
  .beratung-section img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

/* === Mobile Banner Layout Fix === */
@media (max-width: 640px) {
  .hero-contained .hero-stage {
    position: relative;
    overflow: hidden;
  }

  .hero-contained .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top; /* sorgt dafür, dass der obere Bildbereich gezeigt wird */
    display: block;
  }

  .hero-contained .hero-copy {
    position: relative; /* bleibt über dem Bild, aber unverändert */
    z-index: 2;
  }
}