/* Tamago: poprawki wyglądu nakładane na zbudowaną stronę. apply.mjs dodaje ten plik do <head> każdej strony. */

/*
 * Opinie klientów (#testimonials, wariant z dwoma rzędami przesuwającymi się w przeciwne strony, np. strona główna).
 * Na telefonie karty po 340 px nie mieszczą się w ekranie i są ucięte z obu stron, a tekst cały czas jedzie.
 * Do 767 px oba rzędy stają się jednym sliderem przewijanym palcem: karta przyciąga się do lewej krawędzi,
 * kolejna wystaje z prawej. Kopie kart potrzebne tylko do pętli animacji ukrywa ui.js (atrybut data-tamago-dup),
 * a kropki pod sliderem też dodaje ui.js. Wariant z siatką kart (strona O nas) zostaje bez zmian.
 */
#testimonials .tamago-dots {
  display: none;
}

@media (max-width: 767px) {
  #testimonials .space-y-6:has(> .group\/marquee) {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 24px;
    padding: 4px 24px 32px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }

  #testimonials .space-y-6:has(> .group\/marquee)::-webkit-scrollbar {
    display: none;
  }

  #testimonials .space-y-6 > .group\/marquee,
  #testimonials .group\/marquee > [class*='animate-marquee'] {
    display: contents;
  }

  #testimonials [class*='animate-marquee'] {
    animation: none !important;
  }

  /* Szerokość liczona od pasa slidera: następna karta wystaje o ok. 32 px. Mniejszy odstęp wewnętrzny niż
     na desktopie (24 zamiast 32 px), żeby tekst opinii miał tyle miejsca co wcześniej. */
  #testimonials [class*='animate-marquee'] > * {
    width: calc(100% - 24px);
    max-width: 360px;
    margin: 0 !important;
    padding: 24px !important;
    scroll-snap-align: start;
  }

  #testimonials [class*='animate-marquee'] > [data-tamago-dup] {
    display: none;
  }

  #testimonials .tamago-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: -8px;
    padding: 0 24px;
  }

  #testimonials .tamago-dots button {
    position: relative;
    width: 18px;
    height: 28px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    transition: width 0.25s ease;
  }

  #testimonials .tamago-dots button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.25;
    transform: translate(-50%, -50%);
    transition: width 0.25s ease, opacity 0.25s ease;
  }

  #testimonials .tamago-dots button[aria-current='true'] {
    width: 30px;
  }

  #testimonials .tamago-dots button[aria-current='true']::before {
    width: 22px;
    opacity: 1;
  }

  #testimonials .tamago-dots button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
    border-radius: 999px;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  #testimonials .tamago-dots button,
  #testimonials .tamago-dots button::before {
    transition: none;
  }
}
