/* ===== Testimonials Slider (Osstem) =====
   - 2 cards/desktop, 1/mobile (via --per)
   - native scroll-snap + small JS
   - documented for non-developers
*/

.u-test {
  --per: 1;
  --gap: 18px;
  --card-bg: var(--e-global-color-4892045, #F8F8F8);
  --card-brd: rgba(0,0,0,.08);
  --card-radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.05);
  margin-block: clamp(16px, 2.5vw, 36px);
}
@media (min-width: 900px) { .u-test { --per: 2 } }

/* Viewport + track */
.u-test__viewport { position: relative; overflow: visible; }
.u-test__track {
  position: relative; /* anchor for arrows if needed */
  display: flex; gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 4px 2px 8px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.u-test__track::-webkit-scrollbar { height: 0; } /* hide scrollbar */

/* Cards */
.u-test__item {
  flex: 0 0 calc((100% - (var(--gap) * (var(--per) - 1))) / var(--per));
  background: var(--card-bg);
  border: 1px solid var(--card-brd);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 2vw, 2.5rem);
  scroll-snap-align: start;

  /* Layout: quote grows, author sits at bottom */
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;

  /* keep corners rounded when focused/animated */
  overflow: hidden;
  background-clip: padding-box;
}

/* Desktop: Mindesthöhe 400px + mittiges Zitat (mobile bleibt flexibel) */
@media (min-width: 900px) {
  .u-test__item { min-height: 350px; }
}

/* Quote */
.u-test__quote {
  margin: 0; padding: 0; border: 0; font-style: italic;
  display: flex;            /* vertical centering */
  align-items: center;
  min-height: 0;
}
.u-test__quote p {
  margin: 0;
  border-left: 4px solid var(--color-primary, #EB6100);
  padding-left: 2rem;
}
.u-test__qm {
  font-size: 1.6rem; line-height: 0; vertical-align: -0.2em;
  color: var(--e-global-color-8411430, #333333);
  margin: 0 .15em;
}

/* Author block */
.u-test__author { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: center; }
.u-test__avatar { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: #f2f2f2; display: flex; align-items: center; justify-content: center; }
.u-test__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.u-test__name { font-weight: 700; line-height: 1.25; }
.u-test__meta { font-size: .9rem; font-style: italic; opacity: .9; }

/* ---- Arrows: no button bg, centered vertically, visible above track ---- */
.u-test__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10;
  width: 40px; height: 40px; /* comfortable hit area */
  color: var(--e-global-color-5d451a4, #707070); /* drives SVG via currentColor */

  background: transparent !important;
  border: 0;
  padding: 0 !important; margin: 0; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: none !important;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.u-test__nav--prev { left: 6px; }
.u-test__nav--next { right: 6px; }

.u-test__nav:is(:hover,:focus,:active,:focus-visible) {
  background: transparent !important;
  box-shadow: none !important;
}

/* Fallback chevrons until JS injects SVGs */
.u-test__nav::after {
  content: '›';
  display: inline-block;
  color: currentColor;
  font-size: 22px; line-height: 1;
}
.u-test__nav--prev::after { content: '‹'; }
.u-test__nav.has-svg::after { display: none; }

/* SVG icons follow currentColor, not background */
.u-test__nav svg {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none;
  display: block; pointer-events: none;
  transition: stroke .15s ease, color .15s ease;
}
.u-test__nav:hover svg,
.u-test__nav:focus-visible svg { color: var(--color-primary, #EB6100); }

.u-test__nav[disabled] { opacity: .35; cursor: not-allowed; }

/* Dots */
.u-test__dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.u-test__dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: rgba(255,255,255,.5);
  border: 0 !important; padding: 0 !important; cursor: pointer;
}
.u-test__dot[aria-current="true"] { background: var(--color-primary, #EB6100); }

/* Focus: keep rounded corners (no outline) */
.u-test__item:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary, #EB6100);
  border-radius: var(--card-radius);
}
.u-test__nav:focus-visible,
.u-test__dot:focus-visible {
  outline: 2px solid var(--color-primary, #EB6100);
  outline-offset: 2px;
}

/* Mobile tweaks */
@media (max-width: 680px) {
  .u-test__author { grid-template-columns: 70px 1fr; }
  .u-test__avatar { width: 70px; height: 70px; }
  .u-test__nav svg { width: 24px; height: 24px; }
  .u-test__nav--prev { left: 6px; } .u-test__nav--next { right: 6px; }
}