/* Home page slider (index.jsp, rewritten 2026-11-01).
   Slides of any size and shape: the whole image is always shown (object-fit: contain, nothing cut off) on a blurred,
   darkened copy of itself, so posters with text stay readable. The caption sits in a bar under the image.
   flag 0 slides = laptop/desktop, flag 1 = mobile (< 768px), flag 2 = both (the page gets them once per view);
   a view without own slides shows the other view's slides.
   Script: /js/home-slider.js. Classes: ksl-*. */

.ksl {
  --ksl-navy: #0d2847; --ksl-navy-2: #16396a; --ksl-blue: #285690; --ksl-gold: #e0a526;
  /* tall enough to impress, low enough that the caption bar stays on a laptop screen (header ~265px, bar ~85px) */
  /* the shape (width / height) comes from the server: the median shape of the shown slides (--ksl-ratio laptop/desktop,
     --ksl-mratio phones), so most slides fill the slider. Low enough that the caption bar stays on a laptop screen
     (header ~265px, bar ~85px). */
  --ksl-h: clamp(320px, min(calc(100vw / var(--ksl-ratio, 2.8)), calc(100vh - 360px)), 640px);
  position: relative; width: 100%; background: var(--ksl-navy); color: #fff; isolation: isolate;
  font-family: 'Inter', 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.ksl-stage { position: relative; height: var(--ksl-h); overflow: hidden; background: #0a1f38; touch-action: pan-y; }
.ksl:focus-visible { outline: 3px solid var(--ksl-gold); outline-offset: -3px; }

/* slides: stacked; the old slide fades out while the new one fades in, both over 2 s after a 0.3 s pause (2026-11-04,
   agreed timings); the new picture settles from a slight zoom; each slide stays 4 s (DELAY in js/home-slider.js) */
.ksl-slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden;
  transition: opacity 2s ease-in-out .3s, visibility 0s linear 2.3s; }
.ksl-slide.is-active { opacity: 1; visibility: visible; transition: opacity 2s ease-in-out .3s, visibility 0s; z-index: 1; }
/* without the script: the first slide of the view */
.ksl:not(.is-ready) .ksl-slide.is-first { opacity: 1; visibility: visible; }

/* views: mobile slides only on phones, desktop slides only from 768px (unless a view has no slides of its own) */
@media (min-width: 768px) { .ksl:not(.ksl--only-mobile) .ksl-slide[data-view="mobile"] { display: none; } }
@media (max-width: 767.98px) { .ksl:not(.ksl--only-desktop) .ksl-slide[data-view="desktop"] { display: none; } }

.ksl-backdrop { position: absolute; inset: -40px; background-position: center; background-size: cover;
  filter: blur(28px) saturate(1.15) brightness(.55); transform: scale(1.08); }
/* the blurred background drifts slowly; it pauses (instead of jumping back) while its slide fades out */
.ksl-backdrop { animation: ksl-drift 14s ease-in-out infinite alternate; animation-play-state: paused; }
.ksl-slide.is-active .ksl-backdrop { animation-play-state: running; }
.ksl-stage::after { /* soft vignette that ties the image to the caption bar */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 31, 56, 0) 70%, rgba(10, 31, 56, .45) 100%),
              radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .25) 100%);
}
.ksl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .35)); }
.ksl-slide.is-active .ksl-img { animation: ksl-settle 3.2s cubic-bezier(.2, .7, .2, 1) both; }
/* the image has (almost) the stage's shape: fill the stage */
.ksl-slide.is-fill .ksl-img { object-fit: cover; filter: none; }
@keyframes ksl-settle { from { transform: scale(1.05); } to { transform: none; } }
@keyframes ksl-drift { from { transform: scale(1.08) translate3d(0, 0, 0); } to { transform: scale(1.16) translate3d(-1.5%, -1%, 0); } }

/* arrows */
.ksl-arrow { position: absolute; top: 50%; z-index: 3; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-top: -26px; padding: 0; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  background: rgba(13, 40, 71, .35); color: #fff; font-size: 18px; cursor: pointer; opacity: 0;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .25s ease, background-color .2s ease, transform .2s ease; }
.ksl-arrow:hover { background: var(--ksl-gold); border-color: var(--ksl-gold); color: var(--ksl-navy); }
.ksl-arrow:focus-visible { opacity: 1; outline: 3px solid var(--ksl-gold); outline-offset: 2px; }
.ksl-prev { left: 22px; } .ksl-next { right: 22px; }
.ksl-stage:hover .ksl-arrow { opacity: 1; }
@media (hover: none) { .ksl-arrow { opacity: .9; width: 42px; height: 42px; margin-top: -21px; font-size: 15px; } .ksl-prev { left: 10px; } .ksl-next { right: 10px; } }

/* admin: delete the shown slide */
.ksl-delete { position: absolute; top: 16px; right: 16px; z-index: 4; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; background: rgba(180, 35, 24, .92); color: #fff !important; font-size: 13px;
  font-weight: 600; text-decoration: none !important; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.ksl-delete:hover { background: #8f1c13; }

/* caption bar */
.ksl-bar { position: relative; display: flex; align-items: center; gap: 18px 28px; min-height: 84px; padding: 16px 32px 16px 28px;
  background: linear-gradient(90deg, var(--ksl-navy) 0%, var(--ksl-navy-2) 100%); border-top: 1px solid rgba(255, 255, 255, .08); }
.ksl-count { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px;
  padding-right: 22px; border-right: 1px solid rgba(255, 255, 255, .18); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ksl-count b { color: var(--ksl-gold); font-size: 26px; font-weight: 700; }
.ksl-count span { margin-top: 2px; color: rgba(255, 255, 255, .6); font-size: 12px; letter-spacing: .08em; }
.ksl-caption { flex: 1 1 auto; min-width: 0; margin: 0; color: #fff; font-size: 18px; font-weight: 600; line-height: 1.45;
  letter-spacing: .005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ksl-caption.is-changing { animation: ksl-caption-in .9s ease both; }
@keyframes ksl-caption-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ksl-controls { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; }
.ksl-dots { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ksl-dot { display: block; width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .35);
  cursor: pointer; transition: width .3s ease, background-color .3s ease; }
.ksl-dot:hover { background: rgba(255, 255, 255, .7); }
.ksl-dot[aria-current="true"] { width: 28px; background: var(--ksl-gold); }
.ksl-dot:focus-visible, .ksl-pause:focus-visible { outline: 2px solid var(--ksl-gold); outline-offset: 3px; }
.ksl-pause { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: transparent; color: #fff; font-size: 12px; cursor: pointer; }
.ksl-pause:hover { border-color: var(--ksl-gold); color: var(--ksl-gold); }
/* a single slide needs no controls */
.ksl.is-single .ksl-arrow, .ksl.is-single .ksl-controls, .ksl.is-single .ksl-progress, .ksl.is-single .ksl-count { display: none; }

/* phones */
@media (max-width: 767.98px) {
  .ksl { --ksl-h: clamp(220px, calc(100vw / var(--ksl-mratio, 1.2)), 78vh); }
  .ksl-bar { flex-wrap: wrap; gap: 10px 14px; min-height: 0; padding: 14px 16px 12px; }
  .ksl-count { min-width: 0; padding-right: 14px; }
  .ksl-count b { font-size: 20px; }
  .ksl-caption { flex-basis: calc(100% - 80px); font-size: 15px; }
  .ksl-controls { width: 100%; justify-content: center; }
  .ksl-delete { top: 10px; right: 10px; padding: 6px 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ksl-slide, .ksl-slide.is-active { transition: none; }
  .ksl-slide.is-active .ksl-img, .ksl-backdrop, .ksl-slide.is-active .ksl-backdrop, .ksl-caption.is-changing { animation: none; }
}
