/* TræKøb24 hero slider. Timings copied from the Revolution slider it replaces:
   layers rise 50px + fade over 1s (power3.inOut) at their own start times,
   leave by sinking 50px; backgrounds slide in from the right or fade, 1s power2.inOut. */
.tks {
  --tks-e3: cubic-bezier(.645, .045, .355, 1);
  --tks-e2: cubic-bezier(.455, .03, .515, .955);
  --tks-speed: 1000ms;
  --tks-base: #9b9b9b; /* shows through while backgrounds swap */
  --tks-out: 350ms;    /* how fast the old slide's layers vanish */
  position: relative;
  width: 100%;
  height: 620px;
  overflow: hidden;
  background: var(--tks-base);
  font-family: 'Muli', 'Mulish', sans-serif;
}
.tks *, .tks *::before, .tks *::after { box-sizing: border-box; }
/* Full width like the Revolution slider, even inside a boxed page container (JS fine-tunes it). */
.tks[data-full="1"] { width: 100vw; max-width: none; margin-left: calc(50% - 50vw); }
/* Keep the theme's heading and paragraph styles out of the slider. */
.tks .tks-text p, .tks .tks-text h2 { margin-top: 0; padding: 0; letter-spacing: 0; text-shadow: none; }
.tks .tks-title, .tks .tks-sub { font-family: 'Muli', 'Mulish', sans-serif; }
.tks a.tks-btn, .tks a.tks-btn:hover, .tks a.tks-btn:focus, .tks a.tks-btn:active, .tks a.tks-btn:visited {
  text-decoration: none !important; border: 0; box-shadow: none; color: #fff !important;
}

.tks-slide { position: absolute; inset: 0; visibility: hidden; }
.tks-slide.is-active { visibility: visible; z-index: 2; }
.tks-slide.is-leaving { visibility: visible; z-index: 1; }

.tks-bg { position: absolute; inset: 0; background: #fff center / cover no-repeat; }
/* Arrow distance from the edge: 80px on a 1440 screen, never under 16px. The content
   lane is narrowed by the arrow plus a 16px gap each side, so nothing runs under them. */
.tks { --tks-a: max(16px, calc((100% - 1240px) / 2 - 20px)); }
/* Text block and image share one centre line (the same as the arrows) at every width. */
.tks-stage {
  position: relative; width: min(1240px, calc(100% - 2 * (var(--tks-a) + 56px))); height: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
}
.tks-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.tks-pic { order: 2; flex: 0 1 var(--w, 480px); min-width: 0; }

.tks-layer { position: relative; margin: 0; opacity: 0; }
.tks-pic img { display: block; width: 100%; height: auto; }
.tks .tks-kicker { margin-bottom: 12px; font-family: 'Poppins', sans-serif; font-size: 24px; line-height: 25px; font-weight: 400; color: #000; white-space: nowrap; }
.tks .tks-title { margin-bottom: 14px; font-size: clamp(28px, 3.125vw, 45px); line-height: 1.11; font-weight: 900; text-transform: uppercase; color: #009540; white-space: nowrap; }
.tks .tks-sub { margin-bottom: 26px; font-size: clamp(17px, 1.53vw, 22px); line-height: 1.36; font-weight: 400; color: #1d2127; }
.tks-btn {
  display: inline-block; padding: 20px 40px; background: #61380d; color: #fff !important;
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 14px; line-height: 14px;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
  transition: background-color .4s cubic-bezier(.37, 0, .63, 1);
}
.tks-btn:hover { background: #009540; }
.tks-btn:focus-visible, .tks-arrow:focus-visible { outline: 3px solid #009540; outline-offset: 3px; }

.tks-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 40px; height: 40px; padding: 0; border: 0;
  background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background-color .3s ease;
}
.tks-arrow:hover { background: #000; }
.tks-prev { left: var(--tks-a); }
.tks-next { right: var(--tks-a); }

/* Layers in */
.tks-slide.is-active .tks-layer { animation: tks-up-in 1000ms var(--tks-e3) var(--d, 0ms) both; }
.tks-slide.is-active .tks-layer.tks-x { animation-name: tks-left-in; }
/* Layers out, all together and quickly, so the old image never lingers see-through */
.tks-slide.is-leaving .tks-layer { opacity: 1; animation: tks-down-out var(--tks-out) ease-in 0ms both; }
.tks-slide.is-leaving .tks-layer.tks-x { animation-name: tks-right-out; }

/* Backgrounds */
.tks-slide.is-active .tks-bg[data-in="right"] { animation: tks-bg-right var(--tks-speed) var(--tks-e2) both; }
.tks[data-dir="-1"] .tks-slide.is-active .tks-bg[data-in="right"] { animation-name: tks-bg-left; }
.tks-slide.is-active .tks-bg[data-in="fade"] { animation: tks-bg-fade var(--tks-speed) var(--tks-e2) both; }
.tks-slide.is-leaving .tks-bg { animation: tks-bg-out calc(var(--tks-speed) * .5) var(--tks-e2) both; }
.tks.is-first .tks-slide.is-active .tks-bg { animation: none; }

@keyframes tks-up-in { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tks-down-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(50px); } }
@keyframes tks-left-in { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes tks-right-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(50px); } }
@keyframes tks-bg-right { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes tks-bg-left { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes tks-bg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tks-bg-out { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 777px) {
  .tks { height: 550px; }
  .tks-arrow { display: none; }
  .tks-stage { width: 100%; flex-direction: column; justify-content: center; gap: 20px; text-align: center; padding: 24px 20px; }
  .tks-text { flex: 0 0 auto; align-items: center; }
  .tks .tks-title { line-height: 32px; margin-bottom: 10px; }
  .tks .tks-sub { line-height: 24px; margin-bottom: 20px; }
  .tks .tks-kicker { margin-bottom: 8px; }
  .tks-pic { order: -1; flex: 0 0 auto; width: 62%; max-width: 300px; }
  .tks .tks-title { font-size: 24px; white-space: normal; }
  .tks .tks-sub { font-size: 16px; }
  .tks .tks-kicker { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .tks-slide .tks-layer, .tks-slide .tks-bg { animation-duration: 1ms !important; animation-delay: 0ms !important; }
}
