/* ---- components.css: Bausteine, die Startseite und Inhaltsseiten teilen ----
   Wird nach global.css und vor index.css bzw. content.css geladen. Was nur
   auf einer Seitenart anders aussieht (Hintergrund, Farben, Linie mobil),
   steht in index.css bzw. content.css. */

/* ---- Ablauf «So einfach geht's» ----
   Markup: <div class="process" data-animate> mit <ol class="process-list">.
   js/components/process.js setzt .process--armed (Schritte ausgeblendet) und
   danach .is-visible, sobald der Bereich sichtbar wird. Ohne JavaScript bleibt
   alles sichtbar. */
.process {
  margin-top: 36px;
  text-align: center;
}

.process-list {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Verbindungslinie zwischen den Icons: ab 800px waagrecht (siehe unten). Mobil
   würde eine durchgehende Linie durch die Texte laufen, darum nur kurze
   gestrichelte Verbindungen in der Lücke zwischen zwei Schritten. */
.process-list::before {
  content: "";
  display: none;
  position: absolute;
  transform-origin: top;
  transition: transform 1.4s ease 0.2s;
}

.process--armed .process-list::before {
  transform: scaleY(0);
}

.process--armed.is-visible .process-list::before {
  transform: scaleY(1);
}

.process-step {
  position: relative;
  min-height: 88px;
  padding-top: 112px;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.process--armed .process-step {
  opacity: 0;
  transform: translateY(26px);
}

.process--armed.is-visible .process-step {
  opacity: 1;
  transform: none;
}

.process--armed.is-visible .process-step:nth-child(1) { transition-delay: 0.1s; }
.process--armed.is-visible .process-step:nth-child(2) { transition-delay: 0.55s; }
.process--armed.is-visible .process-step:nth-child(3) { transition-delay: 1s; }

.process-icon {
  position: absolute;
  top: 0;
  left: 50%;
  width: 88px;
  height: 88px;
  margin-left: -44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(ellipse at 30% 20%, var(--wine-600) 0%, var(--wine-900) 80%);
  color: var(--gold);
  box-shadow: 0 0 0 6px var(--paper);
  transition: transform 0.3s ease;
}

.process-step:hover .process-icon {
  transform: scale(1.06);
}

.process-icon .icon {
  width: 40px;
  height: 40px;
}

.process-number {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--paper);
  color: var(--wine-900);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: lining-nums;
}

.process-step h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--text-dark);
}

.process-step p {
  max-width: 340px;
  margin: 0 auto;
  font-size: 0.97rem;
  line-height: 1.6;
}

.process-cta {
  margin-top: 48px;
  text-align: center;
}

/* Kleine Icon-Animationen, laufen erst, wenn der Bereich sichtbar ist. */
.process.is-visible .icon-upload .arrow {
  animation: processArrow 1.8s ease-in-out 1.2s infinite;
}

.process .icon-check .checkmark {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}

.process.is-visible .icon-check .checkmark {
  animation: processCheck 0.8s ease 1.4s forwards;
}

.process.is-visible .icon-truck .truck {
  animation: processTruck 2.4s ease-in-out 1.8s infinite;
}

@keyframes processArrow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2.5px); }
}

@keyframes processCheck {
  to { stroke-dashoffset: 0; }
}

@keyframes processTruck {
  0%, 100% { transform: translateX(-1.5px); }
  50%      { transform: translateX(2px); }
}

@media (max-width: 799px) {
  .process-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -30px;
    width: 2px;
    height: 24px;
    margin-left: -1px;
    background: repeating-linear-gradient(to bottom, var(--gold) 0 6px, transparent 6px 12px);
  }
}

@media (min-width: 800px) {
  .process-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }

  .process-list::before {
    display: block;
    left: 16.66%;
    right: 16.66%;
    top: 43px;
    height: 2px;
    background: repeating-linear-gradient(to right, var(--gold) 0 8px, transparent 8px 16px);
    transform-origin: left;
  }

  .process--armed .process-list::before {
    transform: scaleX(0);
  }

  .process--armed.is-visible .process-list::before {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .process--armed .process-step,
  .process--armed .process-list::before {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .process .icon-check .checkmark {
    stroke-dashoffset: 0;
  }

  .process .icon,
  .process .icon * {
    animation: none !important;
  }
}

/* ---- FAQ (<details>, funktioniert ohne JavaScript) ----
   Markup: view/partials/faq.php. Überschrift und Abschnittsbreite stehen in
   index.css bzw. content.css. */
.faq {
  background: var(--bg-light);
}

.faq-list {
  text-align: left;
}

.faq-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.faq-item:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-heading {
  margin: 0;
  font-size: inherit;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-dark);
}

.faq-icon {
  flex-shrink: 0;
  font-size: 1.3rem;
  color: var(--gold-dark);
  transition: transform 0.25s ease;
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

/* Leichtes Einblenden der Antwort beim Öffnen (<details> selbst lässt sich
   nicht animieren; zugeklappt wird sofort). */
.faq-item[open] .faq-answer {
  animation: faqOpen 0.3s ease;
}

@keyframes faqOpen {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-item[open] .faq-answer {
    animation: none;
  }
}

.faq-answer p {
  margin: 0;
  padding: 0 4px 20px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-dark);
}
