/* Zentrale Seitenstruktur */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  font-family: "Segoe UI", sans-serif;
  font-size: 1.05rem;
  color: #1a1a1a;
}

/* Box-Stil für alle Sektionen */
.page-header,
.table-of-contents,
.section-content {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

/* Inhaltsverzeichnis */
.table-of-contents {
  border-left: 4px solid #005a8c;
}

.table-of-contents h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #003366;
  margin-bottom: 1rem;
}

.table-of-contents ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.table-of-contents li {
  margin-bottom: 0.5rem;
  padding-left: 1.2rem;
  position: relative;
}

.table-of-contents li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #0070af;
  font-size: 1rem;
}

.table-of-contents a {
  text-decoration: none;
  color: #005a8c;
  font-weight: 500;
  transition: color 0.2s ease;
}

.table-of-contents a:hover {
  color: #002b4e;
  text-decoration: underline;
}

/* Überschriften */
.page-header h1,
.section-content h2,
.table-of-contents h2 {
  color: #003366;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1.1rem;
  color: #555;
  margin: 0;
}

/* Listen */
.section-content ul {
  list-style: disc;
  padding-left: 1.4rem;
}

.section-content li {
  margin-bottom: 0.5rem;
}

/* Gesetzestooltip – §1901a BGB */

.gesetz-tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #003366;
  display: inline-block;
}

/* Desktop Hover-Aktivierung */
@media (hover: hover) {
  .gesetz-tooltip:hover .gesetz-tooltip-box {
    display: block;
  }
}

/* Tooltip-Box */
.gesetz-tooltip-box {
  display: none;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  background-image: url("/assets/img/abstraktes-glattes-dunkelblau-mit-schwarzem-vignettenstudio-gut-als-hintergrundgeschaeftsberichtdigitalweb-verwenden_1258-107794.avif");
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 1.2rem;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-size: 0.95rem;
  line-height: 1.5;
  backdrop-filter: blur(1px);
}

.gesetz-tooltip-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  z-index: -1;
}

.gesetz-tooltip-box strong {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

/* Tooltip-Box bei Klick aktiv (Mobil) */
.gesetz-tooltip.active .gesetz-tooltip-box {
  display: block;
}

/* Responsives Verhalten */
@media (max-width: 768px) {
  main {
    padding: 1rem;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  .section-content h2,
  .table-of-contents h2 {
    font-size: 1.2rem;
  }

  .gesetz-tooltip-box {
    width: 92vw;
    font-size: 0.95rem;
  }
}

@media (hover: none) {
  .gesetz-tooltip-box {
    position: fixed !important;
    bottom: 2rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100vw - 3rem);
    max-width: 90vw;
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    z-index: 10000;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  }

  .gesetz-tooltip-box::before {
    background: rgba(0, 0, 0, 0.5); /* optional etwas dunkler */
  }
}