/* Shared live/archive PDF viewer. Colors follow the application theme. */
#window-slides {
  --slide-card: var(--card, #fff);
  --slide-bg: var(--bg, #f6f6fb);
  --slide-text: var(--text, #2c3440);
  --slide-muted: var(--muted, #6b7380);
  --slide-border: var(--border, #e6e8ef);
  --slide-accent: var(--accent, #1f7a8c);
  font-family: inherit;
}
#window-slides .slide-window {
  position: relative; display: flex; flex-direction: column;
  height: 600px; min-height: 0; overflow: hidden;
  background: var(--slide-card); color: var(--slide-text);
  border: 1px solid var(--slide-border); border-radius: 8px;
}
#window-slides .slide-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; padding: 12px 16px; background: var(--slide-card);
  border-bottom: 2px solid var(--slide-border); flex-shrink: 0; z-index: 20;
}
#window-slides .slide-title, #window-slides .slide-controls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
#window-slides .slide-title { font-size: 14px; font-weight: 600; gap: 12px; }
#window-slides .slide-controls { margin-left: auto; }
#window-slides .slide-control-btn, #window-slides .nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 36px; padding: 8px 10px;
  font: inherit; font-size: 14px; color: var(--slide-text);
  background: transparent; border: 1px solid var(--slide-border); border-radius: 6px;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
#window-slides button:hover:not(:disabled), #window-slides a.slide-control-btn:hover {
  background: var(--slide-bg); color: var(--slide-accent); border-color: var(--slide-accent);
}
#window-slides .slide-control-btn.active {
  background: var(--slide-accent); border-color: var(--slide-accent); color: #fff;
}
#window-slides button:focus-visible, #window-slides a:focus-visible {
  outline: 2px solid var(--slide-accent); outline-offset: 2px;
}
#window-slides button:disabled { opacity: .35; cursor: default; }
#window-slides .page-nav { display: flex; align-items: center; gap: 6px; }
#window-slides .page-indicator {
  min-width: 52px; text-align: center; white-space: nowrap;
  color: var(--slide-muted); font-size: 13px; font-variant-numeric: tabular-nums;
}
#window-slides .slide-content-area {
  display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--slide-bg);
}
#window-slides .slide-canvas-wrapper {
  position: relative; display: flex; align-items: center; justify-content: center;
  flex: 1; min-height: 0; padding: 12px 52px; box-sizing: border-box;
}
#window-slides .slide-canvas-wrapper > .nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: var(--slide-card);
}
#window-slides .slide-canvas-wrapper > #slide-prev-btn { left: 8px; }
#window-slides .slide-canvas-wrapper > #slide-next-btn { right: 8px; }
#window-slides.compact-slide-viewer .slide-canvas-wrapper { padding: 10px; }
#slide-pdf-canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
#window-slides .slide-lang-dropdown { position: relative; }
#window-slides #slide-lang-toggle { font-size: 13px; }
#window-slides #slide-lang-toggle::after { content: '▾'; font-size: 10px; margin-left: 6px; }
#window-slides .slide-lang-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 150px; max-height: 50vh; overflow-y: auto; z-index: 30;
  background: var(--slide-card); border: 1px solid var(--slide-border); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(26,39,72,.12);
}
#window-slides .slide-lang-menu.hidden { display: none; }
#window-slides .lang-option {
  display: block; width: 100%; padding: 10px 12px; border: 0;
  text-align: left; font: inherit; font-size: 14px; cursor: pointer;
  background: none; color: var(--slide-text);
}
#window-slides .lang-option.active { background: var(--slide-bg); color: var(--slide-accent); font-weight: 600; }
#window-slides .sync-mode-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; color: var(--slide-muted); }
#window-slides .sync-mode-toggle input { accent-color: var(--slide-accent); }
#window-slides #slide-translation-status { font-size: 12px; font-weight: 400; color: var(--slide-muted); }
/* Preserve caption space and sizing while simplifying the surrounding decoration. */
#window-slides .caption-overlay { flex: 0 0 120px; padding: 0 10px; display: flex; align-items: center; }
#window-slides .transcription-panel {
  display: flex; align-items: center; width: 100%; min-height: 80px;
  padding: 1em 1.6em; background: rgba(20,20,20,.8); border-radius: 6px;
}
#window-slides .transcription-panel.hidden { opacity: 0; pointer-events: none; }
#window-slides .transcription-text {
  display: flex; flex-wrap: wrap; gap: .4em; width: 100%; margin: 0;
  font: inherit; font-size: clamp(.85rem, 1vw, 1rem); font-weight: 500;
  line-height: 1.4; color: #fff; overflow-wrap: anywhere;
}
#window-slides .slide-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 16px;
  background: var(--slide-bg); color: var(--slide-muted); z-index: 3; font-size: 14px;
}
#window-slides .slide-spinner {
  width: 28px; height: 28px; border: 3px solid var(--slide-border);
  border-top-color: var(--slide-accent); border-radius: 50%; animation: slide-spin 1s linear infinite;
}
@keyframes slide-spin { to { transform: rotate(360deg); } }
#window-slides .slide-window:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; }
.view-selector { display: flex; align-items: center; gap: 4px; }
.view-selector [hidden], #window-slides [hidden] { display: none !important; }
@media (max-width: 768px) {
  #window-slides .transcription-text { font-size: clamp(.95rem, 3.6vw, 1.1rem); }
}
@media (prefers-reduced-motion: reduce) {
  #window-slides .slide-spinner { animation: none; }
}
