/* override-process.css
   Centralized overrides for the process section
   - hides legacy connector pseudo-elements
   - enforces a simple 4-column grid (2 rows when 8 items)
   - neutralizes any nth-child grid placements coming from legacy styles
*/

.process-section .process-step::before,
.process-section .process-step::after {
  display: none !important;
  content: none !important;
}

/* Simple grid: 4 columns (will render two rows when 8 items present).
   grid-auto-rows locks every row — and therefore every card — to the same
   fixed height regardless of content. */
.process-section .process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  grid-auto-rows: 280px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Responsive fallback */
@media (max-width: 900px) {
  .process-section .process-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto; /* Keine feste Höhe – Text nicht abschneiden */
    gap: 1rem;
  }
  /* Beschreibungstext vollständig anzeigen */
  .process-section .process-step .process-description {
    overflow: visible;
    flex: none;
  }
}

/* Smartphones: 1-spaltig unter 600px */
@media (max-width: 600px) {
  .process-section .process-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Neutralize any previously set explicit placements */
.process-section .process-step:nth-child(n) {
  grid-column: auto !important;
  grid-row: auto !important;
}

/* Remove inline-like transition delays and rely on CSS animations if desired */
.process-section .process-step { transition-delay: 0ms !important; }

/* All cards: fixed size, content starts from the top.
   min-width: 0 overrides the grid default of min-width: auto, which would
   otherwise let a single long word stretch the column beyond its 1fr share.
   overflow stays visible so the absolutely-positioned arrow is not clipped. */
.process-section .process-step {
  position: relative;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  min-width: 0; /* prevent grid item from expanding past its column width */
}

/* Visual spacing for step-number */
.process-section .process-step .step-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: #00b4c9;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.process-section .process-step h3 {
  margin: 0 0 0.5rem 0;
  flex-shrink: 0;
  overflow-wrap: break-word; /* break long words instead of expanding the box */
  word-break: break-word;
  width: 100%;
}

.process-section .process-step .process-description {
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0.9;
  margin-top: 0.75rem;
  overflow-wrap: break-word; /* break long words instead of expanding the box */
  word-break: break-word;
  width: 100%;
  /* flex: 1 lets the description fill the remaining card height;
     overflow: hidden clips text at the card bottom without affecting
     the card's own overflow (which must stay visible for the arrow). */
  flex: 1;
  overflow: hidden;
}

/* ── Arrow connectors between process steps ───────────────────────────── */
.process-section .process-step .step-arrow {
  position: absolute;
  right: -18px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(0, 180, 201, 0.7);
  border-bottom: 2px solid rgba(0, 180, 201, 0.7);
  transform: translateY(-50%) rotate(-45deg);
  z-index: 10;
  display: block;
}

/* Desktop 4-column: hide after last step in each row (4th, 8th) */
.process-section .process-step:nth-child(4n) .step-arrow {
  display: none;
}

/* Tablet and below (≤900px): boxes stack vertically — no arrows */
@media (max-width: 900px) {
  .process-section .process-step .step-arrow {
    display: none;
  }
}
