/* === Hero Slider === */
/* Pełnoekranowy crossfade carousel + zoom-in po fade, vanilla JS, WCAG AA. */

.hero-slider {
  position: relative;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  height: 88vh;
  min-height: 560px;
  max-height: 920px;
  overflow: hidden;
  background: var(--color-ink);
  isolation: isolate;
  font-family: var(--font-display);
}
/* Pozwól sliderowi wyjść poza ast-container na home + zlikwiduj odstęp od headera */
body.home .ast-container,
body.home .entry-content,
body.home main,
body.home .site-content { overflow-x: visible !important; }

body.home #content,
body.home .site-content,
body.home main,
body.home .ast-container,
body.home .entry-content,
body.home article,
body.home .entry-content > *:first-child {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.home .hero-slider { margin-top: 0 !important; }
body.home #primary { margin: 0 !important; padding: 0 !important; }
/* Wytnij ewentualną Astrę post-thumbnail, breadcrumb i page-title pad/margin */
body.home .ast-archive-description,
body.home .ast-author-details,
body.home .post-thumb,
body.home .ast-no-thumbnail .entry-header { display: none !important; }
@media (max-width: 1024px) {
  .hero-slider { height: 72vh; min-height: 480px; }
}

.hero-slider__viewport {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 700ms var(--easing-image);
  will-change: opacity;
  pointer-events: none;
}
.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.hero-slide__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}
.hero-slide__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 9000ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.hero-slide.is-active .hero-slide__media img {
  transform: scale(1.10);
}

.hero-slide__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(95deg, rgba(26,22,20,0.82) 0%, rgba(26,22,20,0.62) 38%, rgba(26,22,20,0.28) 75%, rgba(26,22,20,0.12) 100%),
    linear-gradient(180deg, rgba(26,22,20,0.0) 60%, rgba(26,22,20,0.55) 100%);
  pointer-events: none;
}

.hero-slide__content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 7vw 4rem;
  color: #ffffff;
}
@media (min-width: 1024px) {
  .hero-slide__content { padding: 0 5rem 5rem; }
}

.hero-slide__kicker {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.86);
  margin-bottom: 1.1rem;
  padding-left: 38px;
  position: relative;
}
.hero-slide__kicker::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 2px;
  background: var(--color-rust);
}

.hero-slide__title {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.04;
  margin: 0 0 1.4rem 0;
  max-width: 18ch;
  letter-spacing: -0.02em;
  font-feature-settings: 'kern', 'liga';
  color: #ffffff !important;
  text-shadow: 0 2px 16px rgba(26,22,20,0.45), 0 1px 2px rgba(26,22,20,0.6);
}

.hero-slide__subtitle {
  font-family: var(--font-body);
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 420;
  line-height: 1.5;
  color: rgba(255,255,255,0.94);
  max-width: 52ch;
  margin: 0 0 2.2rem 0;
  text-shadow: 0 1px 8px rgba(26,22,20,0.45);
}

.hero-slide__cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero-slide__cta {
  font-family: var(--font-display);
  font-weight: 540;
  font-size: 16px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  padding: 16px 30px;
  border-radius: 3px 5px 4px 5px;
  transition: transform 280ms var(--easing-cta), background 200ms ease, color 200ms ease, box-shadow 280ms ease;
  letter-spacing: 0.01em;
  border: none;
}

.hero-slide__cta--primary {
  background: var(--color-rust);
  color: #ffffff;
  box-shadow: 2px 4px 12px rgba(198,74,28,0.35), 0 0 0 1px rgba(198,74,28,0.25);
}
.hero-slide__cta--primary:hover,
.hero-slide__cta--primary:focus {
  transform: translate(-1px, -2px) rotate(-0.4deg);
  background: var(--color-clay);
  color: #ffffff;
  box-shadow: 2px 6px 18px rgba(138,106,63,0.40), 0 0 0 1px rgba(138,106,63,0.20);
}

.hero-slide__cta--secondary {
  background: rgba(255,255,255,0.08);
  outline: 1.5px solid rgba(255,255,255,0.92);
  color: #ffffff;
  backdrop-filter: blur(4px);
}
.hero-slide__cta--secondary:hover,
.hero-slide__cta--secondary:focus {
  background: #ffffff;
  color: var(--color-ink);
  outline-color: #ffffff;
  transform: translate(-1px, -2px) rotate(0.3deg);
}

.hero-slide__cta:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* === Nawigacja === */
.hero-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 52px;
  height: 52px;
  border: 1.5px solid rgba(255,255,255,0.65);
  background: rgba(26,22,20,0.42);
  color: #ffffff;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 220ms var(--easing-menu), border-color 220ms ease, transform 220ms ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 0;
}
.hero-slider__nav svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
  stroke: #ffffff;
}
.hero-slider__nav:hover {
  background: rgba(255,255,255,0.18);
  border-color: #ffffff;
}
.hero-slider__nav:focus-visible {
  outline: 2px solid var(--color-rust);
  outline-offset: 3px;
}
.hero-slider__nav--prev { left: 1.8rem; }
.hero-slider__nav--next { right: 1.8rem; }
@media (max-width: 768px) { .hero-slider__nav { display: none; } }

/* === Dots === */
.hero-slider__dots {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 0.75rem;
}
.hero-slider__dot {
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(255,255,255,0.65);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: background 220ms ease, transform 220ms var(--easing-cta), width 220ms ease;
}
.hero-slider__dot:hover { background: rgba(255,255,255,0.4); }
.hero-slider__dot.is-active {
  background: var(--color-rust);
  border-color: var(--color-rust);
  width: 28px;
  border-radius: 5px;
}
.hero-slider__dot:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* === Progress bar === */
.hero-slider__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.12);
  z-index: 5;
}
.hero-slider__progress-bar {
  width: 0;
  height: 100%;
  background: var(--color-rust);
  transition: width linear;
}

/* === Counter === */
.hero-slider__counter {
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.74);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
  .hero-slider__counter { right: 1rem; bottom: 0.9rem; font-size: 11px; }
  .hero-slider__dots { bottom: 1.6rem; }
}

/* === Live region (visually hidden) === */
.hero-slider__live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Progressive enhancement (.no-js) === */
.no-js .hero-slider__nav,
.no-js .hero-slider__dots,
.no-js .hero-slider__progress,
.no-js .hero-slider__counter { display: none; }
.no-js .hero-slide:not(:first-child) { display: none; }
.no-js .hero-slide { opacity: 1; transition: none; pointer-events: auto; }
.no-js .hero-slide__media img { transform: none; }

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-slide__media img { transition: none; transform: none; }
  .hero-slider__progress-bar { transition: none; }
  .hero-slide__cta { transition: none; }
}
