/* Zmienne tylko dla tego slidera */
.hp1-main-slider {
  --hp1-theme-blue: 186, 58%, 70%;
  --hp1-theme-red: 0, 7%, 9%;
  --hp1-theme-pink: 350, 100%, 69%;

  --hp1-theme-black: 0, 7%, 9%;
  --hp1-theme-white: 0, 0%, 100%;
  --hp1-theme-light: 40, 100%, 97%;

  --hp1-card-link-color: var(--hp1-theme-blue);
  --hp1-card-hover-color: var(--hp1-theme-red);
  --hp1-card-focus-color: var(--hp1-theme-pink);
  --hp1-card-inner-focus-color: var(--hp1-theme-white);
  --hp1-card-shadow-color: var(--hp1-theme-black);
  --hp1-card-foreground-color: var(--hp1-theme-dark);
  --hp1-card-background-color: var(--hp1-theme-dark);
}

/* Reset TYLKO wewnątrz slidera */
.hp1-main-slider *,
.hp1-main-slider *::before,
.hp1-main-slider *::after {
  box-sizing: border-box;
}

/* Linki tylko w sliderze */
.hp1-main-slider a {
  color: hsl(var(--hp1-theme-blue));
  transition: color 150ms, text-decoration-color 150ms;
}

.hp1-main-slider a:hover {
  color: hsl(var(--hp1-theme-red));
}

.hp1-main-slider a:focus,
.hp1-main-slider a:hover {
  text-decoration-color: transparent;
}

.hp1-main-slider a:focus,
.hp1-main-slider [tabindex="-1"]:focus {
  outline: 0.125rem solid hsl(var(--hp1-theme-pink));
}

.hp1-main-slider a:focus:not(:focus-visible),
.hp1-main-slider [tabindex="-1"]:focus:not(:focus-visible) {
  outline: none;
}

/* Główna ramka slidera */
.hp1-carousel {
  --carousel-gap: 1rem;
  border-radius: 1rem;
  display: flex;
  gap: var(--carousel-gap);
  overflow-y: hidden;
  overflow-x: auto;
  position: relative;
  scroll-behavior: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  height: 50vw;
  max-height: 25rem;
  outline: none !important;
}

.hp1-carousel::-webkit-scrollbar {
  display: none;
}

/* Karta slajdu */
.hp1-card {
  --card-ratio: auto 1/1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: [media-start] auto [media-end main-start] auto [main-end];
  max-width: 100%;
  position: relative;

  aspect-ratio: var(--card-ratio);
  flex: 1 0 auto;
  min-height: 120%;
  scroll-snap-align: start;
}

.hp1-card__media {
  aspect-ratio: var(--card-ratio);
  background: hsla(var(--hp1-card-background-color), 0.0);
  border-radius: 1rem;
  grid-column: 1 / -1;
  grid-row: media-start / media-end;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  z-index: -1;
}

.hp1-card__media > * {
  border-radius: inherit;
  height: 100%;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.hp1-card__image {
  display: block;
}

/* Wersja overlay */
.hp1-card--overlay {
  --hp1-card-shadow-color: var(--hp1-theme-black);
  --hp1-card-foreground-color: var(--hp1-theme-white);
  --hp1-card-background-color: var(--hp1-theme-dark);
  --hp1-card-link-color: var(--hp1-theme-white);
  --hp1-card-hover-color: var(--hp1-theme-white);
  grid-template-rows: [media-start] 1fr [overlay-start] 1rem [main-start] auto [main-end overlay-end media-end];
}

.hp1-card--overlay::before {
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  content: "";
  display: block;
  grid-column: 1 / -1;
  grid-row: overlay-start / overlay-end;
  overflow: hidden;
}

.hp1-card--insta {
  --card-ratio: auto 9 / 13;
}

/* Główna treść karty (gdyby była) */
.hp1-card__main {
  align-self: end;
  color: hsl(var(--hp1-card-foreground-color));
  grid-column: 1 / -1;
  grid-row: main-start / main-end;
  padding: 1.25rem;
}

.hp1-card__main > * {
  margin: 0;
}

/* Link pokrywający całą kartę */
.hp1-card__link {
  color: hsl(var(--hp1-card-link-color));
  font-weight: 600;
  text-decoration-line: underline;
  text-decoration-color: hsla(var(--hp1-card-link-color), 0.2);
  text-decoration-thickness: 0.125rem;
  text-decoration-skip: ink;
  text-decoration-skip-ink: all;
  text-decoration-offset: 100%;
  position: absolute;
  inset: 0;
}

.hp1-card__link::after {
  border: 0.125rem solid hsl(var(--hp1-card-focus-color));
  box-shadow: inset 0 0 0 0.125rem hsla(var(--hp1-card-inner-focus-color), 1);
  border-radius: 1rem;
  bottom: 0;
  content: "";
  display: block;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: border-color 150ms, opacity 150ms;
  z-index: 1;
}

.hp1-card__link:focus {
  outline: none;
  text-decoration-color: currentColor;
}

/* Kropki / nawigacja */
.hp1-dots {
  align-items: center;
  display: none; /* jeżeli chcesz kropki – zmień na flex */
  flex-wrap: wrap;
  justify-content: center;
}

.hp1-dot {
  border-radius: 100%;
  display: block;
  height: 1.5rem;
  width: 1.5rem;
  position: relative;
}

.hp1-dot::after {
  background: currentColor;
  border-radius: 100%;
  content: "";
  display: block;
  height: 0.375rem;
  width: 0.375rem;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.hp1-dot.hp1-dot--active {
  color: hsl(var(--hp1-theme-pink)) !important;
}

/* Strzałki + paginacja */
.hp1-pagination {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: 1rem -0.5rem;
}

.hp1-pagination .hp1-arrow {
  flex: 0 0 auto;
}

.hp1-arrow {
  align-items: center;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 0.125rem;
  cursor: pointer;
  color: hsl(var(--hp1-theme-blue));
  display: flex;
  height: 3rem;
  justify-content: center;
  opacity: 1;
  padding: 0.5rem;
  transition: opacity 150ms, color 150ms, background-color 150ms;
  width: 3rem;
}

.hp1-arrow:hover {
  color: hsl(var(--hp1-theme-red));
  background-color: #ffffff;
}

.hp1-arrow:focus {
  color: hsl(var(--hp1-theme-pink));
  outline: none;
  background-color: #ffffff;
}

.hp1-arrow:focus svg {
  box-shadow: 0 0 0 0.125rem hsla(var(--hp1-theme-white), 1), 0 0 0 0.25rem currentColor;
}

.hp1-arrow:focus:not(:focus-visible) {
  color: hsl(var(--hp1-theme-red));
}

.hp1-arrow:focus:not(:focus-visible) svg {
  box-shadow: none;
}

.hp1-arrow[disabled] {
  color: #cccccc !important;
  opacity: 0.4;
  pointer-events: none;
  background-color: #ffffff;
}

.hp1-arrow svg {
  border-radius: 100%;
  fill: currentColor;
  height: 100%;
  width: 100%;
  transition: box-shadow 150ms;
}

/* Visually hidden tylko w sliderze */
.hp1-visually-hidden {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  white-space: nowrap !important;
}

/* Obrazki tylko w sliderze */
.hp1-main-slider img {
  display: block;
  height: auto;
  max-width: 100%;
}

/* Zachowanie dla przeglądarek bez aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
  .hp1-card__media {
    height: 100%;
    padding-block-end: calc(100% * (1 / 1));
  }

  .hp1-card--insta .hp1-card__media {
    padding-block-end: calc(100% * (9 / 16));
  }
}

/* RWD: wyłączenie scroll-behavior dla prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .hp1-carousel {
    scroll-behavior: auto;
  }
}
