/* Front styles with smart-contrast & templates */
.wp-block-hsb-hero-slider {
  position: relative;
}

.hsb-hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  touch-action: pan-y pinch-zoom;
}

.hsb-viewport {
  position: relative;
  width: 100%;
  height: var(--hsb-height, 60vh);
  min-height: 320px;
  overflow: hidden;
}

.hsb-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  width: 100%;
  height: 100%;
  transition: transform 450ms ease;
  will-change: transform;
}

.hsb-slide {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.hsb-slide .bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: none !important;
  mix-blend-mode: normal;
  opacity: 1 !important;
}

.hsb-slide .lqip {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(16px);
  transform: scale(1.05);
  transition: opacity .6s ease;
  opacity: 1;
}

.hsb-slide.loaded .lqip {
  opacity: 0;
}

@media (max-width: 640px) {
  .hsb-hero:not([data-mobile-crop="false"]) .hsb-slide .bg-img[data-fx][data-fy] {
    object-position: attr(data-fx percentage) attr(data-fy percentage);
  }
}

.hsb-slide .overlay {
  position: absolute;
  inset: 0;
  background: var(--hsb-overlay-color, rgba(0, 0, 0, .65));
  opacity: var(--hsb-overlay, .3);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: normal;
}

.hsb-slide .content {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--hsb-text, #fff);
  height: 100%;
  padding: 1rem;
}

.hsb-slide .content .inner {
  max-width: 1000px;
}

.hsb-slide h2 {
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.05;
  margin: 0 0 .5rem 0;
}

.hsb-slide p {
  font-size: clamp(16px, 2vw, 22px);
  margin: 0 0 1rem 0;
  opacity: .95;
}

.hsb-btn {
  display: inline-block;
  padding: .85rem 1.25rem;
  border-radius: 999px;
  background: #fff;
  color: #111;
  text-decoration: none;
  font-weight: 600;
  position: relative;
}

@media (max-width: 782px) {

  /* Common mobile full width fixes */
  .hsb-hero.hsb-mobile-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    overflow: visible;
  }

  /* Reset margins for aligned content */
  .hsb-hero.hsb-mobile-full.alignfull,
  .alignfull .hsb-hero.hsb-mobile-full,
  .hsb-hero.hsb-mobile-full.alignwide,
  .alignwide .hsb-hero.hsb-mobile-full {
    margin-left: 0;
    margin-right: 0;
  }

  /* FORCE natural height for all mobile-full variations to fix whitespace */
  .hsb-hero.hsb-mobile-full .hsb-viewport,
  .hsb-hero.hsb-mobile-full[data-mobile-crop="false"] .hsb-viewport {
    height: auto !important;
    min-height: 0 !important;
  }

  .hsb-hero.hsb-mobile-full .hsb-track,
  .hsb-hero.hsb-mobile-full[data-mobile-crop="false"] .hsb-track {
    height: auto !important;
  }

  .hsb-hero.hsb-mobile-full .hsb-slide,
  .hsb-hero.hsb-mobile-full[data-mobile-crop="false"] .hsb-slide {
    height: auto !important;
    min-height: auto !important;
    background: transparent !important;
    aspect-ratio: auto !important;
    display: block;
  }

  /* FORCE image to be relative and auto height, covering container */
  .hsb-hero.hsb-mobile-full .hsb-slide .bg-img,
  .hsb-hero.hsb-mobile-full[data-mobile-crop="false"] .hsb-slide .bg-img {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    /* contain ensures full image is shown */
    filter: brightness(calc(1 - (var(--hsb-overlay, .3) * 0.55)));
    transition: filter .4s ease;
  }

  /* Hide LQIP on mobile to prevent overlay issues */
  .hsb-hero.hsb-mobile-full .hsb-slide .lqip {
    display: none !important;
  }

  /* Overlay handling */
  .hsb-hero.hsb-mobile-full .hsb-slide .overlay {
    /* Keep overlay logic consistent */
    display: block;
  }

  /* Content positioning */
  .hsb-hero.hsb-mobile-full .hsb-slide .content {
    position: absolute;
    inset: 0;
    text-shadow: 0 4px 18px rgba(0, 0, 0, .45);
  }
}

/* Layout sablonok */
.hsb-layout-center .content {
  place-items: center;
  text-align: center;
}

.hsb-layout-left .content {
  justify-items: start;
  text-align: left;
  padding-left: min(8vw, 80px);
}

.hsb-layout-center-mask .content {
  place-items: center;
  text-align: center;
}

.hsb-layout-center-mask .overlay {
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .45), rgba(0, 0, 0, .65) 60%, rgba(0, 0, 0, .75));
  opacity: 1;
}

/* Controls */
.hsb-arrows {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hsb-arrows button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  pointer-events: auto;
}

.hsb-arrows .prev {
  left: 12px;
}

.hsb-arrows .next {
  right: 12px;
}

.hsb-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  z-index: 3;
}

.hsb-dots button {
  min-width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  padding: 0 8px;
  font: 12px/1 system-ui;
  display: inline-grid;
  place-items: center;
}

.hsb-dots button[aria-current="true"] {
  transform: scale(1.08);
}

.hsb-theme-circle .hsb-arrows button {
  width: var(--hsb-arrow, 44px);
  height: var(--hsb-arrow, 44px);
  border-radius: 999px;
  background: var(--hsb-ctrl-bg, rgba(0, 0, 0, .4));
  color: var(--hsb-ctrl-color, #fff);
}

.hsb-theme-square .hsb-arrows button {
  width: var(--hsb-arrow, 44px);
  height: var(--hsb-arrow, 44px);
  border-radius: 10px;
  background: var(--hsb-ctrl-bg, rgba(0, 0, 0, .4));
  color: var(--hsb-ctrl-color, #fff);
}

.hsb-theme-ghost .hsb-arrows button {
  width: var(--hsb-arrow, 44px);
  height: var(--hsb-arrow, 44px);
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--hsb-ctrl-color, #fff);
  color: var(--hsb-ctrl-color, #fff);
}

.hsb-dots.dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  color: transparent;
}

.hsb-dots.dots button[aria-current="true"] {
  background: #fff;
}

.hsb-dots.numbers button {
  height: 22px;
  border-radius: 999px;
  background: var(--hsb-ctrl-bg, rgba(0, 0, 0, .4));
  color: var(--hsb-ctrl-color, #fff);
}