/* ==========================================================================
   Blok „Slider strony głównej” (.hero): slajdy przenikają się, tekst wchodzi po kolei,
   pod zdjęciem pływający biały indeks z paskiem czasu, strzałkami i pauzą.
   Źródło (prototyp): assets/css/style.css – „Hero slider” + sekcje Responsive i Reduced motion.
   Błysk przycisku na aktywnym slajdzie jest w assets/css/base.css motywu.
   ========================================================================== */

.hero { position: relative; background: #fff; overflow: hidden; margin-top: calc(-1 * var(--nav-overlap)); touch-action: pan-y; }
.hero__slides { display: grid; }
.hero__slide {
  grid-area: 1 / 1; position: relative;
  display: grid; align-items: center;
  min-height: clamp(580px, 80vh, 820px);
  padding-top: var(--nav-overlap);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 1000ms var(--ease), visibility 0s 1000ms;
}
.hero__slide.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; z-index: 1; }
.hero__media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 72% center;
}
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, .86) 28%, rgba(255, 255, 255, .4) 48%, rgba(255, 255, 255, 0) 63%);
}
.hero__content { position: relative; z-index: 1; padding: 4rem 0 8.5rem; }
.hero__text { max-width: 610px; }
.hero__title {
  font-size: clamp(2.25rem, 1.25rem + 3.4vw, 4rem); line-height: 1.03;
  margin: 0 0 1.25rem; color: var(--navy-900); font-weight: 600; letter-spacing: -.038em;
}
.hero__desc { font-size: 1.125rem; color: var(--muted); max-width: 50ch; margin-bottom: 2rem; text-wrap: pretty; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }

.hero__slide .eyebrow, .hero__slide .hero__title, .hero__slide .hero__desc, .hero__slide .hero__actions {
  transition: opacity .7s var(--ease), transform 1s var(--ease);
}
.hero__slide:not(.is-active) .eyebrow,
.hero__slide:not(.is-active) .hero__title,
.hero__slide:not(.is-active) .hero__desc,
.hero__slide:not(.is-active) .hero__actions { opacity: 0; transform: translateY(14px); }
.hero__slide.is-active .eyebrow { transition-delay: .08s; }
.hero__slide.is-active .hero__title { transition-delay: .15s; }
.hero__slide.is-active .hero__desc { transition-delay: .28s; }
.hero__slide.is-active .hero__actions { transition-delay: .4s; }

/* Slide index: a white rounded bar floating above the photograph's bottom edge */
.hero__controls {
  position: absolute; left: 0; right: 0; bottom: 1.25rem; z-index: 2;
  width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto;
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: rgba(255, 255, 255, .96); border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(22, 42, 67, .06), var(--shadow-float);
}
@supports (backdrop-filter: blur(1px)) {
  .hero__controls { background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(14px); }
}
.hero__arrow {
  appearance: none; border: 0; background: var(--navy-50); color: var(--navy-900);
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center; cursor: pointer;
  transition: background .2s, color .2s, transform .3s var(--ease);
}
.hero__arrow:hover { background: var(--orange); color: var(--navy-900); }
.hero__arrow:active { transform: scale(.94); }
.hero__arrow .icon { width: 20px; height: 20px; }
.hero__index { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; min-width: 0; align-self: stretch; }
.hero__pause {
  appearance: none; border: 0; background: transparent; color: var(--navy);
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s;
}
.hero__pause:hover { background: var(--navy-50); color: var(--navy-900); }
.hero__pause .icon { width: 18px; height: 18px; grid-area: 1 / 1; }
.hero__pause-icon--play { display: none; }
.hero.is-stopped .hero__pause-icon--play { display: block; }
.hero.is-stopped .hero__pause-icon--pause { display: none; }
.hero.is-stopped .hero__tab-progress { animation-play-state: paused; }
.hero__index li { flex: 1; display: flex; min-width: 0; }
.hero__tab {
  appearance: none; border: 0; background: none; flex: 1; min-width: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; align-items: center;
  text-align: left; padding: .7rem 1rem .8rem; position: relative; cursor: pointer; overflow: hidden;
  font-family: var(--font-display); color: var(--muted); border-radius: 16px;
  transition: color .2s, background .2s;
}
.hero__tab:hover { color: var(--navy-900); background: var(--paper-2); }
.hero__tab-num { font-family: var(--font-ui); font-size: .75rem; font-weight: 500; letter-spacing: .02em; color: var(--muted); font-variant-numeric: tabular-nums; }
.hero__tab-title { font-size: .875rem; font-weight: 600; line-height: 1.25; letter-spacing: -.005em; }
.hero__tab.is-active { color: var(--navy-900); background: var(--navy-50); }
.hero__tab.is-active .hero__tab-num { color: var(--navy-900); }
.hero__tab-progress {
  position: absolute; left: 1rem; right: 1rem; bottom: 6px; height: 3px; border-radius: 2px;
  background: var(--orange); transform: scaleX(0); transform-origin: left;
}
.hero__tab.is-active .hero__tab-progress { animation: tabProgress var(--slide-dur) linear forwards; }
.hero.is-paused .hero__tab-progress { animation-play-state: paused; }
@keyframes tabProgress { to { transform: scaleX(1); } }

.no-js .hero__controls { display: none; }

@media (max-width: 1024px) {
  .hero__tab-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero__tab { grid-template-columns: 1fr; justify-items: center; padding: .9rem .25rem; }
  .hero__index li.is-active { flex: 2.6; }
  .hero__index li.is-active .hero__tab { grid-template-columns: auto minmax(0, 1fr); justify-items: start; padding: .7rem .75rem .8rem; }
  .hero__index li.is-active .hero__tab-title { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; font-size: .75rem; line-height: 1.2; }
}

@media (max-width: 767px) {
  .hero__slide { grid-template-rows: auto auto; align-items: start; min-height: 0; padding-top: var(--nav-overlap); }
  .hero__media { position: relative; aspect-ratio: 16 / 10; }
  .hero__media img { object-position: 70% center; transform: none; }
  .hero__media::after { background: linear-gradient(0deg, #fff 0%, rgba(255, 255, 255, 0) 38%); }
  .hero__content { padding: 1rem 0 6.25rem; }
  .hero__controls { bottom: 1rem; border-radius: 20px; }
  .hero__index li:not(.is-active) { display: none; }
  .hero__index li.is-active { flex: 1; }
  .hero__index li.is-active .hero__tab { grid-template-columns: auto minmax(0, 1fr); padding: .7rem .9rem; }
  /* „01 / 06”: liczba slajdów z atrybutu (prototyp miał stałe „/ 06”) */
  .hero__index li.is-active .hero__tab-num::after { content: " / " attr(data-total); color: var(--muted); }
  .hero__index li.is-active .hero__tab-title { font-size: .8125rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero__desc { font-size: 1rem; margin-bottom: 1.5rem; }
}

@media (max-width: 560px) {
  .hero__arrow { width: 44px; height: 44px; }
  .hero__pause { width: 40px; }
  .hero__actions .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__media img { transform: none; }
  .hero__tab.is-active .hero__tab-progress { animation: none; transform: scaleX(1); }
}

/* edytor: bez zachodzenia pod menu (go tam nie ma) i bez czekania na skrypt */
.editor-styles-wrapper .hero { margin-top: 0; }
.editor-styles-wrapper .hero__tab-progress { animation: none; transform: scaleX(1); }
