* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

/*
 * Abgerundete Ecken für "echte" Content-Fotos (RTE-Fließtext-Bilder ohne eigenen Wrapper, siehe
 * blocks/text.html, sowie das Text-&-Bild-Element, siehe .text-image img weiter unten – hier über
 * den generischen img-Selektor mitabgedeckt statt doppelt gepflegt). Kleine Icon-artige Bilder
 * (Logo im Header, Leistungs-Icons, Team-Foto – letzteres ohnehin schon rund über .team-photo)
 * sollen davon unberührt bleiben, daher :not() mit den jeweils passenden Elternklassen statt
 * eines pauschalen Radius auf allen img.
 */
img:not(.card-icon-img) {
  border-radius: var(--radius);
}

.logo img,
.team-photo img {
  border-radius: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg);
  border-bottom: 3px solid var(--color-accent);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo img {
  height: 60px;
  width: auto;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1.25;
}

.logo-text .main {
  display: block;
}

.logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

nav.main-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

/* Hamburger-Menü für schmale Bildschirme. Rein CSS-basiert (kein
   JavaScript in der exportierten Website nötig): eine unsichtbare
   Checkbox hält den Auf/Zu-Zustand, das <label> davor ist der
   antippbare Button (mind. 44x44px Fläche für Touch-Bedienung), der
   :checked-Zustand blendet das Menü über einen Sibling-Selektor ein.
   Auf breiten Bildschirmen bleibt Button und Checkbox unsichtbar,
   die Hauptnavigation zeigt sich wie gewohnt inline im Header. */
.nav-toggle-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: 8px;
}

.nav-toggle-button span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-primary-dark);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle-checkbox:checked ~ .nav-inner .nav-toggle-button span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle-checkbox:checked ~ .nav-inner .nav-toggle-button span:nth-child(2) {
  opacity: 0;
}

.nav-toggle-checkbox:checked ~ .nav-inner .nav-toggle-button span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Notice bar */
.notice-bar {
  background: var(--color-accent);
  color: #fff;
}

.notice-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.notice-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(26,26,26,0.5), rgba(26,26,26,0.6)),
    var(--hero-image, none);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero-content {
  max-width: 640px;
  padding: 60px 24px;
  margin-left: max(24px, calc((100% - var(--max-width)) / 2 + 24px));
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 12px;
}

.hero h1, .hero h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 16px;
  line-height: 1.2;
  color: #fff;
}

.hero p {
  font-size: 1.1rem;
  margin: 0 0 28px;
  color: #fff;
}


.button-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s;
  border: none;
  cursor: pointer;
  /* Buttons kommen oft ohne .button-row-Wrapper direkt aus dem RTE-Fließtext und stehen dann
     untereinander (z.B. auf schmalen Bildschirmen) – margin-top/-bottom sorgt für Abstand zu
     Nachbarelementen in beide Richtungen, ohne die nebeneinander stehende .button-row-Variante
     (die bereits gap nutzt) zu stören. */
  margin-top: 12px;
  margin-bottom: 12px;
}

.icon-phone {
  flex-shrink: 0;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
}

.btn:hover { transform: translateY(-2px); }

/* Section */
.section { padding: 72px 0; scroll-margin-top: 96px; }
.hero { scroll-margin-top: 0; }
#top { scroll-margin-top: 0; }
.section-alt { background: var(--color-bg-alt); }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
}

.hero-content .section-header {
  text-align: left;
  margin: 0 0 0;
}

.section-eyebrow {
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin: 0 0 12px;
  color: var(--color-primary-dark);
}

.section-header p { color: var(--color-text-muted); margin: 0; }

/*
 * Service cards: die Spaltenzahl kommt vom Nutzer im Editor (GridBlock.columns) und wird wie beim
 * generischen Grid (siehe .grid-generic unten) als CSS-Custom-Property --grid-columns im
 * style-Attribut gesetzt, damit sie in der mobilen Media Query überschrieben werden kann.
 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 1), 1fr);
  gap: 24px;
}

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 3px solid transparent;
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.card:hover {
  box-shadow: 0 12px 24px rgba(43,43,40,0.08);
  transform: translateY(-3px);
  border-top-color: var(--color-accent);
}

/* Verlinkte Leistungs-Karte (service-Blockstil mit gesetztem link-Feld): als <a> statt <div> gerendert, siehe
   blocks/service/card.html. Setzt die Link-typischen Browser-Defaults zurück, damit sie optisch identisch zur
   unverlinkten Karte bleibt. */
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/*
 * Generisches Grid (GridBlock, siehe grid-generic.html): die Spaltenzahl kommt vom Nutzer im Editor und wird als
 * CSS-Custom-Property --grid-columns (statt direkt als grid-template-columns) im style-Attribut gesetzt, damit
 * sie unten in der mobilen Media Query überschrieben werden kann – ein per Inline-style="..." gesetztes
 * grid-template-columns selbst hätte eine höhere Spezifität als jede CSS-Regel und ließe sich auf dem Handy
 * nicht mehr auf eine einzelne Spalte zurückstufen.
 */
.grid-generic {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 1), 1fr);
  gap: 24px;
}

/* Schlichter weißer Wrapper ohne Hover-Effekt, für generische
   Grid-Zellen (z.B. reiner Text-Inhalt), die nicht wie eine
   interaktive Leistungs-Karte wirken sollen. */
.plain-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.text-image {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.text-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/*
 * Bildergalerie (GalleryBlock): Spaltenzahl analog zu .card-grid/.grid-generic oben über --grid-columns steuerbar.
 * Jedes Bild ist ein <a>-Link (siehe blocks/gallery-item.html), den das Lightbox-Skript in page.html abfängt und
 * statt zu navigieren in einem Overlay öffnet – ohne JavaScript bleibt der Link als normales "Bild öffnen"
 * funktionsfähig.
 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 1), 1fr);
  gap: 20px;
}

.gallery-item {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--color-border);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.2s;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item-caption {
  display: block;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

/* Lightbox-Overlay: wird per JS (siehe page.html) dynamisch geöffnet/geschlossen, Grundgerüst liegt fertig im
   HTML (siehe #lightbox-overlay in page.html), damit kein Markup zur Laufzeit erzeugt werden muss. */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 20, 18, 0.92);
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-figure {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.lightbox-caption {
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 720px) {
  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

.card-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 16px;
}

.card-icon-img {
  width: 64px;
  height: 64px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--color-primary-dark);
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

/* Leistungen-Karte (service/card.html): Titel und Notiz folgen dem zentrierten Icon, sollen also ebenfalls
   mittig stehen statt wie sonst bei .card links ausgerichtet zu sein. */
.card-icon ~ h3,
.card-icon ~ p {
  text-align: center;
}

/* Team: Spaltenzahl analog zu .card-grid oben über --grid-columns steuerbar. */
.team-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 1), 1fr);
  gap: 28px;
}

.team-card { text-align: center; }

.team-photo {
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-deco-1), var(--color-deco-2));
  margin: 0 auto 16px;
  max-width: 160px;
  overflow: hidden;
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.team-card .role { color: var(--color-accent); font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.team-card p.bio { font-size: 0.9rem; color: var(--color-text-muted); }

/*
 * Team-Karte mit Details (siehe blocks/team/card.html): natives <details>/<summary> statt eigenem JS, damit
 * Auf-/Zuklappen ganz ohne Skript funktioniert. summary erbt marker::-webkit-details-marker/list-style, die
 * Browser sonst automatisch als Aufklapp-Pfeil davor setzen würden – hier stattdessen ein eigener Pfeil per
 * ::after, der sich beim Öffnen dreht.
 */
.team-card-expandable summary {
  cursor: pointer;
  list-style: none;
}

.team-card-expandable summary::-webkit-details-marker {
  display: none;
}

.team-card-expandable summary::after {
  content: "▾";
  display: block;
  margin-top: 8px;
  color: var(--color-accent);
  transition: transform 0.2s;
}

.team-card-expandable[open] summary::after {
  transform: rotate(180deg);
}

.team-details {
  text-align: left;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

/* Tabellen (TableBlock ebenso wie Tabellen aus dem RTE-Freitext) */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 12px 0;
}

table td, table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
}

/*
 * TableBlock (blocks/table.html) statt der generischen table-Regel oben: eigener Karten-Rahmen wie .card/
 * .plain-card, damit die Tabelle sich optisch in die Section einfügt statt wie eine reine Textformatierung zu
 * wirken. Die erste Zeile ist per Konvention die Kopfzeile (fett gesetzt im Editor) und wird hier über
 * tr:first-child farblich hervorgehoben – bewusst NICHT über die Fett-Schrift selbst (die auch die erste Spalte
 * mit den Kriteriennamen markiert), sonst würden beide gleich aussehen statt nur die Kopfzeile klar
 * abzusetzen.
 */
/*
 * Wrapper um .data-table: overflow-x liegt bewusst hier statt direkt auf der Tabelle, da .data-table selbst
 * "overflow: hidden" für die abgerundeten Ecken (border-radius) braucht – beides zusammen auf einem Element
 * würde horizontales Scrollen wieder verhindern. Auf schmalen Bildschirmen (viele Spalten wie in der
 * Vergleichstabelle) bleibt die Tabelle so vollständig lesbar, statt vom Viewport abgeschnitten zu werden.
 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(43,43,40,0.06);
}

.data-table {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:nth-child(even) td {
  background: var(--color-bg-alt);
}

.data-table tr:first-child td {
  background: var(--color-primary-dark);
  color: #fff;
  border-bottom: none;
}

/* Footer */
footer.site-footer {
  background: var(--color-primary-dark);
  color: #eef0ea;
  padding: 24px 0;
  margin-top: 40px;
  border-top: 3px solid var(--color-accent);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.88rem;
}

.footer-links { display: flex; gap: 24px; list-style: none; padding: 0; margin: 0; }
.footer-links a { text-decoration: none; color: #d6dccf; }
.footer-links a:hover { color: #fff; }

@media (max-width: 720px) {
  .hero { min-height: 400px; }

  .nav-toggle-button {
    display: flex;
  }

  nav.main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--color-bg);
    border-bottom: 3px solid var(--color-accent);
    transition: max-height 0.25s ease;
  }

  /* nav.main-nav ist kein direktes Geschwisterelement der Checkbox
     (liegt innerhalb von .nav-inner) – der ~-Combinator wirkt daher
     über .nav-inner hinweg auf nav.main-nav als dessen Nachfahre. */
  .nav-toggle-checkbox:checked ~ .nav-inner nav.main-nav {
    max-height: 70vh;
    overflow-y: auto;
  }

  nav.main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
  }

  nav.main-nav a {
    display: block;
    padding: 14px 2px;
    border-bottom: 1px solid var(--color-border);
  }

  .grid-generic,
  .card-grid,
  .team-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  /*
   * Mindestbreite pro Zelle statt die Spalten frei schrumpfen zu lassen: ohne das würden lange Texte (z.B. in der
   * Vergleichstabelle "Plugins (können verwaisen)") auf Handy-Breite in der Zelle umbrechen und die Tabelle
   * dadurch unlesbar stauchen, statt einfach per .table-scroll horizontal gescrollt zu werden.
   */
  .data-table td {
    min-width: 140px;
    white-space: nowrap;
  }

  .data-table td:first-child {
    min-width: 180px;
    white-space: normal;
  }
}

/* Erzwingt weißen Text für alle Inhalte im Hero, unabhängig davon,
   welche generische Klasse (section-eyebrow, section-header h1/h2,
   einfacher Fließtext) verwendet wird. Steht bewusst am Dateiende und
   mit !important, da Regeln wie .section-header p (Klasse + Element)
   eine höhere Spezifität als .hero-content * haben und sonst trotz
   späterer Position in der Kaskade gewinnen würden. */
.hero-content,
.hero-content * {
  color: #fff !important;
}
