/* ══════════════════════════════════════════════════
   Hero — Banner, Content, Masks, Divider, Split, Slideshow
   ══════════════════════════════════════════════════ */

.kw-hero-banner {
  position: relative;
  padding: calc(var(--header-full-h, 230px) + clamp(3rem, 10vh, 10rem)) 0 clamp(3rem, 8vh, var(--sp-16));
  scroll-margin-top: var(--scroll-offset);
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--c-border);
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(var(--c-accent-rgb), 0.04), transparent);
}

/* ── Split mode — reduce padding, let grid handle layout ── */
.kw-hero-banner--split {
  padding: var(--header-full-h, 130px) 0 0 0;
  block-size: auto;
  min-block-size: calc(var(--header-full-h, 194px) + clamp(420px, calc(var(--hero-height, 100vh) - var(--header-full-h, 194px)), 760px));
  display: block;
  overflow: visible;
  box-sizing: border-box;
}

/* ── Decorative masks ── */
.kw-hero-mask {
  position: absolute;
  pointer-events: none;
  opacity: 0.12;
  z-index: 0;
}

.kw-hero-mask img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.kw-hero-mask--tl {
  top: -5%;
  left: -8%;
  width: 350px;
  height: 350px;
  transform: rotate(-15deg);
}

.kw-hero-mask--tr {
  top: -8%;
  right: -5%;
  width: 400px;
  height: 400px;
  transform: rotate(25deg);
}

.kw-hero-mask--bl {
  bottom: -10%;
  left: -3%;
  width: 300px;
  height: 300px;
  transform: rotate(10deg);
}

.kw-hero-mask--br {
  bottom: -5%;
  right: -8%;
  width: 380px;
  height: 380px;
  transform: rotate(-20deg);
}

/* ── Orange divider — business card signature ── */
.kw-divider {
  width: 200px;
  height: 1px;
  margin: 0 auto var(--sp-6);
  background: linear-gradient(90deg, transparent, var(--c-accent), var(--c-accent2), transparent);
  opacity: 0.6;
  position: relative;
  z-index: 2;
}

.kw-divider--wide {
  width: 280px;
}

.kw-divider--left {
  margin: 0 0 var(--sp-6);
}

/* ── Hero content ── */
.kw-hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.kw-hero__tag {
  font-family: var(--f-h);
  font-size: clamp(0.58rem, min(0.8vw, 1.5vh), 0.72rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: clamp(var(--sp-4), 3vh, var(--sp-8));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
}

.kw-hero__tag::before,
.kw-hero__tag::after {
  content: '';
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-accent));
  opacity: 0.5;
}

.kw-hero__tag::after {
  background: linear-gradient(90deg, var(--c-accent), transparent);
}

.kw-hero__title {
  font-size: clamp(2rem, min(5vw, 7vh), 3.8rem);
  line-height: 1.1;
  margin-bottom: clamp(var(--sp-4), 3vh, var(--sp-8));
  text-align: center;
}

.kw-hero__title strong {
  font-weight: 700;
  background: linear-gradient(135deg, var(--c-white) 40%, var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kw-hero__sub {
  font-size: clamp(0.9rem, min(1.1vw, 2.2vh), 1.05rem);
  color: var(--c-muted);
  max-width: 550px;
  margin: 0 auto clamp(var(--sp-6), 4vh, var(--sp-12));
  line-height: 1.7;
  font-weight: 300;
  text-align: center;
}

.kw-hero__actions {
  display: flex;
  gap: clamp(var(--sp-2), 2vh, var(--sp-4));
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--sp-8);
}

/* ══════════════════════════════════════════════════
   Hero Split — Two Column Layout with Photo
   ══════════════════════════════════════════════════ */

.kw-hero-split {
  display: grid;
  grid-template-columns: calc(100% - var(--hero-cut-offset, 50%)) var(--hero-cut-offset, 50%);
  block-size: auto;
  min-block-size: clamp(420px, calc(var(--hero-height, 100vh) - var(--header-full-h, 194px)), 760px);
  position: relative;
  z-index: 2;
}

/* Photo on the left */
.kw-hero-split[data-position="left"] {
  direction: rtl;
}

.kw-hero-split[data-position="left"]>* {
  direction: ltr;
}

/* ── Text column ── */
.kw-hero-col--text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(var(--sp-4), 3.2vh, var(--sp-8));
  padding-inline: clamp(var(--sp-4), 3.2vw, var(--sp-12));
  position: relative;
  z-index: 2;
}

.kw-hero-split .kw-hero-content {
  max-width: 520px;
}

.kw-hero-split .kw-hero__title {
  text-align: left;
  font-size: clamp(1.7rem, min(4vw, 6.5vh), 3.2rem);
}

.kw-hero-split .kw-hero__tag {
  justify-content: flex-start;
}

.kw-hero-split .kw-hero__sub {
  text-align: left;
  margin-left: 0;
}

.kw-hero-split .kw-hero__actions .kw-btn {
  padding: clamp(0.7rem, 1.5vh, 1.2rem) clamp(1.25rem, 2.5vw, 3rem) !important;
  font-size: clamp(0.72rem, min(1vw, 1.8vh), 1rem);
  line-height: 1.2;
}

.kw-hero-split .kw-hero__actions {
  justify-content: flex-start;
}

.kw-hero-split .kw-divider {
  width: 100%;
  margin-left: 0;
  margin-right: auto;
}

/* ── Photo column ── */
.kw-hero-col--photo {
  position: relative;
  overflow: hidden;
  min-block-size: 0;
  align-self: stretch;
}

/* ── Diagonal cut — clip-path ── */
.kw-hero-split[data-transition="diagonal-right"] .kw-hero-col--photo {
  clip-path: polygon(calc(0% + tan(var(--hero-cut-angle, 12deg)) * 100%) 0%,
      100% 0%,
      100% 100%,
      0% 100%);
}

.kw-hero-split[data-transition="diagonal-left"] .kw-hero-col--photo {
  clip-path: polygon(0% 0%,
      100% 0%,
      calc(100% - tan(var(--hero-cut-angle, 12deg)) * 100%) 100%,
      0% 100%);
}

/* ══════════════════════════════════════════════════
   Hero Slideshow
   ══════════════════════════════════════════════════ */

.kw-hero-slideshow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.kw-hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  will-change: opacity, transform;
}

.kw-hero-slide.active {
  opacity: 1;
  z-index: 1;
}

/* Leaving slide — fades out while Ken Burns continues */
.kw-hero-slide.leaving {
  opacity: 0;
  z-index: 0;
}

/* ── Ken Burns — apply to both active AND leaving (no animation jump) ── */
.kw-hero-slideshow[data-ken-burns="1"] .kw-hero-slide.active,
.kw-hero-slideshow[data-ken-burns="1"] .kw-hero-slide.leaving {
  animation: var(--kb-anim, kenBurns1) var(--kb-duration, 12s) ease-in-out forwards;
}

@keyframes kenBurns1 {
  0% {
    transform: scale(1) translate(0, 0);
  }

  100% {
    transform: scale(1.12) translate(-2%, -1%);
  }
}

@keyframes kenBurns2 {
  0% {
    transform: scale(1.1) translate(-2%, 0);
  }

  100% {
    transform: scale(1) translate(1%, 1%);
  }
}

@keyframes kenBurns3 {
  0% {
    transform: scale(1) translate(0, 0);
  }

  100% {
    transform: scale(1.08) translate(2%, -2%);
  }
}

@keyframes kenBurns4 {
  0% {
    transform: scale(1.08) translate(1%, 1%);
  }

  100% {
    transform: scale(1) translate(0, 0);
  }
}

/* ══════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════ */

@media (max-width: 1024px) {

  .kw-hero-mask--tl,
  .kw-hero-mask--tr {
    width: 250px;
    height: 250px;
  }

  .kw-hero-mask--bl,
  .kw-hero-mask--br {
    width: 220px;
    height: 220px;
  }

  .kw-hero-split .kw-hero-content {
    max-width: 420px;
  }

  .kw-hero-col--text {
    padding-inline: clamp(var(--sp-4), 3vw, var(--sp-8));
  }
}

@media (min-width: 769px) and (max-height: 760px) {
  .kw-hero-split .kw-hero__tag {
    margin-bottom: clamp(var(--sp-2), 2vh, var(--sp-4));
  }

  .kw-hero-split .kw-hero__title {
    margin-bottom: clamp(var(--sp-2), 2vh, var(--sp-4));
  }

  .kw-hero-split .kw-hero__sub {
    margin-bottom: clamp(var(--sp-3), 2.5vh, var(--sp-6));
  }
}

@media (max-width: 860px) {
  .kozich-premium-web {
    --header-full-h: 124px;
  }

  .kw-hero-banner {
    padding-top: var(--header-full-h, 130px);
    padding-bottom: var(--sp-12);
  }

  .kw-hero__title {
    font-size: 1.8rem;
  }

  .kw-hero__sub {
    font-size: 0.95rem;
  }

  .kw-hero-mask {
    display: none;
  }

  /* Split stacks vertically on mobile */
  .kw-hero-banner--split {
    block-size: auto;
    min-block-size: 0;
    overflow: visible;
    padding: var(--header-full-h, 124px) 0 0;
  }

  .kw-hero-split {
    display: flex;
    flex-direction: column;
    block-size: auto;
    min-block-size: 0;
  }

  .kw-hero-split[data-position="left"] {
    direction: ltr;
  }

  .kw-hero-col--photo {
    position: relative;
    block-size: clamp(260px, 44vh, 340px);
    min-block-size: 0;
    order: -1 !important;
  }

  .kw-hero-slideshow {
    position: relative;
    height: 100%;
  }

  /* Remove diagonal clip on mobile */
  .kw-hero-split[data-transition="diagonal-right"] .kw-hero-col--photo,
  .kw-hero-split[data-transition="diagonal-left"] .kw-hero-col--photo {
    clip-path: none;
    margin-left: 0;
  }

  .kw-hero-col--text {
    padding: var(--sp-6) var(--sp-5, 1.25rem) var(--sp-8);
  }

  .kw-hero-split .kw-hero-content {
    width: 100%;
    max-width: 25rem;
  }

  .kw-hero-split .kw-hero__tag {
    gap: var(--sp-3);
    margin-bottom: var(--sp-5, 1.25rem);
    font-size: 0.62rem;
    line-height: 1.45;
    letter-spacing: 0.22em;
    text-align: center;
  }

  .kw-hero-split .kw-hero__tag::before,
  .kw-hero-split .kw-hero__tag::after {
    flex: 0 0 28px;
    width: 28px;
  }

  .kw-hero-split .kw-hero__title {
    font-size: clamp(1.7rem, min(8vw, 5.8vh), 2.45rem);
    line-height: 1.08;
    margin-bottom: var(--sp-5, 1.25rem);
  }

  .kw-hero-split .kw-hero__sub {
    max-width: 22rem;
    margin: 0 auto var(--sp-6);
    font-size: clamp(0.82rem, min(3.8vw, 1.8vh), 0.92rem);
    line-height: 1.55;
  }

  .kw-hero-split .kw-hero__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    margin-bottom: 0;
  }

  .kw-hero-split .kw-hero__actions .kw-btn {
    width: min(100%, 280px);
    min-height: 48px;
    margin: 0 auto;
    padding: 0.95rem 1.25rem !important;
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .kw-hero-split .kw-hero__title,
  .kw-hero-split .kw-hero__sub {
    text-align: center;
  }

  .kw-hero-split .kw-hero__tag {
    justify-content: center;
  }

  .kw-hero-split .kw-hero__actions {
    justify-content: center;
  }

  .kw-hero-split .kw-divider {
    width: min(100%, 270px);
    margin: 0 auto var(--sp-6);
  }
}

/* ══════════════════════════════════════════════════
   Admin — Hero Photo List
   ══════════════════════════════════════════════════ */

.admin-hero-photos {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-hero-photo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-hero-photo:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}
