/**
 * Services Section CSS - Hybrid Approach
 *
 * Whitespace-basiertes Design mit subtilen Hover-Card-Effekten
 * Icons in farbigen Kreisen mit Gradient-Wechsel
 *
 * Version: 1.0.0
 * Datum: 23.11.2025
 */

/* ============================================
   MAIN CONTAINER & LAYOUT
   ============================================ */

/**
 * Services Section - Haupt-Wrapper
 * Padding & Hintergrund
 *
 * WICHTIG: Asymmetrisches Padding (Spacing Fix)
 * - padding-top: 80px (Standard-Abstand)
 * - padding-bottom: 32px (REDUZIERT von 80px)
 * - Grund: Reduziert Abstand zur Gradient Divider (war 128px, jetzt 48px)
 */
.services-section {
  padding-top: 0;
  padding-bottom: 0;
  background-color: #FFFFFF;
  position: relative;
}

@media (max-width: 767px) {
  .services-section {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/**
 * Content Container
 * Max-Width für optimale Lesbarkeit
 */
.services-section .container,
.services-section > .wp-block-group__inner-container {
  max-width: var(--slv-content-width, 1140px);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   HEADER SECTION
   ============================================ */

/**
 * Header - Intro-Bereich
 * Zentriert, max-width für Lesbarkeit
 */
.services-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 60px;
}

/**
 * Services Label - Kleiner Eyecatcher
 * Uppercase mit Akzent-Balken
 */
.services-label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slv-primary-blue, #5CB8E9);
  margin-bottom: 12px;
  position: relative;
  padding-bottom: 12px;
}

/**
 * Dezenter Akzent-Balken unter Label
 * Gelb als Kontrast zum blauen Text
 */
.services-label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--slv-primary-yellow, #FCBC5B);
  border-radius: 2px;
}

/**
 * Services Title - Haupt-Überschrift (H2)
 */
.services-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--slv-text-dark, #1A1A1A);
  line-height: 1.2;
}

@media (max-width: 767px) {
  .services-title {
    font-size: 2rem;
  }
}

/**
 * Services Intro - Beschreibungstext
 */
.services-intro {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--slv-text-muted, #6B6B6B);
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .services-intro {
    font-size: 1rem;
  }
}

/* ============================================
   GRID SYSTEM
   ============================================ */

/**
 * Services Grid
 * Mobile: 1 Spalte
 * Desktop: 2 Spalten
 */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 60px;
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 60px; /* Vertikal, Horizontal */
  }
}

@media (max-width: 767px) {
  .services-grid {
    gap: 28px;
    margin-bottom: 40px;
  }
}

/* ============================================
   SERVICE ITEM - HYBRID APPROACH
   ============================================ */

/**
 * Service Item
 * Basis: Transparent/Whitespace
 * Hover: Subtle Card-Effekt
 */
.service-item {
  position: relative;
  padding: 24px;
  border-radius: 12px;
  background-color: transparent;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/**
 * Hover-Effekt: Subtle Card
 * Hintergrund + Box-Shadow + Lift
 * Nur auf Desktop mit Hover-Unterstützung
 */
@media (hover: hover) and (pointer: fine) {
  .service-item:hover {
    background-color: #F9FAFB;
    border-color: rgba(92, 184, 233, 0.15);
    box-shadow:
      0 8px 20px rgba(0, 0, 0, 0.06),
      0 1px 3px rgba(92, 184, 233, 0.1);
    transform: translateY(-4px);
  }
}

/**
 * Focus State (Keyboard Navigation)
 * Für Accessibility - gleicher Effekt wie Hover
 */
.service-item:focus-within {
  outline: 3px solid var(--slv-primary-blue, #5CB8E9);
  outline-offset: 4px;
  background-color: #F9FAFB;
}

/**
 * Reduced Motion Support
 * Deaktiviert Animationen für Nutzer mit prefers-reduced-motion
 */
@media (prefers-reduced-motion: reduce) {
  .service-item {
    transition: none;
  }

  .service-item:hover {
    transform: none;
  }

  /* Scroll-Reveal: Sofort sichtbar bei reduced-motion */
  .service-item.scroll-reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   SCROLL-REVEAL ANIMATION - Service Items
   ============================================ */

/**
 * Scroll-Reveal für Service Items
 *
 * Items erscheinen mit Fade-In + Slide-Up Animation
 * wenn sie in den Viewport scrollen.
 *
 * VERWENDUNG:
 * - Füge .scroll-reveal Klasse zu .service-item hinzu
 * - JavaScript (scroll-animations.js) fügt .is-visible hinzu
 *
 * STAGGER-EFFEKT:
 * - Für 2-Spalten Grid: Ungerade/Gerade mit 150ms Versatz
 *
 * @since 1.1.0 - Animation Enhancement Phase 2
 */

/* Initial State: Unsichtbar und nach unten versetzt */
.service-item.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

/* Visible State: Sichtbar und an Position */
.service-item.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger für 2-Spalten Grid */
.service-item.scroll-reveal:nth-child(odd).is-visible {
  transition-delay: 0ms;
}

.service-item.scroll-reveal:nth-child(even).is-visible {
  transition-delay: 150ms;
}

/* Icon Pop Animation bei Sichtbarkeit */
.service-item.scroll-reveal.is-visible .service-icon-wrapper {
  animation: icon-pop 0.4s ease-out 0.3s forwards;
}

@keyframes icon-pop {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   ICON WRAPPER - FARBIGER KREIS
   ============================================ */

/**
 * Icon Wrapper - Farbiger Kreis
 * Standard: Blau-Gradient
 * Hover: Gelb-Gradient + Rotation
 */
.service-icon-wrapper {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #5CB8E9 0%, #1177A0 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(92, 184, 233, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* GPU-Beschleunigung für smoother Animationen */
  transform: translateZ(0);
  will-change: transform;
}

/**
 * Hover: Gradient wechselt zu Gelb + leichte Rotation
 * Nur auf Desktop mit Hover-Unterstützung
 */
@media (hover: hover) and (pointer: fine) {
  .service-item:hover .service-icon-wrapper {
    background: linear-gradient(135deg, #FCBC5B 0%, #D99A44 100%);
    box-shadow: 0 6px 16px rgba(252, 188, 91, 0.4);
    transform: scale(1.1) rotate(5deg);
  }
}

/**
 * Icon selbst (SVG)
 * currentColor für dynamische Farbe (immer weiß)
 */
.service-icon {
  width: 28px;
  height: 28px;
  color: #FFFFFF;
  stroke-width: 2;
  flex-shrink: 0;
}

/* ============================================
   TYPOGRAPHY - TITLE & DESCRIPTION
   ============================================ */

/**
 * Service Title (H3)
 * Hover: Farbe wechselt zu Blau
 */
.service-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--slv-text-dark, #1A1A1A);
  line-height: 1.3;
  transition: color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .service-item:hover .service-title {
    color: var(--slv-primary-blue, #5CB8E9);
  }
}

/**
 * Service Description
 * Grauer Text, optimale Zeilenhöhe
 */
.service-description {
  font-size: 0.9375rem; /* 15px */
  line-height: 1.6;
  color: var(--slv-text-muted, #6B6B6B);
  margin-bottom: 0;
}

/* ============================================
   CTA SECTION
   ============================================ */

/**
 * CTA am Ende der Sektion
 * Zentriert, mit Border oben
 */
.services-cta {
  text-align: center;
  padding: 40px 0 0;
  border-top: 1px solid var(--slv-border-light, #E5E7EB);
  margin-top: 20px;
}

.services-cta p {
  font-size: 1.125rem;
  margin-bottom: 20px;
  color: var(--slv-text-dark, #1A1A1A);
  font-weight: 500;
}

/**
 * CTA Button
 * Nutzt globale Primary Button Styles aus components.css
 * KEINE Overrides mehr - konsistent mit anderen Buttons!
 */

/* ============================================
   WORDPRESS GUTENBERG OVERRIDES
   ============================================ */

/**
 * Verhindere dass WordPress-Standard-Styles stören
 */
.services-section .wp-block-group {
  margin-block-start: 0;
  margin-block-end: 0;
}

.services-section .wp-block-heading {
  margin-top: 0;
}

.services-section .wp-block-paragraph {
  margin-top: 0;
}

/* ============================================
   ACCESSIBILITY - FOCUS STATES
   ============================================ */

/**
 * Focus-Visible für Tastatur-Navigation
 */
.service-item:focus-visible {
  outline: 3px solid var(--slv-primary-blue, #5CB8E9);
  outline-offset: 4px;
}

/* CTA Button nutzt globale Focus-Styles aus components.css */

/* ============================================
   RESPONSIVE FINE-TUNING
   ============================================ */

/**
 * Tablet-Ansicht (768px - 1023px)
 * Kleinere Abstände als Desktop
 */
@media (min-width: 768px) and (max-width: 1023px) {
  .services-header {
    margin-bottom: 50px;
  }

  .services-grid {
    gap: 36px 50px;
  }

  .service-title {
    font-size: 1.125rem;
  }

  .service-description {
    font-size: 0.875rem;
  }
}

/**
 * Große Screens (1440px+)
 * Etwas größere Abstände
 */
@media (min-width: 1440px) {
  .services-section {
    padding: 0;
  }

  .services-header {
    margin-bottom: 80px;
  }

  .services-grid {
    gap: 48px 80px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

/**
 * Optimiert für Drucken
 * Entfernt Hover-Effekte, vereinfacht Darstellung
 */
@media print {
  .services-section {
    padding: 0;
    background-color: transparent;
  }

  .service-item {
    border: 1px solid #E5E7EB;
    page-break-inside: avoid;
  }

  .service-icon-wrapper {
    box-shadow: none;
    background: #5CB8E9;
  }

  .services-cta {
    display: none; /* CTA nicht drucken */
  }
}
