/* panel-zoom.css — Hover-to-zoom popups for figure subpanels */

/* --- Hotspot regions overlaid on figure --- */
.panel-zoom-container {
  position: relative;
  display: block;
}

.panel-zoom-container img {
  display: block;
  width: 100%;
  height: auto;
}

.panel-zoom-hotspot {
  position: absolute;
  cursor: zoom-in;
  z-index: 1;
  /* subtle highlight on hover */
  transition: background 0.15s ease;
}
.panel-zoom-hotspot:hover {
  background: rgba(0, 80, 180, 0.15);
}

/* --- Popup --- */
.panel-zoom-popup {
  position: absolute;
  z-index: 1001;
  display: flex;
  flex-direction: column;

  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: 85vh;

  background: var(--bg, #fcfcf8);
  border: 3px double #ccc;
  box-shadow: 1px 2px 8px 0 #ccc;

  opacity: 1;
  transition: none;

  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.55;
}

.panel-zoom-popup.fading {
  opacity: 0;
  transition: opacity 0.25s ease-in 0.1s;
}

.panel-zoom-popup.focused {
  border-color: #aaa;
  box-shadow: 1px 2px 8px 0 #aaa;
}

/* --- Title bar --- */
.panel-zoom-popup-title-bar {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 1.6rem;
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid #ddd;
  background-color: #fff;
  background-image: radial-gradient(circle, #e6e6e6 1px, transparent 1px);
  background-size: 8px 8px;
  user-select: none;
}

.panel-zoom-popup.focused .panel-zoom-popup-title-bar {
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-color: #e6e6e6;
}

.panel-zoom-popup-title {
  flex: 1 1 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #aaa;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-zoom-popup.focused .panel-zoom-popup-title {
  color: #1a1a1a;
}

/* Pin button */
.panel-zoom-popup-pin {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-right: 0.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.7rem;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.panel-zoom-popup-pin:hover {
  color: #1a1a1a;
}
.panel-zoom-popup.pinned .panel-zoom-popup-pin {
  color: #1a1a1a;
}

/* Expand button */
.panel-zoom-popup-expand {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.panel-zoom-popup-expand:hover {
  color: #1a1a1a;
}
.panel-zoom-popup.focused .panel-zoom-popup-expand {
  color: #777;
}

/* Close button */
.panel-zoom-popup-close {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.panel-zoom-popup-close:hover {
  color: #1a1a1a;
}
.panel-zoom-popup.focused .panel-zoom-popup-close {
  color: #777;
}

/* --- Caption --- */
.panel-zoom-popup-caption {
  margin: 0.6em 0 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #444;
}

/* --- Content area --- */
.panel-zoom-popup-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.6em 0.8em 0.8em 0.8em;
}

.panel-zoom-popup-content img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  background: #fff;
}

/* --- Scrollbar --- */
.panel-zoom-popup-content::-webkit-scrollbar {
  width: 12px;
}
.panel-zoom-popup-content::-webkit-scrollbar-track {
  background: transparent;
}
.panel-zoom-popup-content::-webkit-scrollbar-thumb {
  background: #ddd;
  border: 3px solid var(--bg, #fcfcf8);
  border-radius: 6px;
}
.panel-zoom-popup-content::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}
.panel-zoom-popup-content {
  scrollbar-color: #ddd transparent;
  scrollbar-width: thin;
}

/* --- Fullscreen state --- */
.panel-zoom-popup.fullscreen {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  z-index: 10000;
  border: none;
  border-radius: 0;
}
.panel-zoom-popup.fullscreen .panel-zoom-popup-content {
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-zoom-popup.fullscreen .panel-zoom-popup-content img {
  max-height: calc(100vh - 2.5rem);
}
