/* =========================================================
   Kran Hero Slider – CLEAN STABLE CSS (Liebherr logic)
   FINAL VERSION
   - Original image darkening RESTORED
   - Stable height (no mobile taller than desktop)
   - Desktop strip typography: 22px
   - CTA button black text + arrow
========================================================= */

/* -------------------------
   Base safety (scoped)
------------------------- */
.khs{
  margin: 0;
  padding: 0;
  width: 100%;
}

.khs,
.khs *{
  box-sizing: border-box;
}

/* Prevent accidental horizontal scroll just from slider */
.khs{
  overflow-x: clip;
}
@supports not (overflow: clip){
  .khs{ overflow-x: hidden; }
}

/* -------------------------
   Tokens
------------------------- */
.khs{
  --khs-gap: 4px;

  --khs-stripW: clamp(56px, 9vw, 78px);
  --khs-containerPad: 16px;

  /* JS sets these */
  --khs-safeLeft: 0px;
  --khs-safeRight: 0px;

  --khs-yellow: #FFD000;
  --khs-dark: #111;
  --khs-text: #fff;

  --khs-maxW-desktop: 1920px;
}

/* Tablet+ padding */
@media (min-width: 768px){
  .khs{ --khs-containerPad: 32px; }
}

/* Desktop strip width */
@media (min-width: 1200px){
  .khs{
    --khs-stripW: clamp(52px, 4.2vw, 72px);
    --khs-containerPad: 32px;
  }
}

/* -------------------------
   Wrapper (width + height)
   FIXED: no jump between mobile / desktop
------------------------- */
.khs__wrap{
  position: relative;
  width: 100%;
  margin: 0 auto;
  background: var(--khs-dark);
  overflow: hidden;

  /* smooth across all sizes */
  height: clamp(320px, 42vw, 520px);
}

/* Desktop sizing */
@media (min-width: 1200px){
  .khs__wrap{
    max-width: var(--khs-maxW-desktop);
    height: clamp(420px, 38vw, 680px);
  }
}

/* Mid stabilization */
@media (min-width: 981px) and (max-width: 1199px){
  .khs__wrap{ height: 520px; }
}

/* -------------------------
   Slides (fade)
------------------------- */
.khs__slides{ position: absolute; inset: 0; }

.khs__slide{
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.khs__slide.is-active{
  opacity: 1;
  pointer-events: auto;
}

/* -------------------------
   Background (ORIGINAL DARKENING RESTORED)
------------------------- */
.khs__bg{
  position: absolute;
  inset: 0;
  overflow: hidden;

  background-size: cover;
  background-position: center center;
}

.khs__bg picture,
.khs__bg img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ORIGINAL overlay gradient (mobile/tablet) */
.khs__bg::after{
  content:"";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,.10) 0%,
    rgba(0,0,0,.35) 55%,
    rgba(0,0,0,.65) 100%
  );
}

/* ORIGINAL desktop overlay */
@media (min-width: 1200px){
  .khs__bg::after{
    background: linear-gradient(
      90deg,
      rgba(0,0,0,.62) 0%,
      rgba(0,0,0,.30) 38%,
      rgba(0,0,0,.05) 70%
    );
  }
}

/* -------------------------
   Content (safe zone)
------------------------- */
.khs__content{
  position: absolute;
  z-index: 6;

  left: max(var(--khs-containerPad), var(--khs-safeLeft));
  right: max(var(--khs-containerPad), var(--khs-safeRight));
  bottom: clamp(18px, 3vw, 56px);

  width: auto;
  max-width: min(
    620px,
    calc(
      100% - max(var(--khs-containerPad), var(--khs-safeLeft))
          - max(var(--khs-containerPad), var(--khs-safeRight))
    )
  );

  color: var(--khs-text);
}

.khs__kicker{
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  opacity: .95;
}

.khs__title{
  margin: 0 0 12px;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.05;
  font-weight: 800;
}

.khs__text{
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 700;
}

/* Keep content text white, but not CTA */
.khs__content :where(h1,h2,h3,p,span,small,strong,em){
  color: var(--khs-text) !important;
}

/* CTA */
.khs__btn{
  display: inline-flex;
  align-items: center;
  gap: 12px;

  background: var(--khs-yellow);
  color: #000 !important;
  text-decoration: none;
  font-weight: 800;

  padding: 12px 18px;
  min-width: 160px;
}

.khs__btn span{
  color: #000 !important;
}

@media (max-width: 1199px){
  .khs__btn{
    width: 100%;
    padding: 14px 18px;
  }
}

/* -------------------------
   Rails (strips)
------------------------- */
.khs__rail{
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.khs__railLeft,
.khs__railRight{
  position: absolute;
  top: 0;
  bottom: 0;

  display: flex;
  gap: var(--khs-gap);
  pointer-events: auto;
}
.khs__railLeft{ left: 0; }
.khs__railRight{ right: 0; }

.khs__railPool{ display: none; }

.khs__strip{
  position: relative;
  width: var(--khs-stripW);
  padding: 14px 10px;
  border: 0;
  cursor: pointer;

  background-size: cover;
  background-position: center;
  color: #fff;
}

.khs__strip::after{
  content:"";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.70));
}

.khs__strip.is-hidden{ display: none; }

.khs__stripNo,
.khs__stripLabel{
  position: relative;
  z-index: 2;
  font-weight: 600;
  color: #fff;

  /* mobile */
  font-size: 16px;
}

/* DESKTOP: 22px as requested */
@media (min-width: 1200px){
  .khs__stripNo,
  .khs__stripLabel{
    font-size: 22px;
  }
}

.khs__stripLabel{
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* -------------------------
   WPBakery row fix
------------------------- */
@media (min-width: 1200px){
  .vc_row.khs-row{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .vc_row.khs-row > .wpb_column,
  .vc_row.khs-row .vc_column-inner{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* -------------------------
   Keyboard focus
------------------------- */
.khs:focus{
  outline: none;
}
.khs:focus-visible{
  outline: 2px solid var(--khs-yellow);
  outline-offset: -2px;
}

/* -------------------------
   Reduced motion
------------------------- */
@media (prefers-reduced-motion: reduce){
  .khs__slide{ transition: none !important; }
}
/* =========================================================
   UX: Hide description text on mobile
   ========================================================= */
@media (max-width: 767px){
  .khs__text{
    display: none;
  }
}
