/* ==========================================================================
   Referenzen: aufgefächerter Stapel aus Fotos der Gast-Hunde, darunter das
   Zitat zur vorderen Karte. Steuerung per Tippen, Wischen, Pfeiltasten.
   ========================================================================== */

.refs-section {
  overflow-x: clip;
  padding-block: clamp(3.5rem, 2rem + 4vw, 5.5rem);
}

/* Handy: untereinander. Desktop: links Text, Zitat und Pfeile, rechts der Fächer */
.refs {
  --card-w: clamp(200px, 58vw, 260px);
  --card-h: calc(var(--card-w) * 1.25);
  display: grid;
  grid-template-areas: "head" "stage" "quote" "nav";
}
.refs__head { grid-area: head; }
.refs__stage { grid-area: stage; }
.refs__quotes { grid-area: quote; }
.refs__nav { grid-area: nav; }


.refs__stage {
  position: relative;
  /* Die Karten stehen 60 px über dem Boden: die gekippten äußeren Karten
     reichen damit fast bis unten, die angehobene vordere fast bis oben */
  height: calc(var(--card-h) + 100px);
  perspective: 1200px;
  touch-action: pan-y;
  outline: none;
}
.refs__stage:focus-visible { outline: 3px solid var(--focus); outline-offset: 8px; border-radius: var(--radius-m); }

.refs__card {
  position: absolute;
  left: 50%;
  bottom: 60px;
  width: var(--card-w);
  height: var(--card-h);
  padding: 10px 10px 0;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--nebel);
  box-shadow: 0 1px 0 rgb(36 33 28 / 0.06), 0 22px 40px -24px rgb(36 33 28 / 0.55);
  cursor: pointer;
  text-align: left;
  transform-origin: 50% 100%;
  transform: translateX(-50%);
  transition:
    transform 650ms cubic-bezier(0.3, 1.25, 0.5, 1),
    opacity 400ms ease,
    box-shadow 400ms ease;
  -webkit-tap-highlight-color: transparent;
}
.refs__card[aria-current="true"] {
  cursor: grab;
  box-shadow: 0 1px 0 rgb(36 33 28 / 0.06), 0 34px 60px -28px rgb(36 33 28 / 0.7);
}
.refs__card.is-hidden { opacity: 0; pointer-events: none; }

.refs__photo {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(100% - 3.4rem);
  border-radius: 6px;
  overflow: hidden;
  color: var(--torf-leise);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgb(63 106 90 / 0.06) 14px 15px),
    linear-gradient(to bottom, #d9e1df, #c3cebf);
}
.refs__card:nth-child(2n) .refs__photo { background: repeating-linear-gradient(135deg, transparent 0 14px, rgb(63 106 90 / 0.06) 14px 15px), linear-gradient(to bottom, #dfe3d6, #c9cdb6); }
.refs__card:nth-child(3n) .refs__photo { background: repeating-linear-gradient(135deg, transparent 0 14px, rgb(63 106 90 / 0.06) 14px 15px), linear-gradient(to bottom, #d6e0e2, #bfccc9); }
/* Nicht ziehbar: sonst startet beim Wischen mit der Maus das Bild-Ziehen des Browsers und bricht das Wischen ab */
.refs__photo img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.refs__photo svg { width: 36px; height: 36px; opacity: 0.55; }

.refs__dog {
  display: flex;
  align-items: center;
  height: 3.4rem;
  padding-inline: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--wiese);
  line-height: 1.15;
}

/* Zitat zur vorderen Karte */
.refs__quotes {
  display: grid;
  max-width: 42rem;
  margin: var(--space-7) auto 0;
  text-align: center;
}
.refs__quote {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 450ms ease, transform 450ms var(--ease), visibility 0s linear 450ms;
}
.refs__quote.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 450ms ease 120ms, transform 450ms var(--ease) 120ms, visibility 0s;
}
.refs__quote p {
  max-width: none;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-lg);
  line-height: 1.3;
  color: var(--torf);
  text-wrap: balance;
}
.refs__quote--long p { font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.55rem); }

/* Steuerung */
.refs__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.refs__arrow,
.refs__pause {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--wiese);
  border-radius: 50%;
  background: transparent;
  color: var(--wiese);
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
.refs__arrow:hover,
.refs__pause:hover { background: var(--wiese); color: #fff; }
.refs__arrow svg,
.refs__pause svg { width: 18px; height: 18px; }
.refs__pause { border-color: transparent; }

.refs__dots { display: flex; gap: 2px; }
.refs__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.refs__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(63 106 90 / 0.3);
  transition: background-color 200ms ease, width 200ms ease, height 200ms ease;
}
/* Größer über width/height statt transform: scale, sonst schneidet Safari die Kante des Punkts ab */
.refs__dot[aria-current="true"]::before { width: 11px; height: 11px; background: var(--wiese); }

/* Kontaktknöpfe im ersten Schritt: drei runde Symbole mit Beschriftung */
.leap__contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.leap__chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.25rem 0;
  color: var(--wiese);
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.2;
  text-decoration: none;
}
.leap__chip svg {
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: 11px;
  border: 1.5px solid var(--wiese);
  border-radius: 50%;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
.leap__chip:hover svg { background: var(--wiese); color: #fff; }
.leap__chip:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Layout-Regeln zuletzt, damit sie die Grundwerte oben überschreiben */
@media (min-width: 961px) {
  .refs {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas:
      "head  stage"
      "quote stage"
      "nav   stage";
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
  }
  .refs__head { margin-bottom: var(--space-5); }
  .refs__quotes { margin: 0; text-align: left; }
  .refs__nav { justify-content: flex-start; align-self: start; }
  .refs__stage { align-self: center; }
}

/* Auf dem Handy wird gewischt, die Pfeile entfallen */
@media (max-width: 960px) {
  .refs__arrow { display: none; }
}
@media (min-width: 961px) and (max-width: 1199px) {
  .refs { --card-w: 220px; }
}
