/* cours-zoom.css — Lightbox figures */

/* ── Wrapper autour du SVG ── */
.figure-zoom-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

/* ── Bouton loupe (apparaît au survol de la figure dans la page) ── */
.figure-zoom-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  cursor: zoom-in;
  font-size: 16px;
  line-height: 32px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
  z-index: 10;
  padding: 0;
}

.figure-zoom-wrapper:hover .figure-zoom-btn {
  opacity: 1;
}

.figure-zoom-btn:hover {
  background: rgba(21,101,192,0.85);
}

@media (max-width: 768px) {
  .figure-zoom-btn {
    opacity: 0.75;
    width: 28px;
    height: 28px;
    font-size: 14px;
    line-height: 28px;
  }
}

/* ── Overlay lightbox ── */
#cours-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  cursor: zoom-out;
}

#cours-lightbox.active {
  display: flex;
}

#cours-lightbox-inner {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px 16px;
  max-width: 94vw;
  max-height: 92vh;
  overflow: auto;
  cursor: default;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ── Barre de zoom dans la lightbox ── */
#lbx-zoom-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.lbx-zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  line-height: 30px;
  text-align: center;
  color: #333;
  padding: 0;
  transition: background 0.12s;
}

.lbx-zoom-btn:hover  { background: #e3f2fd; border-color: #1565c0; color: #1565c0; }
.lbx-zoom-btn:disabled { opacity: 0.35; cursor: default; }

#lbx-zoom-pct {
  font-size: 12px;
  color: #555;
  min-width: 42px;
  text-align: center;
}

/* ── Contenu SVG dans la lightbox ── */
#cours-lightbox-content {
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

#cours-lightbox-content svg {
  display: block;
  transition: width 0.15s;
  flex-shrink: 0;
}

#cours-lightbox-legende {
  font-size: 13px;
  color: #555;
  text-align: center;
  max-width: 80vw;
  line-height: 1.5;
  margin: 0;
  flex-shrink: 0;
}

#cours-lightbox-close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 2px 6px;
}

#cours-lightbox-close:hover { color: #e74c3c; }
