/* Zuckerersatz.info - Custom Styles */

/* Performance-Optimierungen */
*,
*::before,
*::after {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sticky-top {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

:root {
  --primary-color: #2d9c84;
  --text-color: #212529;
  --text-muted: #6c757d;
  --bg-light: #f8f9fa;
  --border-color: #e9ecef;
}

/* Typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  color: #1a1a1a;
}

h1 {
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

.lead {
  font-size: 1.05rem;
  font-weight: 400;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #237a68;
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 480px;
  overflow: hidden;
  margin-bottom: 0;
}

.hero-section.hero-small {
  height: 380px;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
  z-index: 0;
  /* Performance: Bild aus dem Reflow-Prozess entfernen */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,1) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 260px;
}

.hero-content h1 {
  color: #111;
  font-weight: 600;
  font-size: 2.5rem;
  text-shadow: 0 2px 20px rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.92);
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
}

.hero-content .lead {
  color: #333;
  background: rgba(255,255,255,0.75);
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 0.375rem;
  margin-top: 0.5rem;
}

.hero-section.hero-small .hero-content {
  padding-top: 200px;
}

/* Breadcrumbs im Hero-Bereich */
.hero-content .breadcrumb {
  background: rgba(255,255,255,0.95);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  display: inline-flex;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.hero-content .breadcrumb-item a {
  color: var(--primary-color);
  font-weight: 500;
}

.hero-content .breadcrumb-item a:hover {
  color: #237a68;
}

.hero-content .breadcrumb-item.active {
  color: var(--text-color);
  font-weight: 500;
}

.hero-content .breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-muted);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 1rem;
  /* Performance-Optimierung für sticky */
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.sidebar .nav-link {
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 400;
}

.sidebar .nav-link:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
}

.sidebar .nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.sidebar .nav-section {
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 1rem 1rem 0.5rem;
  margin-top: 0.5rem;
}

.sidebar .nav-item-child {
  padding-left: 1.5rem;
}

/* Content Area */
.content-area {
  padding: 2rem 0;
}

/* Info Boxes / Alerts */
.info-box {
  border-radius: 0.5rem;
  border-left: 4px solid;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.info-box-tip {
  border-left-color: #28a745;
  background-color: rgba(40, 167, 69, 0.05);
}

.info-box-info {
  border-left-color: #007bff;
  background-color: rgba(0, 123, 255, 0.05);
}

.info-box-warning {
  border-left-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
}

.info-box-note {
  border-left-color: #fd7e14;
  background-color: rgba(253, 126, 20, 0.05);
}

.info-box-title {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-box {
  font-size: 0.9rem;
}

/* Tables */
.table-custom {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.table-custom thead th {
  background-color: var(--bg-light);
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

.table-custom tbody tr:hover {
  background-color: rgba(45, 156, 132, 0.03);
}

/* Cards */
.card-custom {
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
  will-change: box-shadow;
}

.card-custom:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Steckbrief Table */
.steckbrief {
  background: var(--bg-light);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.steckbrief table {
  margin-bottom: 0;
}

.steckbrief th {
  width: 40%;
  font-weight: 500;
}

/* Navbar */
.navbar-custom {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  /* Performance-Optimierung für sticky */
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-color) !important;
}

.navbar-nav .nav-link {
  font-size: 0.9rem;
  font-weight: 450;
}

/* Footer */
.footer {
  background: var(--bg-light);
  padding: 2rem 0;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
}

.footer a {
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 991.98px) {
  .sidebar {
    position: relative;
    top: 0;
    height: auto;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
  }

  .hero-section {
    height: 320px;
  }

  .hero-section.hero-small {
    height: 280px;
  }

  .hero-content {
    padding-top: 180px;
  }

  .hero-section.hero-small .hero-content {
    padding-top: 140px;
  }
}

/* Mobile - mehr Abstand zum Rand */
@media (max-width: 767.98px) {
  .container,
  .container-fluid {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  .content-area {
    padding: 1.5rem 0;
  }

  .row {
    margin-left: 0;
    margin-right: 0;
  }

  .row > * {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 575.98px) {
  .container,
  .container-fluid {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  .hero-content h1 {
    font-size: 1.5rem;
    padding: 0.4rem 0.875rem;
  }

  .hero-content .lead {
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
  }

  .hero-section {
    height: 260px;
  }

  .hero-section.hero-small {
    height: 220px;
  }

  .hero-content {
    padding-top: 120px;
  }

  .hero-section.hero-small .hero-content {
    padding-top: 90px;
  }

  .info-box {
    padding: 1rem;
  }

  .card-custom .card-body {
    padding: 1rem;
  }

  .steckbrief {
    padding: 1rem;
  }

  .footer {
    padding: 1.5rem 0;
  }

  h2 {
    font-size: 1.35rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  .table {
    font-size: 0.85rem;
  }
}

/* Utility Classes */
.text-primary-custom {
  color: var(--primary-color) !important;
}

.bg-primary-custom {
  background-color: var(--primary-color) !important;
}

/* Smooth scrolling - nur für Anker-Links */
@media (prefers-reduced-motion: no-preference) {
  html:focus-within {
    scroll-behavior: smooth;
  }
}

/* Better focus styles */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Quellenangaben - dezent und unauffällig */
.source {
  font-size: 0.6rem;
  color: #bbb;
  text-decoration: none;
  vertical-align: super;
  margin-left: 1px;
  transition: color 0.15s ease;
  opacity: 0.7;
}

.source:hover {
  color: var(--primary-color);
  opacity: 1;
}

/* Quellenverzeichnis am Seitenende */
.sources-section {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.sources-section h2 {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1rem;
}

.sources-list {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.sources-list a {
  color: var(--text-muted);
  word-break: break-word;
}

.sources-list a:hover {
  color: var(--primary-color);
}

.source-item {
  margin-bottom: 0.5rem;
}

.source-number {
  font-weight: 500;
  margin-right: 0.5rem;
}
