/* referencje: style tej sekcji. Wspólne klocki i zmienne są w ../podstawy.css.
   Karuzela: zwykłe przewijanie w poziomie z przyciąganiem do kart; tor ma szerokość treści (.wrap),
   a widoczny skrawek następnej karty zachęca do przewinięcia. */
#referencje { --ref-gap: 20px; --ref-n: 3; --ref-peek: .22; }
#referencje .sec-head { margin-bottom: 36px; }

#referencje .ref-track {
  display: grid; grid-auto-flow: column; gap: var(--ref-gap);
  /* n pełnych kart i ułamek następnej mieści się w szerokości toru */
  grid-auto-columns: calc((100% - var(--ref-n) * var(--ref-gap)) / (var(--ref-n) + var(--ref-peek)));
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px; outline-offset: 6px;
}
#referencje .ref-track::-webkit-scrollbar { display: none; }
#referencje .ref { scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-width: 0; padding: 28px 28px 24px; background: var(--paper); border: 1px solid var(--line); border-top: 2px solid var(--ink); transition: border-color .4s var(--ease); }
#referencje .ref:hover { border-top-color: var(--brand); }
#referencje blockquote { margin: 0; font-size: 19px; line-height: 1.5; letter-spacing: -.005em; color: var(--ink); }
#referencje blockquote strong { font-weight: 500; color: var(--brand); background: linear-gradient(var(--brand), var(--brand)) 0 100% / 100% 1px no-repeat; padding-bottom: 1px; }
#referencje figcaption { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: start; padding-top: 18px; border-top: 1px solid var(--line); }
#referencje figcaption img { width: 52px; height: 52px; object-fit: cover; border-radius: 2px; background: var(--tint); }
#referencje figcaption b { display: block; font-size: 16px; font-weight: 500; line-height: 1.3; }
#referencje figcaption small { display: block; margin-top: 2px; min-height: 2.800em; font-size: 13.500px; line-height: 1.4; color: var(--muted); }

/* pasek sterowania: licznik, linia postępu, strzałki */
#referencje .ref-bar { display: flex; align-items: center; gap: 20px; margin-top: 22px; }
#referencje .ref-count { flex: none; min-width: 4.600em; font-size: 14px; font-weight: 500; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--ink); }
#referencje .ref-count .ref-all { color: var(--muted); font-weight: 400; }
#referencje .ref-prog { position: relative; flex: 1; height: 2px; background: linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat; overflow: hidden; }
#referencje .ref-thumb { position: absolute; left: 0; top: 0; height: 2px; width: var(--tw, 30%); background: var(--brand); transform: translateX(var(--tx, 0)); }
#referencje .ref-nav { flex: none; display: flex; gap: 8px; }
#referencje .ref-btn { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid color-mix(in srgb, var(--ink) 28%, transparent); border-radius: 2px; color: var(--ink); transition: border-color .3s, background .3s, color .3s, opacity .3s; }
#referencje .ref-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.400; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
#referencje .ref-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
#referencje .ref-btn[data-dir="1"]:hover:not(:disabled) svg { transform: translateX(3px); }
#referencje .ref-btn[data-dir="-1"]:hover:not(:disabled) svg { transform: translateX(-3px); }
#referencje .ref-btn:disabled { opacity: .32; cursor: default; }
/* ruch własny: na czas jazdy tor bez przyciągania i bez wygładzania (skrypt przesuwa go co klatkę) */
#referencje .ref-track.is-auto { scroll-snap-type: none; scroll-behavior: auto; }
/* przycisk pauzy: ten sam kształt co strzałki, odsunięty od nich cienką kreską */
#referencje .ref-play { position: relative; margin-right: 9px; }
#referencje .ref-play[hidden] { display: none; }
#referencje .ref-play::after { content: ""; position: absolute; right: -10px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
#referencje .ref-play .ref-i-play { display: none; }
#referencje .ref-play.is-paused .ref-i-pause { display: none; }
#referencje .ref-play.is-paused .ref-i-play { display: inline; }
#referencje .ref-play:hover { border-color: var(--brand); color: var(--brand); }

/* zaproszenie do rozmowy pod opiniami */
#referencje .ref-ask { margin-top: 56px; padding-top: 30px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px 40px; flex-wrap: wrap; }
#referencje .ref-ask p { font-size: clamp(26px, 2.400vw, 36px); line-height: 1.12; font-weight: 500; letter-spacing: -.025em; }
#referencje .ref-ask p i { font-style: normal; color: var(--brand); }

@media (max-width: 1099.98px) { #referencje { --ref-n: 2; --ref-peek: .2; } }
@media (max-width: 699.98px) {
  #referencje { --ref-n: 1; --ref-peek: .12; --ref-gap: 14px; }
  #referencje .ref { padding: 22px 20px 20px; gap: 22px; }
  #referencje blockquote { font-size: 17.500px; }
  #referencje .ref-bar { gap: 14px; }
  /* na telefonie strzałki i pauza po 44 px (dolna granica celu dotyku), żeby linii postępu zostało miejsca */
  #referencje .ref-nav { gap: 6px; }
  #referencje .ref-btn { width: 44px; height: 44px; }
  #referencje .ref-play { margin-right: 7px; }
  #referencje .ref-play::after { right: -7px; }
  #referencje .ref-ask { margin-top: 44px; flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { #referencje .ref-track { scroll-behavior: auto; } }

/* Papierowe karty z podpisem autora pod cytatem. */
#referencje { background: #ede7db; overflow: clip; padding-block: clamp(42px,5vw,78px); }
#referencje .sec-head { display:flex; align-items:center; min-height:48px; margin-bottom:24px; padding-right:210px; }
#referencje #ref-title { margin:0; font-size:14px; line-height:1.4; font-weight:600; letter-spacing:.09em; text-transform:uppercase; }
#referencje .ref-car { position:relative; }
#referencje .ref-track { grid-auto-columns:clamp(300px,24vw,395px); gap:18px; }
#referencje .ref { margin:0; min-height:clamp(325px,25vw,395px); border:0; border-left:1px solid #c9bcaa; padding:clamp(25px,2vw,36px); background:linear-gradient(#fcf9f2,#f8f2e7); }
#referencje blockquote { font-size:clamp(20px,1.55vw,25px); line-height:1.42; }
#referencje blockquote::before { content:""; display:block; width:46px; height:5px; margin:0 0 26px; background:repeating-linear-gradient(120deg,transparent 0 2px,var(--brand) 2px 3px); }
#referencje blockquote strong { font:inherit; color:inherit; background:none; }
#referencje .ref figcaption { display:grid; grid-template-columns:48px 1fr; gap:12px; align-items:center; border-top:1px solid #cfbfab; padding-top:16px; }
#referencje figcaption img { width:48px; height:48px; padding:2px; border:1px solid #d7b6a9; border-radius:50%; object-fit:cover; }
#referencje figcaption b {font-weight:600;font-size:15px;}
#referencje figcaption small { min-height:0; font-size:13px; }
#referencje .ref-bar { position:absolute; right:0; bottom:calc(100% + 24px); margin:0; }
#referencje .ref-count,#referencje .ref-prog { display:none; }
#referencje .ref-btn { border-radius:0; background:#faf7ef; }
#referencje .ref-play { width:auto; padding-inline:14px; margin:0; }
#referencje .ref-play svg,#referencje .ref-play::after {display:none;}
#referencje .ref-play::before {content:"Wstrzymaj";}
#referencje .ref-play.is-paused::before {content:"Odtwórz";}
#referencje .ref-ask {border:0;padding-top:0;margin-top:clamp(34px,4vw,60px);}
#referencje .ref-ask p {font-size:clamp(24px,2vw,32px);}
@media(max-width:640px){
  #referencje .ref-track {grid-auto-columns:86%;}
  #referencje .sec-head {padding:0;min-height:0;margin-bottom:14px;}
  #referencje .ref-car {padding-top:58px;}
  #referencje .ref-bar {top:0;bottom:auto;left:0;right:auto;}
  #referencje .ref {min-height:310px;}
}
