/* Section: Problems ("Jak możemy Ci pomóc") */

.problems { padding-block: var(--space-3xl); }
.problems__container { display: flex; flex-direction: column; gap: var(--space-l); position: relative; }

/* Head */
.problems__head { display: flex; flex-direction: column; gap: var(--space-s); }
.problems__heading { color: var(--color-grey-900); }
.problems__sub { font-size: var(--fs-body-m); line-height: var(--lh-body-m); color: var(--color-grey-900); max-width: 832px; }

/* Segmented control */
.problems__controls { position: relative; max-width: 100%; }
.problems__track {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;          /* Firefox */
  gap: var(--space-2x);
  align-items: center;
  padding: var(--space-2x);
  background: var(--color-grey-100);
  border-radius: var(--radius-m);
  scroll-behavior: smooth;
}
.problems__track::-webkit-scrollbar { display: none; }

/* Right-edge fade + round arrow — revealed by JS only while the tabs overflow
   and aren't scrolled to the end (Figma SegmentedControl scroll affordance). */
.problems__controls::after {
  content: "";
  position: absolute;
  top: var(--space-2x);
  bottom: var(--space-2x);
  right: 0;
  width: 56px;
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  background: linear-gradient(90deg, rgba(249,249,249,0) 0%, var(--color-grey-100) 75%);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  transition: opacity .2s ease;
}
.problems__cats-arrow {
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translateY(-50%) scale(.85);
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--color-grey-200);
  color: var(--color-grey-900);
  box-shadow: 0 4px 16px rgba(13,13,13,.12);   /* lift off the white bg so it reads as a button */
  z-index: 2;                                  /* above the ::after fade, which would cover it */
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
}
.problems__cats-arrow:hover { background: var(--color-grey-400); }
.problems__controls.has-overflow::after { opacity: 1; }
.problems__controls.has-overflow .problems__cats-arrow {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
.problems__seg {
  flex: 0 0 auto;
  padding: var(--space-3xs) var(--space-s);
  border-radius: var(--radius-s);
  font-size: var(--fs-body-s);
  line-height: var(--lh-body-s);
  font-weight: 500;
  color: var(--color-grey-900);
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.problems__seg:hover { color: var(--color-grey-600); }
.problems__seg.is-active { background: var(--color-grey-900); color: var(--color-grey-100); }

/* Slider (CSS-first) */
.problems__slider-wrap { position: relative; }
.problems__slider { width: 100%; overflow: hidden; }
/* AJAX loading state while a type is fetched */
.problems__slider.is-loading { opacity: .5; pointer-events: none; transition: opacity .15s ease; }
.problems__slider .swiper-wrapper { display: flex; }
.problems__slider .swiper-slide {
  width: 312px;
  margin-right: var(--space-s);
  flex-shrink: 0;
  height: auto;
}
.problems__slider .swiper-slide[hidden] { display: none; }

/* Card */
.problem-card { position: relative; display: flex; flex-direction: column; gap: var(--space-3xs); }
/* Whole-card nofollow click target; sits above the image/category but below the
   dofollow title link, so the title stays the only crawlable, clickable link. */
.problem-card__overlay { position: absolute; inset: 0; z-index: 1; }
.problem-card__image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--color-grey-200);
}
.problem-card__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.problem-card__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.35) 100%); }
.problem-card__cat {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 500;
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  color: var(--color-grey-900);
}
.problem-card__titlerow { display: flex; gap: var(--space-xs); align-items: center; }
.problem-card__title {
  position: relative;   /* lift above the overlay so it's the dofollow link */
  z-index: 2;
  flex: 1 1 auto;
  font-size: var(--fs-body-m);
  line-height: var(--lh-body-m);
  font-weight: 500;
  color: var(--color-grey-900);
}
.problem-card__titlerow svg { flex: 0 0 auto; color: var(--color-grey-900); transition: transform .2s ease; }
.problem-card:hover .problem-card__titlerow svg { transform: translateX(4px); }

/* Nav arrows */
.problems__arrow {
  position: absolute;
  top: 156px;                 /* vertical centre of the 312px image */
  transform: translateY(-50%);
  z-index: 2;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--color-grey-900);
  box-shadow: 0 4px 16px rgba(13,13,13,.12);
}
.problems__prev { left: -24px; background: var(--color-grey-100); }
.problems__next { right: -24px; background: var(--color-grey-200); }
.problems__arrow:hover { background: var(--color-grey-400); }
.problems__arrow.swiper-button-disabled { opacity: .4; cursor: default; }
.problems__arrow.swiper-button-lock { display: none; }

/* Tablet keeps the slider arrows (Figma) straddling the card edges. Hang them to the
   section edge (= -gutter); the full desktop overhang would spill past the viewport. */
@media (max-width: 1024px) {
  .problems__prev { left: calc(-1 * var(--gutter)); }
  .problems__next { right: calc(-1 * var(--gutter)); }
}
@media (max-width: 600px) {
  .problems__arrow { display: none; }      /* phones: swipe only */
  .problems__heading { font-size: var(--fs-h-m); line-height: var(--lh-h-m); letter-spacing: var(--ls-h-m); }
  .problems__slider .swiper-slide { width: 260px; }
}
