/* ============================================================
   Video lightbox — opened by [data-kvideo] (Success Stories
   "Read more"). Reuses the kmodal-rise keyframe + kmodal-open
   scroll lock from contact-modal.css (always enqueued together).
   ============================================================ */
.kvmodal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 40px);
}
.kvmodal[hidden] { display: none; }

.kvmodal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 23, 19, .85);
  backdrop-filter: blur(3px);
}

.kvmodal__box {
  position: relative;
  /* 16:9 player that fits both the width and the viewport height */
  width: min(960px, 100%, calc((100vh - 140px) * 16 / 9));
  animation: kmodal-rise .35s var(--ease);
}

.kvmodal__player {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7);
}
/* portrait (9:16) clips — box follows the video instead of letterboxing */
.kvmodal--portrait .kvmodal__box { width: min(420px, 100%, calc((100vh - 140px) * 9 / 16)); }
.kvmodal--portrait .kvmodal__player { aspect-ratio: 9 / 16; }

.kvmodal__player iframe,
.kvmodal__player video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* text mode — story popup instead of a player */
.kvmodal--text .kvmodal__box { width: min(880px, 100%); }
.kvmodal--text .kvmodal__player {
  aspect-ratio: auto;
  max-height: min(82vh, 720px);
  overflow: auto;
  background: var(--c-cream-lt, #f7f1e6);
}
.kvmodal__story { padding: clamp(28px, 5vw, 44px); }
.kvmodal__story h3 {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: clamp(24px, 4vw, 30px);
  color: var(--c-ink);
  margin-bottom: 16px;
}
.kvmodal__story p {
  font-size: 15.5px;
  line-height: 1.8;
  color: #4a3c33;
}
.kvmodal__story p + p { margin-top: 1em; }
/* links inside the description read as bold accent text */
.kvmodal__story a {
  font-weight: 700;
  color: var(--c-maroon);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.kvmodal__story a:hover { color: var(--c-maroon-dk); }

/* books slider inside the story popup — one cover at a time, looping arrows */
.kvmodal__books {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 18px);
  margin-top: 28px;
}
.kvmodal__bviewport {
  flex: 1;
  overflow: hidden;
}
.kvmodal__btrack {
  display: flex;
  transition: transform .35s var(--ease);
}
.kvmodal__book {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
}
.kvmodal__book img {
  display: block;
  width: clamp(160px, 42vw, 240px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 14px 30px -14px rgba(43, 33, 28, .5);
}
.kvmodal__barrow {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(43, 33, 28, .35);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--c-ink);
  transition: background var(--dur-fast) var(--ease);
}
.kvmodal__barrow:hover { background: rgba(43, 33, 28, .08); }

@media (prefers-reduced-motion: reduce) {
  .kvmodal__btrack { transition: none; }
}

.kvmodal__close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  color: var(--c-cream);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.kvmodal__close:hover { background: rgba(247, 245, 242, .14); transform: rotate(90deg); }

@media (prefers-reduced-motion: reduce) {
  .kvmodal__box { animation: none; }
}
