/* ── Ken-Burns Tour Viewer overlay ─────────────────────────────
   Fullscreen painting-tour viewer injected by js/tour-viewer.js.
   All selectors use kb- prefix to avoid conflicts with site styles.
   ────────────────────────────────────────────────────────────── */

#kb-viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #0d0d0d;
}

#kb-canvas {
  display: block;
  width: 100%;
  height: 100%;
  will-change: transform;   /* promotes canvas to its own GPU layer */
  touch-action: none;       /* let JS handle all touch gestures */
}

/* ── Back button ──────────────────────────────────────────── */
#kb-back-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  z-index: 9010;
}

#kb-back-btn:hover {
  color: #fff;
  background: rgba(0,0,0,0.7);
}

/* ── Pace / playback control bar ──────────────────────────── */
#kb-pace-ctrl {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: none;          /* set to flex by tour-viewer.js when viewer opens */
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 18px;
  border-radius: 20px;
  z-index: 9010;
  white-space: nowrap;
}

/* Wave / pace icons */
.kb-pace-icon {
  width: 22px;
  height: 16px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  transition: color 0.15s;
}
.kb-pace-icon:hover  { color: rgba(255,255,255,0.75); }
.kb-pace-icon:active { color: rgba(255,255,255,1.00); }

/* Prev / next arrow buttons */
.kb-nav-btn {
  font-size: 20px;
  line-height: 1;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
  padding: 0 3px;
  flex-shrink: 0;
  background: none;
  border: none;
}
.kb-nav-btn:hover  { color: rgba(255,255,255,0.75); }
.kb-nav-btn:active { color: rgba(255,255,255,1.00); }

/* Thin vertical divider */
.kb-nav-sep {
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

/* Play / pause / stop group */
.kb-pb-group {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.kb-playback-btn {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 0;
}
.kb-playback-btn:hover         { color: rgba(255,255,255,0.75); }
.kb-playback-btn:active        { color: rgba(255,255,255,1.00); }
.kb-playback-btn.pb-active     { color: rgba(255,255,255,0.82); }

/* Range slider */
#kb-pace-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.18);
  outline: none;
  cursor: pointer;
}
#kb-pace-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
}
#kb-pace-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  border: none;
  cursor: pointer;
}

/* ── Painting caption ─────────────────────────────────────── */
/* Shown above the pace bar: title + date/medium/size line    */
#kb-caption {
  display: none;
  position: fixed;
  bottom: 58px;           /* sits 4 px above the pace-ctrl bar */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 3px 12px 4px;
  text-align: center;
  z-index: 9010;
  color: #fff;
  pointer-events: none;   /* let touches fall through to the canvas */
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}

.kb-cap-title {
  display: block;
  font-size: 0.80rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.kb-cap-desc {
  display: block;
  font-size: 0.72rem;
  font-style: italic;
  color: rgba(255,255,255,0.68);
  margin-top: 1px;
}

/* ── Portrait-phone enlargements ──────────────────────────── */
@media (max-width: 430px) and (orientation: portrait) {
  #kb-pace-ctrl {
    left: 10px;
    right: 10px;
    transform: none;
    padding: 10px 12px;
    gap: 8px;
    bottom: 22px;
    justify-content: space-evenly;
  }
  #kb-pace-ctrl .kb-nav-sep { display: none; }
  #kb-pace-slider            { width: 52px; }
  #kb-caption {
    bottom: 80px;              /* clears the taller mobile toolbar */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 36px);
    white-space: normal;
    text-align: center;
  }
  .kb-nav-btn {
    font-size: 28px;
    padding: 0 6px;
  }
  .kb-playback-btn {
    width: 21px;
    height: 21px;
  }
  .kb-pace-icon {
    width: 28px;
    height: 21px;
  }
  #kb-pace-slider {
    width: 68px;
  }
  .kb-pb-group {
    gap: 14px;
  }
}
